@griffel/transform 3.0.4 → 3.0.5

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 (188) hide show
  1. package/CHANGELOG.json +404 -0
  2. package/CHANGELOG.md +130 -0
  3. package/__fixtures__/assets/blank.jpg +0 -0
  4. package/__fixtures__/assets/code.ts +12 -0
  5. package/__fixtures__/assets/empty.jpg +0 -0
  6. package/__fixtures__/assets/output.meta.json +12 -0
  7. package/__fixtures__/assets/output.ts +12 -0
  8. package/__fixtures__/assets-multiple-declarations/blank.jpg +0 -0
  9. package/__fixtures__/assets-multiple-declarations/code.ts +8 -0
  10. package/__fixtures__/assets-multiple-declarations/empty.jpg +0 -0
  11. package/__fixtures__/assets-multiple-declarations/output.meta.json +9 -0
  12. package/__fixtures__/assets-multiple-declarations/output.ts +6 -0
  13. package/__fixtures__/assets-reset-styles/blank.jpg +0 -0
  14. package/__fixtures__/assets-reset-styles/code.ts +11 -0
  15. package/__fixtures__/assets-reset-styles/empty.jpg +0 -0
  16. package/__fixtures__/assets-reset-styles/output.meta.json +11 -0
  17. package/__fixtures__/assets-reset-styles/output.ts +7 -0
  18. package/__fixtures__/assets-urls/code.ts +13 -0
  19. package/__fixtures__/assets-urls/output.meta.json +14 -0
  20. package/__fixtures__/assets-urls/output.ts +10 -0
  21. package/__fixtures__/at-rules/code.ts +14 -0
  22. package/__fixtures__/at-rules/output.meta.json +15 -0
  23. package/__fixtures__/at-rules/output.ts +10 -0
  24. package/__fixtures__/config-classname-hash-salt/code.ts +5 -0
  25. package/__fixtures__/config-classname-hash-salt/output.meta.json +7 -0
  26. package/__fixtures__/config-classname-hash-salt/output.ts +3 -0
  27. package/__fixtures__/config-evaluation-rules/code.ts +8 -0
  28. package/__fixtures__/config-evaluation-rules/consts.ts +1 -0
  29. package/__fixtures__/config-evaluation-rules/output.meta.json +7 -0
  30. package/__fixtures__/config-evaluation-rules/output.ts +4 -0
  31. package/__fixtures__/config-evaluation-rules/sampleEvaluator.cjs +12 -0
  32. package/__fixtures__/error-argument-count/fixture.js +4 -0
  33. package/__fixtures__/error-cjs/fixture.js +4 -0
  34. package/__fixtures__/error-on-undefined/fixture.ts +7 -0
  35. package/__fixtures__/error-on-undefined/tokens.ts +1 -0
  36. package/__fixtures__/export-default/code.ts +6 -0
  37. package/__fixtures__/export-default/output.meta.json +14 -0
  38. package/__fixtures__/export-default/output.ts +6 -0
  39. package/__fixtures__/function-mixin/code.ts +6 -0
  40. package/__fixtures__/function-mixin/mixins.ts +7 -0
  41. package/__fixtures__/function-mixin/output.meta.json +7 -0
  42. package/__fixtures__/function-mixin/output.ts +4 -0
  43. package/__fixtures__/function-mixin/tokens.ts +3 -0
  44. package/__fixtures__/import-alias/code.ts +5 -0
  45. package/__fixtures__/import-alias/output.meta.json +7 -0
  46. package/__fixtures__/import-alias/output.ts +3 -0
  47. package/__fixtures__/import-custom-module/code.ts +6 -0
  48. package/__fixtures__/import-custom-module/output.meta.json +7 -0
  49. package/__fixtures__/import-custom-module/output.ts +4 -0
  50. package/__fixtures__/keyframes/code.ts +22 -0
  51. package/__fixtures__/keyframes/output.meta.json +17 -0
  52. package/__fixtures__/keyframes/output.ts +6 -0
  53. package/__fixtures__/multiple-declarations/code.ts +8 -0
  54. package/__fixtures__/multiple-declarations/output.meta.json +7 -0
  55. package/__fixtures__/multiple-declarations/output.ts +4 -0
  56. package/__fixtures__/non-existing-module-call/code.ts +10 -0
  57. package/__fixtures__/non-existing-module-call/module.ts +13 -0
  58. package/__fixtures__/non-existing-module-call/output.meta.json +7 -0
  59. package/__fixtures__/non-existing-module-call/output.ts +6 -0
  60. package/__fixtures__/object/code.ts +6 -0
  61. package/__fixtures__/object/output.meta.json +14 -0
  62. package/__fixtures__/object/output.ts +6 -0
  63. package/__fixtures__/object-computed-keys/code.ts +8 -0
  64. package/__fixtures__/object-computed-keys/output.meta.json +14 -0
  65. package/__fixtures__/object-computed-keys/output.ts +8 -0
  66. package/__fixtures__/object-imported-keys/code.ts +9 -0
  67. package/__fixtures__/object-imported-keys/consts.ts +2 -0
  68. package/__fixtures__/object-imported-keys/output.meta.json +7 -0
  69. package/__fixtures__/object-imported-keys/output.ts +4 -0
  70. package/__fixtures__/object-mixins/code.ts +11 -0
  71. package/__fixtures__/object-mixins/mixins.ts +17 -0
  72. package/__fixtures__/object-mixins/output.meta.json +16 -0
  73. package/__fixtures__/object-mixins/output.ts +10 -0
  74. package/__fixtures__/object-mixins/tokens.ts +3 -0
  75. package/__fixtures__/object-nesting/code.ts +13 -0
  76. package/__fixtures__/object-nesting/consts.ts +1 -0
  77. package/__fixtures__/object-nesting/output.meta.json +9 -0
  78. package/__fixtures__/object-nesting/output.ts +6 -0
  79. package/__fixtures__/object-reset/code.ts +8 -0
  80. package/__fixtures__/object-reset/output.meta.json +7 -0
  81. package/__fixtures__/object-reset/output.ts +5 -0
  82. package/__fixtures__/object-sequence-expr/code.ts +16 -0
  83. package/__fixtures__/object-sequence-expr/output.meta.json +7 -0
  84. package/__fixtures__/object-sequence-expr/output.ts +7 -0
  85. package/__fixtures__/object-shorthands/code.ts +8 -0
  86. package/__fixtures__/object-shorthands/output.meta.json +20 -0
  87. package/__fixtures__/object-shorthands/output.ts +5 -0
  88. package/__fixtures__/object-variables/code.ts +9 -0
  89. package/__fixtures__/object-variables/output.meta.json +15 -0
  90. package/__fixtures__/object-variables/output.ts +9 -0
  91. package/__fixtures__/object-variables/vars.ts +5 -0
  92. package/__fixtures__/reset-styles/code.ts +6 -0
  93. package/__fixtures__/reset-styles/output.meta.json +7 -0
  94. package/__fixtures__/reset-styles/output.ts +3 -0
  95. package/__fixtures__/reset-styles-at-rules/code.ts +7 -0
  96. package/__fixtures__/reset-styles-at-rules/output.meta.json +8 -0
  97. package/__fixtures__/reset-styles-at-rules/output.ts +3 -0
  98. package/__fixtures__/rules-with-metadata/code.ts +9 -0
  99. package/__fixtures__/rules-with-metadata/output.meta.json +14 -0
  100. package/__fixtures__/rules-with-metadata/output.ts +3 -0
  101. package/__fixtures__/shared-mixins/code.ts +7 -0
  102. package/__fixtures__/shared-mixins/mixins.ts +6 -0
  103. package/__fixtures__/shared-mixins/output.meta.json +7 -0
  104. package/__fixtures__/shared-mixins/output.ts +8 -0
  105. package/__fixtures__/static-styles/code.ts +7 -0
  106. package/__fixtures__/static-styles/output.meta.json +7 -0
  107. package/__fixtures__/static-styles/output.ts +3 -0
  108. package/__fixtures__/static-styles-array/code.ts +10 -0
  109. package/__fixtures__/static-styles-array/output.meta.json +7 -0
  110. package/__fixtures__/static-styles-array/output.ts +3 -0
  111. package/__fixtures__/static-styles-string/code.ts +3 -0
  112. package/__fixtures__/static-styles-string/output.meta.json +7 -0
  113. package/__fixtures__/static-styles-string/output.ts +3 -0
  114. package/__fixtures__/tokens/code.ts +11 -0
  115. package/__fixtures__/tokens/output.meta.json +12 -0
  116. package/__fixtures__/tokens/output.ts +7 -0
  117. package/__fixtures__/tokens/tokens.ts +4 -0
  118. package/__fixtures__/unsupported-css-properties/fixture.ts +16 -0
  119. package/__fixtures__/unsupported-css-properties/output.meta.json +5 -0
  120. package/__fixtures__/unsupported-css-properties/output.ts +3 -0
  121. package/eslint.config.mjs +31 -0
  122. package/package.json +7 -8
  123. package/project.json +51 -0
  124. package/src/{constants.mjs → constants.mts} +0 -1
  125. package/src/evaluation/astEvaluator.mts +109 -0
  126. package/src/evaluation/astEvaluator.test.mts +126 -0
  127. package/src/evaluation/batchEvaluator.mts +79 -0
  128. package/src/evaluation/evalCache.mts +84 -0
  129. package/src/evaluation/fluentTokensPlugin.mts +82 -0
  130. package/src/evaluation/fluentTokensPlugin.test.mts +130 -0
  131. package/src/evaluation/module.mts +271 -0
  132. package/src/evaluation/module.test.mts +133 -0
  133. package/src/evaluation/{process.mjs → process.mts} +12 -7
  134. package/src/evaluation/types.mts +49 -0
  135. package/src/evaluation/vmEvaluator.mts +45 -0
  136. package/src/evaluation/vmEvaluator.test.mts +30 -0
  137. package/src/{index.d.mts → index.mts} +4 -0
  138. package/src/transformSync.mts +425 -0
  139. package/src/transformSync.test.mts +429 -0
  140. package/src/types.mts +13 -0
  141. package/src/utils/convertESMtoCJS.mts +226 -0
  142. package/src/utils/convertESMtoCJS.test.mts +159 -0
  143. package/src/utils/dedupeCSSRules.mts +25 -0
  144. package/src/utils/dedupeCSSRules.test.mts +39 -0
  145. package/tsconfig.json +19 -0
  146. package/tsconfig.lib.json +30 -0
  147. package/tsconfig.spec.json +24 -0
  148. package/vitest.config.mts +18 -0
  149. package/LICENSE.md +0 -21
  150. package/src/constants.d.mts +0 -2
  151. package/src/constants.mjs.map +0 -1
  152. package/src/evaluation/astEvaluator.d.mts +0 -20
  153. package/src/evaluation/astEvaluator.mjs +0 -90
  154. package/src/evaluation/astEvaluator.mjs.map +0 -1
  155. package/src/evaluation/batchEvaluator.d.mts +0 -13
  156. package/src/evaluation/batchEvaluator.mjs +0 -54
  157. package/src/evaluation/batchEvaluator.mjs.map +0 -1
  158. package/src/evaluation/evalCache.d.mts +0 -9
  159. package/src/evaluation/evalCache.mjs +0 -65
  160. package/src/evaluation/evalCache.mjs.map +0 -1
  161. package/src/evaluation/fluentTokensPlugin.d.mts +0 -2
  162. package/src/evaluation/fluentTokensPlugin.mjs +0 -70
  163. package/src/evaluation/fluentTokensPlugin.mjs.map +0 -1
  164. package/src/evaluation/module.d.mts +0 -44
  165. package/src/evaluation/module.mjs +0 -207
  166. package/src/evaluation/module.mjs.map +0 -1
  167. package/src/evaluation/process.d.mts +0 -24
  168. package/src/evaluation/process.mjs.map +0 -1
  169. package/src/evaluation/types.d.mts +0 -34
  170. package/src/evaluation/types.mjs +0 -2
  171. package/src/evaluation/types.mjs.map +0 -1
  172. package/src/evaluation/vmEvaluator.d.mts +0 -3
  173. package/src/evaluation/vmEvaluator.mjs +0 -33
  174. package/src/evaluation/vmEvaluator.mjs.map +0 -1
  175. package/src/index.mjs +0 -9
  176. package/src/index.mjs.map +0 -1
  177. package/src/transformSync.d.mts +0 -41
  178. package/src/transformSync.mjs +0 -252
  179. package/src/transformSync.mjs.map +0 -1
  180. package/src/types.d.mts +0 -12
  181. package/src/types.mjs +0 -2
  182. package/src/types.mjs.map +0 -1
  183. package/src/utils/convertESMtoCJS.d.mts +0 -6
  184. package/src/utils/convertESMtoCJS.mjs +0 -203
  185. package/src/utils/convertESMtoCJS.mjs.map +0 -1
  186. package/src/utils/dedupeCSSRules.d.mts +0 -6
  187. package/src/utils/dedupeCSSRules.mjs +0 -19
  188. package/src/utils/dedupeCSSRules.mjs.map +0 -1
@@ -0,0 +1,159 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { convertESMtoCJS } from './convertESMtoCJS.mjs';
3
+
4
+ describe('convertESMtoCJS', () => {
5
+ it('throws on parse errors', () => {
6
+ expect(() => convertESMtoCJS('for (const key of ) {}', '/test.js')).toThrowError(
7
+ /convertESMtoCJS: failed to parse/,
8
+ );
9
+ });
10
+
11
+ it('returns CJS code unchanged', () => {
12
+ const code = 'const x = require("foo");\nmodule.exports = x;';
13
+ expect(convertESMtoCJS(code, '/test.js')).toBe(code);
14
+ });
15
+
16
+ it('converts side-effect import', () => {
17
+ expect(convertESMtoCJS('import "./foo";', '/test.js')).toMatchInlineSnapshot(`
18
+ "Object.defineProperty(exports, "__esModule", { value: true });
19
+ require("./foo");"
20
+ `);
21
+ });
22
+
23
+ it('converts named import', () => {
24
+ expect(convertESMtoCJS('import { foo } from "./foo";', '/test.js')).toMatchInlineSnapshot(`
25
+ "Object.defineProperty(exports, "__esModule", { value: true });
26
+ const { foo } = require("./foo");"
27
+ `);
28
+ });
29
+
30
+ it('converts aliased named import', () => {
31
+ expect(convertESMtoCJS('import { foo as bar } from "./foo";', '/test.js')).toMatchInlineSnapshot(`
32
+ "Object.defineProperty(exports, "__esModule", { value: true });
33
+ const { foo: bar } = require("./foo");"
34
+ `);
35
+ });
36
+
37
+ it('converts default import', () => {
38
+ expect(convertESMtoCJS('import foo from "./foo";', '/test.js')).toMatchInlineSnapshot(`
39
+ "Object.defineProperty(exports, "__esModule", { value: true });
40
+ const _require$foo = require("./foo");
41
+ const foo = _require$foo.__esModule ? _require$foo.default : _require$foo;"
42
+ `);
43
+ });
44
+
45
+ it('converts namespace import', () => {
46
+ expect(convertESMtoCJS('import * as foo from "./foo";', '/test.js')).toMatchInlineSnapshot(`
47
+ "Object.defineProperty(exports, "__esModule", { value: true });
48
+ const foo = require("./foo");"
49
+ `);
50
+ });
51
+
52
+ it('converts default + named imports', () => {
53
+ expect(convertESMtoCJS('import foo, { bar } from "./foo";', '/test.js')).toMatchInlineSnapshot(`
54
+ "Object.defineProperty(exports, "__esModule", { value: true });
55
+ const _require$foo = require("./foo");
56
+ const foo = _require$foo.__esModule ? _require$foo.default : _require$foo;
57
+ const { bar } = _require$foo;"
58
+ `);
59
+ });
60
+
61
+ it('converts export const', () => {
62
+ expect(convertESMtoCJS('export const x = 1;', '/test.js')).toMatchInlineSnapshot(`
63
+ "Object.defineProperty(exports, "__esModule", { value: true });
64
+ const x = 1;
65
+ exports.x = x;"
66
+ `);
67
+ });
68
+
69
+ it('converts export const with destructuring', () => {
70
+ expect(convertESMtoCJS('export const { a, b } = obj;', '/test.js')).toMatchInlineSnapshot(`
71
+ "Object.defineProperty(exports, "__esModule", { value: true });
72
+ const { a, b } = obj;
73
+ exports.a = a;
74
+ exports.b = b;"
75
+ `);
76
+ });
77
+
78
+ it('converts export function', () => {
79
+ expect(convertESMtoCJS('export function foo() {}', '/test.js')).toMatchInlineSnapshot(`
80
+ "Object.defineProperty(exports, "__esModule", { value: true });
81
+ function foo() {}
82
+ exports.foo = foo;"
83
+ `);
84
+ });
85
+
86
+ it('defers export var assignment for TS enum IIFE pattern', () => {
87
+ const code = [
88
+ 'export var Depths;',
89
+ '(function (Depths) {',
90
+ ' Depths.depth4 = "shadow";',
91
+ '})(Depths || (Depths = {}));',
92
+ ].join('\n');
93
+
94
+ expect(convertESMtoCJS(code, '/test.js')).toMatchInlineSnapshot(`
95
+ "Object.defineProperty(exports, "__esModule", { value: true });
96
+ var Depths;
97
+ (function (Depths) {
98
+ Depths.depth4 = "shadow";
99
+ })(Depths || (Depths = {}));
100
+ exports.Depths = Depths;"
101
+ `);
102
+ });
103
+
104
+ it('converts export { name }', () => {
105
+ expect(convertESMtoCJS('const x = 1;\nexport { x };', '/test.js')).toMatchInlineSnapshot(`
106
+ "Object.defineProperty(exports, "__esModule", { value: true });
107
+ const x = 1;
108
+ exports["x"] = x;"
109
+ `);
110
+ });
111
+
112
+ it('converts re-export from another module', () => {
113
+ expect(convertESMtoCJS('export { foo } from "./bar";', '/test.js')).toMatchInlineSnapshot(`
114
+ "Object.defineProperty(exports, "__esModule", { value: true });
115
+ exports["foo"] = require("./bar")["foo"];"
116
+ `);
117
+ });
118
+
119
+ it('converts export default expression', () => {
120
+ expect(convertESMtoCJS('export default 42;', '/test.js')).toMatchInlineSnapshot(`
121
+ "Object.defineProperty(exports, "__esModule", { value: true });
122
+ exports.default = 42;"
123
+ `);
124
+ });
125
+
126
+ it('converts export default named function', () => {
127
+ expect(convertESMtoCJS('export default function foo() {}', '/test.js')).toMatchInlineSnapshot(`
128
+ "Object.defineProperty(exports, "__esModule", { value: true });
129
+ function foo() {}
130
+ exports.default = foo;"
131
+ `);
132
+ });
133
+
134
+ it('converts export * from', () => {
135
+ expect(convertESMtoCJS('export * from "./foo";', '/test.js')).toMatchInlineSnapshot(`
136
+ "Object.defineProperty(exports, "__esModule", { value: true });
137
+ Object.assign(exports, require("./foo"));"
138
+ `);
139
+ });
140
+
141
+ it('converts export * as name from', () => {
142
+ expect(convertESMtoCJS('export * as ns from "./foo";', '/test.js')).toMatchInlineSnapshot(`
143
+ "Object.defineProperty(exports, "__esModule", { value: true });
144
+ exports["ns"] = require("./foo");"
145
+ `);
146
+ });
147
+
148
+ it('handles "use strict" directive with ESM exports', () => {
149
+ const code = '"use strict";\nexport const foo = 1;\nexport class Bar {}';
150
+ expect(convertESMtoCJS(code, '/test.js')).toMatchInlineSnapshot(`
151
+ "Object.defineProperty(exports, "__esModule", { value: true });
152
+ "use strict";
153
+ const foo = 1;
154
+ class Bar {}
155
+ exports.foo = foo;
156
+ exports.Bar = Bar;"
157
+ `);
158
+ });
159
+ });
@@ -0,0 +1,25 @@
1
+ import type { CSSRulesByBucket, CSSBucketEntry } from '@griffel/core';
2
+
3
+ /**
4
+ * Rules that are returned by `resolveStyles()` are not deduplicated.
5
+ * It's critical to filter out duplicates for build-time transform to avoid duplicated rules in a bundle.
6
+ */
7
+ export function dedupeCSSRules(cssRulesByBucket: CSSRulesByBucket): CSSRulesByBucket {
8
+ return Object.fromEntries(
9
+ Object.entries(cssRulesByBucket).map(([styleBucketName, cssBucketEntries]) => {
10
+ if (styleBucketName === 'm') {
11
+ const seen = new Map<string, CSSBucketEntry>();
12
+
13
+ for (const entry of cssBucketEntries) {
14
+ if (!seen.has(entry[0])) {
15
+ seen.set(entry[0], entry);
16
+ }
17
+ }
18
+
19
+ return [styleBucketName, Array.from(seen.values())];
20
+ }
21
+
22
+ return [styleBucketName, Array.from(new Set(cssBucketEntries))];
23
+ }),
24
+ );
25
+ }
@@ -0,0 +1,39 @@
1
+ import type { CSSRulesByBucket } from '@griffel/core';
2
+ import { expect, it, describe } from 'vitest';
3
+
4
+ import { dedupeCSSRules } from './dedupeCSSRules.mjs';
5
+
6
+ describe('dedupeCSSRules', () => {
7
+ it('dedupes simple rules', () => {
8
+ const rules: CSSRulesByBucket = {
9
+ d: ['.foo { color: red; }', '.foo { color: red; }', '.baz { color: pink }'],
10
+ };
11
+
12
+ expect(dedupeCSSRules(rules)).toMatchObject({
13
+ d: ['.foo { color: red; }', '.baz { color: pink }'],
14
+ });
15
+ });
16
+
17
+ it('dedupes rules with metadata', () => {
18
+ const rules: CSSRulesByBucket = {
19
+ m: [
20
+ ['@media (min-width: 480px) { .foo { color: red; } }', { m: '(min-width: 480px)' }],
21
+ ['@media (min-width: 480px) { .baz { color: pink; } }', { m: '(min-width: 480px)' }],
22
+
23
+ ['@media (min-width: 600px) { .foo { color: red; } }', { m: '(min-width: 600px)' }],
24
+ ['@media (min-width: 600px) { .foo { color: red; } }', { m: '(min-width: 600px)' }],
25
+ ['@media (min-width: 600px) { .baz { color: pink; } }', { m: '(min-width: 600px)' }],
26
+ ],
27
+ };
28
+
29
+ expect(dedupeCSSRules(rules)).toMatchObject({
30
+ m: [
31
+ ['@media (min-width: 480px) { .foo { color: red; } }', { m: '(min-width: 480px)' }],
32
+ ['@media (min-width: 480px) { .baz { color: pink; } }', { m: '(min-width: 480px)' }],
33
+
34
+ ['@media (min-width: 600px) { .foo { color: red; } }', { m: '(min-width: 600px)' }],
35
+ ['@media (min-width: 600px) { .baz { color: pink; } }', { m: '(min-width: 600px)' }],
36
+ ],
37
+ });
38
+ });
39
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "allowJs": true,
5
+ "module": "NodeNext",
6
+ "moduleResolution": "NodeNext",
7
+ "target": "ES2022"
8
+ },
9
+ "files": [],
10
+ "include": [],
11
+ "references": [
12
+ {
13
+ "path": "./tsconfig.lib.json"
14
+ },
15
+ {
16
+ "path": "./tsconfig.spec.json"
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "outDir": "../../dist/out-tsc",
7
+ "declaration": true,
8
+ "types": ["node", "environment"]
9
+ },
10
+ "exclude": [
11
+ "__fixtures__/**/*",
12
+ "**/*.spec.ts",
13
+ "**/*.test.ts",
14
+ "jest.config.ts",
15
+ "vite.config.ts",
16
+ "vite.config.mts",
17
+ "vitest.config.ts",
18
+ "vitest.config.mts",
19
+ "src/**/*.test.ts",
20
+ "src/**/*.test.mts",
21
+ "src/**/*.spec.ts",
22
+ "src/**/*.test.tsx",
23
+ "src/**/*.spec.tsx",
24
+ "src/**/*.test.js",
25
+ "src/**/*.spec.js",
26
+ "src/**/*.test.jsx",
27
+ "src/**/*.spec.jsx"
28
+ ],
29
+ "include": ["**/*.mts"]
30
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "../../dist/out-tsc",
5
+ "typeRoots": ["../../node_modules", "../../node_modules/@types", "../../typings"],
6
+ "types": ["vitest/importMeta", "vite/client", "node", "vitest", "environment"]
7
+ },
8
+ "include": [
9
+ "vite.config.ts",
10
+ "vite.config.mts",
11
+ "vitest.config.ts",
12
+ "vitest.config.mts",
13
+ "src/**/*.test.ts",
14
+ "src/**/*.test.mts",
15
+ "src/**/*.spec.ts",
16
+ "src/**/*.test.tsx",
17
+ "src/**/*.spec.tsx",
18
+ "src/**/*.test.js",
19
+ "src/**/*.spec.js",
20
+ "src/**/*.test.jsx",
21
+ "src/**/*.spec.jsx",
22
+ "src/**/*.d.ts"
23
+ ]
24
+ }
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from 'vitest/config';
2
+ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
3
+
4
+ export default defineConfig({
5
+ root: __dirname,
6
+ cacheDir: '../../node_modules/.vite/packages/transform',
7
+ plugins: [nxViteTsPaths()],
8
+ test: {
9
+ watch: false,
10
+ environment: 'node',
11
+ include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
12
+ reporters: ['default'],
13
+ coverage: {
14
+ reportsDirectory: '../../coverage/packages/transform',
15
+ provider: 'v8',
16
+ },
17
+ },
18
+ });
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE
@@ -1,2 +0,0 @@
1
- export declare const ASSET_TAG_OPEN = "<griffel-asset>";
2
- export declare const ASSET_TAG_CLOSE = "</griffel-asset>";
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../../../packages/transform/src/constants.mts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAChD,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC"}
@@ -1,20 +0,0 @@
1
- import type { Node, Program } from 'oxc-parser';
2
- import type { EvaluationResult, AstEvaluatorPlugin } from './types.mjs';
3
- /**
4
- * Sentinel value returned by plugins and evaluateNode to signal "can't handle this node".
5
- * Using a symbol avoids the cost of Error construction and stack trace capture.
6
- */
7
- export declare const DEOPT: unique symbol;
8
- export type Deopt = typeof DEOPT;
9
- /**
10
- * Simple static evaluator for object expressions with nested objects.
11
- * Based on Babel's evaluation approach but simplified for our specific use case.
12
- *
13
- * Handles:
14
- * - Objects with nested objects: { root: { color: 'red', padding: 0 } }
15
- * - String literals, numeric literals, boolean literals, null
16
- * - Simple property access
17
- *
18
- * Plugins can extend evaluation to handle additional node types.
19
- */
20
- export declare function astEvaluator(node: Node, programAst: Program, plugins?: AstEvaluatorPlugin[]): EvaluationResult;
@@ -1,90 +0,0 @@
1
- /**
2
- * Sentinel value returned by plugins and evaluateNode to signal "can't handle this node".
3
- * Using a symbol avoids the cost of Error construction and stack trace capture.
4
- */
5
- export const DEOPT = Symbol('deopt');
6
- /**
7
- * Simple static evaluator for object expressions with nested objects.
8
- * Based on Babel's evaluation approach but simplified for our specific use case.
9
- *
10
- * Handles:
11
- * - Objects with nested objects: { root: { color: 'red', padding: 0 } }
12
- * - String literals, numeric literals, boolean literals, null
13
- * - Simple property access
14
- *
15
- * Plugins can extend evaluation to handle additional node types.
16
- */
17
- export function astEvaluator(node, programAst, plugins = []) {
18
- const context = {
19
- programAst,
20
- evaluateNode,
21
- };
22
- function evaluateNode(node) {
23
- // Base cases
24
- switch (node.type) {
25
- case 'Literal':
26
- return node.value;
27
- case 'ObjectExpression':
28
- return evaluateObjectExpression(node);
29
- case 'TemplateLiteral':
30
- if (node.expressions.length === 0) {
31
- return node.quasis[0].value.cooked;
32
- }
33
- break;
34
- }
35
- // Try plugins in order
36
- // ---
37
- for (const plugin of plugins) {
38
- const result = plugin.evaluateNode(node, context);
39
- if (result !== DEOPT) {
40
- return result;
41
- }
42
- }
43
- return DEOPT;
44
- }
45
- function evaluateObjectExpression(node) {
46
- const obj = {};
47
- for (const prop of node.properties) {
48
- if (prop.type !== 'Property' || prop.kind !== 'init') {
49
- return DEOPT;
50
- }
51
- let key;
52
- if (prop.computed) {
53
- return DEOPT;
54
- }
55
- else if (prop.key.type === 'Identifier') {
56
- key = prop.key.name;
57
- }
58
- else if (prop.key.type === 'Literal') {
59
- const keyLiteral = prop.key;
60
- if (typeof keyLiteral.value === 'string' || typeof keyLiteral.value === 'number') {
61
- key = String(keyLiteral.value);
62
- }
63
- else {
64
- return DEOPT;
65
- }
66
- }
67
- else {
68
- return DEOPT;
69
- }
70
- const value = evaluateNode(prop.value);
71
- if (value === DEOPT) {
72
- return DEOPT;
73
- }
74
- obj[key] = value;
75
- }
76
- return obj;
77
- }
78
- const result = evaluateNode(node);
79
- if (result === DEOPT) {
80
- return {
81
- confident: false,
82
- value: undefined,
83
- };
84
- }
85
- return {
86
- confident: true,
87
- value: result,
88
- };
89
- }
90
- //# sourceMappingURL=astEvaluator.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"astEvaluator.mjs","sourceRoot":"","sources":["../../../../../packages/transform/src/evaluation/astEvaluator.mts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAkB,MAAM,CAAC,OAAO,CAAC,CAAC;AAGpD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,IAAU,EAAE,UAAmB,EAAE,UAAgC,EAAE;IAC9F,MAAM,OAAO,GAAwB;QACnC,UAAU;QACV,YAAY;KACb,CAAC;IAEF,SAAS,YAAY,CAAC,IAAU;QAC9B,aAAa;QACb,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAC,KAAK,CAAC;YAEpB,KAAK,kBAAkB;gBACrB,OAAO,wBAAwB,CAAC,IAAI,CAAC,CAAC;YAExC,KAAK,iBAAiB;gBACpB,IAAK,IAAwB,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACvD,OAAQ,IAAwB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;gBAC1D,CAAC;gBACD,MAAM;QACV,CAAC;QAED,uBAAuB;QACvB,MAAM;QAEN,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAElD,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;gBACrB,OAAO,MAAM,CAAC;YAChB,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,SAAS,wBAAw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L,SAAS,EAAE,KAAK;YAChB,KAAK,EAAE,SAAS;SACjB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,MAAM;KACd,CAAC;AACJ,CAAC"}
@@ -1,13 +0,0 @@
1
- import type { Program } from 'oxc-parser';
2
- import type { StyleCall } from '../types.mjs';
3
- import type { TransformResolver } from './module.mjs';
4
- import type { AstEvaluatorPlugin, EvalRule } from './types.mjs';
5
- /**
6
- * Batch evaluates all style calls in a file for better performance.
7
- * Uses static evaluation first, then falls back to VM evaluation for complex expressions.
8
- * Optimizes VM evaluation by sharing module loading and parsing overhead.
9
- */
10
- export declare function batchEvaluator(sourceCode: string, filename: string, styleCalls: StyleCall[], evaluationRules: EvalRule[], resolveFilename: TransformResolver, programAst: Program, astEvaluationPlugins?: AstEvaluatorPlugin[]): {
11
- usedVMForEvaluation: boolean;
12
- evaluationResults: unknown[];
13
- };
@@ -1,54 +0,0 @@
1
- import { astEvaluator } from './astEvaluator.mjs';
2
- import { vmEvaluator } from './vmEvaluator.mjs';
3
- /**
4
- * Batch evaluates all style calls in a file for better performance.
5
- * Uses static evaluation first, then falls back to VM evaluation for complex expressions.
6
- * Optimizes VM evaluation by sharing module loading and parsing overhead.
7
- */
8
- export function batchEvaluator(sourceCode, filename, styleCalls, evaluationRules, resolveFilename, programAst, astEvaluationPlugins = []) {
9
- const evaluationResults = new Array(styleCalls.length);
10
- // Track which indices need VM evaluation and build the expression code string
11
- const vmIndices = [];
12
- let expressionCode = '';
13
- // First pass: try static evaluation for all calls
14
- for (let i = 0; i < styleCalls.length; i++) {
15
- const styleCall = styleCalls[i];
16
- const staticResult = astEvaluator(styleCall.argumentNode, programAst, astEvaluationPlugins);
17
- if (staticResult.confident) {
18
- evaluationResults[i] = staticResult.value;
19
- continue;
20
- }
21
- // Mark for VM evaluation
22
- if (expressionCode.length > 0) {
23
- expressionCode += ',';
24
- }
25
- expressionCode += styleCall.argumentCode;
26
- vmIndices.push(i);
27
- }
28
- if (vmIndices.length === 0) {
29
- return {
30
- usedVMForEvaluation: false,
31
- evaluationResults,
32
- };
33
- }
34
- // Second pass: batch VM evaluation for complex expressions
35
- const vmResult = vmEvaluator(sourceCode, filename, expressionCode, evaluationRules, resolveFilename);
36
- if (!vmResult.confident) {
37
- if (vmResult.error) {
38
- throw vmResult.error;
39
- }
40
- else {
41
- throw new Error('Evaluation of a code fragment failed, this is a bug, please report it');
42
- }
43
- }
44
- // Map VM results back to correct indices
45
- const vmValues = vmResult.value;
46
- for (let i = 0; i < vmIndices.length; i++) {
47
- evaluationResults[vmIndices[i]] = vmValues[i];
48
- }
49
- return {
50
- usedVMForEvaluation: true,
51
- evaluationResults,
52
- };
53
- }
54
- //# sourceMappingURL=batchEvaluator.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"batchEvaluator.mjs","sourceRoot":"","sources":["../../../../../packages/transform/src/evaluation/batchEvaluator.mts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,UAAkB,EAClB,QAAgB,EAChB,UAAuB,EACvB,eAA2B,EAC3B,eAAkC,EAClC,UAAmB,EACnB,uBAA6C,EAAE;IAK/C,MAAM,iBAAiB,GAAc,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAElE,8EAA8E;IAC9E,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,IAAI,cAAc,GAAG,EAAE,CAAC;IAExB,kDAAkD;IAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,YAAY,GAAG,YAAY,CAAC,SAAS,CAAC,YAAY,E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
- * Evaluation cache for module results.
3
- * Copied from @linaria/babel-preset v3.0.0-beta.19, adapted to use `debug` package.
4
- */
5
- export declare const clear: () => void;
6
- export declare const clearForFile: (filename: string) => void;
7
- export declare const has: ([filename, ...exports]: string[], text: string) => boolean;
8
- export declare const get: ([filename, ...exports]: string[], text: string) => unknown;
9
- export declare const set: ([filename, ...exports]: string[], text: string, value: unknown) => void;
@@ -1,65 +0,0 @@
1
- /**
2
- * Evaluation cache for module results.
3
- * Copied from @linaria/babel-preset v3.0.0-beta.19, adapted to use `debug` package.
4
- */
5
- import { createHash } from 'node:crypto';
6
- import createDebug from 'debug';
7
- const debug = createDebug('griffel:eval-cache');
8
- const fileHashes = new Map();
9
- const evalCache = new Map();
10
- const fileKeys = new Map();
11
- const hash = (text) => createHash('sha1').update(text).digest('base64');
12
- let lastText = '';
13
- let lastHash = hash(lastText);
14
- const memoizedHash = (text) => {
15
- if (lastText !== text) {
16
- lastHash = hash(text);
17
- lastText = text;
18
- }
19
- return lastHash;
20
- };
21
- const toKey = (filename, exports) => exports.length > 0 ? `${filename}:${exports.join(',')}` : filename;
22
- export const clear = () => {
23
- fileHashes.clear();
24
- evalCache.clear();
25
- fileKeys.clear();
26
- };
27
- export const clearForFile = (filename) => {
28
- const keys = fileKeys.get(filename) ?? [];
29
- if (keys.length === 0) {
30
- return;
31
- }
32
- debug('clear-for-file', filename);
33
- keys.forEach(key => {
34
- fileHashes.delete(key);
35
- evalCache.delete(key);
36
- });
37
- fileKeys.set(filename, []);
38
- };
39
- export const has = ([filename, ...exports], text) => {
40
- const key = toKey(filename, exports);
41
- const textHash = memoizedHash(text);
42
- debug('has', `${key} ${textHash}`);
43
- return fileHashes.get(key) === textHash;
44
- };
45
- export const get = ([filename, ...exports], text) => {
46
- const key = toKey(filename, exports);
47
- const textHash = memoizedHash(text);
48
- debug('get', `${key} ${textHash}`);
49
- if (fileHashes.get(key) !== textHash) {
50
- return undefined;
51
- }
52
- return evalCache.get(key);
53
- };
54
- export const set = ([filename, ...exports], text, value) => {
55
- const key = toKey(filename, exports);
56
- const textHash = memoizedHash(text);
57
- debug('set', `${key} ${textHash}`);
58
- fileHashes.set(key, textHash);
59
- evalCache.set(key, value);
60
- if (!fileKeys.has(filename)) {
61
- fileKeys.set(filename, []);
62
- }
63
- fileKeys.get(filename).push(key);
64
- };
65
- //# sourceMappingURL=evalCache.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"evalCache.mjs","sourceRoot":"","sources":["../../../../../packages/transform/src/evaluation/evalCache.mts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AAEhD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC7C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAmB,CAAC;AAC7C,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAoB,CAAC;AAE7C,MAAM,IAAI,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAExF,IAAI,QAAQ,GAAG,EAAE,CAAC;AAClB,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;AAE9B,MAAM,YAAY,GAAG,CAAC,IAAY,EAAU,EAAE;IAC5C,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,QAAQ,GAAG,IAAI,CAAC;IAClB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,QAAgB,EAAE,OAAiB,EAAU,EAAE,CAC5D,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,C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