@modern-js/utils 1.18.0 → 1.18.1-alpha.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/CHANGELOG.md +12 -0
- package/dist/chainId.d.ts +4 -2
- package/dist/chainId.js +4 -2
- package/dist/path.d.ts +1 -0
- package/dist/path.js +11 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# @modern-js/utils
|
2
2
|
|
3
|
+
## 1.18.1-alpha.0
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 9fcfbd4: chore: add assets retry plugin
|
8
|
+
|
9
|
+
chore: 增加资源重试插件
|
10
|
+
|
11
|
+
- 6c2c745: chore(utils): add RULE.JS_DATA_URI to CHAIN_ID
|
12
|
+
|
13
|
+
chore(utils): CHAIN_ID 增加 RULE.JS_DATA_URI 值
|
14
|
+
|
3
15
|
## 1.18.0
|
4
16
|
|
5
17
|
### Minor Changes
|
package/dist/chainId.d.ts
CHANGED
@@ -13,6 +13,8 @@ export declare const CHAIN_ID: {
|
|
13
13
|
readonly MEDIA: "media";
|
14
14
|
/** Rule for js */
|
15
15
|
readonly JS: "js";
|
16
|
+
/** Rule for data uri encoded javascript */
|
17
|
+
readonly JS_DATA_URI: "js-data-uri";
|
16
18
|
/** Rule for ts */
|
17
19
|
readonly TS: "ts";
|
18
20
|
/** Rule for css */
|
@@ -132,10 +134,10 @@ export declare const CHAIN_ID: {
|
|
132
134
|
readonly REACT_FAST_REFRESH: "react-fast-refresh";
|
133
135
|
/** ProvidePlugin for node polyfill */
|
134
136
|
readonly NODE_POLYFILL_PROVIDE: "node-polyfill-provide";
|
135
|
-
/** ModuleDependencyErrorPlugin */
|
136
|
-
readonly MODULE_DEPENDENCY_ERROR: "module-dependency-error";
|
137
137
|
/** WebpackSRIPlugin */
|
138
138
|
readonly SUBRESOURCE_INTEGRITY: "subresource-integrity";
|
139
|
+
/** WebpackAssetsRetryPlugin */
|
140
|
+
readonly ASSETS_RETRY: "ASSETS_RETRY";
|
139
141
|
};
|
140
142
|
/** Predefined minimizers */
|
141
143
|
readonly MINIMIZER: {
|
package/dist/chainId.js
CHANGED
@@ -16,6 +16,8 @@ exports.CHAIN_ID = {
|
|
16
16
|
MEDIA: 'media',
|
17
17
|
/** Rule for js */
|
18
18
|
JS: 'js',
|
19
|
+
/** Rule for data uri encoded javascript */
|
20
|
+
JS_DATA_URI: 'js-data-uri',
|
19
21
|
/** Rule for ts */
|
20
22
|
TS: 'ts',
|
21
23
|
/** Rule for css */
|
@@ -135,10 +137,10 @@ exports.CHAIN_ID = {
|
|
135
137
|
REACT_FAST_REFRESH: 'react-fast-refresh',
|
136
138
|
/** ProvidePlugin for node polyfill */
|
137
139
|
NODE_POLYFILL_PROVIDE: 'node-polyfill-provide',
|
138
|
-
/** ModuleDependencyErrorPlugin */
|
139
|
-
MODULE_DEPENDENCY_ERROR: 'module-dependency-error',
|
140
140
|
/** WebpackSRIPlugin */
|
141
141
|
SUBRESOURCE_INTEGRITY: 'subresource-integrity',
|
142
|
+
/** WebpackAssetsRetryPlugin */
|
143
|
+
ASSETS_RETRY: 'ASSETS_RETRY',
|
142
144
|
},
|
143
145
|
/** Predefined minimizers */
|
144
146
|
MINIMIZER: {
|
package/dist/path.d.ts
CHANGED
@@ -2,3 +2,4 @@ export declare const isPathString: (test: string) => boolean;
|
|
2
2
|
export declare const isRelativePath: (test: string) => boolean;
|
3
3
|
export declare const normalizeOutputPath: (s: string) => string;
|
4
4
|
export declare const normalizeToPosixPath: (p: string | undefined) => string;
|
5
|
+
export declare const getTemplatePath: (prefix?: string) => string;
|
package/dist/path.js
CHANGED
@@ -3,8 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.normalizeToPosixPath = exports.normalizeOutputPath = exports.isRelativePath = exports.isPathString = void 0;
|
6
|
+
exports.getTemplatePath = exports.normalizeToPosixPath = exports.normalizeOutputPath = exports.isRelativePath = exports.isPathString = void 0;
|
7
7
|
const path_1 = __importDefault(require("path"));
|
8
|
+
const os_1 = __importDefault(require("os"));
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
8
10
|
const compiled_1 = require("./compiled");
|
9
11
|
const isPathString = (test) => path_1.default.posix.basename(test) !== test || path_1.default.win32.basename(test) !== test;
|
10
12
|
exports.isPathString = isPathString;
|
@@ -16,3 +18,11 @@ const normalizeToPosixPath = (p) => compiled_1.upath
|
|
16
18
|
.normalizeSafe(path_1.default.normalize(p || ''))
|
17
19
|
.replace(/^([a-zA-Z]+):/, (_, m) => `/${m.toLowerCase()}`);
|
18
20
|
exports.normalizeToPosixPath = normalizeToPosixPath;
|
21
|
+
const getTemplatePath = (prefix) => {
|
22
|
+
const tmpRoot = fs_1.default.realpathSync(os_1.default.tmpdir());
|
23
|
+
const parts = [tmpRoot];
|
24
|
+
prefix && parts.push(prefix);
|
25
|
+
parts.push((0, compiled_1.nanoid)());
|
26
|
+
return path_1.default.resolve(...parts);
|
27
|
+
};
|
28
|
+
exports.getTemplatePath = getTemplatePath;
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "1.18.0",
|
14
|
+
"version": "1.18.1-alpha.0",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/index.d.ts",
|
17
17
|
"main": "./dist/index.js",
|
@@ -125,9 +125,9 @@
|
|
125
125
|
"lodash": "^4.17.21"
|
126
126
|
},
|
127
127
|
"devDependencies": {
|
128
|
-
"@modern-js/types": "1.18.0",
|
129
|
-
"@scripts/build": "1.18.0",
|
130
|
-
"@scripts/jest-config": "1.18.0",
|
128
|
+
"@modern-js/types": "1.18.1-alpha.0",
|
129
|
+
"@scripts/build": "1.18.1-alpha.0",
|
130
|
+
"@scripts/jest-config": "1.18.1-alpha.0",
|
131
131
|
"@types/jest": "^27",
|
132
132
|
"@types/node": "^14",
|
133
133
|
"typescript": "^4",
|