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.
- package/CHANGELOG.md +6 -0
- package/README.md +143 -84
- package/dist/astro.cjs +15 -15
- package/dist/astro.d.ts +38 -16
- package/dist/astro.d.ts.map +1 -0
- package/dist/astro.js +3 -3
- package/dist/{chunk-KKH6K7RE.cjs → chunk-45JWH4GZ.cjs} +14 -11
- package/dist/{chunk-WUKLRLI4.js → chunk-5RGNKABP.js} +1 -1
- package/dist/{chunk-FEGNQ7CQ.js → chunk-SSMUIUHR.js} +14 -11
- package/dist/{chunk-O4FQWPVV.cjs → chunk-WDYGV6FU.cjs} +2 -2
- package/dist/core/build.d.ts +5 -0
- package/dist/core/build.d.ts.map +1 -0
- package/dist/core/options.d.ts +5 -0
- package/dist/core/options.d.ts.map +1 -0
- package/dist/core/plugins.d.ts +2 -0
- package/dist/core/plugins.d.ts.map +1 -0
- package/dist/core/transformers/astro.d.ts +3 -0
- package/dist/core/transformers/astro.d.ts.map +1 -0
- package/dist/core/transformers/default.d.ts +3 -0
- package/dist/core/transformers/default.d.ts.map +1 -0
- package/dist/core/transformers/index.d.ts +3 -0
- package/dist/core/transformers/index.d.ts.map +1 -0
- package/dist/core/transformers/svelte.d.ts +3 -0
- package/dist/core/transformers/svelte.d.ts.map +1 -0
- package/dist/esbuild.cjs +2 -2
- package/dist/esbuild.d.ts +18 -8
- package/dist/esbuild.d.ts.map +1 -0
- package/dist/esbuild.js +1 -1
- package/dist/farm.cjs +2 -2
- package/dist/farm.d.ts +19 -6
- package/dist/farm.d.ts.map +1 -0
- package/dist/farm.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +7 -11
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/rolldown.cjs +2 -2
- package/dist/rolldown.d.ts +20 -8
- package/dist/rolldown.d.ts.map +1 -0
- package/dist/rolldown.js +1 -1
- package/dist/rollup.cjs +2 -2
- package/dist/rollup.d.ts +17 -8
- package/dist/rollup.d.ts.map +1 -0
- package/dist/rollup.js +1 -1
- package/dist/rspack.cjs +2 -2
- package/dist/rspack.d.ts +17 -8
- package/dist/rspack.d.ts.map +1 -0
- package/dist/rspack.js +1 -1
- package/dist/types.d.ts +16 -10
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +4 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/get-aliases.d.ts +4 -0
- package/dist/utils/get-aliases.d.ts.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/store.d.ts +4 -0
- package/dist/utils/store.d.ts.map +1 -0
- package/dist/utils/stylex-path.d.ts +4 -0
- package/dist/utils/stylex-path.d.ts.map +1 -0
- package/dist/vite.cjs +3 -3
- package/dist/vite.d.ts +18 -8
- package/dist/vite.d.ts.map +1 -0
- package/dist/vite.js +2 -2
- package/dist/webpack.cjs +2 -2
- package/dist/webpack.d.ts +17 -8
- package/dist/webpack.d.ts.map +1 -0
- package/dist/webpack.js +1 -1
- package/jsr.json +1 -1
- package/package.json +9 -7
- package/tsconfig.json +2 -5
- package/dist/astro.d.cts +0 -39
- package/dist/esbuild.d.cts +0 -14
- package/dist/farm.d.cts +0 -11
- package/dist/index.d.cts +0 -20
- package/dist/rolldown.d.cts +0 -14
- package/dist/rollup.d.cts +0 -14
- package/dist/rspack.d.cts +0 -15
- package/dist/types.d.cts +0 -41
- package/dist/vite.d.cts +0 -14
- 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
|
-
|
|
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
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unplugin-stylex",
|
|
3
|
-
"version": "0.6.
|
|
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.
|
|
89
|
+
"@stylexjs/babel-plugin": "^0.18.2",
|
|
90
90
|
"unplugin": "^3.0.0"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@biomejs/biome": "2.4.
|
|
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.
|
|
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": "^
|
|
102
|
-
"vite": "^8.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": "
|
|
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
|
-
"
|
|
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 };
|
package/dist/esbuild.d.cts
DELETED
|
@@ -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
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 };
|
package/dist/rolldown.d.cts
DELETED
|
@@ -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 };
|
package/dist/webpack.d.cts
DELETED
|
@@ -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 };
|