arui-scripts 13.4.0-feat-vite-dev-build.3 → 13.4.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 (51) hide show
  1. package/CHANGELOG.md +3 -13
  2. package/build/bin/index.js +0 -1
  3. package/build/commands/archive-build/index.js +3 -3
  4. package/build/commands/build/build-wrapper.d.ts +1 -1
  5. package/build/commands/build/build-wrapper.js +2 -2
  6. package/build/commands/build/client.js +4 -4
  7. package/build/commands/build/index.js +3 -3
  8. package/build/commands/build/server.js +2 -2
  9. package/build/commands/bundle-analyze/index.js +2 -2
  10. package/build/commands/docker-build/index.js +7 -7
  11. package/build/commands/docker-build-compiled/index.js +5 -5
  12. package/build/commands/start/client.js +3 -3
  13. package/build/commands/start/index.js +3 -3
  14. package/build/commands/start/server.js +2 -2
  15. package/build/commands/start-vite/client.js +6 -3
  16. package/build/commands/util/client-assets-sizes.d.ts +3 -3
  17. package/build/commands/util/client-assets-sizes.js +9 -9
  18. package/build/commands/util/docker-build.d.ts +1 -1
  19. package/build/commands/util/yarn.d.ts +1 -1
  20. package/build/configs/app-configs/available-package-settings.d.ts +2 -2
  21. package/build/configs/app-configs/calculate-dependent-config.js +3 -3
  22. package/build/configs/app-configs/get-defaults.js +2 -3
  23. package/build/configs/app-configs/index.js +6 -6
  24. package/build/configs/app-configs/types.d.ts +1 -2
  25. package/build/configs/app-configs/update-with-config-file.js +3 -3
  26. package/build/configs/app-configs/update-with-env.js +2 -2
  27. package/build/configs/app-configs/update-with-package.js +2 -2
  28. package/build/configs/app-configs/update-with-presets.js +4 -4
  29. package/build/configs/babel-client.js +1 -1
  30. package/build/configs/babel-dependencies.js +1 -1
  31. package/build/configs/babel-server.js +1 -1
  32. package/build/configs/dev-server.js +1 -1
  33. package/build/configs/jest/file-transform.d.ts +2 -1
  34. package/build/configs/jest/index.d.ts +8 -8
  35. package/build/configs/postcss.config.d.ts +1 -1
  36. package/build/configs/postcss.js +1 -1
  37. package/build/configs/stats-options.js +1 -1
  38. package/build/configs/supporting-browsers.js +1 -1
  39. package/build/configs/util/apply-overrides.d.ts +3 -6
  40. package/build/configs/vite.config.js +7 -0
  41. package/build/configs/webpack.client.dev.js +2 -7
  42. package/build/configs/webpack.client.prod.js +3 -5
  43. package/build/configs/webpack.server.dev.js +3 -3
  44. package/build/configs/webpack.server.prod.js +3 -3
  45. package/build/index.js +0 -1
  46. package/build/templates/dockerfile-compiled.template.js +3 -3
  47. package/build/templates/dockerfile.template.js +4 -4
  48. package/build/templates/nginx.conf.template.js +1 -1
  49. package/build/templates/start.template.js +1 -1
  50. package/build/tsconfig-local.tsbuildinfo +8816 -1
  51. package/package.json +2 -9
@@ -1,17 +1,17 @@
1
- export const testRegex: string;
2
- export const moduleFileExtensions: string[];
3
- export const collectCoverageFrom: string[];
4
- export const transform: {
1
+ export declare const testRegex: string;
2
+ export declare const moduleFileExtensions: string[];
3
+ export declare const collectCoverageFrom: string[];
4
+ export declare const transform: {
5
5
  '^.+\\.jsx?$': string;
6
6
  '^.+\\.tsx?$': string;
7
7
  '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': string;
8
8
  };
9
- export const moduleNameMapper: {
9
+ export declare const moduleNameMapper: {
10
10
  '\\.css$': string;
11
11
  };
12
- export const setupFiles: string[];
13
- export const snapshotSerializers: string[];
14
- export const globals: {
12
+ export declare const setupFiles: string[];
13
+ export declare const snapshotSerializers: string[];
14
+ export declare const globals: {
15
15
  'ts-jest': {
16
16
  tsconfig: string | null;
17
17
  babelConfig: any;
@@ -10,7 +10,7 @@ export declare const postcssPluginsOptions: {
10
10
  'postcss-custom-properties'?: {
11
11
  preserve: boolean;
12
12
  importFrom: string | undefined;
13
- } | undefined;
13
+ };
14
14
  'postcss-import': {
15
15
  path: string[];
16
16
  plugins: any[];
@@ -5,5 +5,5 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
7
7
  const postcss_config_1 = require("./postcss.config");
8
- const postcssConfig = (0, apply_overrides_1.default)('postcss', (0, postcss_config_1.createPostcssConfig)(postcss_config_1.postcssPlugins, postcss_config_1.postcssPluginsOptions));
8
+ const postcssConfig = apply_overrides_1.default('postcss', postcss_config_1.createPostcssConfig(postcss_config_1.postcssPlugins, postcss_config_1.postcssPluginsOptions));
9
9
  exports.default = postcssConfig;
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
7
- const statsOptions = (0, apply_overrides_1.default)('stats', {
7
+ const statsOptions = apply_overrides_1.default('stats', {
8
8
  // Add asset Information
9
9
  assets: false,
10
10
  // Add information about cached (not built) modules
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const apply_overrides_1 = __importDefault(require("./util/apply-overrides"));
7
- const supportingBrowsers = (0, apply_overrides_1.default)(['browsers', 'supportingBrowsers'], [
7
+ const supportingBrowsers = apply_overrides_1.default(['browsers', 'supportingBrowsers'], [
8
8
  'last 2 versions',
9
9
  'ie >= 10',
10
10
  'Android >= 4',
@@ -1,8 +1,7 @@
1
1
  import type { Configuration as WebpackConfiguration, WebpackOptionsNormalized } from 'webpack';
2
2
  import type { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
3
3
  import { AppConfigs } from '../app-configs/types';
4
- import { InlineConfig } from 'vite';
5
- type Overrides = {
4
+ declare type Overrides = {
6
5
  webpack: WebpackConfiguration;
7
6
  webpackClient: WebpackConfiguration;
8
7
  webpackDev: WebpackConfiguration;
@@ -14,8 +13,6 @@ type Overrides = {
14
13
  webpackServerProd: WebpackConfiguration;
15
14
  devServer: WebpackDevServerConfiguration;
16
15
  stats: WebpackOptionsNormalized['stats'];
17
- vite: InlineConfig;
18
- viteHtml: string;
19
16
  babel: any;
20
17
  babelClient: any;
21
18
  babelServer: any;
@@ -28,8 +25,8 @@ type Overrides = {
28
25
  nginx: string;
29
26
  'start.sh': string;
30
27
  };
31
- type OverrideFunction<K extends keyof Overrides> = (config: Overrides[K], appConfig: AppConfigs) => Overrides[K];
32
- export type OverrideFile = {
28
+ declare type OverrideFunction<K extends keyof Overrides> = (config: Overrides[K], appConfig: AppConfigs) => Overrides[K];
29
+ export declare type OverrideFile = {
33
30
  [K in keyof Overrides]?: OverrideFunction<K>;
34
31
  };
35
32
  /**
@@ -9,6 +9,7 @@ const app_configs_1 = __importDefault(require("./app-configs"));
9
9
  const plugin_react_1 = __importDefault(require("@vitejs/plugin-react"));
10
10
  const vite_tsconfig_paths_1 = __importDefault(require("vite-tsconfig-paths"));
11
11
  const postcss_1 = __importDefault(require("./postcss"));
12
+ const vite_1 = require("vite");
12
13
  exports.viteConfig = (0, apply_overrides_1.default)('vite', {
13
14
  server: {
14
15
  middlewareMode: true,
@@ -16,6 +17,12 @@ exports.viteConfig = (0, apply_overrides_1.default)('vite', {
16
17
  protocol: 'ws',
17
18
  }
18
19
  },
20
+ customLogger: Object.assign(Object.assign({}, (0, vite_1.createLogger)('info')), { warn(msg) {
21
+ // ignore warning about css import, they are created incorrectly
22
+ if (!msg.includes('Default and named imports from CSS files are deprecated.')) {
23
+ console.log(msg);
24
+ }
25
+ } }),
19
26
  appType: 'custom',
20
27
  build: {
21
28
  manifest: true,
@@ -29,21 +29,18 @@ function getSingleEntry(clientEntry) {
29
29
  require.resolve('webpack/hot/dev-server'),
30
30
  // Finally, this is your app's code:
31
31
  ...clientEntry,
32
- // We include the app code last so that if there is a runtime error during
33
- // initialization, it doesn't blow up the WebpackDevServer client, and
34
- // changing JS code would still trigger a refresh.
35
32
  ].filter(Boolean);
36
33
  }
37
34
  // This is the development configuration.
38
35
  // It is focused on developer experience and fast rebuilds.
39
36
  // The production configuration is different and lives in a separate file.
40
- const webpackClientDev = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], {
37
+ const webpackClientDev = apply_overrides_1.default(['webpack', 'webpackClient', 'webpackDev', 'webpackClientDev'], {
41
38
  target: 'web',
42
39
  mode: 'development',
43
40
  devtool: app_configs_1.default.devSourceMaps,
44
41
  // These are the "entry points" to our application.
45
42
  // This means they will be the "root" imports that are included in JS bundle.
46
- entry: (0, get_entry_1.default)(app_configs_1.default.clientEntry, getSingleEntry),
43
+ entry: get_entry_1.default(app_configs_1.default.clientEntry, getSingleEntry),
47
44
  context: app_configs_1.default.cwd,
48
45
  output: {
49
46
  // Add /* filename */ comments to generated require()s in the output.
@@ -250,8 +247,6 @@ const webpackClientDev = (0, apply_overrides_1.default)(['webpack', 'webpackClie
250
247
  },
251
248
  ].filter(Boolean)),
252
249
  },
253
- // ** STOP ** Are you adding a new loader?
254
- // Make sure to add the new loader(s) before the "file" loader.
255
250
  ],
256
251
  },
257
252
  plugins: ([
@@ -33,12 +33,12 @@ function getSingleEntry(entryPoint) {
33
33
  ].filter(Boolean);
34
34
  }
35
35
  // This is the production configuration.
36
- const config = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webpackProd', 'webpackClientProd'], {
36
+ const config = apply_overrides_1.default(['webpack', 'webpackClient', 'webpackProd', 'webpackClientProd'], {
37
37
  mode: 'production',
38
38
  // You may want 'eval' instead if you prefer to see the compiled output in DevTools.
39
39
  devtool: 'cheap-module-source-map',
40
40
  // In production, we only want to load the polyfills and the app code.
41
- entry: (0, get_entry_1.default)(app_configs_1.default.clientEntry, getSingleEntry),
41
+ entry: get_entry_1.default(app_configs_1.default.clientEntry, getSingleEntry),
42
42
  bail: true,
43
43
  context: app_configs_1.default.cwd,
44
44
  output: {
@@ -291,8 +291,6 @@ const config = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webp
291
291
  },
292
292
  ].filter(Boolean)),
293
293
  },
294
- // ** STOP ** Are you adding a new loader?
295
- // Make sure to add the new loader(s) before the "file" loader.
296
294
  ],
297
295
  },
298
296
  plugins: ([
@@ -314,7 +312,7 @@ const config = (0, apply_overrides_1.default)(['webpack', 'webpackClient', 'webp
314
312
  threshold: 10240,
315
313
  minRatio: 0.8
316
314
  }),
317
- (0, check_node_version_1.default)(10) && new compression_webpack_plugin_1.default({
315
+ check_node_version_1.default(10) && new compression_webpack_plugin_1.default({
318
316
  filename: '[file].br',
319
317
  algorithm: 'brotliCompress',
320
318
  test: /\.(js|css|html|svg)$/,
@@ -39,7 +39,7 @@ const config = {
39
39
  __filename: true,
40
40
  __dirname: true
41
41
  },
42
- entry: (0, get_entry_1.default)(app_configs_1.default.serverEntry, getSingleEntry),
42
+ entry: get_entry_1.default(app_configs_1.default.serverEntry, getSingleEntry),
43
43
  context: app_configs_1.default.cwd,
44
44
  output: {
45
45
  // Add /* filename */ comments to generated require()s in the output.
@@ -61,7 +61,7 @@ const config = {
61
61
  },
62
62
  },
63
63
  externalsPresets: { node: true },
64
- externals: [(0, webpack_node_externals_1.default)({
64
+ externals: [webpack_node_externals_1.default({
65
65
  allowlist: [
66
66
  /^arui-feather/,
67
67
  /^arui-ft-private/,
@@ -239,5 +239,5 @@ const config = {
239
239
  ignored: /node_modules/,
240
240
  }
241
241
  };
242
- const webpackServerDev = (0, apply_overrides_1.default)(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], config);
242
+ const webpackServerDev = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], config);
243
243
  exports.default = webpackServerDev;
@@ -27,7 +27,7 @@ function getSingleEntry(entryPoint) {
27
27
  // This is the production configuration.
28
28
  // It compiles slowly and is focused on producing a fast and minimal bundle.
29
29
  // The development configuration is different and lives in a separate file.
30
- const config = (0, apply_overrides_1.default)(['webpack', 'webpackServer', 'webpackProd', 'webpackServerProd'], {
30
+ const config = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackProd', 'webpackServerProd'], {
31
31
  mode: 'production',
32
32
  // Don't attempt to continue if there are any errors.
33
33
  bail: true,
@@ -38,7 +38,7 @@ const config = (0, apply_overrides_1.default)(['webpack', 'webpackServer', 'webp
38
38
  __filename: true,
39
39
  __dirname: true
40
40
  },
41
- entry: (0, get_entry_1.default)(app_configs_1.default.serverEntry, getSingleEntry),
41
+ entry: get_entry_1.default(app_configs_1.default.serverEntry, getSingleEntry),
42
42
  context: app_configs_1.default.cwd,
43
43
  output: {
44
44
  // Add /* filename */ comments to generated require()s in the output.
@@ -53,7 +53,7 @@ const config = (0, apply_overrides_1.default)(['webpack', 'webpackServer', 'webp
53
53
  .replace(/\\/g, '/'),
54
54
  },
55
55
  externalsPresets: { node: true },
56
- externals: [(0, webpack_node_externals_1.default)({
56
+ externals: [webpack_node_externals_1.default({
57
57
  allowlist: [
58
58
  /^arui-feather/,
59
59
  /^arui-ft-private/,
package/build/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBuildParamsFromArgs = exports.prepareFilesForDocker = void 0;
4
3
  var docker_build_1 = require("./commands/util/docker-build");
5
4
  Object.defineProperty(exports, "prepareFilesForDocker", { enumerable: true, get: function () { return docker_build_1.prepareFilesForDocker; } });
6
5
  var docker_build_2 = require("./commands/util/docker-build");
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const app_configs_1 = __importDefault(require("../configs/app-configs"));
7
7
  const apply_overrides_1 = __importDefault(require("../configs/util/apply-overrides"));
8
8
  const yarn_1 = require("../commands/util/yarn");
9
- const installProductionCommand = (0, yarn_1.getInstallProductionCommand)();
10
- const yarnVersion = (0, yarn_1.getYarnVersion)();
9
+ const installProductionCommand = yarn_1.getInstallProductionCommand();
10
+ const yarnVersion = yarn_1.getYarnVersion();
11
11
  // В зависимости от используемого мендежера зависимостей для их установки нужно копировать разный набор файлов
12
12
  const filesRequiredToInstallDependencies = [
13
13
  'package.json',
@@ -44,4 +44,4 @@ RUN touch /var/run/nginx.pid && \
44
44
  chown -R nginx:nginx /var/run/nginx.pid
45
45
  USER nginx
46
46
  `;
47
- exports.default = (0, apply_overrides_1.default)('DockerfileCompiled', dockerfileTemplate);
47
+ exports.default = apply_overrides_1.default('DockerfileCompiled', dockerfileTemplate);
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const app_configs_1 = __importDefault(require("../configs/app-configs"));
7
7
  const apply_overrides_1 = __importDefault(require("../configs/util/apply-overrides"));
8
8
  const nginxNonRootPart = app_configs_1.default.runFromNonRootUser ?
9
- `RUN chown -R nginx:nginx /src && chmod -R 755 /src && \\
9
+ `RUN chown -R nginx:nginx /src && \\
10
10
  mkdir -p /var/lib/nginx && \\
11
11
  chown -R nginx:nginx /var/lib/nginx && \\
12
12
  chown -R nginx:nginx /var/log/nginx && \\
@@ -25,8 +25,8 @@ ARG NGINX_CONF_LOCATION
25
25
  WORKDIR /src
26
26
  ADD $START_SH_LOCATION /src/start.sh
27
27
  ADD $NGINX_CONF_LOCATION /src/nginx.conf
28
- ADD . /src
29
-
30
28
  ${nginxNonRootPart}
29
+ ${app_configs_1.default.runFromNonRootUser ? 'ADD --chown=nginx:nginx . /src' : 'ADD . /src'}
30
+
31
31
  `;
32
- exports.default = (0, apply_overrides_1.default)('Dockerfile', dockerfileTemplate);
32
+ exports.default = apply_overrides_1.default('Dockerfile', dockerfileTemplate);
@@ -31,4 +31,4 @@ server {
31
31
  }
32
32
  }
33
33
  }`;
34
- exports.default = (0, apply_overrides_1.default)('nginx', nginxTemplate);
34
+ exports.default = apply_overrides_1.default('nginx', nginxTemplate);
@@ -34,4 +34,4 @@ nginx &
34
34
  # Start nodejs process
35
35
  node --max-old-space-size="$node_memory_limit" ./${app_configs_1.default.buildPath}/${app_configs_1.default.serverOutput}
36
36
  `;
37
- exports.default = (0, apply_overrides_1.default)('start.sh', startTemplate);
37
+ exports.default = apply_overrides_1.default('start.sh', startTemplate);