arui-scripts 0.0.0-beta-20260824133302
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/.eslintignore +2 -0
- package/.eslintrc.js +17 -0
- package/.prettierignore +2 -0
- package/.turbo/turbo-build.log +0 -0
- package/.turbo/turbo-test.log +23 -0
- package/CHANGELOG.md +1976 -0
- package/README.md +59 -0
- package/bin/build.sh +2 -0
- package/build/bin/index.d.ts +2 -0
- package/build/bin/index.js +26 -0
- package/build/commands/archive-build/index.d.ts +1 -0
- package/build/commands/archive-build/index.js +15 -0
- package/build/commands/build/build-wrapper.d.ts +8 -0
- package/build/commands/build/build-wrapper.js +40 -0
- package/build/commands/build/client.d.ts +1 -0
- package/build/commands/build/client.js +54 -0
- package/build/commands/build/index.d.ts +1 -0
- package/build/commands/build/index.js +11 -0
- package/build/commands/build/server.d.ts +1 -0
- package/build/commands/build/server.js +29 -0
- package/build/commands/bundle-analyze/index.d.ts +1 -0
- package/build/commands/bundle-analyze/index.js +62 -0
- package/build/commands/changelog/index.d.ts +5 -0
- package/build/commands/changelog/index.js +141 -0
- package/build/commands/docker-build/index.d.ts +1 -0
- package/build/commands/docker-build/index.js +15 -0
- package/build/commands/docker-build-compiled/index.d.ts +1 -0
- package/build/commands/docker-build-compiled/index.js +15 -0
- package/build/commands/ensure-yarn/index.d.ts +1 -0
- package/build/commands/ensure-yarn/index.js +8 -0
- package/build/commands/start/client.d.ts +1 -0
- package/build/commands/start/client.js +7 -0
- package/build/commands/start/index.d.ts +1 -0
- package/build/commands/start/index.js +13 -0
- package/build/commands/start/print-compiler-output.d.ts +2 -0
- package/build/commands/start/print-compiler-output.js +16 -0
- package/build/commands/start/server.d.ts +1 -0
- package/build/commands/start/server.js +7 -0
- package/build/commands/start-prod/client.d.ts +1 -0
- package/build/commands/start-prod/client.js +7 -0
- package/build/commands/start-prod/index.d.ts +1 -0
- package/build/commands/start-prod/index.js +13 -0
- package/build/commands/start-prod/server.d.ts +1 -0
- package/build/commands/start-prod/server.js +7 -0
- package/build/commands/test/get-config.d.ts +1 -0
- package/build/commands/test/get-config.js +83 -0
- package/build/commands/test/index.d.ts +1 -0
- package/build/commands/test/index.js +68 -0
- package/build/commands/test-vitest/index.d.ts +1 -0
- package/build/commands/test-vitest/index.js +15 -0
- package/build/commands/util/artifacts-config.d.ts +25 -0
- package/build/commands/util/artifacts-config.js +119 -0
- package/build/commands/util/artifacts-deprecations.d.ts +9 -0
- package/build/commands/util/artifacts-deprecations.js +65 -0
- package/build/commands/util/arui-scripts-artifacts.d.ts +16 -0
- package/build/commands/util/arui-scripts-artifacts.js +29 -0
- package/build/commands/util/client-assets-sizes.d.ts +2 -0
- package/build/commands/util/client-assets-sizes.js +71 -0
- package/build/commands/util/docker-build.d.ts +35 -0
- package/build/commands/util/docker-build.js +76 -0
- package/build/commands/util/exec.d.ts +1 -0
- package/build/commands/util/exec.js +6 -0
- package/build/commands/util/format-webpack-messages.d.ts +5 -0
- package/build/commands/util/format-webpack-messages.js +95 -0
- package/build/commands/util/get-local-ident.d.ts +6 -0
- package/build/commands/util/get-local-ident.js +29 -0
- package/build/commands/util/load-browserslist.d.ts +1 -0
- package/build/commands/util/load-browserslist.js +15 -0
- package/build/commands/util/make-tmp-dir.d.ts +5 -0
- package/build/commands/util/make-tmp-dir.js +29 -0
- package/build/commands/util/print-build-error.d.ts +1 -0
- package/build/commands/util/print-build-error.js +32 -0
- package/build/commands/util/run-artifacts-cli.d.ts +7 -0
- package/build/commands/util/run-artifacts-cli.js +60 -0
- package/build/commands/util/run-client-dev-server.d.ts +2 -0
- package/build/commands/util/run-client-dev-server.js +47 -0
- package/build/commands/util/run-compilers.d.ts +1 -0
- package/build/commands/util/run-compilers.js +37 -0
- package/build/commands/util/run-server-watch-compiler.d.ts +2 -0
- package/build/commands/util/run-server-watch-compiler.js +17 -0
- package/build/commands/util/run-vitest.d.ts +7 -0
- package/build/commands/util/run-vitest.js +41 -0
- package/build/commands/util/tsc.d.ts +1 -0
- package/build/commands/util/tsc.js +13 -0
- package/build/commands/util/yarn.d.ts +10 -0
- package/build/commands/util/yarn.js +25 -0
- package/build/configs/app-configs/calculate-dependent-config.d.ts +9 -0
- package/build/configs/app-configs/calculate-dependent-config.js +55 -0
- package/build/configs/app-configs/get-defaults.d.ts +5 -0
- package/build/configs/app-configs/get-defaults.js +151 -0
- package/build/configs/app-configs/index.d.ts +5 -0
- package/build/configs/app-configs/index.js +25 -0
- package/build/configs/app-configs/read-config-file.d.ts +2 -0
- package/build/configs/app-configs/read-config-file.js +28 -0
- package/build/configs/app-configs/types.d.ts +146 -0
- package/build/configs/app-configs/types.js +2 -0
- package/build/configs/app-configs/update-with-config-file.d.ts +2 -0
- package/build/configs/app-configs/update-with-config-file.js +17 -0
- package/build/configs/app-configs/update-with-env.d.ts +2 -0
- package/build/configs/app-configs/update-with-env.js +23 -0
- package/build/configs/app-configs/update-with-package.d.ts +2 -0
- package/build/configs/app-configs/update-with-package.js +13 -0
- package/build/configs/app-configs/update-with-presets.d.ts +3 -0
- package/build/configs/app-configs/update-with-presets.js +41 -0
- package/build/configs/app-configs/validate-config.d.ts +2 -0
- package/build/configs/app-configs/validate-config.js +8 -0
- package/build/configs/app-configs/validate-settings-keys.d.ts +7 -0
- package/build/configs/app-configs/validate-settings-keys.js +16 -0
- package/build/configs/app-configs/warn-about-deprecations.d.ts +2 -0
- package/build/configs/app-configs/warn-about-deprecations.js +22 -0
- package/build/configs/babel-client.d.ts +31 -0
- package/build/configs/babel-client.js +69 -0
- package/build/configs/babel-dependencies.d.ts +14 -0
- package/build/configs/babel-dependencies.js +36 -0
- package/build/configs/babel-server.d.ts +26 -0
- package/build/configs/babel-server.js +45 -0
- package/build/configs/client-env-config/add-env-to-html-template.d.ts +1 -0
- package/build/configs/client-env-config/add-env-to-html-template.js +7 -0
- package/build/configs/client-env-config/client-config-plugin.d.ts +5 -0
- package/build/configs/client-env-config/client-config-plugin.js +26 -0
- package/build/configs/client-env-config/constants.d.ts +1 -0
- package/build/configs/client-env-config/constants.js +4 -0
- package/build/configs/client-env-config/get-env-config.d.ts +2 -0
- package/build/configs/client-env-config/get-env-config.js +28 -0
- package/build/configs/client-env-config/index.d.ts +3 -0
- package/build/configs/client-env-config/index.js +9 -0
- package/build/configs/config-extras/minimizers/imagemin/imagemin.d.ts +28 -0
- package/build/configs/config-extras/minimizers/imagemin/imagemin.js +65 -0
- package/build/configs/config-extras/minimizers/imagemin/index.d.ts +1 -0
- package/build/configs/config-extras/minimizers/imagemin/index.js +17 -0
- package/build/configs/config-extras/minimizers/index.d.ts +1 -0
- package/build/configs/config-extras/minimizers/index.js +17 -0
- package/build/configs/dev-server.d.ts +2 -0
- package/build/configs/dev-server.js +78 -0
- package/build/configs/jest/babel-transform.d.ts +2 -0
- package/build/configs/jest/babel-transform.js +6 -0
- package/build/configs/jest/css-mock.d.ts +1 -0
- package/build/configs/jest/css-mock.js +2 -0
- package/build/configs/jest/file-transform.d.ts +3 -0
- package/build/configs/jest/file-transform.js +11 -0
- package/build/configs/jest/settings.d.ts +21 -0
- package/build/configs/jest/settings.js +58 -0
- package/build/configs/modules.d.ts +17 -0
- package/build/configs/modules.js +181 -0
- package/build/configs/mq.css +22 -0
- package/build/configs/postcss.config.d.ts +35 -0
- package/build/configs/postcss.config.js +65 -0
- package/build/configs/postcss.d.ts +6 -0
- package/build/configs/postcss.js +21 -0
- package/build/configs/process-assets-plugin-output.d.ts +2 -0
- package/build/configs/process-assets-plugin-output.js +45 -0
- package/build/configs/server-externals-exemptions.d.ts +1 -0
- package/build/configs/server-externals-exemptions.js +18 -0
- package/build/configs/stats-options.d.ts +2 -0
- package/build/configs/stats-options.js +46 -0
- package/build/configs/supporting-browsers.d.ts +1 -0
- package/build/configs/supporting-browsers.js +5 -0
- package/build/configs/supporting-node.d.ts +1 -0
- package/build/configs/supporting-node.js +5 -0
- package/build/configs/swc.d.ts +4 -0
- package/build/configs/swc.js +30 -0
- package/build/configs/util/apply-overrides.d.ts +87 -0
- package/build/configs/util/apply-overrides.js +56 -0
- package/build/configs/util/check-node-version.d.ts +1 -0
- package/build/configs/util/check-node-version.js +7 -0
- package/build/configs/util/compress-with-dcb.d.ts +2 -0
- package/build/configs/util/compress-with-dcb.js +28 -0
- package/build/configs/util/compression-plugins-for-dictionaries.d.ts +2 -0
- package/build/configs/util/compression-plugins-for-dictionaries.js +78 -0
- package/build/configs/util/create-watch-ignore-regex.d.ts +1 -0
- package/build/configs/util/create-watch-ignore-regex.js +16 -0
- package/build/configs/util/dcb-compression-plugin.d.ts +21 -0
- package/build/configs/util/dcb-compression-plugin.js +130 -0
- package/build/configs/util/find-loader.d.ts +2 -0
- package/build/configs/util/find-loader.js +24 -0
- package/build/configs/util/find-plugin.d.ts +78 -0
- package/build/configs/util/find-plugin.js +21 -0
- package/build/configs/util/get-entry.d.ts +8 -0
- package/build/configs/util/get-entry.js +22 -0
- package/build/configs/util/get-polyfills.d.ts +2 -0
- package/build/configs/util/get-polyfills.js +13 -0
- package/build/configs/util/get-webpack-cache-dependencies.d.ts +1 -0
- package/build/configs/util/get-webpack-cache-dependencies.js +15 -0
- package/build/configs/util/install-sourcemap-support.d.ts +1 -0
- package/build/configs/util/install-sourcemap-support.js +10 -0
- package/build/configs/util/node-assets-ignore.d.ts +1 -0
- package/build/configs/util/node-assets-ignore.js +34 -0
- package/build/configs/util/noop.d.ts +1 -0
- package/build/configs/util/noop.js +2 -0
- package/build/configs/util/register-ts-node.d.ts +1 -0
- package/build/configs/util/register-ts-node.js +18 -0
- package/build/configs/util/resolve.d.ts +14 -0
- package/build/configs/util/resolve.js +29 -0
- package/build/configs/vitest/config.d.ts +2 -0
- package/build/configs/vitest/config.js +5 -0
- package/build/configs/vitest/settings.d.ts +30 -0
- package/build/configs/vitest/settings.js +77 -0
- package/build/configs/webpack.client.d.ts +10 -0
- package/build/configs/webpack.client.dev.d.ts +1 -0
- package/build/configs/webpack.client.dev.js +12 -0
- package/build/configs/webpack.client.js +508 -0
- package/build/configs/webpack.client.prod.d.ts +1 -0
- package/build/configs/webpack.client.prod.js +12 -0
- package/build/configs/webpack.server.d.ts +2 -0
- package/build/configs/webpack.server.dev.d.ts +1 -0
- package/build/configs/webpack.server.dev.js +8 -0
- package/build/configs/webpack.server.js +283 -0
- package/build/configs/webpack.server.prod.d.ts +1 -0
- package/build/configs/webpack.server.prod.js +8 -0
- package/build/index.d.ts +19 -0
- package/build/index.js +35 -0
- package/build/plugins/arui-runtime/arui-runtime-module.d.ts +7 -0
- package/build/plugins/arui-runtime/arui-runtime-module.js +20 -0
- package/build/plugins/arui-runtime/index.d.ts +11 -0
- package/build/plugins/arui-runtime/index.js +47 -0
- package/build/plugins/postcss-global-variables/postcss-global-variables.d.ts +6 -0
- package/build/plugins/postcss-global-variables/postcss-global-variables.js +38 -0
- package/build/plugins/postcss-global-variables/utils/utils.d.ts +7 -0
- package/build/plugins/postcss-global-variables/utils/utils.js +91 -0
- package/build/plugins/postcss-prefix-selector.d.ts +6 -0
- package/build/plugins/postcss-prefix-selector.js +65 -0
- package/build/plugins/reload-server-plugin.d.ts +10 -0
- package/build/plugins/reload-server-plugin.js +46 -0
- package/build/plugins/turn-off-split-remote-entry.d.ts +11 -0
- package/build/plugins/turn-off-split-remote-entry.js +71 -0
- package/build/plugins/watch-missing-node-modules-plugin.d.ts +6 -0
- package/build/plugins/watch-missing-node-modules-plugin.js +20 -0
- package/build/templates/html.template.d.ts +1 -0
- package/build/templates/html.template.js +22 -0
- package/docs/artifact.md +62 -0
- package/docs/caveats.md +41 -0
- package/docs/client-only.md +77 -0
- package/docs/commands.md +159 -0
- package/docs/compilers.md +18 -0
- package/docs/compression-dictionary.md +130 -0
- package/docs/examples.md +100 -0
- package/docs/modules.md +834 -0
- package/docs/overrides.md +175 -0
- package/docs/presets.md +65 -0
- package/docs/settings.md +336 -0
- package/jest-preset.js +5 -0
- package/package.json +215 -0
- package/stylelint.config.js +11 -0
- package/tsconfig-local.json +17 -0
- package/tsconfig-local.tsbuildinfo +1 -0
- package/tsconfig.eslint.json +5 -0
- package/tsconfig.json +29 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.baseNginxConfigFileName = exports.nginxConfigFileName = void 0;
|
|
7
|
+
exports.getDefaultAppConfig = getDefaultAppConfig;
|
|
8
|
+
exports.getDefaultAppContext = getDefaultAppContext;
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const resolve_1 = require("../util/resolve");
|
|
12
|
+
const read_config_file_1 = require("./read-config-file");
|
|
13
|
+
const CWD = process.cwd();
|
|
14
|
+
const absoluteSrcPath = path_1.default.resolve(CWD, 'src');
|
|
15
|
+
exports.nginxConfigFileName = 'nginx.conf';
|
|
16
|
+
exports.baseNginxConfigFileName = 'base-nginx.conf';
|
|
17
|
+
function getDefaultAppConfig() {
|
|
18
|
+
var _a;
|
|
19
|
+
const appPackage = getPackageJson();
|
|
20
|
+
const configFile = (0, read_config_file_1.readConfigFile)(CWD);
|
|
21
|
+
return {
|
|
22
|
+
/// general settings
|
|
23
|
+
clientServerPort: 8080,
|
|
24
|
+
serverPort: 3000,
|
|
25
|
+
debug: false,
|
|
26
|
+
devSourceMaps: 'cheap-module-source-map', // ΡΠ°ΠΊ ΠΏΠΎΠ»ΡΡΠ°ΡΡΡΡ Π½ΠΎΡΠΌΠ°Π»ΡΠ½ΡΠ΅ ΡΠΎΡΡΠΌΠ°ΠΏΡ, Ρ eval - ΠΎΠ½ΠΈ Π½Π΅ ΡΠ°Π±ΠΎΡΠ°ΡΡ
|
|
27
|
+
devServerCors: false,
|
|
28
|
+
useServerHMR: false,
|
|
29
|
+
presets: (configFile === null || configFile === void 0 ? void 0 : configFile.presets) || ((_a = appPackage === null || appPackage === void 0 ? void 0 : appPackage.aruiScripts) === null || _a === void 0 ? void 0 : _a.presets) || null,
|
|
30
|
+
proxy: appPackage.proxy || [],
|
|
31
|
+
clientOnly: false,
|
|
32
|
+
// paths
|
|
33
|
+
buildPath: '.build',
|
|
34
|
+
assetsPath: 'assets',
|
|
35
|
+
statsOutputFilename: 'stats.json',
|
|
36
|
+
serverEntry: path_1.default.resolve(absoluteSrcPath, 'server/index'),
|
|
37
|
+
serverOutput: 'server.js',
|
|
38
|
+
clientPolyfillsEntry: null,
|
|
39
|
+
clientEntry: path_1.default.resolve(absoluteSrcPath, 'index'),
|
|
40
|
+
// docker/archive compilation configs
|
|
41
|
+
// ΠΠ΅ΡΠΎΠ»ΡΡ ΡΡΠΈΡ
Π½Π°ΡΡΡΠΎΠ΅ΠΊ ΠΆΠΈΠ²ΡΡ Π² @alfalab/arui-scripts-artifacts (resolveArtifactsConfig).
|
|
42
|
+
// ΠΠ΄Π΅ΡΡ ΠΊΠ»ΡΡΠΈ ΠΎΠ±ΡΡΠ²Π»Π΅Π½Ρ Π±Π΅Π· Π·Π½Π°ΡΠ΅Π½ΠΈΠΉ, ΡΡΠΎΠ±Ρ Π½Π°ΡΡΡΠΎΠΉΠΊΠ° ΠΈΠ· package.json/ΠΊΠΎΠ½ΡΠΈΠ³Π° Π½Π΅ ΡΡΠΈΡΠ°Π»Π°ΡΡ
|
|
43
|
+
// Π½Π΅ΠΈΠ·Π²Π΅ΡΡΠ½ΠΎΠΉ, Π° `undefined` Π΄ΠΎΠ΅Ρ
Π°Π» Π΄ΠΎ scripts-artifacts ΠΈ Π±ΡΠ» Π·Π°ΠΏΠΎΠ»Π½Π΅Π½ ΡΠ°ΠΌ.
|
|
44
|
+
dockerRegistry: undefined,
|
|
45
|
+
baseDockerImage: undefined,
|
|
46
|
+
nginxRootPath: undefined,
|
|
47
|
+
nginx: undefined,
|
|
48
|
+
runFromNonRootUser: undefined,
|
|
49
|
+
removeDevDependenciesDuringDockerBuild: undefined,
|
|
50
|
+
archiveName: undefined,
|
|
51
|
+
additionalBuildPath: undefined,
|
|
52
|
+
dictionaryCompression: {
|
|
53
|
+
dictionaryPath: [],
|
|
54
|
+
enablePreviousVersionHeaders: false,
|
|
55
|
+
},
|
|
56
|
+
// build tuning
|
|
57
|
+
keepPropTypes: false,
|
|
58
|
+
codeLoader: 'swc',
|
|
59
|
+
experimentalReactCompiler: 'disabled',
|
|
60
|
+
installServerSourceMaps: false,
|
|
61
|
+
disableDevWebpackTypecheck: true,
|
|
62
|
+
jestCodeTransformer: 'swc',
|
|
63
|
+
collectCoverage: process.env.NODE_ENV === 'cypress' || process.env.USE_ISTANBUL === 'enabled',
|
|
64
|
+
// image processing
|
|
65
|
+
dataUrlMaxSize: 1536,
|
|
66
|
+
imageMinimizer: {
|
|
67
|
+
svg: {
|
|
68
|
+
enabled: true,
|
|
69
|
+
},
|
|
70
|
+
gif: {
|
|
71
|
+
enabled: false,
|
|
72
|
+
optimizationLevel: 1,
|
|
73
|
+
},
|
|
74
|
+
jpg: {
|
|
75
|
+
enabled: false,
|
|
76
|
+
quality: 75,
|
|
77
|
+
},
|
|
78
|
+
png: {
|
|
79
|
+
enabled: false,
|
|
80
|
+
optimizationLevel: 3,
|
|
81
|
+
bitDepthReduction: false,
|
|
82
|
+
colorTypeReduction: false,
|
|
83
|
+
paletteReduction: false,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
// CSS
|
|
87
|
+
componentsTheme: null,
|
|
88
|
+
keepCssVars: false,
|
|
89
|
+
// Modules
|
|
90
|
+
disableModulesSupport: false,
|
|
91
|
+
compatModules: null,
|
|
92
|
+
modules: null,
|
|
93
|
+
nodeExternals: {
|
|
94
|
+
modulesFromFile: true,
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function getPackageJson() {
|
|
99
|
+
const appPackage = JSON.parse(fs_1.default.readFileSync(path_1.default.join(CWD, 'package.json'), 'utf8'));
|
|
100
|
+
if (appPackage['arui-scripts']) {
|
|
101
|
+
throw Error('arui-scripts in package.json is not supported. Use aruiScripts instead.');
|
|
102
|
+
}
|
|
103
|
+
return appPackage;
|
|
104
|
+
}
|
|
105
|
+
function getDefaultAppContext() {
|
|
106
|
+
const appPackage = getPackageJson();
|
|
107
|
+
const absoluteNodeModulesPath = path_1.default.resolve(CWD, 'node_modules');
|
|
108
|
+
const absoluteNodeModulesBinPath = path_1.default.resolve(absoluteNodeModulesPath, '.bin');
|
|
109
|
+
const projectTsConfigPath = path_1.default.join(CWD, 'tsconfig.json');
|
|
110
|
+
const yarnLockFilePath = path_1.default.join(CWD, 'yarn.lock');
|
|
111
|
+
const overridesPath = (0, resolve_1.tryResolve)(path_1.default.join(CWD, 'arui-scripts.overrides'));
|
|
112
|
+
const nginxConfFilePath = path_1.default.join(CWD, exports.nginxConfigFileName);
|
|
113
|
+
const nginxBaseConfFilePath = path_1.default.join(CWD, exports.baseNginxConfigFileName);
|
|
114
|
+
const dockerfileFilePath = path_1.default.join(CWD, 'Dockerfile');
|
|
115
|
+
const startScriptFilePath = path_1.default.join(CWD, 'start.sh');
|
|
116
|
+
return {
|
|
117
|
+
appPackage,
|
|
118
|
+
name: appPackage.name,
|
|
119
|
+
normalizedName: appPackage.name.replace(/-/g, '_'), // Π΄Π»Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΡ Π² ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅ ΠΈΠΌΠ΅Π½ΠΈ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠΉ
|
|
120
|
+
version: appPackage.version,
|
|
121
|
+
// general paths
|
|
122
|
+
cwd: CWD,
|
|
123
|
+
appSrc: absoluteSrcPath,
|
|
124
|
+
appNodeModules: absoluteNodeModulesPath,
|
|
125
|
+
appNodeModulesBin: absoluteNodeModulesBinPath,
|
|
126
|
+
overridesPath: overridesPath ? [overridesPath] : [],
|
|
127
|
+
// tools availability
|
|
128
|
+
babelRuntimeVersion: '7.0.0-beta.0',
|
|
129
|
+
useYarn: fs_1.default.existsSync(yarnLockFilePath),
|
|
130
|
+
// compilation configs locations
|
|
131
|
+
tsconfig: fs_1.default.existsSync(projectTsConfigPath) ? projectTsConfigPath : null,
|
|
132
|
+
localNginxConf: fs_1.default.existsSync(nginxConfFilePath) ? nginxConfFilePath : null,
|
|
133
|
+
localNginxBaseConf: fs_1.default.existsSync(nginxBaseConfFilePath) ? nginxBaseConfFilePath : null,
|
|
134
|
+
localDockerfile: fs_1.default.existsSync(dockerfileFilePath) ? dockerfileFilePath : null,
|
|
135
|
+
localStartScript: fs_1.default.existsSync(startScriptFilePath) ? startScriptFilePath : null,
|
|
136
|
+
// ΠΡΠΈ ΠΏΡΡΠΈ Π·Π°Π²ΠΈΡΡΡ ΠΎΡ Π΄ΡΡΠ³ΠΈΡ
Π½Π°ΡΡΡΠΎΠ΅ΠΊ, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΌΠΎΠ³ΡΡ Π±ΡΡΡ ΠΏΠ΅ΡΠ΅ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Ρ ΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΠ΅Π»Π΅ΠΌ
|
|
137
|
+
publicPath: '',
|
|
138
|
+
serverOutputPath: '',
|
|
139
|
+
clientOutputPath: '',
|
|
140
|
+
statsOutputPath: '',
|
|
141
|
+
watchIgnorePath: [],
|
|
142
|
+
// changelog paths
|
|
143
|
+
changelogPath: path_1.default.resolve(CWD, './CHANGELOG.md'),
|
|
144
|
+
changelogTmpPath: path_1.default.resolve(CWD, './CHANGELOG_TMP.md'),
|
|
145
|
+
changelogFeaturesPath: path_1.default.resolve(CWD, './changelog_features.tmp'),
|
|
146
|
+
changelogBugfixesPath: path_1.default.resolve(CWD, './changelog_bugfixes.tmp'),
|
|
147
|
+
changelogBreakingChangesPath: path_1.default.resolve(CWD, './changelog_breaking_changes.tmp'),
|
|
148
|
+
compressionPredefinedDictionaryPath: [],
|
|
149
|
+
compressionPreviousVersionPath: [],
|
|
150
|
+
};
|
|
151
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type AppConfigs, type AppContext, type AppContextWithConfigs } from './types';
|
|
2
|
+
import '../util/register-ts-node';
|
|
3
|
+
export declare const appContext: AppContext;
|
|
4
|
+
export declare const appConfigs: AppConfigs;
|
|
5
|
+
export declare const configs: AppContextWithConfigs;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configs = exports.appConfigs = exports.appContext = void 0;
|
|
4
|
+
const calculate_dependent_config_1 = require("./calculate-dependent-config");
|
|
5
|
+
const get_defaults_1 = require("./get-defaults");
|
|
6
|
+
const update_with_config_file_1 = require("./update-with-config-file");
|
|
7
|
+
const update_with_env_1 = require("./update-with-env");
|
|
8
|
+
const update_with_package_1 = require("./update-with-package");
|
|
9
|
+
const update_with_presets_1 = require("./update-with-presets");
|
|
10
|
+
const validate_config_1 = require("./validate-config");
|
|
11
|
+
const warn_about_deprecations_1 = require("./warn-about-deprecations");
|
|
12
|
+
require("../util/register-ts-node");
|
|
13
|
+
let tmpConfig = (0, get_defaults_1.getDefaultAppConfig)();
|
|
14
|
+
let tmpContext = (0, get_defaults_1.getDefaultAppContext)();
|
|
15
|
+
tmpConfig = (0, update_with_presets_1.updateWithPresets)(tmpConfig, tmpContext);
|
|
16
|
+
tmpConfig = (0, update_with_package_1.updateWithPackage)(tmpConfig, tmpContext);
|
|
17
|
+
tmpConfig = (0, update_with_config_file_1.updateWithConfigFile)(tmpConfig, tmpContext);
|
|
18
|
+
tmpConfig = (0, update_with_env_1.updateWithEnv)(tmpConfig);
|
|
19
|
+
tmpConfig = (0, calculate_dependent_config_1.calculateDependentConfig)(tmpConfig);
|
|
20
|
+
tmpContext = (0, calculate_dependent_config_1.calculateDependentContext)(tmpConfig, tmpContext);
|
|
21
|
+
exports.appContext = tmpContext;
|
|
22
|
+
exports.appConfigs = tmpConfig;
|
|
23
|
+
exports.configs = Object.assign(Object.assign({}, exports.appConfigs), exports.appContext);
|
|
24
|
+
(0, validate_config_1.validateConfig)(exports.configs);
|
|
25
|
+
(0, warn_about_deprecations_1.warnAboutDeprecations)(exports.configs);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.readConfigFile = readConfigFile;
|
|
7
|
+
exports.getConfigFilePath = getConfigFilePath;
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const resolve_1 = require("../util/resolve");
|
|
10
|
+
function readConfigFile(cwd) {
|
|
11
|
+
const appConfigPath = getConfigFilePath(cwd);
|
|
12
|
+
if (appConfigPath) {
|
|
13
|
+
// ΠΡ Π½Π΅ ΠΌΠΎΠΆΠ΅ΠΌ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΠΈΠΌΠΏΠΎΡΡΡ, Π½Π°ΠΌ Π½ΡΠΆΠ΅Π½ ΠΈΠΌΠ΅Π½Π½ΠΎ require, ΠΏΠΎΡΠΎΠΌΡ ΡΡΠΎ ΠΌΡ Π½Π΅ Π·Π½Π°Π΅ΠΌ Π·Π°ΡΠ°Π½Π΅Π΅ Π½Π΅ ΡΠΎΠ»ΡΠΊΠΎ ΠΏΡΡΡ Π΄ΠΎ ΡΠ°ΠΉΠ»Π°,
|
|
14
|
+
// Π½ΠΎ ΠΈ ΡΠΎ, Π½Π° ΠΊΠ°ΠΊΠΎΠΌ ΡΠ·ΡΠΊΠ΅ ΠΎΠ½ Π½Π°ΠΏΠΈΡΠ°Π½
|
|
15
|
+
// eslint-disable-next-line import/no-dynamic-require, global-require, @typescript-eslint/no-var-requires
|
|
16
|
+
let appSettings = require(appConfigPath);
|
|
17
|
+
// ts-node ΠΈΠΌΠΏΠΎΡΡΠΈΡΡΠ΅Ρ esModules, ΠΈΠ· Π½ΠΈΡ
Π½Π°Π΄ΠΎ Π²ΡΡΡΠ³ΠΈΠ²Π°ΡΡ default ΠΈΠΌΠ΅Π½Π½ΠΎ ΡΠ°ΠΊ
|
|
18
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
19
|
+
if (appSettings.__esModule) {
|
|
20
|
+
appSettings = appSettings.default;
|
|
21
|
+
}
|
|
22
|
+
return appSettings;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
function getConfigFilePath(cwd) {
|
|
27
|
+
return (0, resolve_1.tryResolve)(path_1.default.join(cwd, '/arui-scripts.config'));
|
|
28
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { type DevTool, type Shared } from '@rspack/core';
|
|
2
|
+
import { type Configuration as DevServerConfiguration } from '@rspack/dev-server';
|
|
3
|
+
import { type PluginOptions as ReactCompilerOptions } from 'babel-plugin-react-compiler';
|
|
4
|
+
import type webpackNodeExternals from 'webpack-node-externals';
|
|
5
|
+
import { type NginxBaseConfOptions } from '@alfalab/arui-scripts-artifacts';
|
|
6
|
+
/**
|
|
7
|
+
* ΠΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ arui-scripts, ΠΊΠΎΡΠΎΡΠ°Ρ ΠΌΠΎΠΆΠ΅Ρ Π±ΡΡΡ ΠΏΠ΅ΡΠ΅ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½Π° ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ
|
|
8
|
+
*/
|
|
9
|
+
export type AppConfigs = {
|
|
10
|
+
clientServerPort: number;
|
|
11
|
+
serverPort: number;
|
|
12
|
+
debug: boolean;
|
|
13
|
+
devSourceMaps: DevTool;
|
|
14
|
+
devServerCors: boolean;
|
|
15
|
+
useServerHMR: boolean;
|
|
16
|
+
presets: string | null;
|
|
17
|
+
proxy: DevServerConfiguration['proxy'];
|
|
18
|
+
clientOnly: boolean;
|
|
19
|
+
buildPath: string;
|
|
20
|
+
assetsPath: string;
|
|
21
|
+
statsOutputFilename: string;
|
|
22
|
+
serverEntry: string | string[] | Record<string, string | string[]>;
|
|
23
|
+
serverOutput: string;
|
|
24
|
+
clientPolyfillsEntry: null | string | string[];
|
|
25
|
+
clientEntry: string | string[] | Record<string, string | string[]>;
|
|
26
|
+
/** @deprecated ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ `docker.registry` Π² ΠΊΠΎΠ½ΡΠΈΠ³Π΅ @alfalab/arui-scripts-artifacts. */
|
|
27
|
+
dockerRegistry?: string;
|
|
28
|
+
/** @deprecated ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ `docker.baseImage` Π² ΠΊΠΎΠ½ΡΠΈΠ³Π΅ @alfalab/arui-scripts-artifacts. */
|
|
29
|
+
baseDockerImage?: string;
|
|
30
|
+
/** @deprecated ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ `nginx.rootPath` Π² ΠΊΠΎΠ½ΡΠΈΠ³Π΅ @alfalab/arui-scripts-artifacts. */
|
|
31
|
+
nginxRootPath?: string;
|
|
32
|
+
/** @deprecated ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ `nginx.baseConf` Π² ΠΊΠΎΠ½ΡΠΈΠ³Π΅ @alfalab/arui-scripts-artifacts. */
|
|
33
|
+
nginx?: NginxBaseConfOptions | null;
|
|
34
|
+
/** @deprecated ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ `docker.runFromNonRootUser` Π² ΠΊΠΎΠ½ΡΠΈΠ³Π΅ @alfalab/arui-scripts-artifacts. */
|
|
35
|
+
runFromNonRootUser?: boolean;
|
|
36
|
+
/** @deprecated ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ `build.removeDevDependencies` Π² ΠΊΠΎΠ½ΡΠΈΠ³Π΅ @alfalab/arui-scripts-artifacts. */
|
|
37
|
+
removeDevDependenciesDuringDockerBuild?: boolean;
|
|
38
|
+
/** @deprecated ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ `archive.name` Π² ΠΊΠΎΠ½ΡΠΈΠ³Π΅ @alfalab/arui-scripts-artifacts. */
|
|
39
|
+
archiveName?: string;
|
|
40
|
+
/**
|
|
41
|
+
* ΠΠΈΡΠ΅ΠΊΡΠΎΡΠΈΠΈ ΠΏΡΠΎΠ΅ΠΊΡΠ°, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΊΠ»Π°Π΄ΡΡΡΡ Π² tar-Π°ΡΡ
ΠΈΠ² ΡΡΠ΄ΠΎΠΌ ΡΠΎ ΡΠ±ΠΎΡΠΊΠΎΠΉ.
|
|
42
|
+
* @deprecated ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ `archive.additionalPaths` Π² ΠΊΠΎΠ½ΡΠΈΠ³Π΅ @alfalab/arui-scripts-artifacts.
|
|
43
|
+
*/
|
|
44
|
+
additionalBuildPath?: string[];
|
|
45
|
+
dictionaryCompression: {
|
|
46
|
+
dictionaryPath: string[];
|
|
47
|
+
enablePreviousVersionHeaders?: boolean;
|
|
48
|
+
};
|
|
49
|
+
keepPropTypes: boolean;
|
|
50
|
+
codeLoader: 'babel' | 'tsc' | 'swc';
|
|
51
|
+
experimentalReactCompiler: 'disabled' | ReactCompilerOptions;
|
|
52
|
+
installServerSourceMaps: boolean;
|
|
53
|
+
disableDevWebpackTypecheck: boolean;
|
|
54
|
+
jestCodeTransformer: 'babel' | 'tsc' | 'swc';
|
|
55
|
+
collectCoverage: boolean;
|
|
56
|
+
dataUrlMaxSize?: number;
|
|
57
|
+
imageMinimizer?: {
|
|
58
|
+
svg?: {
|
|
59
|
+
enabled?: boolean;
|
|
60
|
+
};
|
|
61
|
+
gif?: {
|
|
62
|
+
enabled?: boolean;
|
|
63
|
+
optimizationLevel?: number;
|
|
64
|
+
};
|
|
65
|
+
jpg?: {
|
|
66
|
+
enabled?: boolean;
|
|
67
|
+
quality: number;
|
|
68
|
+
};
|
|
69
|
+
png?: {
|
|
70
|
+
enabled?: boolean;
|
|
71
|
+
optimizationLevel?: number;
|
|
72
|
+
bitDepthReduction?: boolean;
|
|
73
|
+
colorTypeReduction?: boolean;
|
|
74
|
+
paletteReduction?: boolean;
|
|
75
|
+
interlaced?: boolean;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
componentsTheme: string | null;
|
|
79
|
+
keepCssVars: boolean;
|
|
80
|
+
disableModulesSupport: boolean;
|
|
81
|
+
compatModules: {
|
|
82
|
+
shared?: {
|
|
83
|
+
[libraryName: string]: string;
|
|
84
|
+
};
|
|
85
|
+
exposes?: {
|
|
86
|
+
[moduleId: string]: CompatModuleConfigBase;
|
|
87
|
+
};
|
|
88
|
+
} | null;
|
|
89
|
+
modules: {
|
|
90
|
+
name?: string;
|
|
91
|
+
shared: Shared;
|
|
92
|
+
exposes?: Record<string, string>;
|
|
93
|
+
options?: ModuleConfigBase;
|
|
94
|
+
shareScope?: string;
|
|
95
|
+
} | null;
|
|
96
|
+
nodeExternals?: Omit<webpackNodeExternals.Options, 'allowlist'>;
|
|
97
|
+
};
|
|
98
|
+
export type ModuleConfigBase = {
|
|
99
|
+
cssPrefix?: false | string;
|
|
100
|
+
useSeparateBuild?: boolean;
|
|
101
|
+
separateBuildShared?: Shared;
|
|
102
|
+
};
|
|
103
|
+
type CompatModuleConfigBase = {
|
|
104
|
+
cssPrefix?: false | string;
|
|
105
|
+
entry: string;
|
|
106
|
+
externals?: Record<string, string>;
|
|
107
|
+
};
|
|
108
|
+
export type CompatModuleConfig = CompatModuleConfigBase & {
|
|
109
|
+
name: string;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* ΠΠ½ΡΡΡΠ΅Π½Π½ΠΈΠΉ ΠΊΠΎΠ½ΡΠ΅ΠΊΡΡ arui-scripts
|
|
113
|
+
*/
|
|
114
|
+
export type AppContext = {
|
|
115
|
+
appPackage: any;
|
|
116
|
+
name: string;
|
|
117
|
+
normalizedName: string;
|
|
118
|
+
version: string;
|
|
119
|
+
cwd: string;
|
|
120
|
+
appSrc: string;
|
|
121
|
+
appNodeModules: string;
|
|
122
|
+
appNodeModulesBin: string;
|
|
123
|
+
babelRuntimeVersion: string;
|
|
124
|
+
useYarn: boolean;
|
|
125
|
+
tsconfig: string | null;
|
|
126
|
+
localNginxConf: string | null;
|
|
127
|
+
localNginxBaseConf: string | null;
|
|
128
|
+
localDockerfile: string | null;
|
|
129
|
+
localStartScript: string | null;
|
|
130
|
+
overridesPath: string[];
|
|
131
|
+
publicPath: string;
|
|
132
|
+
serverOutputPath: string;
|
|
133
|
+
clientOutputPath: string;
|
|
134
|
+
statsOutputPath: string;
|
|
135
|
+
watchIgnorePath: string[];
|
|
136
|
+
changelogPath: string;
|
|
137
|
+
changelogTmpPath: string;
|
|
138
|
+
changelogFeaturesPath: string;
|
|
139
|
+
changelogBugfixesPath: string;
|
|
140
|
+
changelogBreakingChangesPath: string;
|
|
141
|
+
compressionPreviousVersionPath: string[];
|
|
142
|
+
compressionPredefinedDictionaryPath: string[];
|
|
143
|
+
};
|
|
144
|
+
export type AppContextWithConfigs = AppContext & AppConfigs;
|
|
145
|
+
export type PackageSettings = Partial<AppConfigs>;
|
|
146
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.updateWithConfigFile = updateWithConfigFile;
|
|
7
|
+
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
8
|
+
const read_config_file_1 = require("./read-config-file");
|
|
9
|
+
const validate_settings_keys_1 = require("./validate-settings-keys");
|
|
10
|
+
function updateWithConfigFile(config, context) {
|
|
11
|
+
const appSettings = (0, read_config_file_1.readConfigFile)(context.cwd);
|
|
12
|
+
if (appSettings) {
|
|
13
|
+
(0, validate_settings_keys_1.validateSettingsKeys)(config, appSettings, context.cwd);
|
|
14
|
+
return (0, lodash_merge_1.default)(config, appSettings);
|
|
15
|
+
}
|
|
16
|
+
return config;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.updateWithEnv = updateWithEnv;
|
|
7
|
+
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
8
|
+
const validate_settings_keys_1 = require("./validate-settings-keys");
|
|
9
|
+
function updateWithEnv(config) {
|
|
10
|
+
if (!process.env.ARUI_SCRIPTS_CONFIG) {
|
|
11
|
+
return config;
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
console.warn('ΠΡΠΏΠΎΠ»ΡΠ·ΡΠΉΡΠ΅ ARUI_SCRIPTS_CONFIG ΡΠΎΠ»ΡΠΊΠΎ Π΄Π»Ρ ΠΎΡΠ»Π°Π΄ΠΊΠΈ');
|
|
15
|
+
const envSettings = JSON.parse(process.env.ARUI_SCRIPTS_CONFIG);
|
|
16
|
+
(0, validate_settings_keys_1.validateSettingsKeys)(config, envSettings, 'ENV');
|
|
17
|
+
return (0, lodash_merge_1.default)(config, envSettings);
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
console.error(e);
|
|
21
|
+
throw Error('Not valid JSON passed. Correct it. For example: ARUI_SCRIPTS_CONFIG="{"serverPort":3333}"');
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.updateWithPackage = updateWithPackage;
|
|
7
|
+
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
8
|
+
const validate_settings_keys_1 = require("./validate-settings-keys");
|
|
9
|
+
function updateWithPackage(config, context) {
|
|
10
|
+
const packageSettings = context.appPackage.aruiScripts || {};
|
|
11
|
+
(0, validate_settings_keys_1.validateSettingsKeys)(config, packageSettings, 'package.json');
|
|
12
|
+
return (0, lodash_merge_1.default)(config, packageSettings);
|
|
13
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.updateWithPresets = updateWithPresets;
|
|
7
|
+
exports.getPresetsConfigPath = getPresetsConfigPath;
|
|
8
|
+
// TODO: remove eslint-disable-next-line
|
|
9
|
+
const lodash_merge_1 = __importDefault(require("lodash.merge"));
|
|
10
|
+
const resolve_1 = require("../util/resolve");
|
|
11
|
+
const validate_settings_keys_1 = require("./validate-settings-keys");
|
|
12
|
+
function updateWithPresets(config, context) {
|
|
13
|
+
if (!config.presets) {
|
|
14
|
+
return config;
|
|
15
|
+
}
|
|
16
|
+
const presetsConfigPath = getPresetsConfigPath(config, context.cwd);
|
|
17
|
+
const presetsOverridesPath = (0, resolve_1.tryResolve)(`${config.presets}/arui-scripts.overrides`, {
|
|
18
|
+
paths: [context.cwd],
|
|
19
|
+
});
|
|
20
|
+
if (presetsConfigPath) {
|
|
21
|
+
// eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-var-requires, global-require
|
|
22
|
+
let presetsSettings = require(presetsConfigPath);
|
|
23
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
24
|
+
if (presetsSettings.__esModule) {
|
|
25
|
+
// ts-node ΠΈΠΌΠΏΠΎΡΡΠΈΡΡΠ΅Ρ esModules, ΠΈΠ· Π½ΠΈΡ
Π½Π°Π΄ΠΎ Π²ΡΡΡΠ³ΠΈΠ²Π°ΡΡ default ΠΈΠΌΠ΅Π½Π½ΠΎ ΡΠ°ΠΊ
|
|
26
|
+
presetsSettings = presetsSettings.default;
|
|
27
|
+
}
|
|
28
|
+
(0, validate_settings_keys_1.validateSettingsKeys)(config, presetsSettings, presetsConfigPath);
|
|
29
|
+
// eslint-disable-next-line no-param-reassign
|
|
30
|
+
config = (0, lodash_merge_1.default)(config, presetsSettings);
|
|
31
|
+
}
|
|
32
|
+
if (presetsOverridesPath) {
|
|
33
|
+
context.overridesPath.unshift(presetsOverridesPath);
|
|
34
|
+
}
|
|
35
|
+
return config;
|
|
36
|
+
}
|
|
37
|
+
function getPresetsConfigPath(config, cwd) {
|
|
38
|
+
return (0, resolve_1.tryResolve)(`${config.presets}/arui-scripts.config`, {
|
|
39
|
+
paths: [cwd],
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateConfig = validateConfig;
|
|
4
|
+
function validateConfig(config) {
|
|
5
|
+
if (config.experimentalReactCompiler !== 'disabled' && config.codeLoader !== 'swc') {
|
|
6
|
+
throw new Error('ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ `experimentalReactCompiler` Π½Π° Π΄Π°Π½Π½ΡΠΉ ΠΌΠΎΠΌΠ΅Π½Ρ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΈΠ²Π°Π΅ΡΡΡ ΡΠΎΠ»ΡΠΊΠΎ Ρ `codeLoader: "swc"`. \nΠΠΈΠ±ΠΎ Π²ΡΠΊΠ»ΡΡΠΈΡΠ΅ `experimentalReactCompiler`, Π»ΠΈΠ±ΠΎ ΠΈΠ·ΠΌΠ΅Π½ΠΈΡΠ΅ Π½Π°ΡΡΡΠΎΠΉΠΊΡ Π΄Π»Ρ `codeLoader`.');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Π€ΡΠ½ΠΊΡΠΈΡ ΠΏΡΠΎΠ²Π΅ΡΡΠ΅Ρ ΡΡΠΎ Π²ΡΠ΅ ΠΊΠ»ΡΡΠΈ ΠΎΠ±ΡΠ΅ΠΊΡΠ° settingsObject Π΅ΡΡΡ Π² ΡΠΆΠ΅ ΡΡΡΠ΅ΡΡΠ²ΡΡΡΠ΅ΠΉ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ.
|
|
3
|
+
*
|
|
4
|
+
* ΠΡΠΎΠ²Π΅ΡΡΠ΅ΡΡΡ ΠΈΠΌΠ΅Π½Π½ΠΎ Π½Π°Π»ΠΈΡΠΈΠ΅ ΠΊΠ»ΡΡΠ°, Π° Π½Π΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: Ρ ΡΠ°ΡΡΠΈ Π½Π°ΡΡΡΠΎΠ΅ΠΊ (Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ, docker-ΡΠΏΠ΅ΡΠΈΡΠΈΡΠ½ΡΡ
)
|
|
5
|
+
* Π΄Π΅ΡΠΎΠ»Ρ ΠΆΠΈΠ²Π΅Ρ Π² @alfalab/arui-scripts-artifacts, ΠΏΠΎΡΡΠΎΠΌΡ Π² ΠΊΠΎΠ½ΡΠΈΠ³Π΅ ΠΎΠ½ΠΈ Π»Π΅ΠΆΠ°Ρ ΡΠΎ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ΠΌ `undefined`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateSettingsKeys(existingConfig: Record<string, unknown>, settingsObject: Record<string, unknown>, source?: string): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSettingsKeys = validateSettingsKeys;
|
|
4
|
+
/**
|
|
5
|
+
* Π€ΡΠ½ΠΊΡΠΈΡ ΠΏΡΠΎΠ²Π΅ΡΡΠ΅Ρ ΡΡΠΎ Π²ΡΠ΅ ΠΊΠ»ΡΡΠΈ ΠΎΠ±ΡΠ΅ΠΊΡΠ° settingsObject Π΅ΡΡΡ Π² ΡΠΆΠ΅ ΡΡΡΠ΅ΡΡΠ²ΡΡΡΠ΅ΠΉ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ.
|
|
6
|
+
*
|
|
7
|
+
* ΠΡΠΎΠ²Π΅ΡΡΠ΅ΡΡΡ ΠΈΠΌΠ΅Π½Π½ΠΎ Π½Π°Π»ΠΈΡΠΈΠ΅ ΠΊΠ»ΡΡΠ°, Π° Π½Π΅ Π·Π½Π°ΡΠ΅Π½ΠΈΡ: Ρ ΡΠ°ΡΡΠΈ Π½Π°ΡΡΡΠΎΠ΅ΠΊ (Π½Π°ΠΏΡΠΈΠΌΠ΅Ρ, docker-ΡΠΏΠ΅ΡΠΈΡΠΈΡΠ½ΡΡ
)
|
|
8
|
+
* Π΄Π΅ΡΠΎΠ»Ρ ΠΆΠΈΠ²Π΅Ρ Π² @alfalab/arui-scripts-artifacts, ΠΏΠΎΡΡΠΎΠΌΡ Π² ΠΊΠΎΠ½ΡΠΈΠ³Π΅ ΠΎΠ½ΠΈ Π»Π΅ΠΆΠ°Ρ ΡΠΎ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ΠΌ `undefined`.
|
|
9
|
+
*/
|
|
10
|
+
function validateSettingsKeys(existingConfig, settingsObject, source) {
|
|
11
|
+
Object.keys(settingsObject).forEach((setting) => {
|
|
12
|
+
if (!Object.prototype.hasOwnProperty.call(existingConfig, setting)) {
|
|
13
|
+
console.warn(`ΠΠ΅ΠΈΠ·Π²Π΅ΡΡΠ½Π°Ρ Π½Π°ΡΡΡΠΎΠΉΠΊΠ° "${setting}" Π² ${source || 'ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ'}`);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.warnAboutDeprecations = warnAboutDeprecations;
|
|
4
|
+
function warnAboutDeprecations(config) {
|
|
5
|
+
if (!Array.isArray(config.proxy) && config.proxy) {
|
|
6
|
+
console.warn('ΠΠ΅ΡΠ΅Π΄Π°ΡΠ° config.proxy ΠΊΠ°ΠΊ ΠΎΠ±ΡΠ΅ΠΊΡΠ° Π±ΠΎΠ»ΡΡΠ΅ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΈΠ²Π°Π΅ΡΡΡ. ', 'arui-scripts ΠΏΠΎΠΏΡΠΎΠ±ΡΠ΅Ρ ΠΏΡΠΈΠ²Π΅ΡΡΠΈ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ ΠΊ ΠΊΠΎΡΡΠ΅ΠΊΡΠ½ΠΎΠΌΡ Π²ΠΈΠ΄Ρ, Π½ΠΎ ΡΡΠΎ Π½Π΅ Π²ΡΠ΅Π³Π΄Π° ΠΌΠΎΠΆΠ΅Ρ ΡΠ°Π±ΠΎΡΠ°ΡΡ ΠΊΠΎΡΡΠ΅ΠΊΡΠ½ΠΎ', 'ΠΡΠ°Π²ΠΈΠ»ΡΠ½ΡΠΉ ΡΠΎΡΠΌΠ°Ρ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΠΎΡΠΌΠΎΡΡΠ΅ΡΡ Π² Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ rspack: https://rspack.dev/guide/features/dev-server#proxy');
|
|
7
|
+
// eslint-disable-next-line no-param-reassign
|
|
8
|
+
config.proxy = convertObjectProxyConfigurationToArray(config.proxy);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function convertObjectProxyConfigurationToArray(proxyConfiguration) {
|
|
12
|
+
const arrayProxy = [];
|
|
13
|
+
Object.keys(proxyConfiguration).forEach((context) => {
|
|
14
|
+
const itemConfig = proxyConfiguration[context];
|
|
15
|
+
arrayProxy.push(Object.assign({ context }, (typeof itemConfig === 'string'
|
|
16
|
+
? {
|
|
17
|
+
target: itemConfig,
|
|
18
|
+
}
|
|
19
|
+
: itemConfig)));
|
|
20
|
+
});
|
|
21
|
+
return arrayProxy;
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const babelClientConfig: {
|
|
2
|
+
presets: (string | false | (string | {
|
|
3
|
+
targets: string[];
|
|
4
|
+
loose: boolean;
|
|
5
|
+
useBuiltIns: string;
|
|
6
|
+
corejs: string;
|
|
7
|
+
exclude: string[];
|
|
8
|
+
})[])[];
|
|
9
|
+
plugins: (string | false | (string | {
|
|
10
|
+
legacy: boolean;
|
|
11
|
+
})[] | (string | {
|
|
12
|
+
loose: boolean;
|
|
13
|
+
})[] | (string | {
|
|
14
|
+
useBuiltIns: boolean;
|
|
15
|
+
})[] | (string | {
|
|
16
|
+
corejs: boolean;
|
|
17
|
+
helpers: boolean;
|
|
18
|
+
version: string;
|
|
19
|
+
regenerator: boolean;
|
|
20
|
+
})[])[];
|
|
21
|
+
env: {
|
|
22
|
+
production: {
|
|
23
|
+
plugins: (string | (string | {
|
|
24
|
+
removeImport: boolean;
|
|
25
|
+
})[])[];
|
|
26
|
+
};
|
|
27
|
+
test: {
|
|
28
|
+
plugins: string[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.babelClientConfig = void 0;
|
|
4
|
+
const apply_overrides_1 = require("./util/apply-overrides");
|
|
5
|
+
const app_configs_1 = require("./app-configs");
|
|
6
|
+
const supporting_browsers_1 = require("./supporting-browsers");
|
|
7
|
+
exports.babelClientConfig = (0, apply_overrides_1.applyOverrides)(['babel', 'babelClient'], {
|
|
8
|
+
presets: [
|
|
9
|
+
[
|
|
10
|
+
require.resolve('@babel/preset-env'),
|
|
11
|
+
{
|
|
12
|
+
targets: supporting_browsers_1.supportingBrowsers,
|
|
13
|
+
loose: true,
|
|
14
|
+
// Allow importing core-js in entrypoint and use browserlist to select polyfills
|
|
15
|
+
useBuiltIns: 'entry',
|
|
16
|
+
// Set the corejs version we are using to avoid warnings in console
|
|
17
|
+
corejs: '3.32',
|
|
18
|
+
// Exclude transforms that make all code slower
|
|
19
|
+
exclude: ['transform-typeof-symbol'],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
app_configs_1.configs.tsconfig !== null &&
|
|
23
|
+
app_configs_1.configs.codeLoader !== 'tsc' &&
|
|
24
|
+
require.resolve('@babel/preset-typescript'),
|
|
25
|
+
require.resolve('@babel/preset-react'),
|
|
26
|
+
].filter(Boolean),
|
|
27
|
+
plugins: [
|
|
28
|
+
require.resolve('@babel/plugin-syntax-dynamic-import'),
|
|
29
|
+
require.resolve('@babel/plugin-transform-proto-to-assign'),
|
|
30
|
+
[require.resolve('@babel/plugin-proposal-decorators'), { legacy: true }],
|
|
31
|
+
[require.resolve('@babel/plugin-transform-class-properties'), { loose: true }],
|
|
32
|
+
[require.resolve('@babel/plugin-transform-private-methods'), { loose: true }],
|
|
33
|
+
[require.resolve('@babel/plugin-transform-private-property-in-object'), { loose: true }],
|
|
34
|
+
require.resolve('@babel/plugin-transform-numeric-separator'),
|
|
35
|
+
require.resolve('@babel/plugin-proposal-export-default-from'),
|
|
36
|
+
require.resolve('@babel/plugin-transform-export-namespace-from'),
|
|
37
|
+
[require.resolve('@babel/plugin-transform-object-rest-spread'), { useBuiltIns: true }],
|
|
38
|
+
[
|
|
39
|
+
require.resolve('@babel/plugin-transform-runtime'),
|
|
40
|
+
{
|
|
41
|
+
corejs: false,
|
|
42
|
+
helpers: true,
|
|
43
|
+
// By default, babel assumes babel/runtime version 7.0.0-beta.0,
|
|
44
|
+
// explicitly resolving to match the provided helper functions.
|
|
45
|
+
// https://github.com/babel/babel/issues/10261
|
|
46
|
+
version: app_configs_1.configs.babelRuntimeVersion,
|
|
47
|
+
regenerator: true,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
require.resolve('@babel/plugin-transform-nullish-coalescing-operator'),
|
|
51
|
+
require.resolve('@babel/plugin-transform-optional-chaining'),
|
|
52
|
+
app_configs_1.configs.collectCoverage && require.resolve('babel-plugin-istanbul'),
|
|
53
|
+
].filter(Boolean),
|
|
54
|
+
env: {
|
|
55
|
+
production: {
|
|
56
|
+
plugins: [
|
|
57
|
+
require.resolve('@babel/plugin-transform-react-constant-elements'),
|
|
58
|
+
require.resolve('@babel/plugin-transform-react-inline-elements'),
|
|
59
|
+
[
|
|
60
|
+
require.resolve('babel-plugin-transform-react-remove-prop-types'),
|
|
61
|
+
{ removeImport: true },
|
|
62
|
+
],
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
test: {
|
|
66
|
+
plugins: [require.resolve('@babel/plugin-transform-modules-commonjs')],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
});
|