@plumeria/turbopack-loader 4.1.2 → 4.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.
Files changed (2) hide show
  1. package/dist/index.js +3 -17
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -21,22 +21,13 @@ async function loader(source) {
21
21
  }
22
22
  this.clearDependencies();
23
23
  this.addDependency(this.resourcePath);
24
- utils_1.tables.staticTable = (0, utils_1.scanForCreateStatic)((path) => this.addDependency(path));
25
- const { keyframesHashTableLocal, keyframesObjectTableLocal } = (0, utils_1.scanForKeyframes)((path) => this.addDependency(path));
26
- utils_1.tables.keyframesHashTable = keyframesHashTableLocal;
27
- utils_1.tables.keyframesObjectTable = keyframesObjectTableLocal;
28
- const { viewTransitionHashTableLocal, viewTransitionObjectTableLocal } = (0, utils_1.scanForViewTransition)((path) => this.addDependency(path));
29
- utils_1.tables.viewTransitionHashTable = viewTransitionHashTableLocal;
30
- utils_1.tables.viewTransitionObjectTable = viewTransitionObjectTableLocal;
31
- const { themeTableLocal, createThemeObjectTableLocal } = (0, utils_1.scanForCreateTheme)((path) => this.addDependency(path));
32
- utils_1.tables.themeTable = themeTableLocal;
33
- utils_1.tables.createThemeObjectTable = createThemeObjectTableLocal;
24
+ (0, utils_1.scanAll)((path) => this.addDependency(path));
34
25
  const ast = (0, core_1.parseSync)(source, {
35
26
  syntax: 'typescript',
36
27
  tsx: true,
37
28
  target: 'es2022',
38
29
  });
39
- const localConsts = (0, utils_1.collectLocalConsts)(ast);
30
+ const localConsts = (0, utils_1.collectLocalConsts)(ast, this.resourcePath);
40
31
  Object.assign(utils_1.tables.staticTable, localConsts);
41
32
  const isTSFile = this.resourcePath.endsWith('.ts') && !this.resourcePath.endsWith('.tsx');
42
33
  const localCreateStyles = {};
@@ -212,14 +203,10 @@ async function loader(source) {
212
203
  return;
213
204
  const styleInfo = localCreateStyles[node.value];
214
205
  if (styleInfo && !styleInfo.hasDynamicAccess) {
215
- const fullHashMap = {};
216
- Object.entries(styleInfo.hashMap).forEach(([key, atomMap]) => {
217
- fullHashMap[key] = Object.values(atomMap).join(' ');
218
- });
219
206
  replacements.push({
220
207
  start: node.span.start - ast.span.start,
221
208
  end: node.span.end - ast.span.start,
222
- content: JSON.stringify(fullHashMap),
209
+ content: JSON.stringify(styleInfo.hashMap),
223
210
  });
224
211
  }
225
212
  },
@@ -437,7 +424,6 @@ async function loader(source) {
437
424
  }
438
425
  const virtualCssRequest = stringifyRequest(this, `${VIRTUAL_CSS_PATH}`);
439
426
  const postfix = `\nimport ${virtualCssRequest};`;
440
- console.log(transformedSource);
441
427
  if (process.env.NODE_ENV === 'production')
442
428
  return callback(null, transformedSource);
443
429
  if (extractedSheets.length > 0 && process.env.NODE_ENV === 'development') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/turbopack-loader",
3
- "version": "4.1.2",
3
+ "version": "4.2.0",
4
4
  "description": "Plumeria Turbopack-loader",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -22,7 +22,7 @@
22
22
  "zero-virtual.css"
23
23
  ],
24
24
  "dependencies": {
25
- "@plumeria/utils": "^4.1.2"
25
+ "@plumeria/utils": "^4.2.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@swc/core": "1.15.8",