From 54b0d02cebb94a3fbc50506ff33513fe3ba2ada9 Mon Sep 17 00:00:00 2001 From: Darren Fang <2055563+darrenfang@users.noreply.github.com> Date: Sat, 17 Aug 2019 11:07:51 +0800 Subject: [PATCH] upgrade to webpack 4 --- .babelrc | 7 +- .circleci/config.yml | 2 +- .editorconfig | 16 ++++ .eslintrc | 61 +++++++++--- .npmignore | 5 +- README.md | 2 +- index.html | 13 --- package.json | 66 ++++++------- src/components/DatetimePicker.vue | 150 +++++++++++++++--------------- src/components/index.js | 7 -- src/index.html | 37 ++++++++ src/index.js | 32 +++++++ src/main.js | 2 +- webpack/build.js | 1 - webpack/dev.js | 1 - webpack/doc.js | 1 - webpack/webpack.base.config.js | 26 ++++-- webpack/webpack.build.config.js | 31 +++--- webpack/webpack.dev.config.js | 25 ++--- webpack/webpack.doc.config.js | 70 -------------- 20 files changed, 286 insertions(+), 269 deletions(-) create mode 100644 .editorconfig delete mode 100644 index.html delete mode 100644 src/components/index.js create mode 100644 src/index.html create mode 100644 src/index.js delete mode 100644 webpack/build.js delete mode 100644 webpack/dev.js delete mode 100644 webpack/doc.js delete mode 100644 webpack/webpack.doc.config.js diff --git a/.babelrc b/.babelrc index 000d063..67fc288 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,7 @@ { "presets": [ - ["es2015", { "modules": false }], - "stage-2" + [ + "@babel/preset-env" + ] ] -} \ No newline at end of file +} diff --git a/.circleci/config.yml b/.circleci/config.yml index 0dee13c..0e679ab 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 defaults: &defaults working_directory: ~/workspace docker: - - image: circleci/node:7.10 + - image: circleci/node:10.16.3 jobs: build: diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7e3649a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[Makefile] +indent_style = tab diff --git a/.eslintrc b/.eslintrc index 50d9764..95b0825 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,16 +1,49 @@ { - "parserOptions": { - "ecmaVersion": 2017, - "sourceType": "module" - }, - "extends": "standard", - "env": { - "browser": true - }, - "plugins": [ - "vue" - ], - "settings": { - "import/extensions": [".js", ".vue", ".less"] - } + "env": { + "browser": true, + "es6": true, + "node": true + }, + "extends": [ + "plugin:vue/essential", + "standard" + ], + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "module" + }, + "plugins": [ + "vue" + ], + "rules": { + "quotes": [ + "error", + "single" + ], + "indent": [ + "error", + 2 + ], + "vue/script-indent": [ + "error", + 2, + { + "baseIndent": 1 + } + ] + }, + "overrides": [ + { + "files": [ + "*.vue" + ], + "rules": { + "indent": "off" + } + } + ] } diff --git a/.npmignore b/.npmignore index b56dc10..16620a2 100644 --- a/.npmignore +++ b/.npmignore @@ -1,9 +1,8 @@ /docs /node_modules /webpack -.babelrc +.editorconfig .eslintignore .eslintrc -index.html .npmignore -*.tgz \ No newline at end of file +*.tgz diff --git a/README.md b/README.md index 9ee5f09..c04a896 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Once installed, it can be used in a template as simply as: | datetime (model) | Date/String | | Time picker model. | | disabled | Boolean | false | Input is disabled. | | label | string | | Sets input label. | -| width | Number | 320 | The width of the content. | +| width | Number | 340 | The width of the content. | | format | string | YYYY-MM-DD HH:mm:ss | Defines the format of a datetime displayed in field. | | timePickerFormat | string | 24hr | Defines the format of a time displayed in picker. Available options are ampm and 24hr. | | locale | string | en-us | Sets the locale. Accepts a string with a BCP 47 language tag. | diff --git a/index.html b/index.html deleted file mode 100644 index 02c4dc0..0000000 --- a/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - -
- -