@gravity-ui/app-builder 0.9.3 → 0.10.0-beta.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.
- package/dist/commands/build/build-service/server.js +9 -1
- package/dist/commands/dev/client.js +25 -27
- package/dist/commands/dev/server.js +10 -2
- package/dist/common/webpack/utils.js +1 -1
- package/dist/common/webpack/worker/web-worker.d.mts +1 -1
- package/dist/common/webpack/worker/web-worker.mjs +0 -1
- package/dist/create-cli.d.ts +2 -2
- package/package.json +60 -63
|
@@ -12,7 +12,15 @@ function buildServer(config) {
|
|
|
12
12
|
(0, utils_1.createRunFolder)();
|
|
13
13
|
return new Promise((resolve, reject) => {
|
|
14
14
|
const build = new controllable_script_1.ControllableScript(`
|
|
15
|
-
|
|
15
|
+
let ts;
|
|
16
|
+
try {
|
|
17
|
+
ts = require('typescript');
|
|
18
|
+
} catch (e) {
|
|
19
|
+
if (e.code !== 'MODULE_NOT_FOUND') {
|
|
20
|
+
throw e;
|
|
21
|
+
}
|
|
22
|
+
ts = require(${JSON.stringify(require.resolve('typescript'))});
|
|
23
|
+
}
|
|
16
24
|
const {Logger} = require(${JSON.stringify(require.resolve('../../../common/logger'))});
|
|
17
25
|
const {compile} = require(${JSON.stringify(require.resolve('../../../common/typescript/compile'))});
|
|
18
26
|
|
|
@@ -81,38 +81,36 @@ async function buildWebpackServer(config) {
|
|
|
81
81
|
if (!listenOn) {
|
|
82
82
|
options.ipc = path.resolve(paths_1.default.appDist, 'run/client.sock');
|
|
83
83
|
}
|
|
84
|
+
const proxy = options.proxy || [];
|
|
84
85
|
if (config.client.lazyCompilation) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
};
|
|
86
|
+
proxy.push({
|
|
87
|
+
context: ['/build/lazy'],
|
|
88
|
+
target: `http://localhost:${config.client.lazyCompilation.port}`,
|
|
89
|
+
pathRewrite: { '^/build/lazy': '' },
|
|
90
|
+
});
|
|
92
91
|
}
|
|
93
92
|
if (config.server.port) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return req.path;
|
|
112
|
-
},
|
|
93
|
+
proxy.push({
|
|
94
|
+
context: ['/'],
|
|
95
|
+
target: `http://localhost:${config.server.port}`,
|
|
96
|
+
bypass: (req) => {
|
|
97
|
+
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
const pathname = req.path.replace(/^\//, '');
|
|
101
|
+
const filepath = path.resolve(paths_1.default.appDist, 'public', pathname);
|
|
102
|
+
if (!fs.existsSync(filepath)) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const stat = fs.statSync(filepath);
|
|
106
|
+
if (!stat.isFile()) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
return req.path;
|
|
113
110
|
},
|
|
114
|
-
};
|
|
111
|
+
});
|
|
115
112
|
}
|
|
113
|
+
options.proxy = proxy;
|
|
116
114
|
const compiler = (0, webpack_1.default)(webpackConfig);
|
|
117
115
|
const server = new webpack_dev_server_1.default(options, compiler);
|
|
118
116
|
try {
|
|
@@ -37,7 +37,15 @@ function watchServerCompilation(config) {
|
|
|
37
37
|
rimraf_1.rimraf.sync(serverPath);
|
|
38
38
|
(0, utils_1.createRunFolder)();
|
|
39
39
|
const build = new controllable_script_1.ControllableScript(`
|
|
40
|
-
|
|
40
|
+
let ts;
|
|
41
|
+
try {
|
|
42
|
+
ts = require('typescript');
|
|
43
|
+
} catch (e) {
|
|
44
|
+
if (e.code !== 'MODULE_NOT_FOUND') {
|
|
45
|
+
throw e;
|
|
46
|
+
}
|
|
47
|
+
ts = require(${JSON.stringify(require.resolve('typescript'))});
|
|
48
|
+
}
|
|
41
49
|
const {Logger} = require(${JSON.stringify(require.resolve('../../common/logger'))});
|
|
42
50
|
const {watch} = require(${JSON.stringify(require.resolve('../../common/typescript/watch'))});
|
|
43
51
|
|
|
@@ -50,7 +58,7 @@ function watchServerCompilation(config) {
|
|
|
50
58
|
onAfterFilesEmitted: () => {
|
|
51
59
|
process.send({type: 'Emitted'});
|
|
52
60
|
},
|
|
53
|
-
enableSourceMap:
|
|
61
|
+
enableSourceMap: true
|
|
54
62
|
}
|
|
55
63
|
);
|
|
56
64
|
`, null);
|
|
@@ -51,7 +51,7 @@ function webpackCompilerHandlerFactory(logger, onCompilationEnd) {
|
|
|
51
51
|
}
|
|
52
52
|
if (stats) {
|
|
53
53
|
const time = stats.endTime - stats.startTime;
|
|
54
|
-
logger.success(`Client was successfully compiled in ${(0, pretty_time_1.prettyTime)(BigInt(time) * BigInt(
|
|
54
|
+
logger.success(`Client was successfully compiled in ${(0, pretty_time_1.prettyTime)(BigInt(time) * BigInt(1_000_000))}`);
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
57
|
logger.success(`Client was successfully compiled`);
|
|
@@ -3,6 +3,6 @@ declare class WebWorker extends Worker {
|
|
|
3
3
|
constructor(url: string | URL, options?: WorkerOptions);
|
|
4
4
|
}
|
|
5
5
|
declare class SharedWebWorker extends SharedWorkerPolyfill {
|
|
6
|
-
constructor(url: string | URL, options?:
|
|
6
|
+
constructor(url: string | URL, options?: WorkerOptions);
|
|
7
7
|
}
|
|
8
8
|
export { WebWorker as Worker, SharedWebWorker as SharedWorker };
|
package/dist/create-cli.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ export type CliArgs = Awaited<ReturnType<typeof createCli>>;
|
|
|
2
2
|
export declare function createCli(argv: string[]): {
|
|
3
3
|
[x: string]: unknown;
|
|
4
4
|
verbose: boolean | undefined;
|
|
5
|
-
c: unknown;
|
|
6
5
|
cdn: string | undefined;
|
|
7
6
|
env: string[] | undefined;
|
|
8
7
|
target: "client" | "server" | undefined;
|
|
9
8
|
inspect: number | undefined;
|
|
9
|
+
c: unknown;
|
|
10
10
|
inspectBrk: number | undefined;
|
|
11
11
|
"inspect-brk": number | undefined;
|
|
12
12
|
entryFilter: string[] | undefined;
|
|
@@ -30,11 +30,11 @@ export declare function createCli(argv: string[]): {
|
|
|
30
30
|
} | Promise<{
|
|
31
31
|
[x: string]: unknown;
|
|
32
32
|
verbose: boolean | undefined;
|
|
33
|
-
c: unknown;
|
|
34
33
|
cdn: string | undefined;
|
|
35
34
|
env: string[] | undefined;
|
|
36
35
|
target: "client" | "server" | undefined;
|
|
37
36
|
inspect: number | undefined;
|
|
37
|
+
c: unknown;
|
|
38
38
|
inspectBrk: number | undefined;
|
|
39
39
|
"inspect-brk": number | undefined;
|
|
40
40
|
entryFilter: string[] | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/app-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0-beta.0",
|
|
4
4
|
"description": "Develop and build your React client-server projects, powered by typescript and webpack",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/gravity-ui/app-builder#readme",
|
|
46
46
|
"scripts": {
|
|
47
|
-
"prepare": "husky
|
|
47
|
+
"prepare": "husky",
|
|
48
48
|
"lint": "run-p lint:*",
|
|
49
49
|
"lint:js": "eslint --ext .js,.ts --report-unused-disable-directives .",
|
|
50
50
|
"lint:other": "npm run prettier -- --check",
|
|
@@ -58,20 +58,20 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@aws-sdk/client-s3": "^3.353.0",
|
|
61
|
-
"@babel/core": "^7.
|
|
62
|
-
"@babel/helper-plugin-utils": "^7.
|
|
63
|
-
"@babel/plugin-transform-class-properties": "^7.
|
|
64
|
-
"@babel/plugin-transform-dynamic-import": "^7.
|
|
65
|
-
"@babel/plugin-transform-modules-commonjs": "^7.
|
|
66
|
-
"@babel/plugin-transform-private-methods": "^7.24.
|
|
67
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
68
|
-
"@babel/preset-env": "^7.
|
|
69
|
-
"@babel/preset-react": "^7.
|
|
70
|
-
"@babel/preset-typescript": "^7.
|
|
71
|
-
"@babel/runtime": "^7.
|
|
72
|
-
"@okikio/sharedworker": "^1.0.
|
|
73
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.
|
|
74
|
-
"@statoscope/webpack-plugin": "^5.
|
|
61
|
+
"@babel/core": "^7.24.0",
|
|
62
|
+
"@babel/helper-plugin-utils": "^7.24.0",
|
|
63
|
+
"@babel/plugin-transform-class-properties": "^7.24.0",
|
|
64
|
+
"@babel/plugin-transform-dynamic-import": "^7.24.0",
|
|
65
|
+
"@babel/plugin-transform-modules-commonjs": "^7.24.0",
|
|
66
|
+
"@babel/plugin-transform-private-methods": "^7.24.0",
|
|
67
|
+
"@babel/plugin-transform-runtime": "^7.24.0",
|
|
68
|
+
"@babel/preset-env": "^7.24.0",
|
|
69
|
+
"@babel/preset-react": "^7.24.0",
|
|
70
|
+
"@babel/preset-typescript": "^7.24.0",
|
|
71
|
+
"@babel/runtime": "^7.24.0",
|
|
72
|
+
"@okikio/sharedworker": "^1.0.7",
|
|
73
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.13",
|
|
74
|
+
"@statoscope/webpack-plugin": "^5.28.2",
|
|
75
75
|
"@svgr/core": "^8.1.0",
|
|
76
76
|
"@svgr/plugin-jsx": "^8.1.0",
|
|
77
77
|
"@svgr/webpack": "^8.1.0",
|
|
@@ -79,92 +79,92 @@
|
|
|
79
79
|
"babel-plugin-import": "^1.13.8",
|
|
80
80
|
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
81
81
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
82
|
-
"browserslist": "^4.
|
|
82
|
+
"browserslist": "^4.23.0",
|
|
83
83
|
"chalk": "^4.1.2",
|
|
84
84
|
"circular-dependency-plugin": "^5.2.2",
|
|
85
85
|
"clean-webpack-plugin": "^4.0.0",
|
|
86
86
|
"clear": "^0.1.0",
|
|
87
87
|
"common-tags": "^1.8.2",
|
|
88
|
-
"cosmiconfig": "^8.
|
|
88
|
+
"cosmiconfig": "^8.3.6",
|
|
89
89
|
"cosmiconfig-typescript-loader": "^5.0.0",
|
|
90
|
-
"css-loader": "^
|
|
91
|
-
"css-minimizer-webpack-plugin": "^
|
|
92
|
-
"dotenv": "^16.
|
|
90
|
+
"css-loader": "^7.1.1",
|
|
91
|
+
"css-minimizer-webpack-plugin": "^6.0.0",
|
|
92
|
+
"dotenv": "^16.4.5",
|
|
93
93
|
"execa": "^5.1.1",
|
|
94
|
-
"fast-glob": "^3.3.
|
|
94
|
+
"fast-glob": "^3.3.2",
|
|
95
95
|
"file-type": "^16.5.3",
|
|
96
96
|
"find-cache-dir": "^3.3.2",
|
|
97
|
-
"fork-ts-checker-webpack-plugin": "^
|
|
98
|
-
"fs-extra": "^11.
|
|
99
|
-
"get-port": "^7.
|
|
97
|
+
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
|
98
|
+
"fs-extra": "^11.2.0",
|
|
99
|
+
"get-port": "^7.1.0",
|
|
100
100
|
"lodash": "^4.17.21",
|
|
101
101
|
"mime-types": "^2.1.35",
|
|
102
|
-
"mini-css-extract-plugin": "^2.
|
|
102
|
+
"mini-css-extract-plugin": "^2.9.0",
|
|
103
103
|
"moment-timezone-data-webpack-plugin": "^1.5.1",
|
|
104
|
-
"nodemon": "^3.0
|
|
104
|
+
"nodemon": "^3.1.0",
|
|
105
105
|
"p-map": "^4.0.0",
|
|
106
106
|
"p-queue": "^6.6.2",
|
|
107
|
-
"pino-pretty": "^
|
|
108
|
-
"postcss": "^8.4.
|
|
109
|
-
"postcss-loader": "^
|
|
107
|
+
"pino-pretty": "^11.0.0",
|
|
108
|
+
"postcss": "^8.4.38",
|
|
109
|
+
"postcss-loader": "^8.1.1",
|
|
110
110
|
"postcss-preset-env": "^9.1.3",
|
|
111
|
-
"react": "^18.
|
|
112
|
-
"react-dom": "^18.
|
|
113
|
-
"react-refresh": "^0.14.
|
|
111
|
+
"react": "^18.3.1",
|
|
112
|
+
"react-dom": "^18.3.1",
|
|
113
|
+
"react-refresh": "^0.14.2",
|
|
114
114
|
"resolve-url-loader": "^5.0.0",
|
|
115
|
-
"rimraf": "^5.0.
|
|
116
|
-
"sass": "^1.
|
|
117
|
-
"sass-loader": "^
|
|
118
|
-
"semver": "^7.
|
|
115
|
+
"rimraf": "^5.0.5",
|
|
116
|
+
"sass": "^1.75.0",
|
|
117
|
+
"sass-loader": "^14.2.1",
|
|
118
|
+
"semver": "^7.6.0",
|
|
119
119
|
"signal-exit": "^4.1.0",
|
|
120
|
-
"source-map-loader": "^
|
|
120
|
+
"source-map-loader": "^5.0.0",
|
|
121
121
|
"strip-ansi": "^6.0.1",
|
|
122
|
-
"style-loader": "^
|
|
123
|
-
"svgo": "^3.0
|
|
122
|
+
"style-loader": "^4.0.0",
|
|
123
|
+
"svgo": "^3.2.0",
|
|
124
124
|
"terser-webpack-plugin": "5.3.10",
|
|
125
125
|
"ts-node": "10.9.2",
|
|
126
126
|
"tslib": "^2.6.2",
|
|
127
|
-
"typescript": "^5.
|
|
127
|
+
"typescript": "^5.4.5",
|
|
128
128
|
"webpack": "^5.91.0",
|
|
129
129
|
"webpack-assets-manifest": "^5.2.1",
|
|
130
|
-
"webpack-bundle-analyzer": "^4.10.
|
|
131
|
-
"webpack-dev-server": "^
|
|
130
|
+
"webpack-bundle-analyzer": "^4.10.2",
|
|
131
|
+
"webpack-dev-server": "^5.0.4",
|
|
132
132
|
"webpack-manifest-plugin": "^5.0.0",
|
|
133
133
|
"worker-loader": "^3.0.8",
|
|
134
134
|
"yargs": "^17.7.2"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
|
-
"@commitlint/cli": "^
|
|
138
|
-
"@commitlint/config-conventional": "^
|
|
139
|
-
"@gravity-ui/eslint-config": "^3.
|
|
137
|
+
"@commitlint/cli": "^19.3.0",
|
|
138
|
+
"@commitlint/config-conventional": "^19.2.2",
|
|
139
|
+
"@gravity-ui/eslint-config": "^3.2.0",
|
|
140
140
|
"@gravity-ui/prettier-config": "^1.1.0",
|
|
141
141
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
142
142
|
"@sentry/webpack-plugin": "^2.7.1",
|
|
143
|
-
"@types/babel__helper-plugin-utils": "^7.10.
|
|
144
|
-
"@types/circular-dependency-plugin": "^5.0.
|
|
145
|
-
"@types/common-tags": "^1.8.
|
|
143
|
+
"@types/babel__helper-plugin-utils": "^7.10.3",
|
|
144
|
+
"@types/circular-dependency-plugin": "^5.0.8",
|
|
145
|
+
"@types/common-tags": "^1.8.4",
|
|
146
146
|
"@types/find-cache-dir": "^3.2.1",
|
|
147
|
-
"@types/fs-extra": "^11.0.
|
|
147
|
+
"@types/fs-extra": "^11.0.4",
|
|
148
148
|
"@types/jest": "^29.5.2",
|
|
149
|
-
"@types/lodash": "^4.
|
|
150
|
-
"@types/mime-types": "^2.1.
|
|
149
|
+
"@types/lodash": "^4.17.0",
|
|
150
|
+
"@types/mime-types": "^2.1.4",
|
|
151
151
|
"@types/node": "^18",
|
|
152
|
-
"@types/nodemon": "^1.19.
|
|
153
|
-
"@types/semver": "^7.5.
|
|
154
|
-
"@types/webpack-assets-manifest": "^5.1.
|
|
155
|
-
"@types/webpack-bundle-analyzer": "^4.
|
|
156
|
-
"@types/webpack-manifest-plugin": "^3.0.
|
|
152
|
+
"@types/nodemon": "^1.19.6",
|
|
153
|
+
"@types/semver": "^7.5.8",
|
|
154
|
+
"@types/webpack-assets-manifest": "^5.1.4",
|
|
155
|
+
"@types/webpack-bundle-analyzer": "^4.7.0",
|
|
156
|
+
"@types/webpack-manifest-plugin": "^3.0.8",
|
|
157
157
|
"@types/yargs": "17.0.11",
|
|
158
158
|
"babel-plugin-tester": "^11.0.4",
|
|
159
159
|
"eslint": "^8.49.0",
|
|
160
|
-
"husky": "^
|
|
160
|
+
"husky": "^9.0.11",
|
|
161
161
|
"jest": "^29.5.0",
|
|
162
162
|
"lightningcss": "^1.21.5",
|
|
163
163
|
"monaco-editor-webpack-plugin": "^6.0.0",
|
|
164
164
|
"nano-staged": "^0.8.0",
|
|
165
165
|
"npm-run-all": "^4.1.5",
|
|
166
|
-
"prettier": "3.
|
|
167
|
-
"ts-jest": "^29.1.
|
|
166
|
+
"prettier": "3.2.5",
|
|
167
|
+
"ts-jest": "^29.1.2"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"@sentry/webpack-plugin": "^2.7.1",
|
|
@@ -189,8 +189,5 @@
|
|
|
189
189
|
"*.{md,yaml,yml,json}": [
|
|
190
190
|
"prettier --write"
|
|
191
191
|
]
|
|
192
|
-
},
|
|
193
|
-
"overrides": {
|
|
194
|
-
"cosmiconfig-typescript-loader": "^5.0.0"
|
|
195
192
|
}
|
|
196
193
|
}
|