@gravity-ui/app-builder 0.6.7 → 0.6.9
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/dist/commands/build/build-lib.js +2 -5
- package/dist/commands/build/build-service/index.js +2 -25
- package/dist/commands/build/build-service/server.js +2 -2
- package/dist/commands/build/index.js +2 -24
- package/dist/commands/dev/index.js +4 -27
- package/dist/common/babel/ui-preset.d.ts +1 -1
- package/dist/common/babel/ui-preset.js +1 -0
- package/dist/common/child-process/controllable-script.d.ts +3 -1
- package/dist/common/child-process/controllable-script.js +0 -1
- package/dist/common/config.js +5 -5
- package/dist/common/library/index.js +9 -11
- package/dist/common/s3-upload/s3-client.js +2 -2
- package/dist/common/s3-upload/webpack-plugin.js +3 -6
- package/dist/common/typescript/transformers.js +6 -6
- package/dist/common/utils.d.ts +3 -0
- package/dist/common/utils.js +6 -1
- package/dist/common/webpack/lazy-client.js +1 -0
- package/dist/common/webpack/public-path.d.ts +1 -1
- package/dist/common/webpack/public-path.js +1 -0
- package/dist/common/webpack/worker/public-path.worker.d.ts +1 -0
- package/dist/common/webpack/worker/public-path.worker.js +1 -1
- package/package.json +39 -40
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.9](https://github.com/gravity-ui/app-builder/compare/v0.6.8...v0.6.9) (2023-09-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* pass correct version to semver ([#77](https://github.com/gravity-ui/app-builder/issues/77)) ([d3f8ed8](https://github.com/gravity-ui/app-builder/commit/d3f8ed8d210995d9d7325f6fd16f0e7e57193105))
|
|
9
|
+
|
|
10
|
+
## [0.6.8](https://github.com/gravity-ui/app-builder/compare/v0.6.7...v0.6.8) (2023-09-18)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* config fails to load ([#75](https://github.com/gravity-ui/app-builder/issues/75)) ([1847dc7](https://github.com/gravity-ui/app-builder/commit/1847dc7ddb6270b61d73836f84ad1944e04d96a7))
|
|
16
|
+
* get-port v5 incorrectly detects empty port ([#73](https://github.com/gravity-ui/app-builder/issues/73)) ([3d7b4df](https://github.com/gravity-ui/app-builder/commit/3d7b4dfd0ba244b1d03b2965beffd9234b328cd6))
|
|
17
|
+
|
|
3
18
|
## [0.6.7](https://github.com/gravity-ui/app-builder/compare/v0.6.6...v0.6.7) (2023-09-06)
|
|
4
19
|
|
|
5
20
|
|
|
@@ -1,9 +1,6 @@
|
|
|
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 signal_exit_1 =
|
|
3
|
+
const signal_exit_1 = require("signal-exit");
|
|
7
4
|
const controllable_script_1 = require("../../common/child-process/controllable-script");
|
|
8
5
|
function default_1(config) {
|
|
9
6
|
return new Promise((resolve, reject) => {
|
|
@@ -28,7 +25,7 @@ function default_1(config) {
|
|
|
28
25
|
await build.stop('SIGTERM');
|
|
29
26
|
process.exit(1);
|
|
30
27
|
});
|
|
31
|
-
(0, signal_exit_1.
|
|
28
|
+
(0, signal_exit_1.onExit)((_code, signal) => {
|
|
32
29
|
build.stop(signal);
|
|
33
30
|
});
|
|
34
31
|
});
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
const utils_1 = require("../../../common/utils");
|
|
27
4
|
function default_1(config) {
|
|
@@ -30,13 +7,13 @@ function default_1(config) {
|
|
|
30
7
|
const compilations = [];
|
|
31
8
|
if (shouldCompileClient) {
|
|
32
9
|
compilations.push((async () => {
|
|
33
|
-
const { buildClient } = await
|
|
10
|
+
const { buildClient } = await import('./client.js');
|
|
34
11
|
return buildClient(config);
|
|
35
12
|
})());
|
|
36
13
|
}
|
|
37
14
|
if (shouldCompileServer) {
|
|
38
15
|
compilations.push((async () => {
|
|
39
|
-
const { buildServer } = await
|
|
16
|
+
const { buildServer } = await import('./server.js');
|
|
40
17
|
return buildServer(config);
|
|
41
18
|
})());
|
|
42
19
|
}
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.buildServer = void 0;
|
|
7
|
-
const signal_exit_1 =
|
|
7
|
+
const signal_exit_1 = require("signal-exit");
|
|
8
8
|
const controllable_script_1 = require("../../../common/child-process/controllable-script");
|
|
9
9
|
const paths_1 = __importDefault(require("../../../common/paths"));
|
|
10
10
|
const utils_1 = require("../../../common/utils");
|
|
@@ -36,7 +36,7 @@ function buildServer(config) {
|
|
|
36
36
|
await build.stop('SIGTERM');
|
|
37
37
|
process.exit(1);
|
|
38
38
|
});
|
|
39
|
-
(0, signal_exit_1.
|
|
39
|
+
(0, signal_exit_1.onExit)((_code, signal) => {
|
|
40
40
|
build.stop(signal);
|
|
41
41
|
});
|
|
42
42
|
});
|
|
@@ -1,32 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
const models_1 = require("../../common/models");
|
|
27
4
|
async function default_1(config) {
|
|
28
5
|
process.env.NODE_ENV = 'production';
|
|
29
|
-
|
|
6
|
+
// eslint-disable-next-line global-require, security/detect-non-literal-require
|
|
7
|
+
const { default: build } = require((0, models_1.isLibraryConfig)(config) ? './build-lib' : './build-service');
|
|
30
8
|
return build(config);
|
|
31
9
|
}
|
|
32
10
|
exports.default = default_1;
|
|
@@ -1,34 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
const node_path_1 = __importDefault(require("node:path"));
|
|
30
7
|
const nodemon_1 = __importDefault(require("nodemon"));
|
|
31
|
-
const signal_exit_1 =
|
|
8
|
+
const signal_exit_1 = require("signal-exit");
|
|
32
9
|
const rimraf_1 = require("rimraf");
|
|
33
10
|
const utils_1 = require("../../common/utils");
|
|
34
11
|
const logger_1 = __importDefault(require("../../common/logger"));
|
|
@@ -69,7 +46,7 @@ async function default_1(config) {
|
|
|
69
46
|
};
|
|
70
47
|
let serverCompilation;
|
|
71
48
|
if (shouldCompileServer) {
|
|
72
|
-
const { watchServerCompilation } = await
|
|
49
|
+
const { watchServerCompilation } = await import('./server.js');
|
|
73
50
|
serverCompilation = watchServerCompilation(config);
|
|
74
51
|
serverCompilation.onMessage((msg) => {
|
|
75
52
|
if (msg.type === 'Emitted') {
|
|
@@ -80,7 +57,7 @@ async function default_1(config) {
|
|
|
80
57
|
}
|
|
81
58
|
let clientCompilation;
|
|
82
59
|
if (shouldCompileClient) {
|
|
83
|
-
const { watchClientCompilation } = await
|
|
60
|
+
const { watchClientCompilation } = await import('./client.js');
|
|
84
61
|
clientCompilation = await watchClientCompilation(config, () => {
|
|
85
62
|
logger_1.default.success('Manifest was compiled successfully');
|
|
86
63
|
clientCompiled = true;
|
|
@@ -99,7 +76,7 @@ async function default_1(config) {
|
|
|
99
76
|
await clientCompilation?.stop();
|
|
100
77
|
process.exit(1);
|
|
101
78
|
});
|
|
102
|
-
(0, signal_exit_1.
|
|
79
|
+
(0, signal_exit_1.onExit)((_code, signal) => {
|
|
103
80
|
serverCompilation?.stop(signal);
|
|
104
81
|
clientCompilation?.stop();
|
|
105
82
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { Serializable } from 'child_process';
|
|
2
4
|
interface IDebugInfo {
|
|
3
5
|
break?: boolean;
|
|
4
6
|
port?: number;
|
|
@@ -13,6 +15,6 @@ export declare class ControllableScript {
|
|
|
13
15
|
stop(signal?: NodeJS.Signals | null, code?: number): Promise<void>;
|
|
14
16
|
onMessage(callback: (msg: any) => void): void;
|
|
15
17
|
onExit(callback: (code: number | null, signal: NodeJS.Signals | null) => void): void;
|
|
16
|
-
send(msg:
|
|
18
|
+
send(msg: Serializable): void;
|
|
17
19
|
}
|
|
18
20
|
export {};
|
|
@@ -114,7 +114,6 @@ class ControllableScript {
|
|
|
114
114
|
}
|
|
115
115
|
this.process.on(`exit`, callback);
|
|
116
116
|
}
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
117
|
send(msg) {
|
|
119
118
|
if (!this.process) {
|
|
120
119
|
throw new Error(`Trying to send a message before process started`);
|
package/dist/common/config.js
CHANGED
|
@@ -8,8 +8,8 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
9
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
10
10
|
const cosmiconfig_typescript_loader_1 = require("cosmiconfig-typescript-loader");
|
|
11
|
-
const get_port_1 = __importDefault(require("get-port"));
|
|
12
11
|
const models_1 = require("./models");
|
|
12
|
+
const utils_1 = require("./utils");
|
|
13
13
|
function splitPaths(paths) {
|
|
14
14
|
return (Array.isArray(paths) ? paths : [paths]).flatMap((p) => p.split(','));
|
|
15
15
|
}
|
|
@@ -126,7 +126,7 @@ async function normalizeConfig(userConfig, mode) {
|
|
|
126
126
|
server.verbose = userConfig.verbose;
|
|
127
127
|
if (mode === 'dev') {
|
|
128
128
|
if (server.port === true) {
|
|
129
|
-
server.port = await (0,
|
|
129
|
+
server.port = await (0, utils_1.getPort)({ port: 3000 });
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
return config;
|
|
@@ -149,17 +149,17 @@ async function normalizeClientConfig(client, mode) {
|
|
|
149
149
|
if (client.lazyCompilation) {
|
|
150
150
|
if (client.lazyCompilation === true) {
|
|
151
151
|
client.lazyCompilation = {
|
|
152
|
-
port: await (0,
|
|
152
|
+
port: await (0, utils_1.getPort)({ port: 6000 }),
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
else if (!client.lazyCompilation.port) {
|
|
156
|
-
client.lazyCompilation.port = await (0,
|
|
156
|
+
client.lazyCompilation.port = await (0, utils_1.getPort)({ port: 6000 });
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
const devServer = client.devServer?.port
|
|
160
160
|
? {
|
|
161
161
|
port: client.devServer.port === true
|
|
162
|
-
? await (0,
|
|
162
|
+
? await (0, utils_1.getPort)({ port: 8000 })
|
|
163
163
|
: client.devServer.port,
|
|
164
164
|
ipc: undefined,
|
|
165
165
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* eslint-disable quotes */
|
|
3
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
3
|
if (k2 === undefined) k2 = k;
|
|
5
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -32,7 +31,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
32
31
|
const fs_1 = __importDefault(require("fs"));
|
|
33
32
|
const child_process_1 = __importDefault(require("child_process"));
|
|
34
33
|
const babel = __importStar(require("@babel/core"));
|
|
35
|
-
const fast_glob_1 =
|
|
34
|
+
const fast_glob_1 = require("fast-glob");
|
|
36
35
|
const rimraf_1 = require("rimraf");
|
|
37
36
|
const sass_1 = __importDefault(require("sass"));
|
|
38
37
|
const postcss_1 = __importDefault(require("postcss"));
|
|
@@ -78,7 +77,7 @@ function compileToCjs(code, file, inputSourceMap, sourceDir = paths_1.default.sr
|
|
|
78
77
|
plugins: [
|
|
79
78
|
require.resolve('./babel-plugin-remove-css-imports'),
|
|
80
79
|
require.resolve('@babel/plugin-transform-modules-commonjs'),
|
|
81
|
-
require.resolve('@babel/plugin-
|
|
80
|
+
require.resolve('@babel/plugin-transform-dynamic-import'),
|
|
82
81
|
],
|
|
83
82
|
sourceMaps: true,
|
|
84
83
|
inputSourceMap,
|
|
@@ -99,7 +98,7 @@ function compileToCjs(code, file, inputSourceMap, sourceDir = paths_1.default.sr
|
|
|
99
98
|
});
|
|
100
99
|
}
|
|
101
100
|
function compileStyles(inputDir, outputDir, onFinish, additionalGlobs = []) {
|
|
102
|
-
const origStylesStream = fast_glob_1.
|
|
101
|
+
const origStylesStream = (0, fast_glob_1.globStream)(['**/*.{sass,scss,css}', ...additionalGlobs], {
|
|
103
102
|
cwd: inputDir,
|
|
104
103
|
});
|
|
105
104
|
origStylesStream.on('data', (file) => {
|
|
@@ -118,7 +117,7 @@ function compileStyles(inputDir, outputDir, onFinish, additionalGlobs = []) {
|
|
|
118
117
|
const globs = outputDir === paths_1.default.libBuildEsm
|
|
119
118
|
? ['**/*.{sass,scss,css}', '!cjs/**/*']
|
|
120
119
|
: ['**/*.{sass,scss,css}'];
|
|
121
|
-
const stylesStream = fast_glob_1.
|
|
120
|
+
const stylesStream = (0, fast_glob_1.globStream)(globs, { cwd: outputDir });
|
|
122
121
|
stylesStream.on('data', async (file) => {
|
|
123
122
|
const origScssFile = getFilePath(file, { dir: inputDir });
|
|
124
123
|
const scssFile = getFilePath(file, { dir: outputDir });
|
|
@@ -168,7 +167,7 @@ function buildLibrary(config) {
|
|
|
168
167
|
const internalGlobs = config.lib?.internalDirs?.map((dir) => `!${dir}/**/*`) ?? [];
|
|
169
168
|
rimraf_1.rimraf.sync(paths_1.default.libBuild);
|
|
170
169
|
// sources compilation
|
|
171
|
-
const sourceStream = fast_glob_1.
|
|
170
|
+
const sourceStream = (0, fast_glob_1.globStream)(['**/*.{js,jsx,ts,tsx}', '!**/*.d.ts', ...internalGlobs], {
|
|
172
171
|
cwd: paths_1.default.src,
|
|
173
172
|
});
|
|
174
173
|
sourceStream.on('data', (file) => {
|
|
@@ -228,7 +227,7 @@ function buildLibrary(config) {
|
|
|
228
227
|
logger_1.default.error(stderr);
|
|
229
228
|
if (!error && !stderr) {
|
|
230
229
|
logger_1.default.message('Typechecking successfully completed');
|
|
231
|
-
const typingsStream = fast_glob_1.
|
|
230
|
+
const typingsStream = (0, fast_glob_1.globStream)(['**/*.d.ts', '!cjs/**/*'], {
|
|
232
231
|
cwd: paths_1.default.libBuildEsm,
|
|
233
232
|
});
|
|
234
233
|
typingsStream.on('data', copyToCjs);
|
|
@@ -253,7 +252,7 @@ function buildLibrary(config) {
|
|
|
253
252
|
export default icon;
|
|
254
253
|
`;
|
|
255
254
|
const svgoRegEx = /assets\/icons/;
|
|
256
|
-
const iconsStream = fast_glob_1.
|
|
255
|
+
const iconsStream = (0, fast_glob_1.globStream)(['**/*.svg', ...internalGlobs], { cwd: paths_1.default.libAssets });
|
|
257
256
|
iconsStream.on('data', async (file) => {
|
|
258
257
|
const iconFile = getFilePath(file, { dir: paths_1.default.libAssets });
|
|
259
258
|
const componentFile = getFilePath(file, { dir: paths_1.default.libCompiledAssetsEsm, ext: 'js' });
|
|
@@ -291,8 +290,7 @@ function buildLibrary(config) {
|
|
|
291
290
|
}
|
|
292
291
|
}
|
|
293
292
|
else {
|
|
294
|
-
|
|
295
|
-
const encoded = new Buffer(fs_1.default.readFileSync(iconFile, 'utf-8')).toString('base64');
|
|
293
|
+
const encoded = Buffer.from(fs_1.default.readFileSync(iconFile, 'utf-8')).toString('base64');
|
|
296
294
|
const code = `export default 'data:image/svg+xml;base64,${encoded}'`;
|
|
297
295
|
fs_1.default.mkdirSync(componentDir, { recursive: true });
|
|
298
296
|
fs_1.default.writeFile(componentFile, code, errorHandlerFactory(`Icons compilation has failed on writing ${componentFile}`));
|
|
@@ -301,7 +299,7 @@ function buildLibrary(config) {
|
|
|
301
299
|
}
|
|
302
300
|
});
|
|
303
301
|
// file assets copying
|
|
304
|
-
const assetsStream = fast_glob_1.
|
|
302
|
+
const assetsStream = (0, fast_glob_1.globStream)(['**/*.json', '!**/tsconfig.json', '**/*.d.ts', ...internalGlobs], { cwd: paths_1.default.src });
|
|
305
303
|
assetsStream.on('data', (file) => {
|
|
306
304
|
const assetFile = getFilePath(file);
|
|
307
305
|
const copiedAssetFile = getFilePath(file, { dir: paths_1.default.libBuildEsm });
|
|
@@ -33,7 +33,7 @@ const client_s3_1 = require("@aws-sdk/client-s3");
|
|
|
33
33
|
const file_type_1 = require("file-type");
|
|
34
34
|
const mime = __importStar(require("mime-types"));
|
|
35
35
|
const p_map_1 = __importDefault(require("p-map"));
|
|
36
|
-
const fast_glob_1 =
|
|
36
|
+
const fast_glob_1 = require("fast-glob");
|
|
37
37
|
function getS3Client(options) {
|
|
38
38
|
const s3Client = new client_s3_1.S3Client(options);
|
|
39
39
|
return {
|
|
@@ -67,7 +67,7 @@ function getS3Client(options) {
|
|
|
67
67
|
return s3Client.send(new client_s3_1.PutObjectCommand(params));
|
|
68
68
|
},
|
|
69
69
|
uploadDir(bucket, dirPath, keyPrefix = '', { concurrency = 512, ...opts } = {}) {
|
|
70
|
-
const files = fast_glob_1.
|
|
70
|
+
const files = (0, fast_glob_1.globSync)('**', { cwd: dirPath });
|
|
71
71
|
return (0, p_map_1.default)(files, (filePath) => {
|
|
72
72
|
const sourcePath = path.join(dirPath, filePath);
|
|
73
73
|
return this.uploadFile(bucket, sourcePath, keyPrefix + filePath, opts);
|
|
@@ -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
3
|
exports.S3UploadPlugin = void 0;
|
|
7
4
|
const webpack_1 = require("webpack");
|
|
8
|
-
const fast_glob_1 =
|
|
5
|
+
const fast_glob_1 = require("fast-glob");
|
|
9
6
|
const upload_js_1 = require("./upload.js");
|
|
10
7
|
class S3UploadPlugin {
|
|
11
8
|
constructor(options) {
|
|
@@ -15,10 +12,10 @@ class S3UploadPlugin {
|
|
|
15
12
|
compiler.hooks.done.tapPromise('S3UploadPlugin', async ({ compilation }) => {
|
|
16
13
|
let fileNames = Object.keys(compilation.assets);
|
|
17
14
|
if (this.options.additionalPattern) {
|
|
18
|
-
const
|
|
15
|
+
const additionalFiles = (0, fast_glob_1.globSync)(this.options.additionalPattern, {
|
|
19
16
|
cwd: compilation.outputOptions.path,
|
|
20
17
|
});
|
|
21
|
-
fileNames = fileNames.concat(
|
|
18
|
+
fileNames = fileNames.concat(additionalFiles);
|
|
22
19
|
}
|
|
23
20
|
fileNames = fileNames.filter((name) => {
|
|
24
21
|
const fullPath = compilation.outputOptions.path + '/' + name;
|
|
@@ -114,8 +114,8 @@ function createTransformPathsToLocalModules(ts) {
|
|
|
114
114
|
}
|
|
115
115
|
exports.createTransformPathsToLocalModules = createTransformPathsToLocalModules;
|
|
116
116
|
function updateImportDeclaration(ts, node, context, resolvedPath) {
|
|
117
|
-
if (semver.lt(ts.version, '5.0')) {
|
|
118
|
-
// for versions before 5.0
|
|
117
|
+
if (semver.lt(ts.version, '5.0.0')) {
|
|
118
|
+
// for versions before 5.0.0
|
|
119
119
|
return context.factory.updateImportDeclaration(node,
|
|
120
120
|
// @ts-expect-error
|
|
121
121
|
node.decorators, node.modifiers, node.importClause, context.factory.createStringLiteral(resolvedPath),
|
|
@@ -125,8 +125,8 @@ function updateImportDeclaration(ts, node, context, resolvedPath) {
|
|
|
125
125
|
return context.factory.updateImportDeclaration(node, node.modifiers, node.importClause, context.factory.createStringLiteral(resolvedPath), node.assertClause);
|
|
126
126
|
}
|
|
127
127
|
function updateExportDeclaration(ts, node, context, resolvedPath) {
|
|
128
|
-
if (semver.lt(ts.version, '5.0')) {
|
|
129
|
-
// for versions before 5.0
|
|
128
|
+
if (semver.lt(ts.version, '5.0.0')) {
|
|
129
|
+
// for versions before 5.0.0
|
|
130
130
|
return context.factory.updateExportDeclaration(node,
|
|
131
131
|
// @ts-expect-error
|
|
132
132
|
node.decorators, node.modifiers, node.isTypeOnly, node.exportClause, context.factory.createStringLiteral(resolvedPath),
|
|
@@ -136,8 +136,8 @@ function updateExportDeclaration(ts, node, context, resolvedPath) {
|
|
|
136
136
|
return context.factory.updateExportDeclaration(node, node.modifiers, node.isTypeOnly, node.exportClause, context.factory.createStringLiteral(resolvedPath), node.assertClause);
|
|
137
137
|
}
|
|
138
138
|
function updateImportTypeNode(ts, node, context, resolvedPath) {
|
|
139
|
-
if (semver.lt(ts.version, '5.0')) {
|
|
140
|
-
// for versions before 5.0
|
|
139
|
+
if (semver.lt(ts.version, '5.0.0')) {
|
|
140
|
+
// for versions before 5.0.0
|
|
141
141
|
return context.factory.updateImportTypeNode(node, context.factory.createLiteralTypeNode(context.factory.createStringLiteral(resolvedPath)),
|
|
142
142
|
// @ts-expect-error
|
|
143
143
|
node.qualifier, node.typeArguments, node.isTypeOf);
|
package/dist/common/utils.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export declare function createRunFolder(): void;
|
|
2
2
|
export declare function shouldCompileTarget(target: 'client' | 'server' | undefined, targetName: string): boolean;
|
|
3
3
|
export declare function getCacheDir(): string;
|
|
4
|
+
export declare function getPort({ port }: {
|
|
5
|
+
port: number;
|
|
6
|
+
}): Promise<number>;
|
package/dist/common/utils.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getCacheDir = exports.shouldCompileTarget = exports.createRunFolder = void 0;
|
|
6
|
+
exports.getPort = exports.getCacheDir = exports.shouldCompileTarget = exports.createRunFolder = void 0;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const os_1 = __importDefault(require("os"));
|
|
9
9
|
const find_cache_dir_1 = __importDefault(require("find-cache-dir"));
|
|
@@ -23,3 +23,8 @@ function getCacheDir() {
|
|
|
23
23
|
return (0, find_cache_dir_1.default)({ name: '@gravity-ui/app-builder', create: true }) || os_1.default.tmpdir();
|
|
24
24
|
}
|
|
25
25
|
exports.getCacheDir = getCacheDir;
|
|
26
|
+
async function getPort({ port }) {
|
|
27
|
+
const { default: getPortDefault, portNumbers } = await import('get-port');
|
|
28
|
+
return getPortDefault({ port: portNumbers(port, port + 100) });
|
|
29
|
+
}
|
|
30
|
+
exports.getPort = getPort;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-env browser */
|
|
2
2
|
/* global __resourceQuery */
|
|
3
3
|
'use strict';
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
5
|
if (typeof EventSource !== 'function') {
|
|
5
6
|
throw new Error("Environment doesn't support lazy compilation (requires EventSource)");
|
|
6
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/app-builder",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"description": "Develop and build your React client-server projects, powered by typescript and webpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"scripts": {
|
|
46
46
|
"prepare": "husky install",
|
|
47
47
|
"lint": "run-p lint:*",
|
|
48
|
-
"lint:js": "eslint --ext .js,.ts .",
|
|
48
|
+
"lint:js": "eslint --ext .js,.ts --report-unused-disable-directives .",
|
|
49
49
|
"lint:other": "npm run prettier -- --check",
|
|
50
50
|
"prettier": "prettier '**/*.{md,yaml,yml,json}'",
|
|
51
51
|
"typecheck": "tsc --noEmit",
|
|
@@ -57,43 +57,43 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@aws-sdk/client-s3": "^3.353.0",
|
|
60
|
-
"@babel/core": "^7.
|
|
60
|
+
"@babel/core": "^7.22.0",
|
|
61
61
|
"@babel/helper-plugin-utils": "^7.22.5",
|
|
62
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
63
|
-
"@babel/plugin-
|
|
64
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
65
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
66
|
-
"@babel/preset-env": "^7.
|
|
67
|
-
"@babel/preset-react": "^7.
|
|
68
|
-
"@babel/preset-typescript": "^7.
|
|
69
|
-
"@babel/runtime": "^7.
|
|
70
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.
|
|
71
|
-
"@statoscope/webpack-plugin": "^5.
|
|
72
|
-
"@svgr/core": "^8.
|
|
73
|
-
"@svgr/plugin-jsx": "^8.0
|
|
74
|
-
"@svgr/webpack": "^8.0
|
|
75
|
-
"babel-loader": "^9.1.
|
|
62
|
+
"@babel/plugin-proposal-decorators": "^7.22.0",
|
|
63
|
+
"@babel/plugin-transform-dynamic-import": "^7.22.0",
|
|
64
|
+
"@babel/plugin-transform-modules-commonjs": "^7.22.0",
|
|
65
|
+
"@babel/plugin-transform-runtime": "^7.22.0",
|
|
66
|
+
"@babel/preset-env": "^7.22.0",
|
|
67
|
+
"@babel/preset-react": "^7.22.0",
|
|
68
|
+
"@babel/preset-typescript": "^7.22.0",
|
|
69
|
+
"@babel/runtime": "^7.22.0",
|
|
70
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
|
71
|
+
"@statoscope/webpack-plugin": "^5.27.0",
|
|
72
|
+
"@svgr/core": "^8.1.0",
|
|
73
|
+
"@svgr/plugin-jsx": "^8.1.0",
|
|
74
|
+
"@svgr/webpack": "^8.1.0",
|
|
75
|
+
"babel-loader": "^9.1.3",
|
|
76
76
|
"babel-plugin-import": "^1.13.8",
|
|
77
77
|
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
78
78
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
79
|
-
"browserslist": "^4.21.
|
|
79
|
+
"browserslist": "^4.21.10",
|
|
80
80
|
"chalk": "^4.1.2",
|
|
81
81
|
"circular-dependency-plugin": "^5.2.2",
|
|
82
82
|
"clean-webpack-plugin": "^4.0.0",
|
|
83
83
|
"clear": "^0.1.0",
|
|
84
84
|
"common-tags": "^1.8.2",
|
|
85
85
|
"cosmiconfig": "^8.1.3",
|
|
86
|
-
"cosmiconfig-typescript-loader": "^
|
|
86
|
+
"cosmiconfig-typescript-loader": "^5.0.0",
|
|
87
87
|
"css-loader": "^6.8.1",
|
|
88
88
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
89
89
|
"dotenv": "^16.3.1",
|
|
90
90
|
"execa": "^5.1.1",
|
|
91
|
-
"fast-glob": "^3.
|
|
91
|
+
"fast-glob": "^3.3.1",
|
|
92
92
|
"file-type": "^16.5.3",
|
|
93
93
|
"find-cache-dir": "^3.3.2",
|
|
94
94
|
"fork-ts-checker-webpack-plugin": "^8.0.0",
|
|
95
95
|
"fs-extra": "^11.1.1",
|
|
96
|
-
"get-port": "^
|
|
96
|
+
"get-port": "^7.0.0",
|
|
97
97
|
"lightningcss": "^1.21.5",
|
|
98
98
|
"lodash": "^4.17.21",
|
|
99
99
|
"mime-types": "^2.1.35",
|
|
@@ -102,61 +102,60 @@
|
|
|
102
102
|
"nodemon": "^3.0.1",
|
|
103
103
|
"p-map": "^4.0.0",
|
|
104
104
|
"p-queue": "^6.6.2",
|
|
105
|
-
"pino-pretty": "^10.
|
|
105
|
+
"pino-pretty": "^10.2.0",
|
|
106
106
|
"postcss": "^8.4.23",
|
|
107
|
-
"postcss-loader": "^7.3.
|
|
107
|
+
"postcss-loader": "^7.3.3",
|
|
108
108
|
"postcss-preset-env": "^8.4.2",
|
|
109
109
|
"react": "^18.2.0",
|
|
110
110
|
"react-dom": "^18.2.0",
|
|
111
111
|
"react-refresh": "^0.14.0",
|
|
112
112
|
"resolve-url-loader": "^5.0.0",
|
|
113
|
-
"rimraf": "^5.0.
|
|
113
|
+
"rimraf": "^5.0.1",
|
|
114
114
|
"sass": "^1.62.1",
|
|
115
|
-
"sass-loader": "^13.3.
|
|
115
|
+
"sass-loader": "^13.3.2",
|
|
116
116
|
"semver": "^7.5.4",
|
|
117
|
-
"signal-exit": "^
|
|
117
|
+
"signal-exit": "^4.1.0",
|
|
118
118
|
"source-map-loader": "^4.0.1",
|
|
119
119
|
"strip-ansi": "^6.0.1",
|
|
120
120
|
"style-loader": "^3.3.3",
|
|
121
121
|
"svgo": "^3.0.2",
|
|
122
122
|
"terser-webpack-plugin": "5.3.9",
|
|
123
123
|
"ts-node": "10.9.1",
|
|
124
|
-
"tslib": "^2.6.
|
|
124
|
+
"tslib": "^2.6.2",
|
|
125
125
|
"typescript": "^5.1.6",
|
|
126
|
-
"webpack": "^5.88.
|
|
126
|
+
"webpack": "^5.88.2",
|
|
127
127
|
"webpack-assets-manifest": "^5.1.0",
|
|
128
|
-
"webpack-bundle-analyzer": "^4.9.
|
|
129
|
-
"webpack-dev-server": "^4.15.
|
|
128
|
+
"webpack-bundle-analyzer": "^4.9.1",
|
|
129
|
+
"webpack-dev-server": "^4.15.1",
|
|
130
130
|
"webpack-manifest-plugin": "^5.0.0",
|
|
131
131
|
"worker-loader": "^3.0.8",
|
|
132
132
|
"yargs": "^17.7.2"
|
|
133
133
|
},
|
|
134
134
|
"devDependencies": {
|
|
135
|
-
"@commitlint/cli": "^17.
|
|
136
|
-
"@commitlint/config-conventional": "^17.
|
|
135
|
+
"@commitlint/cli": "^17.7.1",
|
|
136
|
+
"@commitlint/config-conventional": "^17.7.0",
|
|
137
137
|
"@gravity-ui/eslint-config": "^1.0.2",
|
|
138
138
|
"@gravity-ui/prettier-config": "^1.0.1",
|
|
139
139
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
140
|
-
"@types/babel__helper-plugin-utils": "^7.10.
|
|
141
|
-
"@types/circular-dependency-plugin": "^5.0.
|
|
142
|
-
"@types/common-tags": "^1.8.
|
|
140
|
+
"@types/babel__helper-plugin-utils": "^7.10.1",
|
|
141
|
+
"@types/circular-dependency-plugin": "^5.0.6",
|
|
142
|
+
"@types/common-tags": "^1.8.2",
|
|
143
143
|
"@types/find-cache-dir": "^3.2.1",
|
|
144
|
-
"@types/fs-extra": "^11.0.
|
|
144
|
+
"@types/fs-extra": "^11.0.2",
|
|
145
145
|
"@types/jest": "^29.5.2",
|
|
146
|
-
"@types/lodash": "^4.14.
|
|
146
|
+
"@types/lodash": "^4.14.198",
|
|
147
147
|
"@types/mime-types": "^2.1.1",
|
|
148
148
|
"@types/node": "^14.18.45",
|
|
149
149
|
"@types/nodemon": "^1.19.2",
|
|
150
150
|
"@types/sass": "^1.45.0",
|
|
151
|
-
"@types/semver": "^7.5.
|
|
152
|
-
"@types/signal-exit": "^3.0.1",
|
|
151
|
+
"@types/semver": "^7.5.2",
|
|
153
152
|
"@types/terser-webpack-plugin": "^5.2.0",
|
|
154
153
|
"@types/webpack-assets-manifest": "^5.1.0",
|
|
155
154
|
"@types/webpack-bundle-analyzer": "^4.6.0",
|
|
156
155
|
"@types/webpack-manifest-plugin": "^3.0.5",
|
|
157
156
|
"@types/yargs": "17.0.11",
|
|
158
157
|
"babel-plugin-tester": "^11.0.4",
|
|
159
|
-
"eslint": "^8.
|
|
158
|
+
"eslint": "^8.49.0",
|
|
160
159
|
"husky": "^8.0.3",
|
|
161
160
|
"jest": "^29.5.0",
|
|
162
161
|
"monaco-editor-webpack-plugin": "^6.0.0",
|