arui-scripts 20.1.0 → 20.2.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/.turbo/turbo-test.log +9 -10
- package/CHANGELOG.md +23 -0
- package/build/commands/build/client.js +2 -10
- package/build/commands/util/client-assets-sizes.d.ts +1 -25
- package/build/commands/util/client-assets-sizes.js +51 -63
- package/build/configs/dev-server.d.ts +2 -1
- package/build/configs/util/apply-overrides.d.ts +2 -2
- package/build/configs/util/compress-with-dcb.d.ts +2 -0
- package/build/{commands/util/brotli-dictionary/create-dcb-file.js → configs/util/compress-with-dcb.js} +4 -10
- package/build/configs/util/compression-plugins-for-dictionaries.d.ts +2 -0
- package/build/configs/util/compression-plugins-for-dictionaries.js +81 -0
- package/build/configs/util/dcb-compression-plugin.d.ts +22 -0
- package/build/configs/util/dcb-compression-plugin.js +122 -0
- package/build/configs/webpack.client.js +5 -6
- package/build/configs/webpack.server.js +0 -5
- package/build/tsconfig-local.tsbuildinfo +1 -1
- package/package.json +11 -13
- package/build/commands/util/brotli-dictionary/create-dcb-file.d.ts +0 -6
- package/build/commands/util/brotli-dictionary/find-files-to-compress.d.ts +0 -9
- package/build/commands/util/brotli-dictionary/find-files-to-compress.js +0 -57
- package/build/commands/util/brotli-dictionary/get-bundle-files.d.ts +0 -1
- package/build/commands/util/brotli-dictionary/get-bundle-files.js +0 -26
- package/build/commands/util/create-dictionary-files.d.ts +0 -1
- package/build/commands/util/create-dictionary-files.js +0 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arui-scripts",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.2.0",
|
|
4
4
|
"main": "./build/index.js",
|
|
5
5
|
"typings": "./build/index.d.ts",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"@babel/preset-typescript": "^7.23.3",
|
|
38
38
|
"@babel/runtime": "^7.26.10",
|
|
39
39
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
|
|
40
|
-
"@rsdoctor/rspack-plugin": "
|
|
41
|
-
"@rspack/cli": "1.
|
|
42
|
-
"@rspack/core": "1.
|
|
43
|
-
"@rspack/dev-server": "1.
|
|
44
|
-
"@rspack/plugin-react-refresh": "
|
|
45
|
-
"@swc/core": "1.
|
|
46
|
-
"@swc/jest": "
|
|
40
|
+
"@rsdoctor/rspack-plugin": "1.2.2",
|
|
41
|
+
"@rspack/cli": "1.4.11",
|
|
42
|
+
"@rspack/core": "1.4.11",
|
|
43
|
+
"@rspack/dev-server": "1.1.4",
|
|
44
|
+
"@rspack/plugin-react-refresh": "1.4.3",
|
|
45
|
+
"@swc/core": "1.13.3",
|
|
46
|
+
"@swc/jest": "0.2.39",
|
|
47
47
|
"assets-webpack-plugin": "7.1.1",
|
|
48
48
|
"autoprefixer": "^10.3.16",
|
|
49
49
|
"babel-core": "^7.0.0-bridge.0",
|
|
@@ -62,7 +62,6 @@
|
|
|
62
62
|
"filesize": "^6.4.0",
|
|
63
63
|
"fork-ts-checker-webpack-plugin": "6.5.3",
|
|
64
64
|
"fs-extra": "6.0.1",
|
|
65
|
-
"gzip-size": "5.1.1",
|
|
66
65
|
"html-webpack-plugin": "^5.6.0",
|
|
67
66
|
"image-minimizer-webpack-plugin": "^3.8.3",
|
|
68
67
|
"imagemin": "^8.0.1",
|
|
@@ -100,9 +99,10 @@
|
|
|
100
99
|
"react-refresh": "0.10.0",
|
|
101
100
|
"react-refresh-typescript": "2.0.2",
|
|
102
101
|
"rimraf": "^2.7.1",
|
|
103
|
-
"rspack-manifest-plugin": "5.0.
|
|
102
|
+
"rspack-manifest-plugin": "5.0.3",
|
|
104
103
|
"run-script-webpack-plugin": "0.0.11",
|
|
105
104
|
"semver": "^7.5.4",
|
|
105
|
+
"serialize-javascript": "^6.0.2",
|
|
106
106
|
"shelljs": "0.8.5",
|
|
107
107
|
"strip-ansi": "6.0.1",
|
|
108
108
|
"style-loader": "3.3.3",
|
|
@@ -129,6 +129,7 @@
|
|
|
129
129
|
"@types/postcss-media-query-parser": "0.2.4",
|
|
130
130
|
"@types/react-dev-utils": "9.0.11",
|
|
131
131
|
"@types/semver": "^7.5.0",
|
|
132
|
+
"@types/serialize-javascript": "^5.0.4",
|
|
132
133
|
"@types/shelljs": "^0.8.12",
|
|
133
134
|
"@types/start-server-webpack-plugin": "2.2.2",
|
|
134
135
|
"@types/tar": "^4.0.5",
|
|
@@ -144,9 +145,6 @@
|
|
|
144
145
|
"type-fest": "2.19.0",
|
|
145
146
|
"typescript": "5.6.3"
|
|
146
147
|
},
|
|
147
|
-
"optionalDependencies": {
|
|
148
|
-
"brotli-size": "^4.0.0"
|
|
149
|
-
},
|
|
150
148
|
"engines": {
|
|
151
149
|
"node": ">=12.13.0"
|
|
152
150
|
},
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BuildDcbParams } from './create-dcb-file';
|
|
2
|
-
type FilesToCompress = {
|
|
3
|
-
baseDir: string;
|
|
4
|
-
dictionaryDir: string;
|
|
5
|
-
outDir: string;
|
|
6
|
-
allowedExtensions: string[];
|
|
7
|
-
};
|
|
8
|
-
export declare function findFilesToCompress({ baseDir, dictionaryDir, outDir, allowedExtensions, }: FilesToCompress): Promise<BuildDcbParams[]>;
|
|
9
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.findFilesToCompress = findFilesToCompress;
|
|
16
|
-
const fs_1 = __importDefault(require("fs"));
|
|
17
|
-
const path_1 = __importDefault(require("path"));
|
|
18
|
-
function parseFilename(filename) {
|
|
19
|
-
const parsedName = path_1.default.parse(filename);
|
|
20
|
-
const [stableName, hash] = parsedName.name.split('.');
|
|
21
|
-
return {
|
|
22
|
-
stableName,
|
|
23
|
-
hash,
|
|
24
|
-
ext: parsedName.ext.substring(1),
|
|
25
|
-
filename,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function findFilesToCompress(_a) {
|
|
29
|
-
return __awaiter(this, arguments, void 0, function* ({ baseDir, dictionaryDir, outDir, allowedExtensions, }) {
|
|
30
|
-
const files = yield fs_1.default.promises.readdir(baseDir);
|
|
31
|
-
const dictionaries = yield fs_1.default.promises.readdir(dictionaryDir);
|
|
32
|
-
const parsedDictionaries = dictionaries.reduce((map, current) => {
|
|
33
|
-
const parsed = parseFilename(current);
|
|
34
|
-
return (Object.assign(Object.assign({}, map), { [`${parsed.stableName}.${parsed.ext}`]: parsed }));
|
|
35
|
-
}, {});
|
|
36
|
-
const result = [];
|
|
37
|
-
files.forEach((file) => {
|
|
38
|
-
const parsedFilename = parseFilename(file);
|
|
39
|
-
if (!allowedExtensions.includes(parsedFilename.ext)) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (!parsedFilename.stableName || !parsedFilename.hash) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const matchedDictionary = parsedDictionaries[`${parsedFilename.stableName}.${parsedFilename.ext}`];
|
|
46
|
-
if (!matchedDictionary) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
result.push({
|
|
50
|
-
inputFilePath: path_1.default.join(baseDir, parsedFilename.filename),
|
|
51
|
-
dictionaryFilePath: path_1.default.join(dictionaryDir, matchedDictionary.filename),
|
|
52
|
-
outFilePath: path_1.default.join(outDir, `${parsedFilename.filename}.${matchedDictionary.hash}.dcb`),
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
return result;
|
|
56
|
-
});
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getBundleFiles(): Promise<string[]>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getBundleFiles = getBundleFiles;
|
|
16
|
-
const fs_1 = __importDefault(require("fs"));
|
|
17
|
-
const path_1 = __importDefault(require("path"));
|
|
18
|
-
const app_configs_1 = require("../../../configs/app-configs");
|
|
19
|
-
function getBundleFiles() {
|
|
20
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
const files = yield fs_1.default.promises.readdir(app_configs_1.configs.clientOutputPath);
|
|
22
|
-
return files
|
|
23
|
-
.filter((filename) => filename.endsWith('.js') || filename.endsWith('.css'))
|
|
24
|
-
.map((filename) => path_1.default.join(app_configs_1.configs.clientOutputPath, filename));
|
|
25
|
-
});
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function createDictionaryFiles(): Promise<void>;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.createDictionaryFiles = createDictionaryFiles;
|
|
16
|
-
const path_1 = __importDefault(require("path"));
|
|
17
|
-
const app_configs_1 = require("../../configs/app-configs");
|
|
18
|
-
const create_dcb_file_1 = require("./brotli-dictionary/create-dcb-file");
|
|
19
|
-
const find_files_to_compress_1 = require("./brotli-dictionary/find-files-to-compress");
|
|
20
|
-
const get_bundle_files_1 = require("./brotli-dictionary/get-bundle-files");
|
|
21
|
-
function createDictionaryFiles() {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const previousVersionPath = app_configs_1.configs.compressionPreviousVersionPath;
|
|
24
|
-
const singleFilesDictionaries = app_configs_1.configs.compressionPredefinedDictionaryPath;
|
|
25
|
-
if (previousVersionPath.length > 0) {
|
|
26
|
-
const filesToCompressPromise = previousVersionPath.map((dictionaryDir) => (0, find_files_to_compress_1.findFilesToCompress)({
|
|
27
|
-
baseDir: app_configs_1.configs.clientOutputPath,
|
|
28
|
-
outDir: app_configs_1.configs.clientOutputPath,
|
|
29
|
-
allowedExtensions: ['js', 'css'],
|
|
30
|
-
dictionaryDir,
|
|
31
|
-
}));
|
|
32
|
-
const filesToCompress = (yield Promise.all(filesToCompressPromise)).flat();
|
|
33
|
-
const dcbPromises = filesToCompress.map((fileSettings) => (0, create_dcb_file_1.createDcbFile)(fileSettings));
|
|
34
|
-
yield Promise.all(dcbPromises);
|
|
35
|
-
console.log(`Created ${filesToCompress.length} dcb archives from previous versions`);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (singleFilesDictionaries.length > 0) {
|
|
39
|
-
const bundleFiles = yield (0, get_bundle_files_1.getBundleFiles)();
|
|
40
|
-
const singleFilePromises = singleFilesDictionaries.map((dictionaryPath) => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const dictionaryName = path_1.default.parse(dictionaryPath).name;
|
|
42
|
-
const dcbPromises = bundleFiles.map((bundleFile) => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
return (0, create_dcb_file_1.createDcbFile)({
|
|
44
|
-
inputFilePath: bundleFile,
|
|
45
|
-
dictionaryFilePath: dictionaryPath,
|
|
46
|
-
outFilePath: `${bundleFile}.${dictionaryName}.dcb`,
|
|
47
|
-
});
|
|
48
|
-
}));
|
|
49
|
-
yield Promise.all(dcbPromises);
|
|
50
|
-
console.log(`Created ${dcbPromises.length} dcb archives for ${dictionaryName} dictionary`);
|
|
51
|
-
}));
|
|
52
|
-
yield Promise.all(singleFilePromises);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|