@elliemae/pui-cli 8.5.0 → 8.5.2
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/cjs/commands/utils.js +41 -1
- package/dist/esm/commands/utils.js +42 -2
- package/package.json +8 -8
|
@@ -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 {
|
|
@@ -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 {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/pui-cli",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.2",
|
|
4
4
|
"description": "ICE MT UI Platform CLI",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -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",
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
"eslint-import-resolver-babel-module": "~5.3.2",
|
|
188
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",
|
|
@@ -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": "~9.1.
|
|
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.10.
|
|
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",
|
|
@@ -275,14 +275,14 @@
|
|
|
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
284
|
"vite-tsconfig-paths": "~4.0.8",
|
|
285
|
-
"webpack": "~5.
|
|
285
|
+
"webpack": "~5.78.0",
|
|
286
286
|
"webpack-bundle-analyzer": "~4.8.0",
|
|
287
287
|
"webpack-cli": "~5.0.1",
|
|
288
288
|
"webpack-dev-server": "~4.13.2",
|