unplugin-stylex 0.6.2 → 0.6.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +143 -84
  3. package/dist/astro.cjs +15 -15
  4. package/dist/astro.d.ts +38 -16
  5. package/dist/astro.d.ts.map +1 -0
  6. package/dist/astro.js +3 -3
  7. package/dist/{chunk-KKH6K7RE.cjs → chunk-45JWH4GZ.cjs} +14 -11
  8. package/dist/{chunk-WUKLRLI4.js → chunk-5RGNKABP.js} +1 -1
  9. package/dist/{chunk-FEGNQ7CQ.js → chunk-SSMUIUHR.js} +14 -11
  10. package/dist/{chunk-O4FQWPVV.cjs → chunk-WDYGV6FU.cjs} +2 -2
  11. package/dist/core/build.d.ts +5 -0
  12. package/dist/core/build.d.ts.map +1 -0
  13. package/dist/core/options.d.ts +5 -0
  14. package/dist/core/options.d.ts.map +1 -0
  15. package/dist/core/plugins.d.ts +2 -0
  16. package/dist/core/plugins.d.ts.map +1 -0
  17. package/dist/core/transformers/astro.d.ts +3 -0
  18. package/dist/core/transformers/astro.d.ts.map +1 -0
  19. package/dist/core/transformers/default.d.ts +3 -0
  20. package/dist/core/transformers/default.d.ts.map +1 -0
  21. package/dist/core/transformers/index.d.ts +3 -0
  22. package/dist/core/transformers/index.d.ts.map +1 -0
  23. package/dist/core/transformers/svelte.d.ts +3 -0
  24. package/dist/core/transformers/svelte.d.ts.map +1 -0
  25. package/dist/esbuild.cjs +2 -2
  26. package/dist/esbuild.d.ts +18 -8
  27. package/dist/esbuild.d.ts.map +1 -0
  28. package/dist/esbuild.js +1 -1
  29. package/dist/farm.cjs +2 -2
  30. package/dist/farm.d.ts +19 -6
  31. package/dist/farm.d.ts.map +1 -0
  32. package/dist/farm.js +1 -1
  33. package/dist/index.cjs +2 -2
  34. package/dist/index.d.ts +7 -11
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +1 -1
  37. package/dist/rolldown.cjs +2 -2
  38. package/dist/rolldown.d.ts +20 -8
  39. package/dist/rolldown.d.ts.map +1 -0
  40. package/dist/rolldown.js +1 -1
  41. package/dist/rollup.cjs +2 -2
  42. package/dist/rollup.d.ts +17 -8
  43. package/dist/rollup.d.ts.map +1 -0
  44. package/dist/rollup.js +1 -1
  45. package/dist/rspack.cjs +2 -2
  46. package/dist/rspack.d.ts +17 -8
  47. package/dist/rspack.d.ts.map +1 -0
  48. package/dist/rspack.js +1 -1
  49. package/dist/types.d.ts +16 -10
  50. package/dist/types.d.ts.map +1 -0
  51. package/dist/utils/constants.d.ts +4 -0
  52. package/dist/utils/constants.d.ts.map +1 -0
  53. package/dist/utils/get-aliases.d.ts +4 -0
  54. package/dist/utils/get-aliases.d.ts.map +1 -0
  55. package/dist/utils/index.d.ts +5 -0
  56. package/dist/utils/index.d.ts.map +1 -0
  57. package/dist/utils/store.d.ts +4 -0
  58. package/dist/utils/store.d.ts.map +1 -0
  59. package/dist/utils/stylex-path.d.ts +4 -0
  60. package/dist/utils/stylex-path.d.ts.map +1 -0
  61. package/dist/vite.cjs +3 -3
  62. package/dist/vite.d.ts +18 -8
  63. package/dist/vite.d.ts.map +1 -0
  64. package/dist/vite.js +2 -2
  65. package/dist/webpack.cjs +2 -2
  66. package/dist/webpack.d.ts +17 -8
  67. package/dist/webpack.d.ts.map +1 -0
  68. package/dist/webpack.js +1 -1
  69. package/jsr.json +1 -1
  70. package/package.json +9 -7
  71. package/tsconfig.json +2 -5
  72. package/dist/astro.d.cts +0 -39
  73. package/dist/esbuild.d.cts +0 -14
  74. package/dist/farm.d.cts +0 -11
  75. package/dist/index.d.cts +0 -20
  76. package/dist/rolldown.d.cts +0 -14
  77. package/dist/rollup.d.cts +0 -14
  78. package/dist/rspack.d.cts +0 -15
  79. package/dist/types.d.cts +0 -41
  80. package/dist/vite.d.cts +0 -14
  81. package/dist/webpack.d.cts +0 -14
package/dist/webpack.d.ts CHANGED
@@ -1,14 +1,23 @@
1
- import { WebpackPluginInstance } from 'unplugin';
2
- import { UnpluginStylexInstance } from './types.js';
3
- import '@babel/core';
4
- import '@stylexjs/babel-plugin';
5
-
6
1
  /**
7
2
  * This entry file is for Webpack plugin.
8
3
  *
9
4
  * @module
10
5
  */
11
-
6
+ import type { WebpackPluginInstance } from 'unplugin';
7
+ import type { UnpluginStylexInstance } from './types';
12
8
  declare const webpackPlugin: UnpluginStylexInstance<WebpackPluginInstance>;
13
-
14
- export { webpackPlugin as default };
9
+ /**
10
+ * Webpack plugin
11
+ *
12
+ * @example
13
+ *
14
+ * import stylexPlugin from 'unplugin-stylex/webpack'
15
+ *
16
+ * module.exports = {
17
+ * plugins: [
18
+ * stylexPlugin(),
19
+ * ],
20
+ * }
21
+ */
22
+ export default webpackPlugin;
23
+ //# sourceMappingURL=webpack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack.d.ts","sourceRoot":"","sources":["../src/webpack.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAGrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAErD,QAAA,MAAM,aAAa,EAAE,sBAAsB,CAAC,qBAAqB,CAAwC,CAAA;AAEzG;;;;;;;;;;;;GAYG;AACH,eAAe,aAAa,CAAA"}
package/dist/webpack.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-FEGNQ7CQ.js";
3
+ } from "./chunk-SSMUIUHR.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
 
6
6
  // src/webpack.ts
package/jsr.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eryue0220/unplugin-stylex",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "exports": {
5
5
  "./index": "./src/index.ts",
6
6
  "./esbuild": "./src/esbuild.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-stylex",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Unplugin for stylex",
5
5
  "repository": "https://github.com/eryue0220/unplugin-stylex",
6
6
  "keywords": [
@@ -86,25 +86,27 @@
86
86
  "@babel/plugin-syntax-jsx": "^7.28.6",
87
87
  "@babel/plugin-syntax-typescript": "^7.28.6",
88
88
  "@rollup/pluginutils": "^5.1.4",
89
- "@stylexjs/babel-plugin": "^0.18.1",
89
+ "@stylexjs/babel-plugin": "^0.18.2",
90
90
  "unplugin": "^3.0.0"
91
91
  },
92
92
  "devDependencies": {
93
- "@biomejs/biome": "2.4.7",
93
+ "@biomejs/biome": "2.4.10",
94
94
  "@changesets/changelog-github": "^0.6.0",
95
95
  "@changesets/cli": "^2.30.0",
96
- "@types/node": "^25.5.0",
96
+ "@types/node": "^25.5.2",
97
97
  "@vitest/coverage-v8": "^4.0.15",
98
98
  "babel-plugin-syntax-hermes-parser": "^0.34.0",
99
99
  "jsr": "^0.14.3",
100
100
  "tsup": "^8.5.1",
101
- "typescript": "^5.9.3",
102
- "vite": "^8.0.0",
101
+ "typescript": "^6.0.2",
102
+ "vite": "^8.0.3",
103
103
  "vitest": "^4.0.15"
104
104
  },
105
105
  "scripts": {
106
106
  "dev": "tsup src/*ts --watch src",
107
- "build": "tsup src/*.ts --format cjs,esm --dts --splitting --clean",
107
+ "build": "pnpm run build:js && pnpm run build:types",
108
+ "build:js": "tsup src/*.ts --format cjs,esm --splitting --clean",
109
+ "build:types": "tsc -p tsconfig.json --emitDeclarationOnly --noCheck",
108
110
  "test": "vitest",
109
111
  "test:update": "vitest -u",
110
112
  "test:cov": "vitest --coverage",
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "allowSyntheticDefaultImports": true,
4
- "baseUrl": ".",
4
+ "rootDir": "./src",
5
5
  "declaration": true,
6
6
  "declarationMap": true,
7
7
  "declarationDir": "dist",
@@ -10,10 +10,7 @@
10
10
  "moduleResolution": "bundler",
11
11
  "preserveSymlinks": true,
12
12
  "module": "esnext",
13
- "skipLibCheck": true,
14
- "paths": {
15
- "@/*": ["./src/*"]
16
- }
13
+ "skipLibCheck": true
17
14
  },
18
15
  "include": ["src"],
19
16
  "exclude": ["node_modules"]
package/dist/astro.d.cts DELETED
@@ -1,39 +0,0 @@
1
- import { UnpluginStylexOptions } from './types.cjs';
2
- import '@babel/core';
3
- import '@stylexjs/babel-plugin';
4
-
5
- /**
6
- * This entry file is for astro plugin.
7
- *
8
- * @module
9
- */
10
-
11
- /**
12
- * Astro plugin
13
- *
14
- * @example
15
- *
16
- * import { defineConfig } from 'astro/config'
17
- * import stylexAstroPlugin from 'unplugin-stylex/astro'
18
- *
19
- * export default defineConfig({
20
- * integrations: [
21
- * stylexAstroPlugin(),
22
- * ],
23
- * })
24
- */
25
- declare function astro(options?: UnpluginStylexOptions): {
26
- name: string;
27
- hooks: {
28
- 'astro:config:setup': ({ config, updateConfig, injectScript }: {
29
- config: any;
30
- updateConfig: any;
31
- injectScript: any;
32
- }) => Promise<void>;
33
- 'astro:server:setup': ({ server }: {
34
- server: any;
35
- }) => void;
36
- };
37
- };
38
-
39
- export { astro as default };
@@ -1,14 +0,0 @@
1
- import { EsbuildPlugin } from 'unplugin';
2
- import { UnpluginStylexInstance } from './types.cjs';
3
- import '@babel/core';
4
- import '@stylexjs/babel-plugin';
5
-
6
- /**
7
- * This entry file is for esbuild plugin. Requires esbuild >= 0.15
8
- *
9
- * @module
10
- */
11
-
12
- declare const esbuildPlugin: UnpluginStylexInstance<EsbuildPlugin | EsbuildPlugin[]>;
13
-
14
- export { esbuildPlugin as default };
package/dist/farm.d.cts DELETED
@@ -1,11 +0,0 @@
1
- import { createFarmPlugin } from 'unplugin';
2
-
3
- /**
4
- * This entry file is for farm plugin.
5
- *
6
- * @module
7
- */
8
-
9
- declare const farmPlugin: ReturnType<typeof createFarmPlugin>;
10
-
11
- export { farmPlugin as default };
package/dist/index.d.cts DELETED
@@ -1,20 +0,0 @@
1
- import { UnpluginInstance, UnpluginFactory } from 'unplugin';
2
- import { UnpluginStylexOptions } from './types.cjs';
3
- export { BabelConfig, StylexOptions, UnpluginStylexInstance, UnpluginStylexTransformer } from './types.cjs';
4
- import '@babel/core';
5
- import '@stylexjs/babel-plugin';
6
-
7
- /**
8
- * This entry file is for main unplugin.
9
- *
10
- *
11
- * @module
12
- */
13
-
14
- /**
15
- * The main unplugin factory.
16
- */
17
- declare const unpluginFactory: UnpluginFactory<UnpluginStylexOptions | undefined>;
18
- declare const unplugin: UnpluginInstance<UnpluginStylexOptions | undefined, boolean>;
19
-
20
- export { UnpluginStylexOptions, unplugin as default, unplugin, unpluginFactory };
@@ -1,14 +0,0 @@
1
- import { RolldownPlugin } from 'unplugin';
2
- import { UnpluginStylexInstance } from './types.cjs';
3
- import '@babel/core';
4
- import '@stylexjs/babel-plugin';
5
-
6
- /**
7
- * This entry file is for rolldown plugin.
8
- *
9
- * @module
10
- */
11
-
12
- declare const rolldownPlugin: UnpluginStylexInstance<RolldownPlugin | RolldownPlugin[]>;
13
-
14
- export { rolldownPlugin as default };
package/dist/rollup.d.cts DELETED
@@ -1,14 +0,0 @@
1
- import { RollupPlugin } from 'unplugin';
2
- import { UnpluginStylexInstance } from './types.cjs';
3
- import '@babel/core';
4
- import '@stylexjs/babel-plugin';
5
-
6
- /**
7
- * This entry file is for Rollup plugin.
8
- *
9
- * @module
10
- */
11
-
12
- declare const rollupPlugin: UnpluginStylexInstance<RollupPlugin | RollupPlugin[]>;
13
-
14
- export { rollupPlugin as default };
package/dist/rspack.d.cts DELETED
@@ -1,15 +0,0 @@
1
- import { RspackPluginInstance } from 'unplugin';
2
- import { UnpluginStylexInstance } from './types.cjs';
3
- import '@babel/core';
4
- import '@stylexjs/babel-plugin';
5
-
6
- /**
7
- * This entry file is for Rspack plugin.
8
- *
9
- * @module
10
- */
11
-
12
- type RspackPluginType = UnpluginStylexInstance<RspackPluginInstance>;
13
- declare const rspackPlugin: RspackPluginType;
14
-
15
- export { rspackPlugin as default };
package/dist/types.d.cts DELETED
@@ -1,41 +0,0 @@
1
- import { SourceMap } from '@babel/core';
2
- import { Rule } from '@stylexjs/babel-plugin';
3
-
4
- type BabelConfig = {
5
- plugins: unknown[];
6
- presets: unknown[];
7
- babelrc: boolean;
8
- };
9
- type StylexOptions = {
10
- filename?: string;
11
- aliases?: Record<string, string | string[]>;
12
- stylexImports?: string[];
13
- classNamePrefix?: string;
14
- unstable_moduleResolution?: {
15
- type: 'commonJS' | 'haste';
16
- rootDir: string;
17
- };
18
- babelConfig?: BabelConfig;
19
- useCSSLayers?: boolean;
20
- genConditionalClasses?: boolean;
21
- treeshakeCompensation?: boolean;
22
- runtimeInjection?: boolean;
23
- };
24
- type UnpluginStylexOptions = {
25
- validExts?: RegExp | string[];
26
- dev?: boolean;
27
- stylex?: StylexOptions;
28
- };
29
- type UnpluginStylexInstance<T> = (options?: UnpluginStylexOptions) => T;
30
- type UnpluginStylexTransformer = (context: {
31
- inputCode: string;
32
- id: string;
33
- options: UnpluginStylexOptions;
34
- pluginContext: unknown;
35
- }) => Promise<{
36
- code: string;
37
- map?: SourceMap | null;
38
- stylexRules: Record<string, Rule[]>;
39
- }>;
40
-
41
- export type { BabelConfig, StylexOptions, UnpluginStylexInstance, UnpluginStylexOptions, UnpluginStylexTransformer };
package/dist/vite.d.cts DELETED
@@ -1,14 +0,0 @@
1
- import { VitePlugin } from 'unplugin';
2
- import { UnpluginStylexInstance } from './types.cjs';
3
- import '@babel/core';
4
- import '@stylexjs/babel-plugin';
5
-
6
- /**
7
- * This entry file is for Vite plugin.
8
- *
9
- * @module
10
- */
11
-
12
- declare const vitePlugin: UnpluginStylexInstance<VitePlugin | VitePlugin[]>;
13
-
14
- export { vitePlugin as default };
@@ -1,14 +0,0 @@
1
- import { WebpackPluginInstance } from 'unplugin';
2
- import { UnpluginStylexInstance } from './types.cjs';
3
- import '@babel/core';
4
- import '@stylexjs/babel-plugin';
5
-
6
- /**
7
- * This entry file is for Webpack plugin.
8
- *
9
- * @module
10
- */
11
-
12
- declare const webpackPlugin: UnpluginStylexInstance<WebpackPluginInstance>;
13
-
14
- export { webpackPlugin as default };