arui-scripts 13.3.0 → 13.4.0-feat-vite-dev-build.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/build/bin/index.js +1 -0
- package/build/commands/archive-build/index.js +3 -3
- package/build/commands/build/build-wrapper.d.ts +1 -1
- package/build/commands/build/build-wrapper.js +2 -2
- package/build/commands/build/client.js +4 -4
- package/build/commands/build/index.js +3 -3
- package/build/commands/build/server.js +2 -2
- package/build/commands/bundle-analyze/index.js +2 -2
- package/build/commands/docker-build/index.js +7 -7
- package/build/commands/docker-build-compiled/index.js +5 -5
- package/build/commands/start/client.js +3 -3
- package/build/commands/start/index.js +3 -3
- package/build/commands/start/server.js +2 -2
- package/build/commands/start-vite/client.d.ts +1 -0
- package/build/commands/start-vite/client.js +62 -0
- package/build/commands/start-vite/index.d.ts +1 -0
- package/build/commands/start-vite/index.js +30 -0
- package/build/commands/util/client-assets-sizes.d.ts +3 -3
- package/build/commands/util/client-assets-sizes.js +9 -9
- package/build/commands/util/docker-build.d.ts +1 -1
- package/build/commands/util/localhost-certs.d.ts +2 -0
- package/build/commands/util/localhost-certs.js +50 -0
- package/build/commands/util/start-http2-proxy-server.d.ts +7 -0
- package/build/commands/util/start-http2-proxy-server.js +40 -0
- package/build/commands/util/vite-proxy-utils.d.ts +63 -0
- package/build/commands/util/vite-proxy-utils.js +94 -0
- package/build/commands/util/yarn.d.ts +3 -2
- package/build/commands/util/yarn.js +19 -1
- package/build/configs/app-configs/available-package-settings.d.ts +2 -2
- package/build/configs/app-configs/calculate-dependent-config.js +3 -3
- package/build/configs/app-configs/get-defaults.js +2 -1
- package/build/configs/app-configs/index.js +6 -6
- package/build/configs/app-configs/types.d.ts +2 -1
- package/build/configs/app-configs/update-with-config-file.js +3 -3
- package/build/configs/app-configs/update-with-env.js +2 -2
- package/build/configs/app-configs/update-with-package.js +2 -2
- package/build/configs/app-configs/update-with-presets.js +4 -4
- package/build/configs/babel-client.js +1 -1
- package/build/configs/babel-dependencies.js +1 -1
- package/build/configs/babel-server.js +1 -1
- package/build/configs/dev-server.js +1 -1
- package/build/configs/jest/file-transform.d.ts +1 -2
- package/build/configs/jest/index.d.ts +8 -8
- package/build/configs/postcss.config.d.ts +1 -1
- package/build/configs/postcss.js +1 -1
- package/build/configs/stats-options.js +1 -1
- package/build/configs/supporting-browsers.js +1 -1
- package/build/configs/util/apply-overrides.d.ts +6 -3
- package/build/configs/vite.config.d.ts +1 -0
- package/build/configs/vite.config.js +46 -0
- package/build/configs/vite.html-template.d.ts +1 -0
- package/build/configs/vite.html-template.js +16 -0
- package/build/configs/webpack.client.dev.js +7 -2
- package/build/configs/webpack.client.prod.js +5 -3
- package/build/configs/webpack.server.dev.js +3 -3
- package/build/configs/webpack.server.prod.js +3 -3
- package/build/index.js +1 -0
- package/build/templates/dockerfile-compiled.template.js +15 -6
- package/build/templates/dockerfile.template.js +1 -1
- package/build/templates/nginx.conf.template.js +1 -1
- package/build/templates/start.template.js +1 -1
- package/build/tsconfig-local.tsbuildinfo +1 -8816
- package/package.json +8 -2
|
@@ -33,12 +33,12 @@ function getSingleEntry(entryPoint) {
|
|
|
33
33
|
].filter(Boolean);
|
|
34
34
|
}
|
|
35
35
|
// This is the production configuration.
|
|
36
|
-
const config = apply_overrides_1.default(['webpack', 'webpackClient', 'webpackProd', 'webpackClientProd'], {
|
|
36
|
+
const config = (0, 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: get_entry_1.default(app_configs_1.default.clientEntry, getSingleEntry),
|
|
41
|
+
entry: (0, 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,6 +291,8 @@ const config = apply_overrides_1.default(['webpack', 'webpackClient', 'webpackPr
|
|
|
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.
|
|
294
296
|
],
|
|
295
297
|
},
|
|
296
298
|
plugins: ([
|
|
@@ -312,7 +314,7 @@ const config = apply_overrides_1.default(['webpack', 'webpackClient', 'webpackPr
|
|
|
312
314
|
threshold: 10240,
|
|
313
315
|
minRatio: 0.8
|
|
314
316
|
}),
|
|
315
|
-
check_node_version_1.default(10) && new compression_webpack_plugin_1.default({
|
|
317
|
+
(0, check_node_version_1.default)(10) && new compression_webpack_plugin_1.default({
|
|
316
318
|
filename: '[file].br',
|
|
317
319
|
algorithm: 'brotliCompress',
|
|
318
320
|
test: /\.(js|css|html|svg)$/,
|
|
@@ -39,7 +39,7 @@ const config = {
|
|
|
39
39
|
__filename: true,
|
|
40
40
|
__dirname: true
|
|
41
41
|
},
|
|
42
|
-
entry: get_entry_1.default(app_configs_1.default.serverEntry, getSingleEntry),
|
|
42
|
+
entry: (0, 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: [webpack_node_externals_1.default({
|
|
64
|
+
externals: [(0, 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 = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackDev', 'webpackServerDev'], config);
|
|
242
|
+
const webpackServerDev = (0, 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 = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackProd', 'webpackServerProd'], {
|
|
30
|
+
const config = (0, 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 = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackPr
|
|
|
38
38
|
__filename: true,
|
|
39
39
|
__dirname: true
|
|
40
40
|
},
|
|
41
|
-
entry: get_entry_1.default(app_configs_1.default.serverEntry, getSingleEntry),
|
|
41
|
+
entry: (0, 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 = apply_overrides_1.default(['webpack', 'webpackServer', 'webpackPr
|
|
|
53
53
|
.replace(/\\/g, '/'),
|
|
54
54
|
},
|
|
55
55
|
externalsPresets: { node: true },
|
|
56
|
-
externals: [webpack_node_externals_1.default({
|
|
56
|
+
externals: [(0, webpack_node_externals_1.default)({
|
|
57
57
|
allowlist: [
|
|
58
58
|
/^arui-feather/,
|
|
59
59
|
/^arui-ft-private/,
|
package/build/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBuildParamsFromArgs = exports.prepareFilesForDocker = void 0;
|
|
3
4
|
var docker_build_1 = require("./commands/util/docker-build");
|
|
4
5
|
Object.defineProperty(exports, "prepareFilesForDocker", { enumerable: true, get: function () { return docker_build_1.prepareFilesForDocker; } });
|
|
5
6
|
var docker_build_2 = require("./commands/util/docker-build");
|
|
@@ -6,7 +6,16 @@ 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
|
|
9
|
+
const installProductionCommand = (0, yarn_1.getInstallProductionCommand)();
|
|
10
|
+
const yarnVersion = (0, yarn_1.getYarnVersion)();
|
|
11
|
+
// В зависимости от используемого мендежера зависимостей для их установки нужно копировать разный набор файлов
|
|
12
|
+
const filesRequiredToInstallDependencies = [
|
|
13
|
+
'package.json',
|
|
14
|
+
'yarn.lock',
|
|
15
|
+
yarnVersion === '2+' && '.yarnrc.yml',
|
|
16
|
+
yarnVersion === '2+' && '.yarn',
|
|
17
|
+
yarnVersion === 'unavailable' && 'package-lock.json',
|
|
18
|
+
].filter(Boolean);
|
|
10
19
|
const dockerfileTemplate = `
|
|
11
20
|
FROM ${app_configs_1.default.baseDockerImage}
|
|
12
21
|
ARG START_SH_LOCATION
|
|
@@ -19,10 +28,10 @@ ADD $START_SH_LOCATION /src/start.sh
|
|
|
19
28
|
ADD $NGINX_CONF_LOCATION /src/nginx.conf
|
|
20
29
|
|
|
21
30
|
# Зависимости. При некоторой удаче могут кешироваться и соответственно кешировать установку зависимостей
|
|
22
|
-
ADD --chown=nginx:nginx
|
|
23
|
-
|
|
24
|
-
RUN ${
|
|
25
|
-
yarn cache clean
|
|
31
|
+
${filesRequiredToInstallDependencies.map((file) => `ADD --chown=nginx:nginx ${file} /src/${file}`).join('\n')}
|
|
32
|
+
|
|
33
|
+
RUN ${installProductionCommand} && \\
|
|
34
|
+
${yarnVersion === 'unavailable' ? 'npm cache clean --force' : 'yarn cache clean'}
|
|
26
35
|
|
|
27
36
|
ADD --chown=nginx:nginx . /src
|
|
28
37
|
|
|
@@ -35,4 +44,4 @@ RUN touch /var/run/nginx.pid && \
|
|
|
35
44
|
chown -R nginx:nginx /var/run/nginx.pid
|
|
36
45
|
USER nginx
|
|
37
46
|
`;
|
|
38
|
-
exports.default = apply_overrides_1.default('DockerfileCompiled', dockerfileTemplate);
|
|
47
|
+
exports.default = (0, apply_overrides_1.default)('DockerfileCompiled', dockerfileTemplate);
|
|
@@ -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 = apply_overrides_1.default('start.sh', startTemplate);
|
|
37
|
+
exports.default = (0, apply_overrides_1.default)('start.sh', startTemplate);
|