arui-scripts 13.0.1-feat-speadup.1 → 13.1.0

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/CHANGELOG.md CHANGED
@@ -1,9 +1,16 @@
1
- ## [13.0.1-feat-speadup.1](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.0.0...v13.0.1-feat-speadup.1) (2022-08-03)
1
+ # [13.1.0](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.0.0...v13.1.0) (2022-08-05)
2
2
 
3
3
 
4
- ### Performance Improvements
4
+ ### Features
5
+
6
+ * add yarn 2 support ([5d4bb8c](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/5d4bb8c5e4debb3d0db430c094effbedd9b7bcc3))
7
+
8
+ # [13.1.0-feature-yarn2.1](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v13.0.0...v13.1.0-feature-yarn2.1) (2022-08-04)
9
+
10
+
11
+ ### Features
5
12
 
6
- * **webpack-dev:** add caching ([ed76817](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/ed7681710130e6d0716114b11c5b698a15eb4b45))
13
+ * add yarn 2 support ([5d4bb8c](https://git.moscow.alfaintra.net/ef/arui-scripts/commit/5d4bb8c5e4debb3d0db430c094effbedd9b7bcc3))
7
14
 
8
15
  # [13.0.0](https://git.moscow.alfaintra.net/ef/arui-scripts/compare/v12.5.0...v13.0.0) (2022-07-11)
9
16
 
package/README.md CHANGED
@@ -297,6 +297,7 @@ docker
297
297
 
298
298
  Команда предполагает наличие установленных `node_modules` перед сборкой, в процессе работы же очищает дев зависимости используя `yarn` или `npm`.
299
299
  yarn будет использоваться когда в рутовой папке проекта есть `yarn.lock` и `yarn` доступен в системе.
300
+ Если вы используете yarn 2, для выполнения команды очистки используется плагин [workspace-tools](https://github.com/yarnpkg/berry/blob/HEAD/packages/plugin-workspace-tools/README.md), поэтому он должен быть установлен и указан в `.yarnrc.yml` вашего проекта.
300
301
 
301
302
  Итоговый контейнер будет содержать `nginx` и скрипт для запуска `nginx` одновременно с `nodejs` сервером.
302
303
 
@@ -323,6 +324,7 @@ archive
323
324
 
324
325
  Команда предполагает наличие установленных `node_modules` перед сборкой, в процессе работы же очищает дев зависимости используя `yarn` или `npm`.
325
326
  yarn будет использоваться когда в рутовой папке проекта есть `yarn.lock` и `yarn` доступен в системе.
327
+ Если вы используете yarn 2, для выполнения команды очистки используется плагин [workspace-tools](https://github.com/yarnpkg/berry/blob/HEAD/packages/plugin-workspace-tools/README.md), поэтому он должен быть установлен и указан в `.yarnrc.yml` вашего проекта.
326
328
 
327
329
  Итоговый архив будет содержать в себе `.build`, `node_modules`, `package.json` и `config` папки вашего проекта.
328
330
 
@@ -51,7 +51,14 @@ const packageJsonPath = path_1.default.join(app_configs_1.default.cwd, packageJs
51
51
  console.time('Remove build dependencies time');
52
52
  // if yarn is available prune dev dependencies with yarn, otherwise use npm
53
53
  if (app_configs_1.default.useYarn && shelljs_1.default.which('yarn')) {
54
- yield exec_1.default('yarn install --production --ignore-optional --frozen-lockfile --ignore-scripts --prefer-offline');
54
+ const yarnVersion = shelljs_1.default.exec('yarn -v', { silent: true });
55
+ const yarnMajorVersion = Number(yarnVersion.split('.')[0]);
56
+ if (yarnMajorVersion > 1) {
57
+ yield exec_1.default('yarn workspaces focus --production --all');
58
+ }
59
+ else {
60
+ yield exec_1.default('yarn install --production --ignore-optional --frozen-lockfile --ignore-scripts --prefer-offline');
61
+ }
55
62
  }
56
63
  else {
57
64
  yield exec_1.default('npm prune --production');
@@ -74,7 +74,14 @@ const imageFullName = `${dockerRegistry ? `${dockerRegistry}/` : ''}${imageName}
74
74
  console.time('Remove dev dependencies time');
75
75
  // if yarn is available prune dev dependencies with yarn, otherwise use npm
76
76
  if (app_configs_1.default.useYarn && shelljs_1.default.which('yarn')) {
77
- yield exec_1.default('yarn install --production --ignore-optional --frozen-lockfile --ignore-scripts --prefer-offline');
77
+ const yarnVersion = shelljs_1.default.exec('yarn -v', { silent: true });
78
+ const yarnMajorVersion = Number(yarnVersion.split('.')[0]);
79
+ if (yarnMajorVersion > 1) {
80
+ yield exec_1.default('yarn workspaces focus --production --all');
81
+ }
82
+ else {
83
+ yield exec_1.default('yarn install --production --ignore-optional --frozen-lockfile --ignore-scripts --prefer-offline');
84
+ }
78
85
  }
79
86
  else {
80
87
  yield exec_1.default('npm prune --production');
@@ -9,9 +9,11 @@ const case_sensitive_paths_webpack_plugin_1 = __importDefault(require("case-sens
9
9
  const fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
10
10
  const assets_webpack_plugin_1 = __importDefault(require("assets-webpack-plugin"));
11
11
  const tsconfig_paths_webpack_plugin_1 = __importDefault(require("tsconfig-paths-webpack-plugin"));
12
+ const WatchMissingNodeModulesPlugin_1 = __importDefault(require("react-dev-utils/WatchMissingNodeModulesPlugin"));
12
13
  const getCSSModuleLocalIdent_1 = __importDefault(require("react-dev-utils/getCSSModuleLocalIdent"));
13
14
  const PnpWebpackPlugin = require('pnp-webpack-plugin');
14
15
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
16
+ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
15
17
  const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
16
18
  const ReactRefreshTypeScript = require('react-refresh-typescript');
17
19
  const app_configs_1 = __importDefault(require("./app-configs"));
@@ -79,12 +81,6 @@ const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient',
79
81
  PnpWebpackPlugin.moduleLoader(module),
80
82
  ],
81
83
  },
82
- cache: {
83
- type: 'filesystem',
84
- buildDependencies: {
85
- config: [__filename],
86
- },
87
- },
88
84
  module: {
89
85
  // typescript interface will be removed from modules, and we will get an error on correct code
90
86
  // see https://github.com/webpack/webpack/issues/7378
@@ -142,7 +138,6 @@ const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient',
142
138
  // It enables caching results in ./node_modules/.cache/babel-loader/
143
139
  // directory for faster rebuilds.
144
140
  cacheDirectory: true,
145
- cacheCompression: false,
146
141
  plugins: require.resolve('react-refresh/babel')
147
142
  }, babel_client_1.default)
148
143
  },
@@ -259,6 +254,17 @@ const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient',
259
254
  // a plugin that prints an error when you attempt to do this.
260
255
  // See https://github.com/facebookincubator/create-react-app/issues/240
261
256
  new case_sensitive_paths_webpack_plugin_1.default(),
257
+ // If you require a missing module and then `npm install` it, you still have
258
+ // to restart the development server for Webpack to discover it. This plugin
259
+ // makes the discovery automatic so you don't have to restart.
260
+ // See https://github.com/facebookincubator/create-react-app/issues/186
261
+ new WatchMissingNodeModulesPlugin_1.default(app_configs_1.default.appNodeModules),
262
+ // new CopyWebpackPlugin([
263
+ // {
264
+ // from: configs.staticFilesLocation,
265
+ // to: configs.clientOutputPath
266
+ // }
267
+ // ])
262
268
  app_configs_1.default.tsconfig !== null && new fork_ts_checker_webpack_plugin_1.default(),
263
269
  new MiniCssExtractPlugin(),
264
270
  ].filter(Boolean)),
@@ -269,16 +275,34 @@ const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient',
269
275
  hints: false,
270
276
  },
271
277
  optimization: {
272
- minimize: false,
278
+ minimize: true,
273
279
  nodeEnv: false,
274
- // Оптимизации времени билда, см https://webpack.js.org/guides/build-performance/
275
- removeAvailableModules: false,
276
- removeEmptyChunks: false,
277
- splitChunks: false
280
+ minimizer: [
281
+ new CssMinimizerPlugin({
282
+ minimizerOptions: {
283
+ processorOptions: {
284
+ map: {
285
+ // `inline: false` generates the source map in a separate file.
286
+ // Otherwise, the CSS file is needlessly large.
287
+ inline: false,
288
+ // `annotation: false` skips appending the `sourceMappingURL`
289
+ // to the end of the CSS file. Webpack already handles this.
290
+ annotation: false,
291
+ },
292
+ },
293
+ preset: () => ({
294
+ plugins: [
295
+ // eslint-disable-next-line global-require
296
+ require('postcss-discard-duplicates'),
297
+ ],
298
+ }),
299
+ },
300
+ }),
301
+ ],
278
302
  },
279
303
  // Без этого комиляция трирегилась на изменение в node_modules и приводила к утечке памяти
280
304
  watchOptions: {
281
- ignored: /node_modules/,
305
+ ignored: '**/node_modules',
282
306
  }
283
307
  });
284
308
  exports.default = webpackClientDev;
@@ -53,13 +53,6 @@ const config = {
53
53
  .relative(app_configs_1.default.appSrc, info.absoluteResourcePath)
54
54
  .replace(/\\/g, '/'),
55
55
  },
56
- cache: {
57
- type: 'filesystem',
58
- name: 'server',
59
- buildDependencies: {
60
- config: [__filename],
61
- },
62
- },
63
56
  externalsPresets: { node: true },
64
57
  externals: [webpack_node_externals_1.default({
65
58
  allowlist: [
@@ -224,9 +217,6 @@ const config = {
224
217
  performance: {
225
218
  hints: false,
226
219
  },
227
- watchOptions: {
228
- ignored: /node_modules/,
229
- }
230
220
  };
231
221
  const webpackServerDev = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], config);
232
222
  exports.default = webpackServerDev;
@@ -797,7 +797,7 @@
797
797
  "affectsGlobalScope": false
798
798
  },
799
799
  "../src/commands/archive-build/index.ts": {
800
- "version": "2b19da65c72de5ab026dda1bcaa7ca47aaa095115043ec3d2adb33b553f748f5",
800
+ "version": "dd67bcf3100cbd10b03627a144dfa3e311d40b9d64c443bcd16e6e378d5045f4",
801
801
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
802
802
  "affectsGlobalScope": false
803
803
  },
@@ -1247,7 +1247,7 @@
1247
1247
  "affectsGlobalScope": false
1248
1248
  },
1249
1249
  "../src/commands/docker-build/index.ts": {
1250
- "version": "1b5c4842fdd8a6f8c3da38afa0b4eab277f567bd0161cb5cc01f707fc2f7e2a3",
1250
+ "version": "3e1518759f88ff6c846f5fd5f3293d4fb65958073f013bcd68a192e2e40bebfc",
1251
1251
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
1252
1252
  "affectsGlobalScope": false
1253
1253
  },
@@ -1311,8 +1311,13 @@
1311
1311
  "signature": "a36125690b0197836e27f150c6848c40aeca31d692b7b3f58ac2fb9d9fce28b5",
1312
1312
  "affectsGlobalScope": false
1313
1313
  },
1314
+ "../../../.yarn/cache/@types-react-dev-utils-npm-9.0.8-14221814bb-d7b6cdc89a.zip/node_modules/@types/react-dev-utils/WatchMissingNodeModulesPlugin.d.ts": {
1315
+ "version": "c4ecf6cf29e03d5b9947d634f72561d87a6c16e0081933b759f9eb97c81c305a",
1316
+ "signature": "c4ecf6cf29e03d5b9947d634f72561d87a6c16e0081933b759f9eb97c81c305a",
1317
+ "affectsGlobalScope": false
1318
+ },
1314
1319
  "../src/configs/webpack.client.dev.ts": {
1315
- "version": "ab613f3f0228e6654c545b4e0976ce30a7ff265ef978a70452e64ef253d71928",
1320
+ "version": "b0faf6fe2b3727ce933e8f061febf434270230d6a0e329b851373b9c6053ce7f",
1316
1321
  "signature": "bf4cb593d7c7ac6097823d647f70fdf078e1b8175693cf9e24537625e3e69fa0",
1317
1322
  "affectsGlobalScope": false
1318
1323
  },
@@ -1336,13 +1341,8 @@
1336
1341
  "signature": "735d19ae41bbcd78b654d84c5bbd2474472cc20b5299aaeabb0b096cdd05a59d",
1337
1342
  "affectsGlobalScope": false
1338
1343
  },
1339
- "../../../.yarn/cache/@types-react-dev-utils-npm-9.0.8-14221814bb-d7b6cdc89a.zip/node_modules/@types/react-dev-utils/WatchMissingNodeModulesPlugin.d.ts": {
1340
- "version": "c4ecf6cf29e03d5b9947d634f72561d87a6c16e0081933b759f9eb97c81c305a",
1341
- "signature": "c4ecf6cf29e03d5b9947d634f72561d87a6c16e0081933b759f9eb97c81c305a",
1342
- "affectsGlobalScope": false
1343
- },
1344
1344
  "../src/configs/webpack.server.dev.ts": {
1345
- "version": "bac57268e464424a7c9ac90ea88623edf45792a6cc2ca60ca8e8966fbe03e2e3",
1345
+ "version": "0597234884dd74415bee23d36364cc4151225e8d0dae8bfd7de6f026733e1aec",
1346
1346
  "signature": "4289eb8081c31f5b009209c36c04417fd4a0f39c5740422650d076d059d0a5d3",
1347
1347
  "affectsGlobalScope": false
1348
1348
  },
@@ -5568,6 +5568,7 @@
5568
5568
  "../../../.yarn/cache/@types-node-npm-12.12.58-b4a5c5f701-2e86ae45c7.zip/node_modules/@types/node/ts3.1/util.d.ts",
5569
5569
  "../../../.yarn/cache/@types-node-npm-12.12.58-b4a5c5f701-2e86ae45c7.zip/node_modules/@types/node/ts3.3/fs.d.ts",
5570
5570
  "../../../.yarn/cache/@types-node-npm-12.12.58-b4a5c5f701-2e86ae45c7.zip/node_modules/@types/node/ts3.3/util.d.ts",
5571
+ "../../../.yarn/cache/@types-react-dev-utils-npm-9.0.8-14221814bb-d7b6cdc89a.zip/node_modules/@types/react-dev-utils/WatchMissingNodeModulesPlugin.d.ts",
5571
5572
  "../../../.yarn/cache/@types-react-dev-utils-npm-9.0.8-14221814bb-d7b6cdc89a.zip/node_modules/@types/react-dev-utils/getCSSModuleLocalIdent.d.ts",
5572
5573
  "../../../.yarn/cache/tsconfig-paths-webpack-plugin-npm-3.5.1-f1a5ca3b27-86a58fc9ab.zip/node_modules/tsconfig-paths-webpack-plugin/lib/index.d.ts",
5573
5574
  "../src/configs/app-configs/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arui-scripts",
3
- "version": "13.0.1-feat-speadup.1",
3
+ "version": "13.1.0",
4
4
  "main": "./build/index.js",
5
5
  "typings": "./build/index.d.ts",
6
6
  "license": "MPL-2.0",