Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to last Vue CLI v4 template #312

Merged
merged 63 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d6ba287
Fixed a typo
sronveaux Apr 20, 2022
f3f0bb2
Added a few lines to stick with the source template
sronveaux Apr 20, 2022
4619cf9
Changed eslint-html-plugin to eslint-vue-plugin
sronveaux Apr 20, 2022
ee7aff8
Changed import style to conform to source template
sronveaux Apr 20, 2022
51a0b49
Changed import style and var usage to conform to source templates
sronveaux Apr 20, 2022
01b99e8
Changed import style, var usage and arrow functions to conform to sou…
sronveaux Apr 20, 2022
e82af80
Removed some packages and added others to stay in tune with source te…
sronveaux Apr 20, 2022
5edb0c4
Added the first version of the new webpack config files
sronveaux Apr 20, 2022
b6ab124
Corrected a bug linked to babel-eslint-parser
sronveaux Apr 20, 2022
b75d91a
Added the possibility to open the browser specified in the config/ind…
sronveaux Apr 20, 2022
909b7eb
Removed opn which is installed as peer dependency now
sronveaux Apr 21, 2022
66a889b
Corrected a bug linked to serving static files while in development mode
sronveaux Apr 21, 2022
1b28a45
Removed the now useless build scripts
sronveaux Apr 21, 2022
c11e37b
Added a useless <div> tag so that vue-eslint stops complaining about it
sronveaux Apr 21, 2022
77b0b75
Fixed a lot of lint errors now that vue-eslint works as expected
sronveaux Apr 21, 2022
abbf7cc
Resetted the package-lock.json to avoid a small incompatibility with …
sronveaux Apr 21, 2022
ee51e31
Upgraded the first files to the new vue-CLI V3 format
sronveaux Apr 25, 2022
91c3174
Made changes to conform to new linting configuration format
sronveaux Apr 25, 2022
a9cdcd2
Corrected an indentation error returned by ESLint
sronveaux Apr 25, 2022
40b7ce7
Converted the Babel and postCSS config files to the new format
sronveaux Apr 25, 2022
012547d
Moved the index.html and embedded.html files to the public directory.…
sronveaux Apr 25, 2022
cb96ffe
Added a first version of the vue.config.js file
sronveaux Apr 25, 2022
d5e6ade
Changed the dev and build script to conform to the Vue-CLI V3 format
sronveaux Apr 25, 2022
cf19d16
Added two Babel polyfills needed as the project was reverted to core-…
sronveaux Apr 25, 2022
1bed884
Added eslint-formatter-friendly again to avoid a warning reporting bu…
sronveaux Apr 26, 2022
a468846
Changed the main.js to conform to new Vue-CLI template and to Vue bes…
sronveaux Apr 26, 2022
e7762ef
Changed the vue.config.js to have the favicon working again
sronveaux Apr 26, 2022
ff0c8c1
Commented an ESLint rule as wegue main script uses console logs to re…
sronveaux Apr 26, 2022
a141396
Changed README.md to reflect the new npm commands syntax
sronveaux Jul 26, 2022
611764b
Renamed test directory to tests as in the new Vue-CLI template
sronveaux Jul 26, 2022
491a787
Added updated Karma back in the project
sronveaux Jul 26, 2022
028e20c
Changed the path to the Webpack config file in karma.conf.js
sronveaux Jul 26, 2022
5a8caaf
Removed the now useless build and config directories
sronveaux Jul 26, 2022
76e21db
Added the source map configuration to reflect what was done before
sronveaux Jul 26, 2022
ede4680
Added cross-env back and added the npm script to run tests through Karma
sronveaux Jul 26, 2022
3e439b7
Added babel-plugin-istanbul and changed the babel.config.js to make c…
sronveaux Jul 26, 2022
2183fea
Changed a test and made it async to avoid a new strange bug(https://g…
sronveaux Jul 26, 2022
a5a09e7
Changed a forgotten file to use correct test files
sronveaux Jul 29, 2022
4fefd3b
changed an npm script to point to correct test directory
sronveaux Jul 29, 2022
0b9480c
Changed two commands in the documentation
sronveaux Jul 29, 2022
a80ed56
Merged official master branch before amending this branch following d…
sronveaux Oct 3, 2022
e8f1475
Added unit tests coverage reporrts to .gitignore and .dockerignore files
sronveaux Oct 3, 2022
b78606d
Made Karma the default test runner and removed the Vue CLI mocha-webp…
sronveaux Oct 3, 2022
edf6427
Changed the command used to run development server inside the Worksho…
sronveaux Oct 3, 2022
dad49c4
Reintroduced the min engine requirements to conform to Vue-CLI V3 rec…
sronveaux Oct 4, 2022
4480fe3
Set APP resolver alias to base configuration instead of test configur…
sronveaux Oct 4, 2022
4a3b2a2
Added mocha environment in the .eslintrc.js file
sronveaux Oct 4, 2022
147f29a
Merged official master branch before upgrading to VueCLI4
sronveaux Dec 20, 2022
8353669
Upgraded all vueCLI and plugins to latest V4
sronveaux Jul 27, 2022
aa02309
Changed .browserlistrc .gitignore and .eslinrc.js to conform to new V…
sronveaux Jul 27, 2022
8007461
Removed two config files which are not needed anymore with new Vue te…
sronveaux Jul 27, 2022
1a2e46b
Changed a font name to conform to new Vue template
sronveaux Jul 27, 2022
ed54a82
Added .eslintrc in tests/unit to avoid spurrious errors of undeclared…
sronveaux Jul 27, 2022
b3794ff
Fixed a lot of linter errors linked to the new rules of eslint6
sronveaux Jul 28, 2022
f44207b
Changed how hasOwnProperty is used to conform to a new eslint rule
sronveaux Jul 28, 2022
5d1cb1b
Fixed some linter errors in app-starter linked to the new rules of es…
sronveaux Dec 20, 2022
d6448a7
Removed two Babel polyfills which are now included in core-js@3
sronveaux Dec 20, 2022
05a6455
Changed some unit tests to call setProps correctly (https://test-util…
sronveaux Dec 20, 2022
98ccffd
Added the openssl-legacy-provider flag to get around digital envelope…
sronveaux Jan 20, 2023
3df6254
Corrected the coverage of .vue file bug
sronveaux Jan 20, 2023
16cc072
Merged official master branch to resolve conflicts
sronveaux Jan 20, 2023
5397902
Raise lint errors when using debugger in production
sronveaux Jan 20, 2023
5e66257
Removed a trailing space which gave errors when building under Docker
sronveaux Jan 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .babelrc

This file was deleted.

3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
app/
dist/
node_modules/
test/unit/coverage/
tests/unit/coverage/
.git/
8 changes: 2 additions & 6 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
root = true

[*]
charset = utf-8
[*.{js,jsx,ts,tsx,vue}]
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
insert_final_newline = true
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build/*.js
config/*.js
/build/
/config/
/test/unit/coverage/
45 changes: 24 additions & 21 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
// http://eslint.org/docs/user-guide/configuring

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
env: {
browser: true,
node: true,
},
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
extends: 'standard',
// required to lint *.vue files
plugins: [
'html'
extends: [
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
'@vue/standard'
],
// add your custom rules here
'rules': {
// allow paren-less arrow functions
'arrow-parens': 'off',
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
rules: {
// 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would prefer to raise a 'no-debugger' error for production environments.

And as a future proposal - probably as part of a seperate PR:
Maybe we could do something about the 'no-console' setting. E.g. we could pool all wegue logging operations into a logger module and then use the eslint-disable directive there. So warnings could be generally enabled.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem to revert the change, simply, that's not something that I personally changed, this is what is present in Vue-CLI V4 and Vue-CLI V5 templates.

Your future proposal is intersting, it would be nice to enable this rule in the end for sure!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted to raise error if debugger is used while building for production


// allow semicolons and the end of a statement
'semi': 'off',

Expand All @@ -40,5 +29,19 @@ module.exports = {
'padded-blocks': process.env.NODE_ENV === 'development' ? 'warn' : 'error',
'keyword-spacing': process.env.NODE_ENV === 'development' ? 'warn' : 'error',
'arrow-spacing': process.env.NODE_ENV === 'development' ? 'warn' : 'error'
}
},
parserOptions: {
parser: 'babel-eslint',
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
],
env: {
mocha: true
}
}
]
}
21 changes: 17 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
.DS_Store
node_modules/
dist/
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
test/unit/coverage
pnpm-debug.log*

# Unit tests coverage reports
test/unit/coverage/
tests/unit/coverage/

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sln
*.sw?
2 changes: 1 addition & 1 deletion .gitpod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ports:
onOpen: open-preview
tasks:
- init: npm install && npm run init:app
command: npm run dev
command: npm run serve
vscode:
extensions:
- dbaeumer.vscode-eslint
8 changes: 0 additions & 8 deletions .postcssrc.js

This file was deleted.

28 changes: 23 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ npm run init:app

``` bash
# serve with hot reload at localhost:8081
npm run dev
npm run serve
```

### Unit tests

To run all unit tests execute the following:
To run all unit tests using Karma test runner execute the following:

``` bash
# run all tests
npm test
npm run test
```

NB the unit tests require Chrome or Chromium browser executable to be found.
Expand All @@ -83,7 +83,25 @@ Run the build script in order to create a production build, which can be copied
npm run build
```

For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
### Linting your files

Run the lint script in order to lint all your files without fixing the errors. The problems will be reported in the console only.

``` bash
npm run lint
```

### Linting and fixing your files

Run the lint script in order to lint all your files and fix the errors at the same time.

``` bash
npm run lint:fix
```

### Customize configuration

See [Configuration Reference](https://cli.vuejs.org/config/).

## Run with Docker

Expand Down Expand Up @@ -140,6 +158,6 @@ You need professional support or teachings for Wegue? Please contact a service p

## Credits

The basic project setup was created by https://github.com/vuejs-templates/webpack.
The basic project setup was created with [Vue CLI](https://cli.vuejs.org).

Thanks for this great template! :+1:
14 changes: 7 additions & 7 deletions app-starter/WguApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
</template>

<script>
import WguAppTemplate from './WguAppTemplate.vue';
export default {
name: 'my-wgu-app',
components: {
'wgu-app-tpl': WguAppTemplate
}
// add Vue methods and hooks here
import WguAppTemplate from './WguAppTemplate.vue';
export default {
name: 'my-wgu-app',
components: {
'wgu-app-tpl': WguAppTemplate
}
// add Vue methods and hooks here
}
</script>
4 changes: 2 additions & 2 deletions app-starter/WguAppTemplate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
v-bind="moduleWin"
/>
</template>
</wgu-app-sidebar>
</wgu-app-sidebar>

<slot name="wgu-before-content" />
<v-content app>
<v-container id="ol-map-container" fluid fill-height class="pa-0">
<wgu-map />
<!-- layer loading indicator -->
<wgu-maploading-status />
<slot name="wgu-after-map">
<slot name="wgu-after-map">
</slot>
<!-- Portal to overlay the map content from an application module -->
<portal-target name="map-overlay" />
Expand Down
2 changes: 1 addition & 1 deletion app-starter/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<v-list color="primary">
<template v-for="(tbButton, index) in menuButtons">
<v-list-item :key="index">
<component
<component
:is="tbButton.type" :key="index"
v-bind="tbButton"
/>
Expand Down
8 changes: 4 additions & 4 deletions app-starter/components/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
absolute
top
color="secondary"
@click="sidebarOpen = !sidebarOpen">
<v-icon color="onsecondary" v-if="sidebarOpen">chevron_left</v-icon>
<v-icon color="onsecondary" v-else>chevron_right</v-icon>
@click="sidebarOpen = !sidebarOpen">
<v-icon color="onsecondary" v-if="sidebarOpen">chevron_left</v-icon>
<v-icon color="onsecondary" v-else>chevron_right</v-icon>
</v-btn>
</template>
</v-navigation-drawer>
Expand Down Expand Up @@ -66,4 +66,4 @@ export default {
}
}
}
</script>
</script>
14 changes: 14 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
],
plugins: [
'@babel/plugin-proposal-nullish-coalescing-operator',
'@babel/plugin-proposal-optional-chaining'
],
'env': {
'test': {
'plugins': ['istanbul']
}
}
}
40 changes: 0 additions & 40 deletions build/build.js

This file was deleted.

Loading