@griffel/transform 1.2.0 → 1.2.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.
- package/CHANGELOG.md +11 -2
- package/evaluation/module.d.mts +1 -1
- package/package.json +2 -2
- package/transform.js +2 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Change Log - @griffel/transform
|
|
2
2
|
|
|
3
|
-
This log was last generated on Fri, 06 Mar 2026
|
|
3
|
+
This log was last generated on Fri, 06 Mar 2026 15:54:55 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.2.1
|
|
8
|
+
|
|
9
|
+
Fri, 06 Mar 2026 15:54:55 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- refactor: remove cookModuleId from module evaluation (olfedias@microsoft.com)
|
|
14
|
+
- Bump @griffel/core to v1.20.1
|
|
15
|
+
|
|
7
16
|
## 1.2.0
|
|
8
17
|
|
|
9
|
-
Fri, 06 Mar 2026 08:
|
|
18
|
+
Fri, 06 Mar 2026 08:17:05 GMT
|
|
10
19
|
|
|
11
20
|
### Minor changes
|
|
12
21
|
|
package/evaluation/module.d.mts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class Module {
|
|
|
12
12
|
private debug;
|
|
13
13
|
private debuggerDepth;
|
|
14
14
|
constructor(filename: string, options: StrictOptions, debuggerDepth?: number);
|
|
15
|
-
resolve: (
|
|
15
|
+
resolve: (id: string) => string;
|
|
16
16
|
require: ((id: string) => unknown) & {
|
|
17
17
|
ensure: () => void;
|
|
18
18
|
cache: Record<string, Module>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griffel/transform",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "A package that performs build time transforms for Griffel",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"./package.json": "./package.json"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@griffel/core": "^1.20.
|
|
19
|
+
"@griffel/core": "^1.20.1",
|
|
20
20
|
"@linaria/shaker": "^3.0.0-beta.22",
|
|
21
21
|
"debug": "^4.3.0",
|
|
22
22
|
"magic-string": "^0.30.19",
|
package/transform.js
CHANGED
|
@@ -168,20 +168,6 @@ const createCustomDebug = (depth) => (namespaces, arg1, ...args) => {
|
|
|
168
168
|
const modulePrefix = depth === 0 ? "module" : `sub-module-${depth}`;
|
|
169
169
|
debug(`${modulePrefix}:${namespaces}`, arg1, ...args);
|
|
170
170
|
};
|
|
171
|
-
const BABEL_ESM = "/@babel/runtime/helpers/esm/";
|
|
172
|
-
const BABEL_CJS = "/@babel/runtime/helpers/";
|
|
173
|
-
const SWC_HELPERS_RE = /(@swc\/helpers\/)src(\/.+)\.mjs/;
|
|
174
|
-
const cookModuleId = (rawId) => {
|
|
175
|
-
const babelESMIndex = rawId.indexOf(BABEL_ESM);
|
|
176
|
-
if (babelESMIndex !== -1) {
|
|
177
|
-
return rawId.slice(0, babelESMIndex) + BABEL_CJS + rawId.slice(babelESMIndex + BABEL_ESM.length);
|
|
178
|
-
}
|
|
179
|
-
const swcHelpersIndex = rawId.indexOf("@swc/helpers/src/");
|
|
180
|
-
if (swcHelpersIndex === -1) {
|
|
181
|
-
return rawId.replace(SWC_HELPERS_RE, "$1lib$2.js");
|
|
182
|
-
}
|
|
183
|
-
return rawId;
|
|
184
|
-
};
|
|
185
171
|
class Module {
|
|
186
172
|
id;
|
|
187
173
|
filename;
|
|
@@ -221,8 +207,7 @@ class Module {
|
|
|
221
207
|
this.extensions = [".json", ".js", ".jsx", ".ts", ".tsx", ".cjs"];
|
|
222
208
|
this.debug("prepare", filename);
|
|
223
209
|
}
|
|
224
|
-
resolve = (
|
|
225
|
-
const id = cookModuleId(rawId);
|
|
210
|
+
resolve = (id) => {
|
|
226
211
|
const extensions = NativeModule._extensions;
|
|
227
212
|
const added = [];
|
|
228
213
|
try {
|
|
@@ -239,8 +224,7 @@ class Module {
|
|
|
239
224
|
}
|
|
240
225
|
};
|
|
241
226
|
require = Object.assign(
|
|
242
|
-
(
|
|
243
|
-
const id = cookModuleId(rawId);
|
|
227
|
+
(id) => {
|
|
244
228
|
this.debug("require", id);
|
|
245
229
|
if (id in builtins) {
|
|
246
230
|
if (builtins[id]) {
|