yakuza0 2.20.3 → 2.20.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli/index.js CHANGED
@@ -433,9 +433,10 @@ var run = exports.run = function () {
433
433
  }, _callee9, undefined);
434
434
  })));
435
435
 
436
- _commander2.default.command('verify <cmd>').option('-e, --edit <envName>', 'commit msg').option('-y0ba, --yk0-build-app <appName>', 'Building a specified application').option('-e, --env <envName>', 'yk server env').description('husky').action(function () {
436
+ _commander2.default.command('verify <cmd>').option('-ed, --edit <envName>', 'commit file').option('-m, --msg <msg>', 'commit msg').option('-y0ba, --yk0-build-app <appName>', 'Building a specified application').option('-e, --env <envName>', 'yk server env').description('husky').action(function () {
437
437
  var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(cmd, _ref16) {
438
438
  var edit = _ref16.edit,
439
+ msg = _ref16.msg,
439
440
  yk0BuildApp = _ref16.yk0BuildApp,
440
441
  env = _ref16.env;
441
442
  return _regenerator2.default.wrap(function _callee10$(_context10) {
@@ -452,7 +453,7 @@ var run = exports.run = function () {
452
453
 
453
454
  case 3:
454
455
  _context10.t0 = cmd;
455
- _context10.next = _context10.t0 === "commit-init" ? 6 : _context10.t0 === "commit-eslint" ? 9 : _context10.t0 === "commit-msg" ? 12 : 15;
456
+ _context10.next = _context10.t0 === "commit-init" ? 6 : 9;
456
457
  break;
457
458
 
458
459
  case 6:
@@ -467,14 +468,12 @@ var run = exports.run = function () {
467
468
  return (0, _verify.commitEsLint)({ edit: edit });
468
469
 
469
470
  case 11:
470
- return _context10.abrupt('break', 15);
471
-
472
- case 12:
473
- _context10.next = 14;
474
- return (0, _verify.commitMsg)({ edit: edit });
471
+ _context10.next = 13;
472
+ return (0, _verify.commitStyleLint)({ edit: edit });
475
473
 
476
- case 14:
477
- return _context10.abrupt('break', 15);
474
+ case 13:
475
+ _context10.next = 15;
476
+ return (0, _verify.commitMsg)({ edit: msg });
478
477
 
479
478
  case 15:
480
479
  case 'end':
@@ -487,7 +486,17 @@ var run = exports.run = function () {
487
486
  return function (_x10, _x11) {
488
487
  return _ref17.apply(this, arguments);
489
488
  };
490
- }());
489
+ }()
490
+ // case "commit-eslint":
491
+ // await commitEsLint({edit});
492
+ // break;
493
+ // case "commit-stylelint":
494
+ // await commitStyleLint({edit});
495
+ // break;
496
+ // case "commit-msg":
497
+ // await commitMsg({edit});
498
+ // break;
499
+ );
491
500
 
492
501
  _commander2.default.command('server <cmd>').alias('s').option('-y0ba, --yk0-build-app <appName>', 'Building a specified application').option('-e, --env <envName>', 'yk server env').description('service control').action(function () {
493
502
  var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(cmd, _ref18) {
@@ -60,12 +60,13 @@ _yakuza.global.NUXT_BUILD_FILENAME_INDEX = 0;
60
60
 
61
61
  exports.default = function (config) {
62
62
  var nuxtConf = _config2.default.nuxt;
63
+ var appConf = config.appConf;
63
64
  var extendFn = function extendFn(conf, ctx) {};
64
65
 
65
66
  config.build = (0, _extends3.default)({}, config.build, {
66
- extractCSS: {
67
- ignoreOrder: false
68
- },
67
+ // extractCSS: {
68
+ // ignoreOrder: false,
69
+ // },
69
70
  // extractCSS: !yConf.dev,
70
71
  corejs: _config2.default.resolve.babelConf.corejs,
71
72
  transpile: [_yakuza._.regAnd(['@rdc', 'ant-design-vue']), _yakuza._.regAnd(['.cache', 'yakuza0', 'middleware']), 'nuxt', 'delay', 'node-fetch', 'data-uri-to-buffer', 'fetch-blob', 'quill-image-drop-module'].concat((0, _toConsumableArray3.default)(nuxtConf.build && nuxtConf.build.tsl || [])),
@@ -78,7 +79,9 @@ exports.default = function (config) {
78
79
 
79
80
  // config.build.extractCSS = true;
80
81
  if (!_config2.default.dev) {
81
- // config.build.extractCSS = true;
82
+ config.build.extractCSS = {
83
+ ignoreOrder: false
84
+ };
82
85
  // config.build.optimization = {
83
86
  // splitChunks: {
84
87
  // chunks: 'async',
@@ -169,6 +172,24 @@ exports.default = function (config) {
169
172
  }
170
173
  }
171
174
  });
175
+
176
+ // if (!appConf.server.openHmr) {
177
+ // const hmrIndex = conf.plugins.findIndex(p => {
178
+ // return p.constructor.name === 'HotModuleReplacementPlugin';
179
+ // });
180
+ //
181
+ // if (hmrIndex !== -1) {
182
+ // conf.plugins.splice(hmrIndex, 1)
183
+ // }
184
+ //
185
+ // conf.plugins.forEach(p => {
186
+ // console.log(p.constructor.name);
187
+ // });
188
+ // }
189
+
190
+ if (ctx.loaders && ctx.loaders.scss) {
191
+ ctx.loaders.scss.additionalData = '@use "sass:math";\n@use "sass:color";\n@use "sass:list";\n@use "sass:map";\n@use "sass:meta";\n@use "sass:selector";\n@use "sass:string";\n';
192
+ }
172
193
  };
173
194
 
174
195
  // config.build.vendor = ['babel-polyfill'];
@@ -200,7 +221,7 @@ exports.default = function (config) {
200
221
  // parallel: true,
201
222
  // cache: false,
202
223
  // hardSource: false,
203
- // cache: yConf.dev,
224
+ cache: _config2.default.dev,
204
225
  hardSource: _config2.default.dev,
205
226
  "html.minify": {
206
227
  sortAttributes: true,
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ var consola = require('consola');
4
+
5
+ module.exports = consola.withScope('yk:stylelint');
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ var _extends2 = require('babel-runtime/helpers/extends');
4
+
5
+ var _extends3 = _interopRequireDefault(_extends2);
6
+
7
+ var _paths = require('../../config/paths');
8
+
9
+ var _paths2 = _interopRequireDefault(_paths);
10
+
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+
13
+ // const { resolve } = require('path')
14
+ var _require = require('./utils'),
15
+ moduleExists = _require.moduleExists;
16
+
17
+ var logger = require('./logger');
18
+
19
+
20
+ module.exports = function (moduleOptions) {
21
+ if (!moduleExists('stylelint')) {
22
+ logger.warn('The dependency `stylelint` not found.', 'Please run `pxnpm install stylelint --save-dev` or `npm install stylelint --save-dev`');
23
+ return;
24
+ }
25
+
26
+ var options = (0, _extends3.default)({
27
+ context: this.options.srcDir,
28
+ // configFile: paths.appDirectory + paths.sep + ".stylelintrc.js",
29
+ files: [this.options.dir.assets + '/**/*.{s?(a|c)ss,less,stylus}', '{components,' + this.options.dir.layouts + ',' + this.options.dir.pages + '}/**/*.vue']
30
+ }, this.options.stylelint, moduleOptions);
31
+
32
+ var filesToWatch = ['.stylelintignore', '.stylelintrc', '.stylelintrc.json', '.stylelintrc.yaml', '.stylelintrc.yml', '.stylelintrc.js', 'stylelint.config.js'];
33
+
34
+ filesToWatch.forEach(function (p) {
35
+ var v = _paths2.default.appDirectory + _paths2.default.sep + p;
36
+ if (_paths2.default.access(v)) {
37
+ options.configFile = v;
38
+ }
39
+ });
40
+
41
+ // this.options.watch.push(
42
+ // ...filesToWatch.map(p => (paths.appDirectory + paths.sep + p))
43
+ // )
44
+
45
+ console.warn = function () {};
46
+ this.extendBuild(function (config, _ref) {
47
+ var isDev = _ref.isDev,
48
+ isClient = _ref.isClient;
49
+
50
+ if (isDev && isClient) {
51
+ var StylelintPlugin = require('stylelint-webpack-plugin');
52
+
53
+ config.plugins.push(new StylelintPlugin(options));
54
+ }
55
+ });
56
+ };
57
+
58
+ // module.exports.meta = require('../package.json')
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var moduleExists = function moduleExists(name) {
4
+ try {
5
+ return require.resolve(name);
6
+ } catch (e) /* istanbul ignore next */{
7
+ return false;
8
+ }
9
+ };
10
+
11
+ module.exports = {
12
+ moduleExists: moduleExists
13
+ };
@@ -2,10 +2,17 @@
2
2
 
3
3
  var _yakuza = require('yakuza1');
4
4
 
5
+ var _init = require('yakuza0/nuxt/store/init');
6
+
7
+ var ykInit = _interopRequireWildcard(_init);
8
+
9
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
10
+
5
11
  var commonStore = require.context('$common.store/', true, /\.js$/);
6
12
  var store = require.context('~/store/', true, /\.js$/);
7
13
 
8
14
  var storeObj = {};
15
+ storeObj['__yk_init__'] = ykInit;
9
16
 
10
17
  var errStateFile = [];
11
18
 
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var namespaced = exports.namespaced = true;
7
+ var state = exports.state = function state() {
8
+ return {
9
+ gu: {
10
+ group: '',
11
+ name: '',
12
+ ver: ''
13
+ }
14
+ };
15
+ };
16
+ var mutations = exports.mutations = {
17
+ SET_GU: function SET_GU(state, gu) {
18
+ state.gu = gu;
19
+ }
20
+ };
21
+ var actions = exports.actions = {
22
+ setGU: function setGU(_ref, gu) {
23
+ var commit = _ref.commit;
24
+
25
+ commit('SET_GU', gu);
26
+ }
27
+ };
package/nuxt/style.js CHANGED
@@ -26,10 +26,22 @@ var _config = require('../config');
26
26
 
27
27
  var _config2 = _interopRequireDefault(_config);
28
28
 
29
+ var _paths = require('../config/paths');
30
+
31
+ var _paths2 = _interopRequireDefault(_paths);
32
+
29
33
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
34
 
31
35
  exports.default = function (config) {
36
+ var stylelint = _config2.default.extend.plugins.stylelint;
37
+
32
38
  config.buildModules = ['@rdc/nuxtjs-style-resources'];
39
+
40
+ if (stylelint.enabled) {
41
+ var sm = ['yakuza0/nuxt/buildModules/stylelint', stylelint.options];
42
+ config.buildModules.push(sm);
43
+ }
44
+
33
45
  var globalStyle = (0, _extends3.default)({
34
46
  compile: [],
35
47
  sass: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.20.3",
3
+ "version": "2.20.7",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -27,7 +27,7 @@
27
27
  "@commitlint/load": "^12.1.1",
28
28
  "@commitlint/read": "^12.1.1",
29
29
  "@nuxtjs/eslint-config": "^3.0.0",
30
- "@nuxtjs/pwa": "^3.0.0-beta.19",
30
+ "@nuxtjs/stylelint-module": "^4.0.0",
31
31
  "@rdc/nuxt": "2.15.8-0",
32
32
  "@rdc/nuxtjs-style-resources": "^1.0.0",
33
33
  "address": "^1.0.3",
@@ -72,16 +72,26 @@
72
72
  "less": "^3.10.3",
73
73
  "less-loader": "^5.0.0",
74
74
  "markdown-loader": "^6.0.0",
75
- "node-sass": "^4.9.3",
76
75
  "node-ssh": "5",
77
76
  "path-match": "^1.2.4",
78
77
  "pm2": "^4.2.0",
79
78
  "react-dev-utils": "^11.0.4",
80
79
  "require-from-string": "^2.0.2",
81
80
  "rimraf": "^2.6.3",
82
- "sass-loader": "^7.1.0",
81
+ "sass": "^1.43.4",
82
+ "sass-loader": "^10",
83
83
  "semver": "^6.3.0",
84
84
  "socket.io-client": "^2.2.0",
85
+ "stylelint": "^14.1.0",
86
+ "stylelint-config-prettier": "^9.0.3",
87
+ "stylelint-config-rational-order": "^0.1.2",
88
+ "stylelint-config-recommended-vue": "^1.0.0",
89
+ "stylelint-config-standard": "^24.0.0",
90
+ "stylelint-config-standard-scss": "^2.0.1",
91
+ "stylelint-declaration-block-no-ignored-properties": "^2.5.0",
92
+ "stylelint-order": "^5.0.0",
93
+ "stylelint-scss": "^4.0.0",
94
+ "stylelint-webpack-plugin": "^3.1.0",
85
95
  "stylus": "^0.54.7",
86
96
  "stylus-loader": "^3.0.2",
87
97
  "tcp-port-used": "^1.0.1",