Skip to content

Commit

Permalink
Upgrade Vue.js CLI to 4.x (#969)
Browse files Browse the repository at this point in the history
* Package updates

* Update for new output names

* Update permissions editor to vue-cli 4.3.x

* Update vue-cdr-access packages

* Router push needs a catch block, as navigating to same route throws an error, see vuejs/vue-router#2881 (comment). It seems it's not supposed to throw the error if parameters are changed, so maybe a bug in vue-router?

* * Update vue-cdr-access packages
* Security fixes

* Fix issue with js build not overwriting previous build

* Update vue-test-utils and fix tests. There were breaking changes in 1.0.0-beta.30
  • Loading branch information
lfarrell authored Apr 30, 2020
1 parent 6a95d6a commit df38161
Show file tree
Hide file tree
Showing 27 changed files with 19,322 additions and 11,645 deletions.
34 changes: 10 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@ endif

cat /dev/null > static/js/vue-permissions.js

ifeq ($(DEPLOY_TYPE), prod)
cat static/js/admin/vue-permissions-editor/dist/js/chunk-vendors*.js > static/js/vue-permissions.js
endif
cat static/js/admin/vue-permissions-editor/dist/js/chunk-vendors*js > static/js/vue-permissions.js


# Add new line so app*.js doesn't get commented out
echo >> static/js/vue-permissions.js

ifeq ($(DEPLOY_TYPE), prod)
cat static/js/admin/vue-permissions-editor/dist/js/app*.js >> static/js/vue-permissions.js
else
cat static/js/admin/vue-permissions-editor/dist/app.js >> static/js/vue-permissions.js
endif
cat static/js/admin/vue-permissions-editor/dist/js/app*js >> static/js/vue-permissions.js

cat static/js/lib/jquery.min.js > static/js/cdr-admin.js
echo "define('jquery-ui', ['jquery'], function ($$) {" >> static/js/cdr-admin.js
Expand Down Expand Up @@ -56,7 +51,7 @@ endif
> static/css/cdr_admin.css

ifeq ($(DEPLOY_TYPE), prod)
cat static/js/admin/vue-permissions-editor/dist/css/app*.css >> static/css/cdr_admin.css
cat static/js/admin/vue-permissions-editor/dist/css/app*css >> static/css/cdr_admin.css
endif

ifneq ($(VERSION), "")
Expand All @@ -67,7 +62,7 @@ ifneq ($(VERSION), "")
endif

build-access:
# Build vue application(s) files
# Build vue application(s) files
npm --prefix static/js/vue-cdr-access install

ifeq ($(DEPLOY_TYPE), prod)
Expand All @@ -76,7 +71,8 @@ else
npm --prefix static/js/vue-cdr-access run build-dev
endif

# Make sure file is empty
# Make sure files are empty
cat /dev/null > static/js/vue-access.js
cat /dev/null > static/css/sass/cdr-ui.scss

cat static/css/sass/cdr_homepage.scss \
Expand All @@ -88,24 +84,14 @@ endif
cat static/js/lib/jquery-ui-access.min.js >> static/js/cdr-access.js
echo "});" >> static/js/cdr-access.js

cat /dev/null > static/js/vue-access.js

ifeq ($(DEPLOY_TYPE), prod)
cat static/js/vue-cdr-access/dist/js/chunk-vendors*.js >> static/js/vue-access.js
endif
cat static/js/vue-cdr-access/dist/js/chunk-vendors*js >> static/js/vue-access.js

# Add new line so app*.js doesn't get commented out
echo >> static/js/vue-access.js

ifeq ($(DEPLOY_TYPE), prod)
cat static/js/vue-cdr-access/dist/js/app*.js >> static/js/vue-access.js
else
cat static/js/vue-cdr-access/dist/app.js >> static/js/vue-access.js
endif
cat static/js/vue-cdr-access/dist/js/app*js >> static/js/vue-access.js

cat \
static/js/public/src/*.js \
static/js/vue-access.js \
>> static/js/cdr-access.js

cat static/css/reset.css \
Expand All @@ -118,7 +104,7 @@ endif
> static/css/cdr_access.css

ifeq ($(DEPLOY_TYPE), prod)
cat static/js/vue-cdr-access/dist/css/app*.css >> static/css/cdr_access.css
cat static/js/vue-cdr-access/dist/css/app*css >> static/css/cdr_access.css
endif
SUSPEND = "n"

Expand Down
2 changes: 1 addition & 1 deletion static/js/admin/vue-permissions-editor/babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
presets: [
'@vue/app'
'@vue/cli-plugin-babel/preset'
]
}
29 changes: 1 addition & 28 deletions static/js/admin/vue-permissions-editor/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
module.exports = {
moduleFileExtensions: [
'js',
'jsx',
'json',
'vue'
],
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest'
},
transformIgnorePatterns: [
'/node_modules/'
],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
},
snapshotSerializers: [
'jest-serializer-vue'
],
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
],
testURL: 'http://localhost/',
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname'
]
preset: '@vue/cli-plugin-unit-jest'
}
Loading

0 comments on commit df38161

Please sign in to comment.