@unpackjs/core 2.3.1 → 2.3.3
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/compiled/css-loader/index.js +20 -20
- package/compiled/less-loader/index.js +8 -8
- package/compiled/postcss-loader/index.js +10 -10
- package/compiled/sass-loader/index.js +8 -8
- package/compiled/webpack-bundle-analyzer/index.js +21 -13274
- package/dist/bundler-config/cache.cjs +2 -1
- package/dist/bundler-config/cache.js +2 -1
- package/dist/bundler-config/css.cjs +10 -5
- package/dist/bundler-config/css.d.ts.map +1 -1
- package/dist/bundler-config/css.js +11 -6
- package/dist/bundler-config/experimentCss.cjs +8 -5
- package/dist/bundler-config/experimentCss.d.ts.map +1 -1
- package/dist/bundler-config/experimentCss.js +9 -6
- package/dist/bundler-config/helpers.cjs +5 -13
- package/dist/bundler-config/helpers.d.ts +3 -2
- package/dist/bundler-config/helpers.d.ts.map +1 -1
- package/dist/bundler-config/helpers.js +6 -14
- package/dist/bundler-config/index.cjs +25 -25
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +23 -26
- package/dist/bundler-config/jsMinify.cjs +1 -1
- package/dist/bundler-config/jsMinify.js +1 -1
- package/dist/bundler-config/progress/helpers.cjs +1 -1
- package/dist/bundler-config/progress/helpers.js +1 -1
- package/dist/bundler-config/progress/rspack.cjs +1 -1
- package/dist/bundler-config/progress/rspack.d.ts.map +1 -1
- package/dist/bundler-config/progress/rspack.js +1 -1
- package/dist/bundler-config/progress/webpack.cjs +1 -1
- package/dist/bundler-config/progress/webpack.d.ts.map +1 -1
- package/dist/bundler-config/progress/webpack.js +1 -1
- package/dist/colors.d.ts +1 -0
- package/dist/colors.d.ts.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.cjs +7 -3
- package/dist/constants.d.ts +7 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +7 -3
- package/dist/createUnpack.cjs +4 -3
- package/dist/createUnpack.d.ts.map +1 -1
- package/dist/createUnpack.js +5 -4
- package/dist/global.d.ts +1 -1
- package/dist/global.d.ts.map +1 -1
- package/dist/index.js +5 -36
- package/dist/logger.cjs +3 -5
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +3 -5
- package/dist/openBrowser.cjs +46 -61
- package/dist/openBrowser.d.ts.map +1 -1
- package/dist/openBrowser.js +2 -18
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/prebundleDeps.cjs +4 -3
- package/dist/prebundleDeps.d.ts.map +1 -1
- package/dist/prebundleDeps.js +4 -3
- package/dist/run/dev.cjs +8 -5
- package/dist/run/dev.d.ts.map +1 -1
- package/dist/run/dev.js +8 -5
- package/dist/typed-css-modules/loader.cjs +91 -130
- package/dist/typed-css-modules/loader.d.ts +1 -3
- package/dist/typed-css-modules/loader.d.ts.map +1 -1
- package/dist/typed-css-modules/loader.js +2 -41
- package/dist/typed-css-modules/plugin.d.ts +1 -1
- package/dist/typed-css-modules/plugin.d.ts.map +1 -1
- package/dist/typed-css-modules/utils.d.ts +1 -1
- package/dist/typed-css-modules/utils.d.ts.map +1 -1
- package/dist/types/config.d.ts +4 -4
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils.cjs +3 -5
- package/dist/utils.d.ts +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -5
- package/package.json +9 -15
- package/compiled/line-diff/index.d.ts +0 -1
- package/compiled/line-diff/index.js +0 -160
- package/compiled/line-diff/license +0 -21
- package/compiled/line-diff/package.json +0 -1
- package/compiled/portfinder/index.d.ts +0 -105
- package/compiled/portfinder/index.js +0 -3231
- package/compiled/portfinder/license +0 -22
- package/compiled/portfinder/package.json +0 -1
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
"../../compiled/line-diff/index.js": function(module) {
|
|
4
|
-
module.exports = require("../../compiled/line-diff/index.js");
|
|
5
|
-
}
|
|
6
|
-
};
|
|
7
|
-
var __webpack_module_cache__ = {};
|
|
8
|
-
function __webpack_require__(moduleId) {
|
|
9
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
-
exports: {}
|
|
13
|
-
};
|
|
14
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
-
return module.exports;
|
|
16
|
-
}
|
|
2
|
+
var __webpack_require__ = {};
|
|
17
3
|
(()=>{
|
|
18
4
|
__webpack_require__.n = (module)=>{
|
|
19
5
|
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
@@ -45,128 +31,103 @@ function __webpack_require__(moduleId) {
|
|
|
45
31
|
};
|
|
46
32
|
})();
|
|
47
33
|
var __webpack_exports__ = {};
|
|
48
|
-
(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
wrapQuotes: ()=>wrapQuotes,
|
|
37
|
+
default: ()=>loader,
|
|
38
|
+
isInNodeModules: ()=>isInNodeModules
|
|
39
|
+
});
|
|
40
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
41
|
+
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
42
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
43
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
44
|
+
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
45
|
+
const external_utils_cjs_namespaceObject = require("./utils.cjs");
|
|
46
|
+
const isInNodeModules = (path)=>external_constants_cjs_namespaceObject.NODE_MODULES_REGEX.test(path);
|
|
47
|
+
function wrapQuotes(key) {
|
|
48
|
+
const isValidIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key);
|
|
49
|
+
if (isValidIdentifier) return key;
|
|
50
|
+
return `'${key}'`;
|
|
51
|
+
}
|
|
52
|
+
const cssModuleToNamedExports = (cssModuleKeys)=>cssModuleKeys.sort().map((key)=>`export const ${key}: string;`).join('\n');
|
|
53
|
+
const cssModuleToInterface = (cssModulesKeys)=>{
|
|
54
|
+
const interfaceFields = cssModulesKeys.sort().map((key)=>` ${wrapQuotes(key)}: string;`).join('\n');
|
|
55
|
+
return `interface CssExports {\n${interfaceFields}\n}`;
|
|
56
|
+
};
|
|
57
|
+
const filenameToTypingsFilename = (filename)=>{
|
|
58
|
+
const dirName = external_node_path_default().dirname(filename);
|
|
59
|
+
const baseName = external_node_path_default().basename(filename);
|
|
60
|
+
return external_node_path_default().join(dirName, `${baseName}.d.ts`);
|
|
61
|
+
};
|
|
62
|
+
const enforceLFLineSeparators = (text)=>{
|
|
63
|
+
if (text) return text.replace(/\r\n/g, '\n');
|
|
64
|
+
return text;
|
|
65
|
+
};
|
|
66
|
+
const compareText = (contentA, contentB)=>enforceLFLineSeparators(contentA) === enforceLFLineSeparators(contentB);
|
|
67
|
+
const makeDoneHandlers = (callback, content, rest)=>({
|
|
68
|
+
failed: (e)=>callback(e),
|
|
69
|
+
success: ()=>callback(null, content, ...rest)
|
|
54
70
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const cssModuleToNamedExports = (cssModuleKeys)=>cssModuleKeys.sort().map((key)=>`export const ${key}: string;`).join('\n');
|
|
74
|
-
const cssModuleToInterface = (cssModulesKeys)=>{
|
|
75
|
-
const interfaceFields = cssModulesKeys.sort().map((key)=>` ${wrapQuotes(key)}: string;`).join('\n');
|
|
76
|
-
return `interface CssExports {\n${interfaceFields}\n}`;
|
|
77
|
-
};
|
|
78
|
-
const filenameToTypingsFilename = (filename)=>{
|
|
79
|
-
const dirName = external_node_path_default().dirname(filename);
|
|
80
|
-
const baseName = external_node_path_default().basename(filename);
|
|
81
|
-
return external_node_path_default().join(dirName, `${baseName}.d.ts`);
|
|
82
|
-
};
|
|
83
|
-
const enforceLFLineSeparators = (text)=>{
|
|
84
|
-
if (text) return text.replace(/\r\n/g, '\n');
|
|
85
|
-
return text;
|
|
86
|
-
};
|
|
87
|
-
const compareText = (contentA, contentB)=>enforceLFLineSeparators(contentA) === enforceLFLineSeparators(contentB);
|
|
88
|
-
const validModes = [
|
|
89
|
-
'emit',
|
|
90
|
-
'verify'
|
|
91
|
-
];
|
|
92
|
-
const isFileNotFound = (err)=>err && 'ENOENT' === err.code;
|
|
93
|
-
const makeDoneHandlers = (callback, content, rest)=>({
|
|
94
|
-
failed: (e)=>callback(e),
|
|
95
|
-
success: ()=>callback(null, content, ...rest)
|
|
96
|
-
});
|
|
97
|
-
const makeFileHandlers = (filename)=>({
|
|
98
|
-
read: (handler)=>external_node_fs_default().readFile(filename, {
|
|
99
|
-
encoding: 'utf-8'
|
|
100
|
-
}, handler),
|
|
101
|
-
write: (content, handler)=>external_node_fs_default().writeFile(filename, content, {
|
|
102
|
-
encoding: 'utf-8'
|
|
103
|
-
}, handler)
|
|
104
|
-
});
|
|
105
|
-
const extractLocalExports = (content)=>{
|
|
106
|
-
let localExports = content.split('exports.locals')[1];
|
|
107
|
-
if (!localExports) localExports = content.split('___CSS_LOADER_EXPORT___.locals')[1];
|
|
108
|
-
return localExports;
|
|
109
|
-
};
|
|
110
|
-
const getCSSModulesKeys = (content, namedExport)=>{
|
|
111
|
-
const keys = new Set();
|
|
112
|
-
if (namedExport) {
|
|
113
|
-
const exportsRegex = /export\s+var\s+(\w+)\s*=/g;
|
|
114
|
-
let match = exportsRegex.exec(content);
|
|
115
|
-
while(null !== match){
|
|
116
|
-
keys.add(match[1]);
|
|
117
|
-
match = exportsRegex.exec(content);
|
|
118
|
-
}
|
|
119
|
-
return Array.from(keys);
|
|
120
|
-
}
|
|
121
|
-
const localExports = extractLocalExports(content);
|
|
122
|
-
const keyRegex = /"([^\\"]+)":/g;
|
|
123
|
-
let match = keyRegex.exec(localExports);
|
|
71
|
+
const makeFileHandlers = (filename)=>({
|
|
72
|
+
read: (handler)=>external_node_fs_default().readFile(filename, {
|
|
73
|
+
encoding: 'utf-8'
|
|
74
|
+
}, handler),
|
|
75
|
+
write: (content, handler)=>external_node_fs_default().writeFile(filename, content, {
|
|
76
|
+
encoding: 'utf-8'
|
|
77
|
+
}, handler)
|
|
78
|
+
});
|
|
79
|
+
const extractLocalExports = (content)=>{
|
|
80
|
+
let localExports = content.split('exports.locals')[1];
|
|
81
|
+
if (!localExports) localExports = content.split('___CSS_LOADER_EXPORT___.locals')[1];
|
|
82
|
+
return localExports;
|
|
83
|
+
};
|
|
84
|
+
const getCSSModulesKeys = (content, namedExport)=>{
|
|
85
|
+
const keys = new Set();
|
|
86
|
+
if (namedExport) {
|
|
87
|
+
const exportsRegex = /export\s+var\s+(\w+)\s*=/g;
|
|
88
|
+
let match = exportsRegex.exec(content);
|
|
124
89
|
while(null !== match){
|
|
125
90
|
keys.add(match[1]);
|
|
126
|
-
match =
|
|
91
|
+
match = exportsRegex.exec(content);
|
|
127
92
|
}
|
|
128
93
|
return Array.from(keys);
|
|
129
|
-
};
|
|
130
|
-
function codegen(keys, namedExport) {
|
|
131
|
-
const bannerMessage = '// Generated automatically, do not edit';
|
|
132
|
-
if (namedExport) return `${bannerMessage}\n${cssModuleToNamedExports(keys)}\n`;
|
|
133
|
-
const cssModuleExport = 'declare const cssExports: CssExports;\nexport default cssExports;\n';
|
|
134
|
-
return `${bannerMessage}\n${cssModuleToInterface(keys)}\n${cssModuleExport}`;
|
|
135
94
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
resourcePath,
|
|
143
|
-
modules
|
|
144
|
-
}) || isInNodeModules(resourcePath)) return void success();
|
|
145
|
-
const cssModuleInterfaceFilename = filenameToTypingsFilename(resourcePath);
|
|
146
|
-
const { read, write } = makeFileHandlers(cssModuleInterfaceFilename);
|
|
147
|
-
const namedExport = external_constants_cjs_namespaceObject.CSS_NAMED_EXPORT;
|
|
148
|
-
const cssModulesKeys = getCSSModulesKeys(content, namedExport);
|
|
149
|
-
const cssModulesCode = codegen(cssModulesKeys, namedExport);
|
|
150
|
-
read('verify' === mode ? (err, fileContents)=>{
|
|
151
|
-
if (isFileNotFound(err)) return failed(getNoDeclarationFileError({
|
|
152
|
-
filename: cssModuleInterfaceFilename
|
|
153
|
-
}));
|
|
154
|
-
if (err) return failed(err);
|
|
155
|
-
if (!compareText(cssModulesCode, fileContents)) return failed(getTypeMismatchError({
|
|
156
|
-
filename: cssModuleInterfaceFilename,
|
|
157
|
-
expected: cssModulesCode,
|
|
158
|
-
actual: fileContents
|
|
159
|
-
}));
|
|
160
|
-
return success();
|
|
161
|
-
} : (_, fileContents)=>{
|
|
162
|
-
if (compareText(cssModulesCode, fileContents)) success();
|
|
163
|
-
else write(cssModulesCode, (err)=>{
|
|
164
|
-
if (err) failed(err);
|
|
165
|
-
else success();
|
|
166
|
-
});
|
|
167
|
-
});
|
|
95
|
+
const localExports = extractLocalExports(content);
|
|
96
|
+
const keyRegex = /"([^\\"]+)":/g;
|
|
97
|
+
let match = keyRegex.exec(localExports);
|
|
98
|
+
while(null !== match){
|
|
99
|
+
keys.add(match[1]);
|
|
100
|
+
match = keyRegex.exec(localExports);
|
|
168
101
|
}
|
|
169
|
-
|
|
102
|
+
return Array.from(keys);
|
|
103
|
+
};
|
|
104
|
+
function codegen(keys, namedExport) {
|
|
105
|
+
const bannerMessage = '// Generated automatically, do not edit';
|
|
106
|
+
if (namedExport) return `${bannerMessage}\n${cssModuleToNamedExports(keys)}\n`;
|
|
107
|
+
const cssModuleExport = 'declare const cssExports: CssExports;\nexport default cssExports;\n';
|
|
108
|
+
return `${bannerMessage}\n${cssModuleToInterface(keys)}\n${cssModuleExport}`;
|
|
109
|
+
}
|
|
110
|
+
function loader(content, ...rest) {
|
|
111
|
+
const { failed, success } = makeDoneHandlers(this.async(), content, rest);
|
|
112
|
+
const { resourcePath } = this;
|
|
113
|
+
const { modules } = this.getOptions() || {};
|
|
114
|
+
if (!(0, external_utils_cjs_namespaceObject.isCSSModules)({
|
|
115
|
+
resourcePath,
|
|
116
|
+
modules
|
|
117
|
+
}) || isInNodeModules(resourcePath)) return void success();
|
|
118
|
+
const cssModuleInterfaceFilename = filenameToTypingsFilename(resourcePath);
|
|
119
|
+
const { read, write } = makeFileHandlers(cssModuleInterfaceFilename);
|
|
120
|
+
const namedExport = external_constants_cjs_namespaceObject.CSS_NAMED_EXPORT;
|
|
121
|
+
const cssModulesKeys = getCSSModulesKeys(content, namedExport);
|
|
122
|
+
const cssModulesCode = codegen(cssModulesKeys, namedExport);
|
|
123
|
+
read((_, fileContents)=>{
|
|
124
|
+
if (compareText(cssModulesCode, fileContents)) success();
|
|
125
|
+
else write(cssModulesCode, (err)=>{
|
|
126
|
+
if (err) failed(err);
|
|
127
|
+
else success();
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
170
131
|
exports["default"] = __webpack_exports__["default"];
|
|
171
132
|
exports.isInNodeModules = __webpack_exports__.isInNodeModules;
|
|
172
133
|
exports.wrapQuotes = __webpack_exports__.wrapQuotes;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type * as Rspack from '@rspack/core';
|
|
2
2
|
import type { UnpackConfig } from '../types/index';
|
|
3
|
-
export type CssLoaderModules = UnpackConfig['css']['modules'];
|
|
4
3
|
export declare const isInNodeModules: (path: string) => boolean;
|
|
5
4
|
export declare function wrapQuotes(key: string): string;
|
|
6
5
|
export default function (this: Rspack.LoaderContext<{
|
|
7
|
-
|
|
8
|
-
modules: CssLoaderModules;
|
|
6
|
+
modules: NonNullable<UnpackConfig['css']>['modules'];
|
|
9
7
|
}>, content: string, ...rest: any[]): void;
|
|
10
8
|
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/typed-css-modules/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAA;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/typed-css-modules/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,MAAM,cAAc,CAAA;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAGnD,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,YAAkC,CAAA;AAE9E,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ9C;AA+FD,MAAM,CAAC,OAAO,WACZ,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC;IACzB,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;CACrD,CAAC,EACF,OAAO,EAAE,MAAM,EACf,GAAG,IAAI,EAAE,GAAG,EAAE,GACb,IAAI,CA+BN"}
|
|
@@ -1,32 +1,10 @@
|
|
|
1
1
|
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE__compiled_line_diff_index_js_2f8a9adc__ from "../../compiled/line-diff/index.js";
|
|
4
3
|
import node_fs from "node:fs";
|
|
5
4
|
import node_path from "node:path";
|
|
6
5
|
import { CSS_NAMED_EXPORT, NODE_MODULES_REGEX } from "../constants.js";
|
|
7
6
|
import { isCSSModules } from "./utils.js";
|
|
8
|
-
var __webpack_modules__ = {
|
|
9
|
-
"../../compiled/line-diff/index.js": function(module) {
|
|
10
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__compiled_line_diff_index_js_2f8a9adc__;
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
var __webpack_module_cache__ = {};
|
|
14
|
-
function __webpack_require__(moduleId) {
|
|
15
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
16
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
17
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
18
|
-
exports: {}
|
|
19
|
-
};
|
|
20
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
21
|
-
return module.exports;
|
|
22
|
-
}
|
|
23
|
-
const LineDiff = __webpack_require__("../../compiled/line-diff/index.js");
|
|
24
7
|
const isInNodeModules = (path)=>NODE_MODULES_REGEX.test(path);
|
|
25
|
-
const getNoDeclarationFileError = ({ filename })=>new Error(`Generated type declaration does not exist. Run dev and commit the type declaration for '${filename}'`);
|
|
26
|
-
const getTypeMismatchError = ({ filename, expected, actual })=>{
|
|
27
|
-
const diff = new LineDiff(enforceLFLineSeparators(actual), expected).toString();
|
|
28
|
-
return new Error(`Generated type declaration file is outdated. Run dev and commit the updated type declaration for '${filename}'\n\n${diff}`);
|
|
29
|
-
};
|
|
30
8
|
function wrapQuotes(key) {
|
|
31
9
|
const isValidIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key);
|
|
32
10
|
if (isValidIdentifier) return key;
|
|
@@ -47,11 +25,6 @@ const enforceLFLineSeparators = (text)=>{
|
|
|
47
25
|
return text;
|
|
48
26
|
};
|
|
49
27
|
const compareText = (contentA, contentB)=>enforceLFLineSeparators(contentA) === enforceLFLineSeparators(contentB);
|
|
50
|
-
const validModes = [
|
|
51
|
-
'emit',
|
|
52
|
-
'verify'
|
|
53
|
-
];
|
|
54
|
-
const isFileNotFound = (err)=>err && 'ENOENT' === err.code;
|
|
55
28
|
const makeDoneHandlers = (callback, content, rest)=>({
|
|
56
29
|
failed: (e)=>callback(e),
|
|
57
30
|
success: ()=>callback(null, content, ...rest)
|
|
@@ -98,8 +71,7 @@ function codegen(keys, namedExport) {
|
|
|
98
71
|
function loader(content, ...rest) {
|
|
99
72
|
const { failed, success } = makeDoneHandlers(this.async(), content, rest);
|
|
100
73
|
const { resourcePath } = this;
|
|
101
|
-
const {
|
|
102
|
-
if (!validModes.includes(mode)) return void failed(new Error(`Invalid mode option: ${mode}`));
|
|
74
|
+
const { modules } = this.getOptions() || {};
|
|
103
75
|
if (!isCSSModules({
|
|
104
76
|
resourcePath,
|
|
105
77
|
modules
|
|
@@ -109,18 +81,7 @@ function loader(content, ...rest) {
|
|
|
109
81
|
const namedExport = CSS_NAMED_EXPORT;
|
|
110
82
|
const cssModulesKeys = getCSSModulesKeys(content, namedExport);
|
|
111
83
|
const cssModulesCode = codegen(cssModulesKeys, namedExport);
|
|
112
|
-
read(
|
|
113
|
-
if (isFileNotFound(err)) return failed(getNoDeclarationFileError({
|
|
114
|
-
filename: cssModuleInterfaceFilename
|
|
115
|
-
}));
|
|
116
|
-
if (err) return failed(err);
|
|
117
|
-
if (!compareText(cssModulesCode, fileContents)) return failed(getTypeMismatchError({
|
|
118
|
-
filename: cssModuleInterfaceFilename,
|
|
119
|
-
expected: cssModulesCode,
|
|
120
|
-
actual: fileContents
|
|
121
|
-
}));
|
|
122
|
-
return success();
|
|
123
|
-
} : (_, fileContents)=>{
|
|
84
|
+
read((_, fileContents)=>{
|
|
124
85
|
if (compareText(cssModulesCode, fileContents)) success();
|
|
125
86
|
else write(cssModulesCode, (err)=>{
|
|
126
87
|
if (err) failed(err);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { UnpackConfig } from '../types/index';
|
|
2
2
|
import type { Compiler } from 'webpack';
|
|
3
3
|
type PluginTypedCssModulesOptions = {
|
|
4
|
-
modules?: UnpackConfig['css']['modules'];
|
|
4
|
+
modules?: NonNullable<UnpackConfig['css']>['modules'];
|
|
5
5
|
};
|
|
6
6
|
export declare class PluginTypedCssModules {
|
|
7
7
|
private dtsCreator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/typed-css-modules/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAGnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AA2BvC,KAAK,4BAA4B,GAAG;IAClC,OAAO,CAAC,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/typed-css-modules/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAGnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AA2BvC,KAAK,4BAA4B,GAAG;IAClC,OAAO,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;CACtD,CAAA;AAED,qBAAa,qBAAqB;IAChC,OAAO,CAAC,UAAU,CAAY;IAC9B,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,WAAW,CAA6B;IAChD,WAAW,EAAE,4BAA4B,CAAA;gBAE7B,OAAO,EAAE,4BAA4B;IAQjD,KAAK,CAAC,QAAQ,EAAE,QAAQ;YAmBV,kBAAkB;CAQjC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UnpackConfig } from '../types/index';
|
|
2
2
|
export declare const isCSSModules: ({ resourcePath, modules, }: {
|
|
3
3
|
resourcePath: string;
|
|
4
|
-
modules: UnpackConfig["css"]["modules"];
|
|
4
|
+
modules: NonNullable<UnpackConfig["css"]>["modules"];
|
|
5
5
|
}) => boolean;
|
|
6
6
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/typed-css-modules/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAGnD,eAAO,MAAM,YAAY,GAAI,4BAG1B;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/typed-css-modules/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAGnD,eAAO,MAAM,YAAY,GAAI,4BAG1B;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;CACrD,KAAG,OAQH,CAAA"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Configuration } from '@rspack/core';
|
|
1
|
+
import type { Configuration, LoaderContext } from '@rspack/core';
|
|
2
2
|
import type { AcceptedPlugin, ProcessOptions } from 'postcss';
|
|
3
3
|
import type SassLoader from '../../compiled/sass-loader/index.js';
|
|
4
4
|
import type { ChunkSplit } from './chunkSplit';
|
|
@@ -72,7 +72,7 @@ export type UnpackConfig = {
|
|
|
72
72
|
auto?: boolean | RegExp | ((resourcePath: string) => boolean);
|
|
73
73
|
localIdentName?: string;
|
|
74
74
|
};
|
|
75
|
-
postcss?: PostCSSOptions | ((loaderContext:
|
|
75
|
+
postcss?: PostCSSOptions | ((loaderContext: LoaderContext) => PostCSSOptions);
|
|
76
76
|
lightningcss?: LightningcssTransformOptions;
|
|
77
77
|
less?: Less.Options;
|
|
78
78
|
sass?: SassLoader.Options['sassOptions'];
|
|
@@ -103,7 +103,7 @@ export type UnpackConfig = {
|
|
|
103
103
|
/**
|
|
104
104
|
* Proxy configuration for the dev server.
|
|
105
105
|
*/
|
|
106
|
-
proxy?: BundlerConfiguration['devServer']['proxy'] | Record<string, string>;
|
|
106
|
+
proxy?: NonNullable<BundlerConfiguration['devServer']>['proxy'] | Record<string, string>;
|
|
107
107
|
};
|
|
108
108
|
dev?: {
|
|
109
109
|
/**
|
|
@@ -128,7 +128,7 @@ export type UnpackConfig = {
|
|
|
128
128
|
/**
|
|
129
129
|
* Ignore CSS files from specified dependencies in prebundle output.
|
|
130
130
|
*/
|
|
131
|
-
|
|
131
|
+
ignoreCSS?: string[];
|
|
132
132
|
};
|
|
133
133
|
};
|
|
134
134
|
build?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7D,OAAO,KAAK,UAAU,MAAM,qCAAqC,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,+BAA+B,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAA;AACnG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,MAAM,MAAM,oBAAoB,GAAG,aAAa,CAAA;AAEhD,KAAK,cAAc,GAAG,cAAc,GAAG;IACrC;;;;OAIG;IACH,MAAM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CAAA;IACD,WAAW,CAAC,EAAE;QACZ;;WAEG;QACH,GAAG,CAAC,EAAE,OAAO,CAAA;KACd,CAAA;IACD;;OAEG;IACH,GAAG,CAAC,EACA,OAAO,GACP;QACE;;WAEG;QACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;QACvB;;WAEG;QACH,SAAS,CAAC,EAAE,OAAO,CAAA;QACnB;;WAEG;QACH,MAAM,CAAC,EAAE,MAAM,CAAA;KAChB,CAAA;IACL;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,EAAE,CAAA;IACxB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC9B,CAAA"}
|
package/dist/utils.cjs
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
"../compiled/portfinder/index.js": function(module) {
|
|
4
|
-
module.exports = require("../compiled/portfinder/index.js");
|
|
5
|
-
},
|
|
6
3
|
"../compiled/webpack-merge/index.js": function(module) {
|
|
7
4
|
module.exports = require("../compiled/webpack-merge/index.js");
|
|
8
5
|
}
|
|
@@ -92,11 +89,12 @@ var __webpack_exports__ = {};
|
|
|
92
89
|
var external_node_os_default = /*#__PURE__*/ __webpack_require__.n(external_node_os_namespaceObject);
|
|
93
90
|
const external_node_path_namespaceObject = require("node:path");
|
|
94
91
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
92
|
+
const external_portfinder_namespaceObject = require("portfinder");
|
|
93
|
+
var external_portfinder_default = /*#__PURE__*/ __webpack_require__.n(external_portfinder_namespaceObject);
|
|
95
94
|
const external_colors_cjs_namespaceObject = require("./colors.cjs");
|
|
96
95
|
const external_constants_cjs_namespaceObject = require("./constants.cjs");
|
|
97
96
|
const external_logger_cjs_namespaceObject = require("./logger.cjs");
|
|
98
97
|
const { merge } = __webpack_require__("../compiled/webpack-merge/index.js");
|
|
99
|
-
const portfinder = __webpack_require__("../compiled/portfinder/index.js");
|
|
100
98
|
const getNodeEnv = ()=>process.env.NODE_ENV;
|
|
101
99
|
const setNodeEnv = (env)=>{
|
|
102
100
|
process.env.NODE_ENV = env;
|
|
@@ -146,7 +144,7 @@ var __webpack_exports__ = {};
|
|
|
146
144
|
current[pathArray.at(-1)] = value;
|
|
147
145
|
};
|
|
148
146
|
const getPort = (startPort = 45678)=>new Promise((resolve)=>{
|
|
149
|
-
|
|
147
|
+
external_portfinder_default().getPort({
|
|
150
148
|
port: startPort
|
|
151
149
|
}, (_, port)=>{
|
|
152
150
|
resolve(port);
|
package/dist/utils.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare const getPort: (startPort?: number) => Promise<number>;
|
|
|
22
22
|
export declare const getCompiledPkgPath: (packageName: CompiledPkgName) => string;
|
|
23
23
|
export declare const getUserDepPath: (root: string, deps: string | string[]) => string | undefined;
|
|
24
24
|
export declare function getTime(): string;
|
|
25
|
-
export declare const debounce: (fn: any, delay:
|
|
25
|
+
export declare const debounce: (fn: (...args: any[]) => any, delay: number) => (...args: any[]) => void;
|
|
26
26
|
export declare const getIpv4Interfaces: () => os.NetworkInterfaceInfo[];
|
|
27
27
|
type AddressUrl = {
|
|
28
28
|
label: string;
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,SAAS,CAAA;AAMxB,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAI7D,eAAO,MAAM,UA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import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
|
|
4
4
|
import { dirname as __webpack_dirname__ } from "node:path";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE__compiled_portfinder_index_js_249feeee__ from "../compiled/portfinder/index.js";
|
|
6
5
|
import * as __WEBPACK_EXTERNAL_MODULE__compiled_webpack_merge_index_js_efd91626__ from "../compiled/webpack-merge/index.js";
|
|
7
6
|
import node_fs from "node:fs";
|
|
8
7
|
import node_net from "node:net";
|
|
9
8
|
import node_os from "node:os";
|
|
10
9
|
import node_path from "node:path";
|
|
10
|
+
import portfinder from "portfinder";
|
|
11
11
|
import { colors } from "./colors.js";
|
|
12
12
|
import { DEFAULT_DEV_HOST } from "./constants.js";
|
|
13
13
|
import { logger } from "./logger.js";
|
|
14
14
|
var __webpack_modules__ = {
|
|
15
|
-
"../compiled/portfinder/index.js": function(module) {
|
|
16
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__compiled_portfinder_index_js_249feeee__;
|
|
17
|
-
},
|
|
18
15
|
"../compiled/webpack-merge/index.js": function(module) {
|
|
19
16
|
module.exports = __WEBPACK_EXTERNAL_MODULE__compiled_webpack_merge_index_js_efd91626__;
|
|
20
17
|
}
|
|
@@ -31,7 +28,6 @@ function __webpack_require__(moduleId) {
|
|
|
31
28
|
}
|
|
32
29
|
var utils_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
33
30
|
const { merge } = __webpack_require__("../compiled/webpack-merge/index.js");
|
|
34
|
-
const portfinder = __webpack_require__("../compiled/portfinder/index.js");
|
|
35
31
|
const getNodeEnv = ()=>process.env.NODE_ENV;
|
|
36
32
|
const setNodeEnv = (env)=>{
|
|
37
33
|
process.env.NODE_ENV = env;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unpackjs/core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
"import": "./dist/index.js",
|
|
10
10
|
"require": "./dist/index.cjs"
|
|
11
11
|
},
|
|
12
|
-
"./portfinder": {
|
|
13
|
-
"types": "./compiled/portfinder/index.d.ts",
|
|
14
|
-
"default": "./compiled/portfinder/index.js"
|
|
15
|
-
},
|
|
16
12
|
"./webpack-merge": {
|
|
17
13
|
"types": "./compiled/webpack-merge/index.d.ts",
|
|
18
14
|
"default": "./compiled/webpack-merge/index.js"
|
|
@@ -41,14 +37,11 @@
|
|
|
41
37
|
"types": "./compiled/webpack-bundle-analyzer/index.d.ts",
|
|
42
38
|
"default": "./compiled/webpack-bundle-analyzer/index.js"
|
|
43
39
|
},
|
|
44
|
-
"./line-diff": {
|
|
45
|
-
"types": "./compiled/line-diff/index.d.ts",
|
|
46
|
-
"default": "./compiled/line-diff/index.js"
|
|
47
|
-
},
|
|
48
40
|
"./style-loader": {
|
|
49
41
|
"types": "./compiled/style-loader/index.d.ts",
|
|
50
42
|
"default": "./compiled/style-loader/index.js"
|
|
51
|
-
}
|
|
43
|
+
},
|
|
44
|
+
"./package.json": "./package.json"
|
|
52
45
|
},
|
|
53
46
|
"main": "./dist/index.cjs",
|
|
54
47
|
"types": "./dist/index.d.ts",
|
|
@@ -64,11 +57,11 @@
|
|
|
64
57
|
"access": "public"
|
|
65
58
|
},
|
|
66
59
|
"devDependencies": {
|
|
60
|
+
"@types/cors": "2.8.19",
|
|
61
|
+
"@types/express": "5.0.3",
|
|
67
62
|
"@types/sass-loader": "8.0.9",
|
|
68
63
|
"css-loader": "7.1.2",
|
|
69
64
|
"less-loader": "12.3.0",
|
|
70
|
-
"line-diff": "2.1.2",
|
|
71
|
-
"portfinder": "1.0.37",
|
|
72
65
|
"postcss-loader": "8.1.1",
|
|
73
66
|
"sass-loader": "16.0.5",
|
|
74
67
|
"semver": "7.7.2",
|
|
@@ -77,7 +70,7 @@
|
|
|
77
70
|
"webpack-merge": "6.0.1"
|
|
78
71
|
},
|
|
79
72
|
"dependencies": {
|
|
80
|
-
"@rspack/core": "1.4.
|
|
73
|
+
"@rspack/core": "1.4.2",
|
|
81
74
|
"@types/less": "3.0.8",
|
|
82
75
|
"chokidar": "4.0.3",
|
|
83
76
|
"copy-webpack-plugin": "13.0.0",
|
|
@@ -90,8 +83,9 @@
|
|
|
90
83
|
"lightningcss": "1.30.1",
|
|
91
84
|
"mini-css-extract-plugin": "2.9.2",
|
|
92
85
|
"open": "8.4.2",
|
|
93
|
-
"oxc-minify": "0.75.
|
|
86
|
+
"oxc-minify": "0.75.1",
|
|
94
87
|
"picocolors": "1.1.1",
|
|
88
|
+
"portfinder": "1.0.37",
|
|
95
89
|
"postcss": "8.5.6",
|
|
96
90
|
"thread-loader": "4.0.4",
|
|
97
91
|
"tinyglobby": "0.2.14",
|
|
@@ -102,7 +96,7 @@
|
|
|
102
96
|
},
|
|
103
97
|
"scripts": {
|
|
104
98
|
"dev": "rslib build --watch",
|
|
105
|
-
"build": "pnpm prebundle && rslib build",
|
|
99
|
+
"build": "pnpm run prebundle && rslib build",
|
|
106
100
|
"prebundle": "prebundle && node ./scripts/afterPrebundle.js"
|
|
107
101
|
}
|
|
108
102
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export = any;
|