@elliemae/pui-cli 8.4.0 → 8.5.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.
|
@@ -42,9 +42,13 @@ __export(utils_exports, {
|
|
|
42
42
|
module.exports = __toCommonJS(utils_exports);
|
|
43
43
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
44
44
|
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
45
|
-
var import_promises = require("fs/promises");
|
|
45
|
+
var import_promises = require("node:fs/promises");
|
|
46
|
+
var import_node_zlib = require("node:zlib");
|
|
47
|
+
var import_node_stream = require("node:stream");
|
|
48
|
+
var import_node_util = require("node:util");
|
|
46
49
|
var import_execa = require("execa");
|
|
47
50
|
var import_chalk = __toESM(require("chalk"), 1);
|
|
51
|
+
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
48
52
|
var import_helpers = require("../webpack/helpers.js");
|
|
49
53
|
const browsersMapping = {
|
|
50
54
|
and_chr: "Chrome for Android",
|
|
@@ -145,6 +149,37 @@ const updateManifestWithVersionInfo = async (dest) => {
|
|
|
145
149
|
manifestData = manifestData.replace(/latest\//g, `${(0, import_helpers.getAppVersion)()}/`);
|
|
146
150
|
await (0, import_promises.writeFile)(manifestFile, manifestData);
|
|
147
151
|
};
|
|
152
|
+
const updateRuntimeFile = async (src, dest, version) => {
|
|
153
|
+
const latestJSFolder = "latest/js";
|
|
154
|
+
const pipe = (0, import_node_util.promisify)(import_node_stream.pipeline);
|
|
155
|
+
const results = await (0, import_fast_glob.default)([import_node_path.default.join(src, "runtime~app.*.js")]);
|
|
156
|
+
if (!results?.length)
|
|
157
|
+
throw new Error("Runtime file not found");
|
|
158
|
+
const runtimeFilePath = results[0];
|
|
159
|
+
const runtimeFileName = import_node_path.default.basename(runtimeFilePath);
|
|
160
|
+
const destRuntimeFilePath = import_node_path.default.join(dest, runtimeFileName);
|
|
161
|
+
const runtimeFileData = await (0, import_promises.readFile)(runtimeFilePath, "utf8");
|
|
162
|
+
if (runtimeFileData.includes(latestJSFolder)) {
|
|
163
|
+
await (0, import_promises.writeFile)(
|
|
164
|
+
destRuntimeFilePath,
|
|
165
|
+
runtimeFileData.replace(latestJSFolder, `${version}/js`)
|
|
166
|
+
);
|
|
167
|
+
const sourceMapFile = `${runtimeFilePath}.map`;
|
|
168
|
+
const sourcemap = await (0, import_promises.readFile)(sourceMapFile, "utf8");
|
|
169
|
+
await (0, import_promises.writeFile)(
|
|
170
|
+
`${destRuntimeFilePath}.map`,
|
|
171
|
+
sourcemap.replace(latestJSFolder, `${version}/js`)
|
|
172
|
+
);
|
|
173
|
+
const gzip = (0, import_node_zlib.createGzip)();
|
|
174
|
+
let source = (0, import_node_fs.createReadStream)(destRuntimeFilePath);
|
|
175
|
+
let destination = (0, import_node_fs.createWriteStream)(`${destRuntimeFilePath}.gz`);
|
|
176
|
+
await pipe(source, gzip, destination);
|
|
177
|
+
const brotli = (0, import_node_zlib.createBrotliCompress)();
|
|
178
|
+
source = (0, import_node_fs.createReadStream)(destRuntimeFilePath);
|
|
179
|
+
destination = (0, import_node_fs.createWriteStream)(`${destRuntimeFilePath}.br`);
|
|
180
|
+
await pipe(source, brotli, destination);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
148
183
|
const copyBuildAssetsToVersionedFolder = async () => {
|
|
149
184
|
const appVersion = (0, import_helpers.getAppVersion)();
|
|
150
185
|
const isVersionedApp = (0, import_helpers.isAppLoaderEnabled)() && appVersion !== import_helpers.LATEST_VERSION;
|
|
@@ -154,6 +189,11 @@ const copyBuildAssetsToVersionedFolder = async () => {
|
|
|
154
189
|
const dest = import_node_path.default.resolve(process.cwd(), `build/public/${appVersion}`);
|
|
155
190
|
await copyDir(src, dest);
|
|
156
191
|
await updateManifestWithVersionInfo(dest);
|
|
192
|
+
await updateRuntimeFile(
|
|
193
|
+
import_node_path.default.join(src, "js"),
|
|
194
|
+
import_node_path.default.join(dest, "js"),
|
|
195
|
+
appVersion
|
|
196
|
+
);
|
|
157
197
|
};
|
|
158
198
|
const isPathExist = async (pathToCheck) => {
|
|
159
199
|
try {
|
|
@@ -254,7 +254,7 @@ const baseConfig = (options) => ({
|
|
|
254
254
|
resourceQuery: /resource/,
|
|
255
255
|
type: "asset/resource",
|
|
256
256
|
generator: {
|
|
257
|
-
filename: "latest/[name].[hash][ext]
|
|
257
|
+
filename: "latest/[name].[hash][ext]"
|
|
258
258
|
},
|
|
259
259
|
exclude: (0, import_helpers.excludeNodeModulesExcept)(import_helpers.modulesToTranspile)
|
|
260
260
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import fs, { constants } from "node:fs";
|
|
2
|
+
import fs, { constants, createReadStream, createWriteStream } from "node:fs";
|
|
3
3
|
import {
|
|
4
4
|
readFile,
|
|
5
5
|
writeFile,
|
|
@@ -7,9 +7,13 @@ import {
|
|
|
7
7
|
readdir,
|
|
8
8
|
copyFile,
|
|
9
9
|
access
|
|
10
|
-
} from "fs/promises";
|
|
10
|
+
} from "node:fs/promises";
|
|
11
|
+
import { createGzip, createBrotliCompress } from "node:zlib";
|
|
12
|
+
import { pipeline } from "node:stream";
|
|
13
|
+
import { promisify } from "node:util";
|
|
11
14
|
import { execaCommand } from "execa";
|
|
12
15
|
import chalk from "chalk";
|
|
16
|
+
import fg from "fast-glob";
|
|
13
17
|
import {
|
|
14
18
|
getPaths,
|
|
15
19
|
isAppLoaderEnabled,
|
|
@@ -115,6 +119,37 @@ const updateManifestWithVersionInfo = async (dest) => {
|
|
|
115
119
|
manifestData = manifestData.replace(/latest\//g, `${getAppVersion()}/`);
|
|
116
120
|
await writeFile(manifestFile, manifestData);
|
|
117
121
|
};
|
|
122
|
+
const updateRuntimeFile = async (src, dest, version) => {
|
|
123
|
+
const latestJSFolder = "latest/js";
|
|
124
|
+
const pipe = promisify(pipeline);
|
|
125
|
+
const results = await fg([path.join(src, "runtime~app.*.js")]);
|
|
126
|
+
if (!results?.length)
|
|
127
|
+
throw new Error("Runtime file not found");
|
|
128
|
+
const runtimeFilePath = results[0];
|
|
129
|
+
const runtimeFileName = path.basename(runtimeFilePath);
|
|
130
|
+
const destRuntimeFilePath = path.join(dest, runtimeFileName);
|
|
131
|
+
const runtimeFileData = await readFile(runtimeFilePath, "utf8");
|
|
132
|
+
if (runtimeFileData.includes(latestJSFolder)) {
|
|
133
|
+
await writeFile(
|
|
134
|
+
destRuntimeFilePath,
|
|
135
|
+
runtimeFileData.replace(latestJSFolder, `${version}/js`)
|
|
136
|
+
);
|
|
137
|
+
const sourceMapFile = `${runtimeFilePath}.map`;
|
|
138
|
+
const sourcemap = await readFile(sourceMapFile, "utf8");
|
|
139
|
+
await writeFile(
|
|
140
|
+
`${destRuntimeFilePath}.map`,
|
|
141
|
+
sourcemap.replace(latestJSFolder, `${version}/js`)
|
|
142
|
+
);
|
|
143
|
+
const gzip = createGzip();
|
|
144
|
+
let source = createReadStream(destRuntimeFilePath);
|
|
145
|
+
let destination = createWriteStream(`${destRuntimeFilePath}.gz`);
|
|
146
|
+
await pipe(source, gzip, destination);
|
|
147
|
+
const brotli = createBrotliCompress();
|
|
148
|
+
source = createReadStream(destRuntimeFilePath);
|
|
149
|
+
destination = createWriteStream(`${destRuntimeFilePath}.br`);
|
|
150
|
+
await pipe(source, brotli, destination);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
118
153
|
const copyBuildAssetsToVersionedFolder = async () => {
|
|
119
154
|
const appVersion = getAppVersion();
|
|
120
155
|
const isVersionedApp = isAppLoaderEnabled() && appVersion !== LATEST_VERSION;
|
|
@@ -124,6 +159,11 @@ const copyBuildAssetsToVersionedFolder = async () => {
|
|
|
124
159
|
const dest = path.resolve(process.cwd(), `build/public/${appVersion}`);
|
|
125
160
|
await copyDir(src, dest);
|
|
126
161
|
await updateManifestWithVersionInfo(dest);
|
|
162
|
+
await updateRuntimeFile(
|
|
163
|
+
path.join(src, "js"),
|
|
164
|
+
path.join(dest, "js"),
|
|
165
|
+
appVersion
|
|
166
|
+
);
|
|
127
167
|
};
|
|
128
168
|
const isPathExist = async (pathToCheck) => {
|
|
129
169
|
try {
|
|
@@ -227,7 +227,7 @@ const baseConfig = (options) => ({
|
|
|
227
227
|
resourceQuery: /resource/,
|
|
228
228
|
type: "asset/resource",
|
|
229
229
|
generator: {
|
|
230
|
-
filename: "latest/[name].[hash][ext]
|
|
230
|
+
filename: "latest/[name].[hash][ext]"
|
|
231
231
|
},
|
|
232
232
|
exclude: excludeNodeModulesExcept(modulesToTranspile)
|
|
233
233
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.1",
|
|
4
4
|
"description": "ICE MT UI Platform CLI",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@axe-core/react": "~4.6.1",
|
|
79
79
|
"@babel/cli": "~7.21.0",
|
|
80
|
-
"@babel/core": "~7.21.
|
|
80
|
+
"@babel/core": "~7.21.4",
|
|
81
81
|
"@babel/eslint-parser": "~7.21.3",
|
|
82
82
|
"@babel/node": "~7.20.7",
|
|
83
83
|
"@babel/plugin-proposal-class-properties": "~7.18.6",
|
|
@@ -88,18 +88,18 @@
|
|
|
88
88
|
"@babel/plugin-transform-react-constant-elements": "~7.21.3",
|
|
89
89
|
"@babel/plugin-transform-react-inline-elements": "~7.21.0",
|
|
90
90
|
"@babel/plugin-transform-react-jsx-source": "~7.19.6",
|
|
91
|
-
"@babel/plugin-transform-runtime": "~7.21.
|
|
92
|
-
"@babel/preset-env": "~7.
|
|
91
|
+
"@babel/plugin-transform-runtime": "~7.21.4",
|
|
92
|
+
"@babel/preset-env": "~7.21.4",
|
|
93
93
|
"@babel/preset-react": "~7.18.6",
|
|
94
|
-
"@babel/preset-typescript": "~7.21.
|
|
94
|
+
"@babel/preset-typescript": "~7.21.4",
|
|
95
95
|
"@babel/runtime": "~7.21.0",
|
|
96
96
|
"@commitlint/cli": "~17.5.1",
|
|
97
97
|
"@commitlint/config-conventional": "~17.4.4",
|
|
98
98
|
"@elliemae/browserslist-config-elliemae-latest-browsers": "~1.7.0",
|
|
99
99
|
"@faker-js/faker": "7.6.0",
|
|
100
|
-
"@nrwl/cli": "15.9.
|
|
101
|
-
"@nrwl/tao": "15.9.
|
|
102
|
-
"@nrwl/workspace": "15.9.
|
|
100
|
+
"@nrwl/cli": "15.9.2",
|
|
101
|
+
"@nrwl/tao": "15.9.2",
|
|
102
|
+
"@nrwl/workspace": "15.9.2",
|
|
103
103
|
"@pmmmwh/react-refresh-webpack-plugin": "~0.5.10",
|
|
104
104
|
"@semantic-release/changelog": "~6.0.3",
|
|
105
105
|
"@semantic-release/exec": "~6.0.3",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"@stylelint/postcss-css-in-js": "~0.38.0",
|
|
119
119
|
"@svgr/webpack": "~7.0.0",
|
|
120
120
|
"@swc/cli": "~0.1.62",
|
|
121
|
-
"@swc/core": "~1.3.
|
|
121
|
+
"@swc/core": "~1.3.46",
|
|
122
122
|
"@swc/jest": "~0.2.24",
|
|
123
123
|
"@testing-library/jest-dom": "~5.16.5",
|
|
124
124
|
"@testing-library/react": "~14.0.0",
|
|
@@ -141,8 +141,8 @@
|
|
|
141
141
|
"@types/uuid": "~9.0.1",
|
|
142
142
|
"@types/testing-library__jest-dom": "~5.14.5",
|
|
143
143
|
"@types/webpack-bundle-analyzer": "~4.6.0",
|
|
144
|
-
"@typescript-eslint/eslint-plugin": "~5.57.
|
|
145
|
-
"@typescript-eslint/parser": "~5.57.
|
|
144
|
+
"@typescript-eslint/eslint-plugin": "~5.57.1",
|
|
145
|
+
"@typescript-eslint/parser": "~5.57.1",
|
|
146
146
|
"@vitejs/plugin-react": "~3.1.0",
|
|
147
147
|
"@vitest/coverage-c8": "~0.29.8",
|
|
148
148
|
"autoprefixer": "~10.4.14",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"babel-plugin-lodash": "~3.3.4",
|
|
154
154
|
"babel-plugin-module-resolver": "~5.0.0",
|
|
155
155
|
"babel-plugin-source-map-support": "~2.2.0",
|
|
156
|
-
"babel-plugin-styled-components": "~2.
|
|
156
|
+
"babel-plugin-styled-components": "~2.1.1",
|
|
157
157
|
"babel-plugin-transform-react-remove-prop-types": "~0.4.24",
|
|
158
158
|
"babel-plugin-transform-remove-console": "~6.9.4",
|
|
159
159
|
"babel-plugin-transform-strip-block": "~0.0.5",
|
|
@@ -175,7 +175,7 @@
|
|
|
175
175
|
"dotenv-webpack": "~8.0.1",
|
|
176
176
|
"duplicate-package-checker-webpack-plugin": "~3.0.0",
|
|
177
177
|
"enhanced-resolve": "5.12.0",
|
|
178
|
-
"esbuild": "~0.17.
|
|
178
|
+
"esbuild": "~0.17.15",
|
|
179
179
|
"esbuild-loader": "~3.0.1",
|
|
180
180
|
"esbuild-plugin-svgr": "~1.1.0",
|
|
181
181
|
"eslint": "~8.37.0",
|
|
@@ -185,13 +185,13 @@
|
|
|
185
185
|
"eslint-config-prettier": "~8.8.0",
|
|
186
186
|
"eslint-config-react-app": "~7.0.1",
|
|
187
187
|
"eslint-import-resolver-babel-module": "~5.3.2",
|
|
188
|
-
"eslint-import-resolver-typescript": "~3.5.
|
|
188
|
+
"eslint-import-resolver-typescript": "~3.5.5",
|
|
189
189
|
"eslint-import-resolver-webpack": "~0.13.2",
|
|
190
|
-
"eslint-plugin-compat": "~4.1.
|
|
190
|
+
"eslint-plugin-compat": "~4.1.4",
|
|
191
191
|
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
192
192
|
"eslint-plugin-import": "~2.27.5",
|
|
193
193
|
"eslint-plugin-jest": "~27.2.1",
|
|
194
|
-
"eslint-plugin-jsdoc": "~40.1.
|
|
194
|
+
"eslint-plugin-jsdoc": "~40.1.1",
|
|
195
195
|
"eslint-plugin-jsx-a11y": "~6.7.1",
|
|
196
196
|
"eslint-plugin-mdx": "~2.0.5",
|
|
197
197
|
"eslint-plugin-prettier": "~4.2.1",
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
"fast-glob": "~3.2.12",
|
|
210
210
|
"find-up": "~6.3.0",
|
|
211
211
|
"find-up-cli": "~5.0.0",
|
|
212
|
-
"happy-dom": "~
|
|
212
|
+
"happy-dom": "~9.1.9",
|
|
213
213
|
"helmet-csp": "~3.4.0",
|
|
214
214
|
"html-loader": "~4.2.0",
|
|
215
215
|
"html-webpack-plugin": "~5.5.0",
|
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
"jscodeshift": "~0.14.0",
|
|
228
228
|
"jsdoc": "~4.0.2",
|
|
229
229
|
"lerna": "~6.6.1",
|
|
230
|
-
"lint-staged": "~13.2.
|
|
230
|
+
"lint-staged": "~13.2.1",
|
|
231
231
|
"mini-css-extract-plugin": "~2.7.5",
|
|
232
232
|
"minimist": "~1.2.8",
|
|
233
233
|
"moment": "~2.29.4",
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
"node-plop": "~0.31.1",
|
|
239
239
|
"nodemon": "~2.0.22",
|
|
240
240
|
"normalize-path": "~3.0.0",
|
|
241
|
-
"npm-check-updates": "16.
|
|
241
|
+
"npm-check-updates": "16.10.7",
|
|
242
242
|
"pino": "~8.11.0",
|
|
243
243
|
"pino-http": "~8.3.3",
|
|
244
244
|
"pino-pretty": "~10.0.0",
|
|
@@ -246,9 +246,9 @@
|
|
|
246
246
|
"postcss": "~8.4.21",
|
|
247
247
|
"postcss-html": "~1.5.0",
|
|
248
248
|
"postcss-jsx": "~0.36.4",
|
|
249
|
-
"postcss-loader": "~7.
|
|
249
|
+
"postcss-loader": "~7.2.4",
|
|
250
250
|
"postcss-markdown": "~1.2.0",
|
|
251
|
-
"postcss-preset-env": "~8.0
|
|
251
|
+
"postcss-preset-env": "~8.3.0",
|
|
252
252
|
"postcss-syntax": "~0.36.2",
|
|
253
253
|
"prettier": "~2.8.7",
|
|
254
254
|
"prisma": "~4.12.0",
|
|
@@ -261,13 +261,13 @@
|
|
|
261
261
|
"resize-observer-polyfill": "~1.5.1",
|
|
262
262
|
"resolve-typescript-plugin": "~2.0.1",
|
|
263
263
|
"rimraf": "~4.4.1",
|
|
264
|
-
"semantic-release": "~21.0.
|
|
264
|
+
"semantic-release": "~21.0.1",
|
|
265
265
|
"slackify-markdown": "~4.3.1",
|
|
266
266
|
"speed-measure-webpack-plugin": "~1.5.0",
|
|
267
267
|
"storybook-addon-turbo-build": "~1.1.0",
|
|
268
268
|
"storybook-react-router": "~1.0.8",
|
|
269
269
|
"style-loader": "~3.3.2",
|
|
270
|
-
"stylelint": "~15.
|
|
270
|
+
"stylelint": "~15.4.0",
|
|
271
271
|
"stylelint-config-recommended": "~11.0.0",
|
|
272
272
|
"stylelint-config-styled-components": "~0.1.1",
|
|
273
273
|
"supertest": "~6.3.3",
|
|
@@ -275,17 +275,17 @@
|
|
|
275
275
|
"ts-node": "~10.9.1",
|
|
276
276
|
"tsc-alias": "~1.8.5",
|
|
277
277
|
"typedoc": "~0.23.28",
|
|
278
|
-
"typescript": "~5.0.
|
|
278
|
+
"typescript": "~5.0.4",
|
|
279
279
|
"update-notifier": "~6.0.2",
|
|
280
280
|
"url-loader": "~4.1.1",
|
|
281
281
|
"uuid": "~9.0.0",
|
|
282
282
|
"vite": "~4.2.1",
|
|
283
283
|
"vitest": "~0.29.8",
|
|
284
|
-
"vite-tsconfig-paths": "~4.0.
|
|
285
|
-
"webpack": "~5.
|
|
284
|
+
"vite-tsconfig-paths": "~4.0.8",
|
|
285
|
+
"webpack": "~5.78.0",
|
|
286
286
|
"webpack-bundle-analyzer": "~4.8.0",
|
|
287
287
|
"webpack-cli": "~5.0.1",
|
|
288
|
-
"webpack-dev-server": "~4.13.
|
|
288
|
+
"webpack-dev-server": "~4.13.2",
|
|
289
289
|
"webpack-manifest-plugin": "~5.0.0",
|
|
290
290
|
"webpack-merge": "~5.8.0",
|
|
291
291
|
"whatwg-fetch": "~3.6.2",
|