Skip to content

Commit fa29755

Browse files
committed
vuejs: first steps based on vueexample
1 parent dbf00b8 commit fa29755

File tree

103 files changed

+13894
-79149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+13894
-79149
lines changed

.eslintrc.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es6: true,
6+
node: true,
7+
jest: true
8+
},
9+
globals: {
10+
t: true,
11+
n: true,
12+
OC: true,
13+
OCA: true,
14+
Vue: true,
15+
VueRouter: true
16+
},
17+
parserOptions: {
18+
parser: 'babel-eslint'
19+
},
20+
extends: [
21+
'eslint:recommended',
22+
'plugin:node/recommended',
23+
'plugin:vue/essential',
24+
'plugin:vue/recommended',
25+
'standard'
26+
],
27+
plugins: ['vue', 'node'],
28+
rules: {
29+
// space before function ()
30+
'space-before-function-paren': ['error', 'never'],
31+
// curly braces always space
32+
'object-curly-spacing': ['error', 'always'],
33+
// stay consistent with array brackets
34+
'array-bracket-newline': ['error', 'consistent'],
35+
// 1tbs brace style
36+
'brace-style': 'error',
37+
// tabs only
38+
indent: ['error', 'tab'],
39+
'no-tabs': 0,
40+
'vue/html-indent': ['error', 'tab'],
41+
// only debug console
42+
'no-console': ['error', { allow: ['error', 'warn', 'debug'] }],
43+
// classes blocks
44+
'padded-blocks': ['error', { classes: 'always' }],
45+
// always add a trailing comma, for diff readability
46+
'comma-dangle': ["error", "only-multiline"],
47+
// always have the operator in front
48+
'operator-linebreak': ['error', 'before'],
49+
// ternary on multiline
50+
'multiline-ternary': ['error', 'always-multiline'],
51+
// force proper JSDocs
52+
'valid-jsdoc': [2, {
53+
'prefer': {
54+
'return': 'returns'
55+
},
56+
'requireReturn': false,
57+
'requireReturnDescription': false
58+
}],
59+
// es6 import/export and require
60+
'node/no-unpublished-require': ['off'],
61+
'node/no-unsupported-features/es-syntax': ['off'],
62+
// space before self-closing elements
63+
'vue/html-closing-bracket-spacing': 'error',
64+
// code spacing with attributes
65+
'vue/max-attributes-per-line': [
66+
'error',
67+
{
68+
singleline: 3,
69+
multiline: {
70+
max: 3,
71+
allowFirstLine: true
72+
}
73+
}
74+
]
75+
}
76+
};

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
node_modules/
22
*.log
3-
build/artifacts
3+
build/
4+
js/
45
.rvm
56
report
67
clover.xml

.travis.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ addons:
77
packages:
88
- libxml2-utils
99

10+
cache:
11+
directories:
12+
- node_modules
13+
1014
env:
1115
global:
1216
- CORE_BRANCH=master
@@ -44,24 +48,7 @@ script:
4448
# - phpunit --coverage-clover clover.xml -c phpunit.xml
4549
# - phpunit -c phpunit.integration.xml
4650

47-
# execute js tests
48-
- cd js
49-
- npm install
50-
- npm install -g gulp
51-
#- gulp test
52-
- gulp
53-
54-
# Create coverage report
55-
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
56-
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then php ocular.phar code-coverage:upload --format=php-clover clover.xml; fi"
57-
58-
#matrix:
59-
# include:
60-
# - php: 7.1
61-
# env: DB=mysql
62-
# - php: 7.0
63-
# env: "DB=mysql CORE_BRANCH=stable9.1"
64-
# - php: 5.6
65-
# env: "DB=sqlite CORE_BRANCH=stable9"
66-
# fast_finish: true
51+
# build js
52+
- npm run lint
53+
- npm run build
6754

Makefile

Lines changed: 54 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
1-
#
2-
# Nextcloud scaffolder tool
3-
#
4-
# Copyright (C) 2013 Bernhard Posselt, <[email protected]>
5-
#
6-
# This program is free software; you can redistribute it and/or modify
7-
# it under the terms of the GNU General Public License as published by
8-
# the Free Software Foundation; either version 3 of the License, or
9-
# (at your option) any later version.
10-
#
11-
# This program is distributed in the hope that it will be useful,
12-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14-
# GNU General Public License for more details.
15-
#
16-
# You should have received a copy of the GNU General Public License
17-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18-
19-
20-
# Makefile for building the project
1+
2+
### build and sign release
3+
214
app_name=notes
225
project_dir=$(CURDIR)/../$(app_name)
236
build_dir=$(CURDIR)/build/artifacts
@@ -26,80 +9,6 @@ appstore_dir=$(build_dir)/appstore
269
package_name=$(app_name)
2710
cert_dir=$(HOME)/.nextcloud/certificates
2811

29-
# binary directories for running the CI tests
30-
firefox_bin=/usr/bin/firefox
31-
chrome_bin=/usr/bin/chromium
32-
phantomjs_bin=/usr/bin/phantomjs
33-
34-
js_dir=$(CURDIR)/js
35-
js_public_dir=$(js_dir)/public
36-
37-
# common directories
38-
grunt_dir=$(js_dir)/node_modules/grunt-cli/bin/grunt
39-
bower_dir=$(js_dir)/node_modules/bower/bin/bower
40-
gruntfile_dir=$(js_dir)/Gruntfile.js
41-
42-
php_unit_tests_dir=$(CURDIR)/tests/unit
43-
php_integration_tests_dir=$(CURDIR)/tests/integration
44-
php_acceptance_tests_dir=$(CURDIR)/tests/acceptance
45-
46-
47-
48-
# building the javascript
49-
all: build
50-
51-
build: deps
52-
mkdir -p $(js_public_dir)
53-
$(grunt_dir) --config $(gruntfile_dir) build
54-
55-
watch: build
56-
$(grunt_dir) --config $(gruntfile_dir) watch:concat
57-
58-
update: deps
59-
$(bower_dir) update
60-
61-
# testing
62-
tests: js-unit-tests php-unit-tests php-integration-tests php-acceptance-tests
63-
64-
unit-tests: js-unit-tests php-unit-tests
65-
66-
67-
# testing js
68-
js-unit-tests: deps
69-
export PHANTOMJS_BIN=$(phantomjs_bin) && \
70-
$(grunt_dir) --config $(gruntfile_dir) karma:continuous
71-
72-
watch-js-unit-tests: deps
73-
export CHROME_BIN=$(chrome_bin) && export FIREFOX_BIN=$(firefox_bin) && \
74-
$(grunt_dir) --config $(gruntfile_dir) karma:unit
75-
76-
77-
# testing php
78-
php-unit-tests: deps
79-
phpunit $(php_unit_tests_dir)
80-
81-
watch-php-unit-tests: deps
82-
$(grunt_dir) --config $(gruntfile_dir) watch:phpunit
83-
84-
php-integration-tests: deps
85-
phpunit $(php_integration_tests_dir)
86-
87-
php-acceptance-tests: deps
88-
cd $(php_acceptance_tests_dir); make headless
89-
90-
91-
# general
92-
deps:
93-
cd js
94-
npm install --deps
95-
cd ..
96-
97-
clean:
98-
rm -rf $(CURDIR)/node_modules
99-
rm -rf $(build_dir)
100-
101-
dist: appstore
102-
10312
appstore: clean
10413
mkdir -p $(sign_dir)
10514
rsync -a \
@@ -128,10 +37,60 @@ appstore: clean
12837
--exclude=js/package.json \
12938
$(project_dir) $(sign_dir)
13039
@echo "Signing…"
131-
php ../../occ integrity:sign-app \
40+
php ../server/occ integrity:sign-app \
13241
--privateKey=$(cert_dir)/$(app_name).key\
13342
--certificate=$(cert_dir)/$(app_name).crt\
13443
--path=$(sign_dir)/$(app_name)
13544
tar -czf $(build_dir)/$(app_name).tar.gz \
13645
-C $(sign_dir) $(app_name)
13746
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name).tar.gz | openssl base64
47+
48+
49+
### from vueexample
50+
51+
all: dev-setup lint build-js-production test
52+
53+
# Dev env management
54+
dev-setup: clean clean-dev npm-init
55+
56+
npm-init:
57+
npm install
58+
59+
npm-update:
60+
npm update
61+
62+
# Building
63+
build-js:
64+
npm run dev
65+
66+
build-js-production:
67+
npm run build
68+
69+
watch-js:
70+
npm run watch
71+
72+
# Testing
73+
test:
74+
npm run test
75+
76+
test-watch:
77+
npm run test:watch
78+
79+
test-coverage:
80+
npm run test:coverage
81+
82+
# Linting
83+
lint:
84+
npm run lint
85+
86+
lint-fix:
87+
npm run lint:fix
88+
89+
# Cleaning
90+
clean:
91+
rm -f js/notes.js
92+
rm -f js/notes.js.map
93+
94+
clean-dev:
95+
rm -rf node_modules
96+

js/.bowerrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

js/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

js/.jshintrc

Lines changed: 0 additions & 48 deletions
This file was deleted.

js/README.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)