arui-scripts 19.0.7 → 19.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.
Files changed (96) hide show
  1. package/.turbo/turbo-test.log +7 -7
  2. package/CHANGELOG.md +12 -0
  3. package/build/bin/index.js +0 -5
  4. package/build/commands/archive-build/index.js +18 -18
  5. package/build/commands/build/build-wrapper.js +3 -5
  6. package/build/commands/build/client.js +5 -7
  7. package/build/commands/build/index.js +1 -3
  8. package/build/commands/build/server.js +2 -4
  9. package/build/commands/bundle-analyze/index.js +7 -9
  10. package/build/commands/changelog/index.js +27 -9
  11. package/build/commands/docker-build/index.js +18 -18
  12. package/build/commands/docker-build-compiled/index.js +14 -14
  13. package/build/commands/ensure-yarn/index.js +0 -1
  14. package/build/commands/start/client.js +2 -5
  15. package/build/commands/start/index.js +1 -3
  16. package/build/commands/start/print-compiler-output.d.ts +2 -1
  17. package/build/commands/start/print-compiler-output.js +3 -3
  18. package/build/commands/start/server.js +2 -5
  19. package/build/commands/start-prod/client.js +2 -5
  20. package/build/commands/start-prod/index.js +1 -3
  21. package/build/commands/start-prod/server.js +2 -5
  22. package/build/commands/test/index.js +0 -2
  23. package/build/commands/util/client-assets-sizes.js +0 -1
  24. package/build/commands/util/docker-build.js +14 -14
  25. package/build/commands/util/exec.d.ts +1 -2
  26. package/build/commands/util/exec.js +2 -4
  27. package/build/commands/util/format-webpack-messages.d.ts +4 -10
  28. package/build/commands/util/format-webpack-messages.js +21 -22
  29. package/build/commands/util/make-tmp-dir.d.ts +1 -2
  30. package/build/commands/util/make-tmp-dir.js +1 -1
  31. package/build/commands/util/run-client-dev-server.js +7 -9
  32. package/build/commands/util/run-server-watch-compiler.js +4 -7
  33. package/build/configs/app-configs/index.d.ts +0 -1
  34. package/build/configs/app-configs/index.js +0 -1
  35. package/build/configs/app-configs/types.d.ts +2 -2
  36. package/build/configs/app-configs/warn-about-deprecations.js +5 -3
  37. package/build/configs/babel-client.d.ts +1 -2
  38. package/build/configs/babel-client.js +5 -8
  39. package/build/configs/babel-dependencies.js +4 -7
  40. package/build/configs/babel-server.d.ts +1 -2
  41. package/build/configs/babel-server.js +7 -10
  42. package/build/configs/dev-server.d.ts +1 -2
  43. package/build/configs/dev-server.js +8 -7
  44. package/build/configs/jest/babel-transform.js +1 -1
  45. package/build/configs/jest/settings.js +1 -1
  46. package/build/configs/modules.js +5 -3
  47. package/build/configs/postcss.config.d.ts +2 -2
  48. package/build/configs/postcss.config.js +9 -11
  49. package/build/configs/postcss.d.ts +1 -2
  50. package/build/configs/postcss.js +3 -8
  51. package/build/configs/process-assets-plugin-output.js +8 -8
  52. package/build/configs/server-externals-exemptions.js +2 -5
  53. package/build/configs/stats-options.d.ts +1 -2
  54. package/build/configs/stats-options.js +3 -6
  55. package/build/configs/supporting-browsers.d.ts +1 -2
  56. package/build/configs/supporting-browsers.js +3 -6
  57. package/build/configs/swc.js +5 -10
  58. package/build/configs/util/apply-overrides.d.ts +2 -2
  59. package/build/configs/util/apply-overrides.js +5 -9
  60. package/build/configs/util/check-node-version.d.ts +1 -2
  61. package/build/configs/util/check-node-version.js +1 -1
  62. package/build/configs/util/find-loader.js +3 -3
  63. package/build/configs/util/get-entry.d.ts +1 -2
  64. package/build/configs/util/get-entry.js +1 -1
  65. package/build/configs/util/get-webpack-cache-dependencies.js +4 -7
  66. package/build/configs/util/install-sourcemap-support.js +0 -1
  67. package/build/configs/util/register-ts-node.js +0 -1
  68. package/build/configs/webpack.client.dev.d.ts +1 -2
  69. package/build/configs/webpack.client.dev.js +3 -6
  70. package/build/configs/webpack.client.js +22 -33
  71. package/build/configs/webpack.client.prod.d.ts +1 -2
  72. package/build/configs/webpack.client.prod.js +3 -6
  73. package/build/configs/webpack.server.dev.d.ts +1 -2
  74. package/build/configs/webpack.server.dev.js +3 -6
  75. package/build/configs/webpack.server.js +35 -39
  76. package/build/configs/webpack.server.prod.d.ts +1 -2
  77. package/build/configs/webpack.server.prod.js +3 -6
  78. package/build/plugins/arui-runtime/index.js +2 -2
  79. package/build/plugins/postcss-global-variables/utils/utils.js +4 -4
  80. package/build/plugins/postcss-prefix-selector.js +5 -2
  81. package/build/templates/base-nginx.conf.template.d.ts +1 -2
  82. package/build/templates/base-nginx.conf.template.js +3 -5
  83. package/build/templates/dockerfile-compiled.template.d.ts +1 -2
  84. package/build/templates/dockerfile-compiled.template.js +7 -9
  85. package/build/templates/dockerfile.template.d.ts +1 -2
  86. package/build/templates/dockerfile.template.js +10 -8
  87. package/build/templates/html.template.js +2 -5
  88. package/build/templates/nginx.conf.template.d.ts +1 -2
  89. package/build/templates/nginx.conf.template.js +3 -5
  90. package/build/templates/start.template.d.ts +1 -2
  91. package/build/templates/start.template.js +3 -5
  92. package/build/tsconfig-local.tsbuildinfo +1 -1
  93. package/docs/modules.md +5 -3
  94. package/docs/settings.md +12 -12
  95. package/package.json +1 -1
  96. package/tsconfig.json +2 -1
@@ -4,8 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createServerConfig = void 0;
7
- // TODO: remove eslint-disable
8
- /* eslint-disable @typescript-eslint/no-var-requires */
9
7
  const fs_1 = __importDefault(require("fs"));
10
8
  const path_1 = __importDefault(require("path"));
11
9
  const getCSSModuleLocalIdent_1 = __importDefault(require("react-dev-utils/getCSSModuleLocalIdent"));
@@ -16,11 +14,11 @@ const run_script_webpack_plugin_1 = require("run-script-webpack-plugin");
16
14
  const webpack_node_externals_1 = __importDefault(require("webpack-node-externals"));
17
15
  const reload_server_plugin_1 = require("../plugins/reload-server-plugin");
18
16
  const watch_missing_node_modules_plugin_1 = require("../plugins/watch-missing-node-modules-plugin");
19
- const get_entry_1 = __importDefault(require("./util/get-entry"));
20
- const app_configs_1 = __importDefault(require("./app-configs"));
17
+ const get_entry_1 = require("./util/get-entry");
18
+ const app_configs_1 = require("./app-configs");
21
19
  const babel_dependencies_1 = require("./babel-dependencies");
22
- const babel_server_1 = __importDefault(require("./babel-server"));
23
- const postcss_1 = __importDefault(require("./postcss"));
20
+ const babel_server_1 = require("./babel-server");
21
+ const postcss_1 = require("./postcss");
24
22
  const server_externals_exemptions_1 = require("./server-externals-exemptions");
25
23
  const swc_1 = require("./swc");
26
24
  const assetsIgnoreBanner = fs_1.default.readFileSync(require.resolve('./util/node-assets-ignore'), 'utf8');
@@ -29,7 +27,7 @@ const sourceMapSupportBanner = fs_1.default.readFileSync(require.resolve('./util
29
27
  const cssRegex = /\.css$/;
30
28
  const cssModuleRegex = /\.module\.css$/;
31
29
  function getSingleEntry(entryPoint, mode) {
32
- const prefix = mode === 'dev' && app_configs_1.default.useServerHMR
30
+ const prefix = mode === 'dev' && app_configs_1.configs.useServerHMR
33
31
  ? [`${require.resolve('@rspack/core/hot/poll')}?1000`]
34
32
  : [];
35
33
  return [...prefix, ...entryPoint];
@@ -39,24 +37,24 @@ const createServerConfig = (mode) => ({
39
37
  mode: mode === 'dev' ? 'development' : 'production',
40
38
  // fail on first error in production mode
41
39
  bail: mode === 'prod',
42
- devtool: mode === 'dev' ? app_configs_1.default.devSourceMaps : 'source-map',
40
+ devtool: mode === 'dev' ? app_configs_1.configs.devSourceMaps : 'source-map',
43
41
  target: 'node',
44
42
  node: {
45
43
  __filename: true,
46
44
  __dirname: true,
47
45
  },
48
- entry: (0, get_entry_1.default)(app_configs_1.default.serverEntry, getSingleEntry, mode),
49
- context: app_configs_1.default.cwd,
46
+ entry: (0, get_entry_1.getEntry)(app_configs_1.configs.serverEntry, getSingleEntry, mode),
47
+ context: app_configs_1.configs.cwd,
50
48
  output: {
51
- assetModuleFilename: `${app_configs_1.default.assetsPath}/static/media/[name].[hash:8][ext]`,
49
+ assetModuleFilename: `${app_configs_1.configs.assetsPath}/static/media/[name].[hash:8][ext]`,
52
50
  // Add /* filename */ comments to generated require()s in the output.
53
51
  pathinfo: true,
54
- path: app_configs_1.default.serverOutputPath,
55
- publicPath: app_configs_1.default.publicPath,
56
- filename: app_configs_1.default.serverOutput,
52
+ path: app_configs_1.configs.serverOutputPath,
53
+ publicPath: app_configs_1.configs.publicPath,
54
+ filename: app_configs_1.configs.serverOutput,
57
55
  chunkFilename: '[name].js',
58
56
  // Point sourcemap entries to original disk location (format as URL on Windows)
59
- devtoolModuleFilenameTemplate: (info) => path_1.default.relative(app_configs_1.default.appSrc, info.absoluteResourcePath).replace(/\\/g, '/'),
57
+ devtoolModuleFilenameTemplate: (info) => path_1.default.relative(app_configs_1.configs.appSrc, info.absoluteResourcePath).replace(/\\/g, '/'),
60
58
  },
61
59
  cache: mode === 'dev',
62
60
  externalsPresets: { node: true },
@@ -77,7 +75,7 @@ const createServerConfig = (mode) => ({
77
75
  // We placed these paths second because we want `node_modules` to "win"
78
76
  // if there are any conflicts. This matches Node resolution mechanism.
79
77
  // https://github.com/facebookincubator/create-react-app/issues/253
80
- modules: ['node_modules', app_configs_1.default.appNodeModules],
78
+ modules: ['node_modules', app_configs_1.configs.appNodeModules],
81
79
  // These are the reasonable defaults supported by the Node ecosystem.
82
80
  // We also include JSX as a common component filename extension to support
83
81
  // some tools, although we do not recommend using it, see:
@@ -85,7 +83,7 @@ const createServerConfig = (mode) => ({
85
83
  // `web` extension prefixes have been added for better support
86
84
  // for React Native Web.
87
85
  extensions: ['.web.js', '.mjs', '.js', '.json', '.web.jsx', '.jsx', '.ts', '.tsx'],
88
- tsConfig: app_configs_1.default.tsconfig ? { configFile: app_configs_1.default.tsconfig } : undefined,
86
+ tsConfig: app_configs_1.configs.tsconfig ? { configFile: app_configs_1.configs.tsconfig } : undefined,
89
87
  },
90
88
  module: {
91
89
  rules: [
@@ -119,7 +117,7 @@ const createServerConfig = (mode) => ({
119
117
  loader: require.resolve('postcss-loader'),
120
118
  options: {
121
119
  postcssOptions: {
122
- plugins: postcss_1.default,
120
+ plugins: postcss_1.postcssConfig,
123
121
  },
124
122
  },
125
123
  },
@@ -130,11 +128,11 @@ const createServerConfig = (mode) => ({
130
128
  type: 'asset',
131
129
  generator: {
132
130
  dataUrl: (file) => (0, mini_svg_data_uri_1.default)(file.content.toString()),
133
- publicPath: ''
131
+ publicPath: '',
134
132
  },
135
133
  parser: {
136
134
  dataUrlCondition: {
137
- maxSize: app_configs_1.default.dataUrlMaxSize,
135
+ maxSize: app_configs_1.configs.dataUrlMaxSize,
138
136
  },
139
137
  },
140
138
  },
@@ -142,7 +140,7 @@ const createServerConfig = (mode) => ({
142
140
  exclude: [/\.(js|jsx|mjs|ts|tsx)$/, /\.(html|ejs)$/, /\.json$/, /\.svg$/],
143
141
  type: 'asset/resource',
144
142
  generator: {
145
- publicPath: ''
143
+ publicPath: '',
146
144
  },
147
145
  },
148
146
  ].filter(Boolean),
@@ -155,7 +153,7 @@ const createServerConfig = (mode) => ({
155
153
  raw: true,
156
154
  entryOnly: false,
157
155
  }),
158
- app_configs_1.default.installServerSourceMaps &&
156
+ app_configs_1.configs.installServerSourceMaps &&
159
157
  new core_1.BannerPlugin({
160
158
  banner: sourceMapSupportBanner,
161
159
  raw: true,
@@ -163,12 +161,12 @@ const createServerConfig = (mode) => ({
163
161
  }),
164
162
  // dev plugins:
165
163
  mode === 'dev' &&
166
- (app_configs_1.default.useServerHMR
164
+ (app_configs_1.configs.useServerHMR
167
165
  ? new run_script_webpack_plugin_1.RunScriptWebpackPlugin({
168
- name: app_configs_1.default.serverOutput,
166
+ name: app_configs_1.configs.serverOutput,
169
167
  })
170
168
  : new reload_server_plugin_1.ReloadServerPlugin({
171
- script: path_1.default.join(app_configs_1.default.serverOutputPath, app_configs_1.default.serverOutput),
169
+ script: path_1.default.join(app_configs_1.configs.serverOutputPath, app_configs_1.configs.serverOutput),
172
170
  })),
173
171
  // Watcher doesn't work well if you mistype casing in a path so we use
174
172
  // a plugin that prints an error when you attempt to do this.
@@ -178,12 +176,12 @@ const createServerConfig = (mode) => ({
178
176
  // to restart the development server for Webpack to discover it. This plugin
179
177
  // makes the discovery automatic so you don't have to restart.
180
178
  // See https://github.com/facebookincubator/create-react-app/issues/186
181
- mode === 'dev' && new watch_missing_node_modules_plugin_1.WatchMissingNodeModulesPlugin(app_configs_1.default.appNodeModules),
182
- mode === 'dev' && app_configs_1.default.useServerHMR && new core_1.HotModuleReplacementPlugin(),
179
+ mode === 'dev' && new watch_missing_node_modules_plugin_1.WatchMissingNodeModulesPlugin(app_configs_1.configs.appNodeModules),
180
+ mode === 'dev' && app_configs_1.configs.useServerHMR && new core_1.HotModuleReplacementPlugin(),
183
181
  ].filter(Boolean),
184
182
  // Без этого комиляция трирегилась на изменение в node_modules и приводила к утечке памяти
185
183
  watchOptions: {
186
- ignored: new RegExp(app_configs_1.default.watchIgnorePath.join('|')),
184
+ ignored: new RegExp(app_configs_1.configs.watchIgnorePath.join('|')),
187
185
  aggregateTimeout: 100,
188
186
  },
189
187
  performance: {
@@ -193,21 +191,19 @@ const createServerConfig = (mode) => ({
193
191
  });
194
192
  exports.createServerConfig = createServerConfig;
195
193
  function getCodeLoader(mode) {
196
- if (app_configs_1.default.codeLoader === 'swc') {
194
+ if (app_configs_1.configs.codeLoader === 'swc') {
197
195
  return {
198
196
  test: /\.(js|jsx|mjs|ts|tsx|cjs)$/,
199
- include: app_configs_1.default.appSrc,
197
+ include: app_configs_1.configs.appSrc,
200
198
  loader: 'builtin:swc-loader',
201
199
  options: swc_1.swcServerConfig,
202
200
  };
203
201
  }
204
202
  return {
205
- test: app_configs_1.default.codeLoader === 'tsc'
206
- ? /\.(js|jsx|mjs|cjs)$/
207
- : /\.(js|jsx|mjs|ts|tsx|cjs)$/,
208
- include: app_configs_1.default.appSrc,
203
+ test: app_configs_1.configs.codeLoader === 'tsc' ? /\.(js|jsx|mjs|cjs)$/ : /\.(js|jsx|mjs|ts|tsx|cjs)$/,
204
+ include: app_configs_1.configs.appSrc,
209
205
  loader: require.resolve('babel-loader'),
210
- options: Object.assign(Object.assign({}, babel_server_1.default), {
206
+ options: Object.assign(Object.assign({}, babel_server_1.config), {
211
207
  // This is a feature of `babel-loader` for webpack (not Babel itself).
212
208
  // It enables caching results in ./node_modules/.cache/babel-loader/
213
209
  // directory for faster rebuilds.
@@ -215,7 +211,7 @@ function getCodeLoader(mode) {
215
211
  };
216
212
  }
217
213
  function getTsLoaderIfEnabled(mode) {
218
- if (app_configs_1.default.codeLoader !== 'tsc' || !app_configs_1.default.tsconfig) {
214
+ if (app_configs_1.configs.codeLoader !== 'tsc' || !app_configs_1.configs.tsconfig) {
219
215
  return false;
220
216
  }
221
217
  return {
@@ -227,7 +223,7 @@ function getTsLoaderIfEnabled(mode) {
227
223
  // This is a feature of `babel-loader` for webpack (not Babel itself).
228
224
  // It enables caching results in ./node_modules/.cache/babel-loader/
229
225
  // directory for faster rebuilds.
230
- cacheDirectory: mode === 'dev' }, babel_server_1.default),
226
+ cacheDirectory: mode === 'dev' }, babel_server_1.config),
231
227
  },
232
228
  {
233
229
  loader: require.resolve('ts-loader'),
@@ -235,7 +231,7 @@ function getTsLoaderIfEnabled(mode) {
235
231
  onlyCompileBundledFiles: true,
236
232
  transpileOnly: true,
237
233
  happyPackMode: true,
238
- configFile: app_configs_1.default.tsconfig,
234
+ configFile: app_configs_1.configs.tsconfig,
239
235
  },
240
236
  },
241
237
  ],
@@ -249,7 +245,7 @@ function getExternalCodeLoader(mode) {
249
245
  fullySpecified: false,
250
246
  },
251
247
  };
252
- if (app_configs_1.default.codeLoader === 'swc') {
248
+ if (app_configs_1.configs.codeLoader === 'swc') {
253
249
  return Object.assign(Object.assign({}, baseLoaderConfig), { loader: 'builtin:swc-loader' });
254
250
  }
255
251
  return Object.assign(Object.assign({}, baseLoaderConfig), { loader: require.resolve('babel-loader'), options: Object.assign(Object.assign({}, babel_dependencies_1.babelDependencies), { babelrc: false, configFile: false, compact: false, cacheDirectory: mode === 'dev', cacheCompression: false }) });
@@ -1,2 +1 @@
1
- declare const config: import("@rspack/core").RspackOptions;
2
- export default config;
1
+ export declare const webpackServerConfig: import("@rspack/core").RspackOptions;
@@ -1,11 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
3
+ exports.webpackServerConfig = void 0;
4
+ const apply_overrides_1 = require("./util/apply-overrides");
7
5
  const find_loader_1 = require("./util/find-loader");
8
6
  const find_plugin_1 = require("./util/find-plugin");
9
7
  const webpack_server_1 = require("./webpack.server");
10
- const config = (0, apply_overrides_1.default)(['webpack', 'webpackServer', 'webpackProd', 'webpackServerProd'], (0, webpack_server_1.createServerConfig)('prod'), { findLoader: find_loader_1.findLoader, findPlugin: (0, find_plugin_1.findPlugin)() });
11
- exports.default = config;
8
+ exports.webpackServerConfig = (0, apply_overrides_1.applyOverrides)(['webpack', 'webpackServer', 'webpackProd', 'webpackServerProd'], (0, webpack_server_1.createServerConfig)('prod'), { findLoader: find_loader_1.findLoader, findPlugin: (0, find_plugin_1.findPlugin)() });
@@ -24,7 +24,7 @@ exports.AruiRuntimePlugin = AruiRuntimePlugin;
24
24
  * Более того, мы не можем использовать импорты или require внутри, это так же сломает сборку.
25
25
  */
26
26
  function getInsertCssRuntimeMethod() {
27
- /* eslint-disable */
27
+ /* eslint-disable no-var,vars-on-top,prefer-destructuring */
28
28
  return function insertCssRuntime(linkTag) {
29
29
  if (__webpack_require__ && __webpack_require__.$ARUI.scriptSource) {
30
30
  var scriptSource = __webpack_require__.$ARUI.scriptSource;
@@ -43,5 +43,5 @@ function getInsertCssRuntimeMethod() {
43
43
  }
44
44
  document.head.appendChild(linkTag);
45
45
  };
46
- /* eslint-enable */
46
+ /* eslint-enable no-var,vars-on-top,prefer-destructuring */
47
47
  }
@@ -20,7 +20,7 @@ function parseImport(root, postcssHelpers, filePath) {
20
20
  resolvedPath = path_1.default.resolve(filePath);
21
21
  }
22
22
  catch (err) {
23
- throw new Error(`Failed to read ${filePath} with error ${(err instanceof Error) ? err.message : err}`);
23
+ throw new Error(`Failed to read ${filePath} with error ${err instanceof Error ? err.message : err}`);
24
24
  }
25
25
  postcssHelpers.result.messages.push({
26
26
  type: 'dependency',
@@ -77,10 +77,10 @@ const insertParsedCss = (root, parsedVariables, parsedCustomMedia) => {
77
77
  // берем все вхождения --desktop, --mobile
78
78
  const mediaName = value.match(parseRule);
79
79
  // итерируемся по [--desktop, --mobile]
80
- mediaName === null || mediaName === void 0 ? void 0 : mediaName.forEach((rule) => {
80
+ mediaName === null || mediaName === void 0 ? void 0 : mediaName.forEach((name) => {
81
81
  // подставляем значения если у нас есть под это custom-media
82
- if (parsedCustomMedia[rule]) {
83
- root.append(parsedCustomMedia[rule]);
82
+ if (parsedCustomMedia[name]) {
83
+ root.append(parsedCustomMedia[name]);
84
84
  }
85
85
  });
86
86
  }
@@ -8,6 +8,7 @@ const postCssPrefix = (options) => {
8
8
  const prefix = (options === null || options === void 0 ? void 0 : options.prefix) || '.prefix ';
9
9
  return {
10
10
  postcssPlugin: '@alfalab/postcss-prefix-selector',
11
+ /* eslint-disable no-param-reassign */
11
12
  RootExit(root) {
12
13
  if (root[VisitedRule]) {
13
14
  return;
@@ -16,7 +17,8 @@ const postCssPrefix = (options) => {
16
17
  root.walkRules((rule) => {
17
18
  const hasParent = !!rule.parent;
18
19
  const parentIsAtRule = rule.parent && rule.parent.type === 'atrule';
19
- const parentIsKeyframe = parentIsAtRule && KEYFRAME_RULES.includes(rule.parent.name);
20
+ const parentIsKeyframe = parentIsAtRule &&
21
+ KEYFRAME_RULES.includes(rule.parent.name);
20
22
  if (hasParent && parentIsKeyframe) {
21
23
  // Нам не нужно добавлять префиксы для keyframes и элементов внутри них
22
24
  return;
@@ -31,7 +33,7 @@ const postCssPrefix = (options) => {
31
33
  * Оборачивам только самим префиксом без :root.
32
34
  * Позволяет инкапсулировать css переменные под классом.
33
35
  * В таком случае они будут доступны в модулях приложений после использования флага keepCssVars.
34
- */
36
+ */
35
37
  if (selector === ROOT_SELECTOR) {
36
38
  return prefix;
37
39
  }
@@ -39,6 +41,7 @@ const postCssPrefix = (options) => {
39
41
  });
40
42
  });
41
43
  },
44
+ /* eslint-enable no-param-reassign */
42
45
  };
43
46
  };
44
47
  exports.postCssPrefix = postCssPrefix;
@@ -1,2 +1 @@
1
- declare const _default: string;
2
- export default _default;
1
+ export declare const nginxBaseConfTemplate: string;
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nginxBaseConfTemplate = void 0;
6
4
  const app_configs_1 = require("../configs/app-configs");
7
- const apply_overrides_1 = __importDefault(require("../configs/util/apply-overrides"));
5
+ const apply_overrides_1 = require("../configs/util/apply-overrides");
8
6
  const baseNginxConfig = {
9
7
  workerProcesses: 2,
10
8
  workerRlimitNoFile: 20000,
@@ -58,4 +56,4 @@ http {
58
56
 
59
57
  include /etc/nginx/conf.d/*.conf;
60
58
  }`;
61
- exports.default = (0, apply_overrides_1.default)('nginxConf', baseNginxTemplate);
59
+ exports.nginxBaseConfTemplate = (0, apply_overrides_1.applyOverrides)('nginxConf', baseNginxTemplate);
@@ -1,2 +1 @@
1
- declare const _default: string;
2
- export default _default;
1
+ export declare const dockerfileTemplate: string;
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dockerfileTemplate = void 0;
6
4
  const yarn_1 = require("../commands/util/yarn");
7
- const app_configs_1 = __importDefault(require("../configs/app-configs"));
8
- const apply_overrides_1 = __importDefault(require("../configs/util/apply-overrides"));
5
+ const app_configs_1 = require("../configs/app-configs");
6
+ const apply_overrides_1 = require("../configs/util/apply-overrides");
9
7
  const installProductionCommand = (0, yarn_1.getInstallProductionCommand)();
10
8
  const yarnVersion = (0, yarn_1.getYarnVersion)();
11
- const { nginx } = app_configs_1.default;
9
+ const { nginx } = app_configs_1.configs;
12
10
  // В зависимости от используемого мендежера зависимостей для их установки нужно копировать разный набор файлов
13
11
  const filesRequiredToInstallDependencies = [
14
12
  'package.json',
@@ -17,8 +15,8 @@ const filesRequiredToInstallDependencies = [
17
15
  yarnVersion === '2+' && '.yarn',
18
16
  yarnVersion === 'unavailable' && 'package-lock.json',
19
17
  ].filter(Boolean);
20
- const dockerfileTemplate = `
21
- FROM ${app_configs_1.default.baseDockerImage}
18
+ const template = `
19
+ FROM ${app_configs_1.configs.baseDockerImage}
22
20
  ARG START_SH_LOCATION
23
21
  ARG NGINX_CONF_LOCATION
24
22
  ARG NGINX_BASE_CONF_LOCATION
@@ -49,4 +47,4 @@ RUN touch /var/run/nginx.pid && \
49
47
  chown -R nginx:nginx /var/run/nginx.pid
50
48
  USER nginx
51
49
  `;
52
- exports.default = (0, apply_overrides_1.default)('DockerfileCompiled', dockerfileTemplate);
50
+ exports.dockerfileTemplate = (0, apply_overrides_1.applyOverrides)('DockerfileCompiled', template);
@@ -1,2 +1 @@
1
- declare const _default: string;
2
- export default _default;
1
+ export declare const dockerfileTemplate: string;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dockerfileTemplate = void 0;
6
4
  const app_configs_1 = require("../configs/app-configs");
7
- const apply_overrides_1 = __importDefault(require("../configs/util/apply-overrides"));
5
+ const apply_overrides_1 = require("../configs/util/apply-overrides");
8
6
  const appPathToAdd = app_configs_1.configs.clientOnly ? app_configs_1.configs.buildPath : '.';
9
7
  const appTargetPath = app_configs_1.configs.clientOnly ? `/src/${app_configs_1.configs.buildPath}` : '/src';
10
- const nginxConfTargetLocation = app_configs_1.configs.clientOnly ? '/etc/nginx/conf.d/default.conf' : '/src/nginx.conf';
8
+ const nginxConfTargetLocation = app_configs_1.configs.clientOnly
9
+ ? '/etc/nginx/conf.d/default.conf'
10
+ : '/src/nginx.conf';
11
11
  const { nginx } = app_configs_1.configs;
12
12
  const nginxNonRootPart = app_configs_1.configs.runFromNonRootUser
13
13
  ? `RUN chown -R nginx:nginx /src && \\
@@ -21,7 +21,7 @@ const nginxNonRootPart = app_configs_1.configs.runFromNonRootUser
21
21
 
22
22
  USER nginx`
23
23
  : '';
24
- const dockerfileTemplate = `
24
+ const template = `
25
25
  FROM ${app_configs_1.configs.baseDockerImage}
26
26
  ARG START_SH_LOCATION
27
27
  ARG NGINX_CONF_LOCATION
@@ -34,8 +34,10 @@ ${nginx ? 'ADD $NGINX_BASE_CONF_LOCATION /etc/nginx/nginx.conf' : ''}
34
34
 
35
35
  ${nginxNonRootPart}
36
36
 
37
- ${app_configs_1.configs.runFromNonRootUser ? `ADD --chown=nginx:nginx ${appPathToAdd} ${appTargetPath}` : `ADD ${appPathToAdd} ${appTargetPath}`}
37
+ ${app_configs_1.configs.runFromNonRootUser
38
+ ? `ADD --chown=nginx:nginx ${appPathToAdd} ${appTargetPath}`
39
+ : `ADD ${appPathToAdd} ${appTargetPath}`}
38
40
  ${app_configs_1.configs.clientOnly ? 'COPY env-config.jso[n] /src/' : ''}
39
41
  ${app_configs_1.configs.clientOnly ? 'CMD ["nginx"]' : ''}
40
42
  `;
41
- exports.default = (0, apply_overrides_1.default)('Dockerfile', dockerfileTemplate);
43
+ exports.dockerfileTemplate = (0, apply_overrides_1.applyOverrides)('Dockerfile', template);
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.htmlTemplate = void 0;
7
- const apply_overrides_1 = __importDefault(require("../configs/util/apply-overrides"));
4
+ const apply_overrides_1 = require("../configs/util/apply-overrides");
8
5
  const template = `<!doctype html>
9
6
  <html lang="ru">
10
7
  <head>
@@ -22,4 +19,4 @@ const template = `<!doctype html>
22
19
  </script>
23
20
  </body>
24
21
  </html>`;
25
- exports.htmlTemplate = (0, apply_overrides_1.default)('html', template);
22
+ exports.htmlTemplate = (0, apply_overrides_1.applyOverrides)('html', template);
@@ -1,2 +1 @@
1
- declare const _default: string;
2
- export default _default;
1
+ export declare const nginxConfTemplate: string;
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nginxConfTemplate = void 0;
6
4
  const app_configs_1 = require("../configs/app-configs");
7
- const apply_overrides_1 = __importDefault(require("../configs/util/apply-overrides"));
5
+ const apply_overrides_1 = require("../configs/util/apply-overrides");
8
6
  const nginxTemplate = `client_max_body_size 20m;
9
7
 
10
8
  server {
@@ -36,4 +34,4 @@ server {
36
34
  }
37
35
  }
38
36
  }`;
39
- exports.default = (0, apply_overrides_1.default)('nginx', nginxTemplate);
37
+ exports.nginxConfTemplate = (0, apply_overrides_1.applyOverrides)('nginx', nginxTemplate);
@@ -1,2 +1 @@
1
- declare const _default: string;
2
- export default _default;
1
+ export declare const startScript: string;
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startScript = void 0;
6
4
  const app_configs_1 = require("../configs/app-configs");
7
5
  const client_env_config_1 = require("../configs/client-env-config");
8
- const apply_overrides_1 = __importDefault(require("../configs/util/apply-overrides"));
6
+ const apply_overrides_1 = require("../configs/util/apply-overrides");
9
7
  const startTemplate = `#!/bin/sh
10
8
 
11
9
  # Подменяем env переменные в nginx конфиге перед стартом
@@ -68,4 +66,4 @@ if [ -f ${envConfigPath} ]; then
68
66
  fi
69
67
 
70
68
  nginx`;
71
- exports.default = (0, apply_overrides_1.default)('start.sh', app_configs_1.configs.clientOnly ? clientOnlyStartTemplate : startTemplate);
69
+ exports.startScript = (0, apply_overrides_1.applyOverrides)('start.sh', app_configs_1.configs.clientOnly ? clientOnlyStartTemplate : startTemplate);