@gravity-ui/app-builder 0.1.1 → 0.2.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 +16 -0
- package/dist/commands/dev/client.js +1 -0
- package/dist/common/library/index.js +4 -1
- package/dist/common/models/index.d.ts +8 -7
- package/dist/common/typescript/watch.js +1 -1
- package/dist/common/webpack/config.js +34 -16
- package/dist/common/webpack/utils.js +1 -1
- package/dist/create-cli.js +2 -0
- package/package.json +41 -40
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.1](https://github.com/gravity-ui/app-builder/compare/v0.2.0...v0.2.1) (2023-04-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **cli:** correctly consider --inspect/--inspect-brk options without value ([#11](https://github.com/gravity-ui/app-builder/issues/11)) ([a5c74c3](https://github.com/gravity-ui/app-builder/commit/a5c74c39e64d6fc57bf10eb3e49596d96a9e8dcb))
|
|
9
|
+
* sove fixes ([#13](https://github.com/gravity-ui/app-builder/issues/13)) ([e4f9e1a](https://github.com/gravity-ui/app-builder/commit/e4f9e1a14c9e71197e91586a9c254db880f8ac11))
|
|
10
|
+
|
|
11
|
+
## [0.2.0](https://github.com/gravity-ui/app-builder/compare/v0.1.1...v0.2.0) (2023-03-10)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* allow upload to many s3 destinations ([#7](https://github.com/gravity-ui/app-builder/issues/7)) ([406c4b2](https://github.com/gravity-ui/app-builder/commit/406c4b2362793528f85384ec3247f49ce8cbda16))
|
|
17
|
+
* enable verbose mode in `CleanWebpackPlugin` ([#5](https://github.com/gravity-ui/app-builder/issues/5)) ([945f28a](https://github.com/gravity-ui/app-builder/commit/945f28a0875312256af143ca5e98c42fe414691f))
|
|
18
|
+
|
|
3
19
|
## [0.1.1](https://github.com/gravity-ui/app-builder/compare/v0.1.0...v0.1.1) (2023-03-10)
|
|
4
20
|
|
|
5
21
|
|
|
@@ -76,7 +76,10 @@ function compileToCjs(code, file, inputSourceMap, sourceDir = paths_1.default.sr
|
|
|
76
76
|
fs_1.default.mkdirSync(compiledCjsDir, { recursive: true });
|
|
77
77
|
babel.transform(finalCode, {
|
|
78
78
|
filename: sourceFile,
|
|
79
|
-
plugins: [
|
|
79
|
+
plugins: [
|
|
80
|
+
'@babel/plugin-transform-modules-commonjs',
|
|
81
|
+
'@babel/plugin-proposal-dynamic-import',
|
|
82
|
+
],
|
|
80
83
|
sourceMaps: true,
|
|
81
84
|
inputSourceMap,
|
|
82
85
|
}, (err, transformedCjs) => {
|
|
@@ -138,13 +138,14 @@ export interface ClientConfig {
|
|
|
138
138
|
};
|
|
139
139
|
definitions?: DefinePlugin['definitions'];
|
|
140
140
|
watchOptions?: Configuration['watchOptions'];
|
|
141
|
-
cdn?:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
cdn?: CdnUploadConfig | CdnUploadConfig[];
|
|
142
|
+
}
|
|
143
|
+
interface CdnUploadConfig {
|
|
144
|
+
bucket: string;
|
|
145
|
+
prefix?: string;
|
|
146
|
+
region?: string;
|
|
147
|
+
endpoint?: string;
|
|
148
|
+
compress?: boolean;
|
|
148
149
|
}
|
|
149
150
|
export interface ServerConfig {
|
|
150
151
|
port?: number | true;
|
|
@@ -14,7 +14,7 @@ function watch(ts, projectPath, { logger, onAfterFilesEmitted, enableSourceMap,
|
|
|
14
14
|
getCurrentDirectory: ts.sys.getCurrentDirectory,
|
|
15
15
|
getNewLine: () => ts.sys.newLine,
|
|
16
16
|
};
|
|
17
|
-
const host = ts.createWatchCompilerHost(configPath, { noEmitOnError: false, inlineSourceMap: enableSourceMap, inlineSources: enableSourceMap }, ts.sys, createProgram, reportDiagnostic, reportWatchStatusChanged);
|
|
17
|
+
const host = ts.createWatchCompilerHost(configPath, Object.assign({ noEmitOnError: false, inlineSourceMap: enableSourceMap, inlineSources: enableSourceMap }, (enableSourceMap ? { sourceMap: false } : undefined)), ts.sys, createProgram, reportDiagnostic, reportWatchStatusChanged);
|
|
18
18
|
host.readFile = (0, utils_1.displayFilename)(host.readFile, 'Reading', logger);
|
|
19
19
|
(0, utils_1.onHostEvent)(host, 'createProgram', () => {
|
|
20
20
|
logger.verbose("We're about to create the program");
|
|
@@ -484,6 +484,7 @@ function configurePlugins(options) {
|
|
|
484
484
|
const excludeFromClean = config.excludeFromClean || [];
|
|
485
485
|
const plugins = [
|
|
486
486
|
new clean_webpack_plugin_1.CleanWebpackPlugin({
|
|
487
|
+
verbose: config.verbose,
|
|
487
488
|
cleanOnceBeforeBuildPatterns: [
|
|
488
489
|
'**/*',
|
|
489
490
|
...(isEnvDevelopment ? ['!manifest.json'] : []),
|
|
@@ -523,7 +524,8 @@ function configurePlugins(options) {
|
|
|
523
524
|
publicPath: path_1.default.normalize(config.publicPathPrefix + '/build/') })));
|
|
524
525
|
}
|
|
525
526
|
if (isEnvDevelopment && !config.disableReactRefresh) {
|
|
526
|
-
|
|
527
|
+
const { webSocketPath = path_1.default.normalize(`/${config.publicPathPrefix}/build/sockjs-node`) } = config.devServer || {};
|
|
528
|
+
plugins.push(new react_refresh_webpack_plugin_1.default({ overlay: { sockPath: webSocketPath } }));
|
|
527
529
|
}
|
|
528
530
|
if (config.detectCircularDependencies) {
|
|
529
531
|
let circularPluginOptions = {
|
|
@@ -596,26 +598,42 @@ function configurePlugins(options) {
|
|
|
596
598
|
output: path_1.default.resolve(paths_1.default.appBuild, manifestFile),
|
|
597
599
|
}));
|
|
598
600
|
if (config.cdn) {
|
|
599
|
-
let
|
|
601
|
+
let credentialsGlobal;
|
|
600
602
|
if (process.env.FRONTEND_S3_ACCESS_KEY_ID && process.env.FRONTEND_S3_SECRET_ACCESS_KEY) {
|
|
601
|
-
|
|
603
|
+
credentialsGlobal = {
|
|
602
604
|
accessKeyId: process.env.FRONTEND_S3_ACCESS_KEY_ID,
|
|
603
605
|
secretAccessKey: process.env.FRONTEND_S3_SECRET_ACCESS_KEY,
|
|
604
606
|
};
|
|
605
607
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
608
|
+
const cdns = Array.isArray(config.cdn) ? config.cdn : [config.cdn];
|
|
609
|
+
for (let index = 0; index < cdns.length; index++) {
|
|
610
|
+
const cdn = cdns[index];
|
|
611
|
+
if (!cdn) {
|
|
612
|
+
continue;
|
|
613
|
+
}
|
|
614
|
+
let credentials = credentialsGlobal;
|
|
615
|
+
const accessKeyId = process.env[`FRONTEND_S3_ACCESS_KEY_ID_${index}`];
|
|
616
|
+
const secretAccessKey = process.env[`FRONTEND_S3_SECRET_ACCESS_KEY_${index}`];
|
|
617
|
+
if (accessKeyId && secretAccessKey) {
|
|
618
|
+
credentials = {
|
|
619
|
+
accessKeyId,
|
|
620
|
+
secretAccessKey,
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
plugins.push(new s3_upload_1.S3UploadPlugin({
|
|
624
|
+
exclude: config.hiddenSourceMap ? /\.map$/ : undefined,
|
|
625
|
+
compress: cdn.compress,
|
|
626
|
+
s3ClientOptions: {
|
|
627
|
+
region: cdn.region,
|
|
628
|
+
endpoint: cdn.endpoint,
|
|
629
|
+
credentials,
|
|
630
|
+
},
|
|
631
|
+
s3UploadOptions: {
|
|
632
|
+
bucket: cdn.bucket,
|
|
633
|
+
targetPath: cdn.prefix,
|
|
634
|
+
},
|
|
635
|
+
}));
|
|
636
|
+
}
|
|
619
637
|
}
|
|
620
638
|
return plugins;
|
|
621
639
|
}
|
|
@@ -45,7 +45,7 @@ function resolveTsconfigPathsToAlias(tsConfigPath) {
|
|
|
45
45
|
}
|
|
46
46
|
const basePath = path_1.default.resolve(path_1.default.dirname(tsConfigPath), baseUrl);
|
|
47
47
|
const aliases = {};
|
|
48
|
-
const modules = [];
|
|
48
|
+
const modules = [basePath];
|
|
49
49
|
for (const [key, value] of Object.entries(paths)) {
|
|
50
50
|
if (!Array.isArray(value) || value.length === 0) {
|
|
51
51
|
continue;
|
package/dist/create-cli.js
CHANGED
|
@@ -86,11 +86,13 @@ function createCli(argv) {
|
|
|
86
86
|
group: 'Server',
|
|
87
87
|
type: 'number',
|
|
88
88
|
describe: 'Opens a port for debugging',
|
|
89
|
+
coerce: (arg) => (arg === undefined ? null : arg),
|
|
89
90
|
})
|
|
90
91
|
.option('inspect-brk', {
|
|
91
92
|
group: 'Server',
|
|
92
93
|
type: 'number',
|
|
93
94
|
describe: 'Opens a port for debugging. Will block until debugger is attached',
|
|
95
|
+
coerce: (arg) => (arg === undefined ? null : arg),
|
|
94
96
|
})
|
|
95
97
|
.option('entry-filter', {
|
|
96
98
|
group: 'Client',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/app-builder",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,20 +37,22 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@aws-sdk/client-s3": "^3.216.0",
|
|
40
|
-
"@babel/core": "^7.
|
|
41
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
42
|
-
"@babel/plugin-
|
|
43
|
-
"@babel/plugin-transform-
|
|
40
|
+
"@babel/core": "^7.21.0",
|
|
41
|
+
"@babel/plugin-proposal-decorators": "^7.21.0",
|
|
42
|
+
"@babel/plugin-proposal-dynamic-import": "^7.18.6",
|
|
43
|
+
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
|
|
44
|
+
"@babel/plugin-transform-runtime": "^7.21.0",
|
|
44
45
|
"@babel/preset-env": "^7.20.2",
|
|
45
46
|
"@babel/preset-react": "^7.18.6",
|
|
46
|
-
"@babel/preset-typescript": "^7.
|
|
47
|
-
"@babel/runtime": "^7.
|
|
47
|
+
"@babel/preset-typescript": "^7.21.0",
|
|
48
|
+
"@babel/runtime": "^7.21.0",
|
|
48
49
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
|
49
|
-
"@statoscope/webpack-plugin": "^5.
|
|
50
|
+
"@statoscope/webpack-plugin": "^5.25.1",
|
|
50
51
|
"@svgr/core": "^6.5.1",
|
|
51
52
|
"@svgr/webpack": "^6.5.1",
|
|
52
|
-
"babel-loader": "^9.1.
|
|
53
|
-
"babel-plugin-
|
|
53
|
+
"babel-loader": "^9.1.2",
|
|
54
|
+
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
55
|
+
"babel-plugin-inline-react-svg": "^2.0.2",
|
|
54
56
|
"babel-plugin-lodash": "^3.3.4",
|
|
55
57
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
56
58
|
"chalk": "^4.1.2",
|
|
@@ -59,33 +61,33 @@
|
|
|
59
61
|
"clear": "^0.1.0",
|
|
60
62
|
"common-tags": "^1.8.2",
|
|
61
63
|
"cosmiconfig": "^7.1.0",
|
|
62
|
-
"cosmiconfig-typescript-loader": "^4.
|
|
63
|
-
"css-loader": "^6.7.
|
|
64
|
+
"cosmiconfig-typescript-loader": "^4.3.0",
|
|
65
|
+
"css-loader": "^6.7.3",
|
|
64
66
|
"css-minimizer-webpack-plugin": "^4.2.2",
|
|
65
67
|
"dotenv": "^16.0.3",
|
|
66
68
|
"execa": "^5.1.1",
|
|
67
69
|
"fast-glob": "^3.2.12",
|
|
68
70
|
"file-type": "^16.5.3",
|
|
69
|
-
"fork-ts-checker-webpack-plugin": "^7.
|
|
70
|
-
"fs-extra": "^
|
|
71
|
+
"fork-ts-checker-webpack-plugin": "^7.3.0",
|
|
72
|
+
"fs-extra": "^11.1.0",
|
|
71
73
|
"get-port": "^5.1.1",
|
|
72
74
|
"lodash": "^4.17.21",
|
|
73
75
|
"mime-types": "^2.1.35",
|
|
74
|
-
"mini-css-extract-plugin": "^2.7.
|
|
76
|
+
"mini-css-extract-plugin": "^2.7.2",
|
|
75
77
|
"moment-timezone-data-webpack-plugin": "^1.5.1",
|
|
76
78
|
"nodemon": "^2.0.20",
|
|
77
79
|
"p-map": "^4.0.0",
|
|
78
80
|
"p-queue": "^6.6.2",
|
|
79
|
-
"pino-pretty": "^9.
|
|
80
|
-
"postcss": "^8.4.
|
|
81
|
-
"postcss-loader": "^7.0.
|
|
82
|
-
"postcss-preset-env": "^
|
|
83
|
-
"react": "^
|
|
84
|
-
"react-dom": "^
|
|
81
|
+
"pino-pretty": "^9.4.0",
|
|
82
|
+
"postcss": "^8.4.21",
|
|
83
|
+
"postcss-loader": "^7.0.2",
|
|
84
|
+
"postcss-preset-env": "^8.0.1",
|
|
85
|
+
"react": "^18.2.0",
|
|
86
|
+
"react-dom": "^18.2.0",
|
|
85
87
|
"react-refresh": "^0.14.0",
|
|
86
88
|
"resolve-url-loader": "^5.0.0",
|
|
87
|
-
"rimraf": "^
|
|
88
|
-
"sass": "^1.
|
|
89
|
+
"rimraf": "^4.1.2",
|
|
90
|
+
"sass": "^1.58.3",
|
|
89
91
|
"sass-loader": "^13.2.0",
|
|
90
92
|
"semver": "^7.3.8",
|
|
91
93
|
"signal-exit": "^3.0.7",
|
|
@@ -94,46 +96,45 @@
|
|
|
94
96
|
"style-loader": "^3.3.1",
|
|
95
97
|
"svgo": "^3.0.2",
|
|
96
98
|
"ts-node": "10.9.1",
|
|
97
|
-
"tslib": "^2.
|
|
98
|
-
"typescript": "^4.9.
|
|
99
|
+
"tslib": "^2.5.0",
|
|
100
|
+
"typescript": "^4.9.5",
|
|
99
101
|
"webpack": "^5.75.0",
|
|
100
102
|
"webpack-assets-manifest": "^5.1.0",
|
|
101
|
-
"webpack-bundle-analyzer": "^4.
|
|
102
|
-
"webpack-dev-server": "^4.
|
|
103
|
+
"webpack-bundle-analyzer": "^4.8.0",
|
|
104
|
+
"webpack-dev-server": "^4.13.2",
|
|
103
105
|
"webpack-manifest-plugin": "^5.0.0",
|
|
104
106
|
"worker-loader": "^3.0.8",
|
|
105
|
-
"yargs": "^17.
|
|
107
|
+
"yargs": "^17.7.1"
|
|
106
108
|
},
|
|
107
109
|
"devDependencies": {
|
|
108
|
-
"@commitlint/cli": "^17.
|
|
109
|
-
"@commitlint/config-conventional": "^17.
|
|
110
|
+
"@commitlint/cli": "^17.4.4",
|
|
111
|
+
"@commitlint/config-conventional": "^17.4.4",
|
|
110
112
|
"@gravity-ui/eslint-config": "^1.0.2",
|
|
111
113
|
"@gravity-ui/prettier-config": "^1.0.1",
|
|
112
114
|
"@gravity-ui/tsconfig": "^1.0.0",
|
|
113
115
|
"@types/circular-dependency-plugin": "^5.0.5",
|
|
114
116
|
"@types/common-tags": "^1.8.1",
|
|
115
|
-
"@types/fs-extra": "^
|
|
116
|
-
"@types/jest": "^29.
|
|
117
|
-
"@types/lodash": "^4.14.
|
|
117
|
+
"@types/fs-extra": "^11.0.1",
|
|
118
|
+
"@types/jest": "^29.4.0",
|
|
119
|
+
"@types/lodash": "^4.14.191",
|
|
118
120
|
"@types/mime-types": "^2.1.1",
|
|
119
|
-
"@types/node": "^14.18.
|
|
121
|
+
"@types/node": "^14.18.37",
|
|
120
122
|
"@types/nodemon": "^1.19.2",
|
|
121
|
-
"@types/
|
|
122
|
-
"@types/sass": "^1.43.1",
|
|
123
|
+
"@types/sass": "^1.45.0",
|
|
123
124
|
"@types/semver": "^7.3.13",
|
|
124
125
|
"@types/signal-exit": "^3.0.1",
|
|
125
126
|
"@types/terser-webpack-plugin": "^5.2.0",
|
|
126
127
|
"@types/webpack-assets-manifest": "^5.1.0",
|
|
127
128
|
"@types/webpack-bundle-analyzer": "^4.6.0",
|
|
128
129
|
"@types/webpack-manifest-plugin": "^3.0.5",
|
|
129
|
-
"eslint": "^8.
|
|
130
|
-
"husky": "^8.0.
|
|
131
|
-
"jest": "^29.3
|
|
130
|
+
"eslint": "^8.35.0",
|
|
131
|
+
"husky": "^8.0.3",
|
|
132
|
+
"jest": "^29.4.3",
|
|
132
133
|
"monaco-editor-webpack-plugin": "^6.0.0",
|
|
133
134
|
"nano-staged": "^0.8.0",
|
|
134
135
|
"npm-run-all": "^4.1.5",
|
|
135
136
|
"prettier": "^2.8.0",
|
|
136
|
-
"ts-jest": "^29.0.
|
|
137
|
+
"ts-jest": "^29.0.5"
|
|
137
138
|
},
|
|
138
139
|
"peerDependencies": {
|
|
139
140
|
"monaco-editor-webpack-plugin": "*"
|