unplugin-stylex 0.5.0 → 0.5.2

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.
@@ -0,0 +1,8 @@
1
+ # Changesets
2
+
3
+ Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4
+ with multi-package repos, or single-package repos to help you version and publish your code. You can
5
+ find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6
+
7
+ We have a quick list of common questions to get you started engaging with this project in
8
+ [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://unpkg.com/@changesets/config@3.0.4/schema.json",
3
+ "changelog": ["@changesets/changelog-github", { "repo": "eryue0220/unplugin-stylex" }],
4
+ "access": "public",
5
+ "commit": false,
6
+ "linked": [],
7
+ "baseBranch": "origin/main",
8
+ "updateInternalDependencies": "patch",
9
+ "ignore": [
10
+ "esbuild-example",
11
+ "farm-example",
12
+ "rollup-example",
13
+ "rsbuild-example",
14
+ "rspack-example",
15
+ "solid-example",
16
+ "vite-example",
17
+ "vue-example",
18
+ "webpack-example"
19
+ ]
20
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # unplugin-stylex
2
+
3
+ ## 0.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#99](https://github.com/eryue0220/unplugin-stylex/pull/99) [`e44301a`](https://github.com/eryue0220/unplugin-stylex/commit/e44301a934c65e46dc00de650c910babb31e2525) Thanks [@eryue0220](https://github.com/eryue0220)! - fix unplugin option alias prop
8
+
9
+ ## 0.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#93](https://github.com/eryue0220/unplugin-stylex/pull/93) [`d5f2c1a`](https://github.com/eryue0220/unplugin-stylex/commit/d5f2c1a287ac7325fb6c0ce07355f10600dc01a2) Thanks [@eryue0220](https://github.com/eryue0220)! - fix: update stylex aliases types
14
+
15
+ - [#97](https://github.com/eryue0220/unplugin-stylex/pull/97) [`906a065`](https://github.com/eryue0220/unplugin-stylex/commit/906a065c7f9cb84821bf3dc8567e1410fcdb59df) Thanks [@eryue0220](https://github.com/eryue0220)! - fix aliases type declaration
16
+
17
+ ## 0.5.1
18
+
19
+ ### Patch Changes
20
+
21
+ - [#85](https://github.com/eryue0220/unplugin-stylex/pull/85) [`47b44ce`](https://github.com/eryue0220/unplugin-stylex/commit/47b44ce40113613aea856f8731b89ec2f1f15e9a) Thanks [@eryue0220](https://github.com/eryue0220)! - upgrade deps and support changeset
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 cin
3
+ Copyright (c) 2023 eryue0220
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -26,7 +26,7 @@ pnpm i unplugin-stylex --save-dev
26
26
  ## Configuration
27
27
 
28
28
  <details>
29
- <summary>Vite</summary><br>
29
+ <summary>vite</summary><br>
30
30
 
31
31
  ```js
32
32
  // vite.config.js
@@ -94,6 +94,23 @@ module.exports = {
94
94
 
95
95
  </br></details>
96
96
 
97
+ <details>
98
+ <summary>rolldown(⚠️ experimental)</summary><br>
99
+
100
+ ```js
101
+ // rolldown.config.js
102
+ import stylexRolldownPlugin from 'unplugin-stylex/rolldown'
103
+
104
+ export default {
105
+ // other rolldown config
106
+ plugins: [
107
+ stylexRolldownPlugin({ /* options */}),
108
+ ],
109
+ }
110
+ ```
111
+
112
+ </br></details>
113
+
97
114
  <details>
98
115
  <summary>rollup</summary><br>
99
116
 
package/biome.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3
+ "files": {
4
+ "ignoreUnknown": false,
5
+ "ignore": [".github/*", "biomejs.json", "dist/*", "node_modules/*", "pnpm-lock.yaml", "pnpm-workspace.yaml"]
6
+ },
7
+ "linter": {
8
+ "enabled": true
9
+ }
10
+ }
@@ -16,6 +16,7 @@ var isDevelopment = process.env.NODE_ENV !== "production" || process.env.BABEL_E
16
16
 
17
17
  // src/core/options.ts
18
18
  function getOptions(options) {
19
+ var _a, _b, _c;
19
20
  const stylex2 = options.stylex || {};
20
21
  const isDev = options.dev || isDevelopment;
21
22
  return {
@@ -31,9 +32,9 @@ function getOptions(options) {
31
32
  useCSSLayers: stylex2.useCSSLayers || false,
32
33
  unstable_moduleResolution: stylex2.unstable_moduleResolution || { type: "commonJS", rootDir: process.cwd() },
33
34
  babelConfig: {
34
- babelrc: (stylex2.babelConfig || {}).babelrc || false,
35
- plugins: (stylex2.babelConfig || {}).plugins || [],
36
- presets: (stylex2.babelConfig || {}).presets || []
35
+ babelrc: _nullishCoalesce(((_a = stylex2.babelConfig) == null ? void 0 : _a.babelrc), () => ( false)),
36
+ plugins: _nullishCoalesce(((_b = stylex2.babelConfig) == null ? void 0 : _b.plugins), () => ( [])),
37
+ presets: _nullishCoalesce(((_c = stylex2.babelConfig) == null ? void 0 : _c.presets), () => ( []))
37
38
  },
38
39
  ...stylex2
39
40
  }
@@ -47,8 +48,8 @@ var _pluginsyntaxjsx = require('@babel/plugin-syntax-jsx'); var _pluginsyntaxjsx
47
48
 
48
49
 
49
50
  // src/core/plugins.ts
50
- var _pluginsyntaxtypescript = require('@babel/plugin-syntax-typescript'); var _pluginsyntaxtypescript2 = _interopRequireDefault(_pluginsyntaxtypescript);
51
51
  var _pluginsyntaxflow = require('@babel/plugin-syntax-flow'); var _pluginsyntaxflow2 = _interopRequireDefault(_pluginsyntaxflow);
52
+ var _pluginsyntaxtypescript = require('@babel/plugin-syntax-typescript'); var _pluginsyntaxtypescript2 = _interopRequireDefault(_pluginsyntaxtypescript);
52
53
  function getSyntaxPlugins(extname2) {
53
54
  const TSPlugin = extname2 === ".tsx" ? [[_pluginsyntaxtypescript2.default, { isTSX: true }]] : [_pluginsyntaxtypescript2.default];
54
55
  return [".js", ".jsx"].includes(extname2) ? [_pluginsyntaxflow2.default] : TSPlugin;
@@ -72,15 +73,12 @@ async function transformer(context) {
72
73
  _pluginsyntaxjsx2.default,
73
74
  _babelplugin2.default.withOptions(stylexBabelPluginOptions)
74
75
  ];
75
- const { code, map, metadata } = await _core.transformAsync.call(void 0,
76
- inputCode,
77
- {
78
- babelrc: (_b = stylex2.babelConfig) == null ? void 0 : _b.babelrc,
79
- filename: id,
80
- presets: (_c = stylex2.babelConfig) == null ? void 0 : _c.presets,
81
- plugins
82
- }
83
- );
76
+ const { code, map, metadata } = await _core.transformAsync.call(void 0, inputCode, {
77
+ babelrc: (_b = stylex2.babelConfig) == null ? void 0 : _b.babelrc,
78
+ filename: id,
79
+ presets: (_c = stylex2.babelConfig) == null ? void 0 : _c.presets,
80
+ plugins
81
+ });
84
82
  if (metadata.stylex && metadata.stylex.length > 0) {
85
83
  stylexRules[id] = metadata.stylex;
86
84
  }
@@ -110,6 +108,7 @@ var unpluginFactory = (rawOptions = {}) => {
110
108
  return validExts instanceof RegExp ? validExts.test(validExtName) : validExts.includes(validExtName);
111
109
  },
112
110
  async transform(code, id) {
111
+ var _a;
113
112
  const dir = path.dirname(id);
114
113
  const basename2 = path.basename(id);
115
114
  const file = path.join(dir, basename2.includes("?") ? basename2.split("?")[0] : basename2);
@@ -124,7 +123,7 @@ var unpluginFactory = (rawOptions = {}) => {
124
123
  };
125
124
  try {
126
125
  const result = await transformer(context);
127
- if (result.stylexRules && result.stylexRules[id]) {
126
+ if ((_a = result.stylexRules) == null ? void 0 : _a[id]) {
128
127
  stylexRules[id] = result.stylexRules[id];
129
128
  }
130
129
  return result;
@@ -156,7 +155,7 @@ var unpluginFactory = (rawOptions = {}) => {
156
155
  },
157
156
  buildEnd() {
158
157
  var _a;
159
- const fileName = `${_nullishCoalesce(((_a = viteConfig.build) == null ? void 0 : _a.assetsDir), () => ( "assets"))}/${options.stylex.filename}`;
158
+ const fileName = `${_nullishCoalesce(((_a = viteConfig == null ? void 0 : viteConfig.build) == null ? void 0 : _a.assetsDir), () => ( "assets"))}/${options.stylex.filename}`;
160
159
  const collectedCSS = buildStylexRules(stylexRules, options.stylex.useCSSLayers);
161
160
  if (!collectedCSS) return;
162
161
  this.emitFile({
@@ -167,15 +166,12 @@ var unpluginFactory = (rawOptions = {}) => {
167
166
  },
168
167
  transformIndexHtml(html, ctx) {
169
168
  var _a, _b;
170
- const fileName = `${_nullishCoalesce(((_a = viteConfig.build) == null ? void 0 : _a.assetsDir), () => ( "assets"))}/${options.stylex.filename}`;
169
+ const fileName = `${_nullishCoalesce(((_a = viteConfig == null ? void 0 : viteConfig.build) == null ? void 0 : _a.assetsDir), () => ( "assets"))}/${options.stylex.filename}`;
171
170
  const css = (_b = ctx.bundle) == null ? void 0 : _b[fileName];
172
171
  if (!css) {
173
172
  return html;
174
173
  }
175
- const publicPath = path.posix.join(
176
- _nullishCoalesce(viteConfig.base, () => ( "/")),
177
- fileName.replace(/\\/g, "/")
178
- );
174
+ const publicPath = path.posix.join(_nullishCoalesce((viteConfig == null ? void 0 : viteConfig.base), () => ( "/")), fileName.replace(/\\/g, "/"));
179
175
  return [
180
176
  {
181
177
  tag: "link",
@@ -191,10 +187,10 @@ var unpluginFactory = (rawOptions = {}) => {
191
187
  };
192
188
  };
193
189
  var unplugin = _unplugin.createUnplugin.call(void 0, unpluginFactory);
194
- var src_default = unplugin;
190
+ var index_default = unplugin;
195
191
 
196
192
 
197
193
 
198
194
 
199
195
 
200
- exports.unpluginFactory = unpluginFactory; exports.unplugin = unplugin; exports.src_default = src_default;
196
+ exports.unpluginFactory = unpluginFactory; exports.unplugin = unplugin; exports.index_default = index_default;
@@ -16,6 +16,7 @@ var isDevelopment = process.env.NODE_ENV !== "production" || process.env.BABEL_E
16
16
 
17
17
  // src/core/options.ts
18
18
  function getOptions(options) {
19
+ var _a, _b, _c;
19
20
  const stylex2 = options.stylex || {};
20
21
  const isDev = options.dev || isDevelopment;
21
22
  return {
@@ -31,9 +32,9 @@ function getOptions(options) {
31
32
  useCSSLayers: stylex2.useCSSLayers || false,
32
33
  unstable_moduleResolution: stylex2.unstable_moduleResolution || { type: "commonJS", rootDir: process.cwd() },
33
34
  babelConfig: {
34
- babelrc: (stylex2.babelConfig || {}).babelrc || false,
35
- plugins: (stylex2.babelConfig || {}).plugins || [],
36
- presets: (stylex2.babelConfig || {}).presets || []
35
+ babelrc: ((_a = stylex2.babelConfig) == null ? void 0 : _a.babelrc) ?? false,
36
+ plugins: ((_b = stylex2.babelConfig) == null ? void 0 : _b.plugins) ?? [],
37
+ presets: ((_c = stylex2.babelConfig) == null ? void 0 : _c.presets) ?? []
37
38
  },
38
39
  ...stylex2
39
40
  }
@@ -47,8 +48,8 @@ import jsxSyntaxPlugin from "@babel/plugin-syntax-jsx";
47
48
  import stylexBabelPlugin from "@stylexjs/babel-plugin";
48
49
 
49
50
  // src/core/plugins.ts
50
- import typescriptSyntaxPlugin from "@babel/plugin-syntax-typescript";
51
51
  import flowSyntaxPlugin from "@babel/plugin-syntax-flow";
52
+ import typescriptSyntaxPlugin from "@babel/plugin-syntax-typescript";
52
53
  function getSyntaxPlugins(extname2) {
53
54
  const TSPlugin = extname2 === ".tsx" ? [[typescriptSyntaxPlugin, { isTSX: true }]] : [typescriptSyntaxPlugin];
54
55
  return [".js", ".jsx"].includes(extname2) ? [flowSyntaxPlugin] : TSPlugin;
@@ -72,15 +73,12 @@ async function transformer(context) {
72
73
  jsxSyntaxPlugin,
73
74
  stylexBabelPlugin.withOptions(stylexBabelPluginOptions)
74
75
  ];
75
- const { code, map, metadata } = await transformAsync(
76
- inputCode,
77
- {
78
- babelrc: (_b = stylex2.babelConfig) == null ? void 0 : _b.babelrc,
79
- filename: id,
80
- presets: (_c = stylex2.babelConfig) == null ? void 0 : _c.presets,
81
- plugins
82
- }
83
- );
76
+ const { code, map, metadata } = await transformAsync(inputCode, {
77
+ babelrc: (_b = stylex2.babelConfig) == null ? void 0 : _b.babelrc,
78
+ filename: id,
79
+ presets: (_c = stylex2.babelConfig) == null ? void 0 : _c.presets,
80
+ plugins
81
+ });
84
82
  if (metadata.stylex && metadata.stylex.length > 0) {
85
83
  stylexRules[id] = metadata.stylex;
86
84
  }
@@ -110,6 +108,7 @@ var unpluginFactory = (rawOptions = {}) => {
110
108
  return validExts instanceof RegExp ? validExts.test(validExtName) : validExts.includes(validExtName);
111
109
  },
112
110
  async transform(code, id) {
111
+ var _a;
113
112
  const dir = path.dirname(id);
114
113
  const basename2 = path.basename(id);
115
114
  const file = path.join(dir, basename2.includes("?") ? basename2.split("?")[0] : basename2);
@@ -124,7 +123,7 @@ var unpluginFactory = (rawOptions = {}) => {
124
123
  };
125
124
  try {
126
125
  const result = await transformer(context);
127
- if (result.stylexRules && result.stylexRules[id]) {
126
+ if ((_a = result.stylexRules) == null ? void 0 : _a[id]) {
128
127
  stylexRules[id] = result.stylexRules[id];
129
128
  }
130
129
  return result;
@@ -156,7 +155,7 @@ var unpluginFactory = (rawOptions = {}) => {
156
155
  },
157
156
  buildEnd() {
158
157
  var _a;
159
- const fileName = `${((_a = viteConfig.build) == null ? void 0 : _a.assetsDir) ?? "assets"}/${options.stylex.filename}`;
158
+ const fileName = `${((_a = viteConfig == null ? void 0 : viteConfig.build) == null ? void 0 : _a.assetsDir) ?? "assets"}/${options.stylex.filename}`;
160
159
  const collectedCSS = buildStylexRules(stylexRules, options.stylex.useCSSLayers);
161
160
  if (!collectedCSS) return;
162
161
  this.emitFile({
@@ -167,15 +166,12 @@ var unpluginFactory = (rawOptions = {}) => {
167
166
  },
168
167
  transformIndexHtml(html, ctx) {
169
168
  var _a, _b;
170
- const fileName = `${((_a = viteConfig.build) == null ? void 0 : _a.assetsDir) ?? "assets"}/${options.stylex.filename}`;
169
+ const fileName = `${((_a = viteConfig == null ? void 0 : viteConfig.build) == null ? void 0 : _a.assetsDir) ?? "assets"}/${options.stylex.filename}`;
171
170
  const css = (_b = ctx.bundle) == null ? void 0 : _b[fileName];
172
171
  if (!css) {
173
172
  return html;
174
173
  }
175
- const publicPath = path.posix.join(
176
- viteConfig.base ?? "/",
177
- fileName.replace(/\\/g, "/")
178
- );
174
+ const publicPath = path.posix.join((viteConfig == null ? void 0 : viteConfig.base) ?? "/", fileName.replace(/\\/g, "/"));
179
175
  return [
180
176
  {
181
177
  tag: "link",
@@ -191,10 +187,10 @@ var unpluginFactory = (rawOptions = {}) => {
191
187
  };
192
188
  };
193
189
  var unplugin = createUnplugin(unpluginFactory);
194
- var src_default = unplugin;
190
+ var index_default = unplugin;
195
191
 
196
192
  export {
197
193
  unpluginFactory,
198
194
  unplugin,
199
- src_default
195
+ index_default
200
196
  };
package/dist/esbuild.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkM2CH7D27cjs = require('./chunk-M2CH7D27.cjs');
3
+ var _chunk3YYDUMQWcjs = require('./chunk-3YYDUMQW.cjs');
4
4
  require('./chunk-ZBPRDZS4.cjs');
5
5
 
6
6
  // src/esbuild.ts
7
7
  var _unplugin = require('unplugin');
8
- var esbuildPlugin = _unplugin.createEsbuildPlugin.call(void 0, _chunkM2CH7D27cjs.unpluginFactory);
8
+ var esbuildPlugin = _unplugin.createEsbuildPlugin.call(void 0, _chunk3YYDUMQWcjs.unpluginFactory);
9
9
  var esbuild_default = esbuildPlugin;
10
10
 
11
11
 
package/dist/esbuild.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-KUBFLNSW.js";
3
+ } from "./chunk-MOKLFQZU.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
 
6
6
  // src/esbuild.ts
package/dist/farm.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkM2CH7D27cjs = require('./chunk-M2CH7D27.cjs');
3
+ var _chunk3YYDUMQWcjs = require('./chunk-3YYDUMQW.cjs');
4
4
  require('./chunk-ZBPRDZS4.cjs');
5
5
 
6
6
  // src/farm.ts
7
7
  var _unplugin = require('unplugin');
8
- var farmPlugin = _unplugin.createFarmPlugin.call(void 0, _chunkM2CH7D27cjs.unpluginFactory);
8
+ var farmPlugin = _unplugin.createFarmPlugin.call(void 0, _chunk3YYDUMQWcjs.unpluginFactory);
9
9
  var farm_default = farmPlugin;
10
10
 
11
11
 
package/dist/farm.d.cts CHANGED
@@ -1,5 +1,4 @@
1
- import { JsPluginExtended } from 'unplugin';
2
- import { UnpluginStylexInstance } from './types.cjs';
1
+ import { createFarmPlugin } from 'unplugin';
3
2
 
4
3
  /**
5
4
  * This entry file is for farm plugin.
@@ -7,6 +6,6 @@ import { UnpluginStylexInstance } from './types.cjs';
7
6
  * @module
8
7
  */
9
8
 
10
- declare const farmPlugin: UnpluginStylexInstance<JsPluginExtended | JsPluginExtended[]>;
9
+ declare const farmPlugin: ReturnType<typeof createFarmPlugin>;
11
10
 
12
11
  export { farmPlugin as default };
package/dist/farm.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import { JsPluginExtended } from 'unplugin';
2
- import { UnpluginStylexInstance } from './types.js';
1
+ import { createFarmPlugin } from 'unplugin';
3
2
 
4
3
  /**
5
4
  * This entry file is for farm plugin.
@@ -7,6 +6,6 @@ import { UnpluginStylexInstance } from './types.js';
7
6
  * @module
8
7
  */
9
8
 
10
- declare const farmPlugin: UnpluginStylexInstance<JsPluginExtended | JsPluginExtended[]>;
9
+ declare const farmPlugin: ReturnType<typeof createFarmPlugin>;
11
10
 
12
11
  export { farmPlugin as default };
package/dist/farm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-KUBFLNSW.js";
3
+ } from "./chunk-MOKLFQZU.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
 
6
6
  // src/farm.ts
package/dist/index.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkM2CH7D27cjs = require('./chunk-M2CH7D27.cjs');
5
+ var _chunk3YYDUMQWcjs = require('./chunk-3YYDUMQW.cjs');
6
6
  require('./chunk-ZBPRDZS4.cjs');
7
7
 
8
8
 
9
9
 
10
10
 
11
- exports.default = _chunkM2CH7D27cjs.src_default; exports.unplugin = _chunkM2CH7D27cjs.unplugin; exports.unpluginFactory = _chunkM2CH7D27cjs.unpluginFactory;
11
+ exports.default = _chunk3YYDUMQWcjs.index_default; exports.unplugin = _chunk3YYDUMQWcjs.unplugin; exports.unpluginFactory = _chunk3YYDUMQWcjs.unpluginFactory;
package/dist/index.d.cts CHANGED
@@ -5,6 +5,7 @@ export { BabelConfig, StylexOptions, UnpluginStylexInstance } from './types.cjs'
5
5
  /**
6
6
  * This entry file is for main unplugin.
7
7
  *
8
+ *
8
9
  * @module
9
10
  */
10
11
 
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { BabelConfig, StylexOptions, UnpluginStylexInstance } from './types.js';
5
5
  /**
6
6
  * This entry file is for main unplugin.
7
7
  *
8
+ *
8
9
  * @module
9
10
  */
10
11
 
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
- src_default,
2
+ index_default,
3
3
  unplugin,
4
4
  unpluginFactory
5
- } from "./chunk-KUBFLNSW.js";
5
+ } from "./chunk-MOKLFQZU.js";
6
6
  import "./chunk-6F4PWJZI.js";
7
7
  export {
8
- src_default as default,
8
+ index_default as default,
9
9
  unplugin,
10
10
  unpluginFactory
11
11
  };
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk3YYDUMQWcjs = require('./chunk-3YYDUMQW.cjs');
4
+ require('./chunk-ZBPRDZS4.cjs');
5
+
6
+ // src/rolldown.ts
7
+ var _unplugin = require('unplugin');
8
+ var rolldownPlugin = _unplugin.createRolldownPlugin.call(void 0, _chunk3YYDUMQWcjs.unpluginFactory);
9
+ var rolldown_default = rolldownPlugin;
10
+
11
+
12
+ exports.default = rolldown_default;
@@ -0,0 +1,12 @@
1
+ import { RolldownPlugin } from 'unplugin';
2
+ import { UnpluginStylexInstance } from './types.cjs';
3
+
4
+ /**
5
+ * This entry file is for rolldown plugin.
6
+ *
7
+ * @module
8
+ */
9
+
10
+ declare const rolldownPlugin: UnpluginStylexInstance<RolldownPlugin | RolldownPlugin[]>;
11
+
12
+ export { rolldownPlugin as default };
@@ -0,0 +1,12 @@
1
+ import { RolldownPlugin } from 'unplugin';
2
+ import { UnpluginStylexInstance } from './types.js';
3
+
4
+ /**
5
+ * This entry file is for rolldown plugin.
6
+ *
7
+ * @module
8
+ */
9
+
10
+ declare const rolldownPlugin: UnpluginStylexInstance<RolldownPlugin | RolldownPlugin[]>;
11
+
12
+ export { rolldownPlugin as default };
@@ -0,0 +1,12 @@
1
+ import {
2
+ unpluginFactory
3
+ } from "./chunk-MOKLFQZU.js";
4
+ import "./chunk-6F4PWJZI.js";
5
+
6
+ // src/rolldown.ts
7
+ import { createRolldownPlugin } from "unplugin";
8
+ var rolldownPlugin = createRolldownPlugin(unpluginFactory);
9
+ var rolldown_default = rolldownPlugin;
10
+ export {
11
+ rolldown_default as default
12
+ };
package/dist/rollup.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkM2CH7D27cjs = require('./chunk-M2CH7D27.cjs');
3
+ var _chunk3YYDUMQWcjs = require('./chunk-3YYDUMQW.cjs');
4
4
  require('./chunk-ZBPRDZS4.cjs');
5
5
 
6
6
  // src/rollup.ts
7
7
  var _unplugin = require('unplugin');
8
- var rollupPlugin = _unplugin.createRollupPlugin.call(void 0, _chunkM2CH7D27cjs.unpluginFactory);
8
+ var rollupPlugin = _unplugin.createRollupPlugin.call(void 0, _chunk3YYDUMQWcjs.unpluginFactory);
9
9
  var rollup_default = rollupPlugin;
10
10
 
11
11
 
package/dist/rollup.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-KUBFLNSW.js";
3
+ } from "./chunk-MOKLFQZU.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
 
6
6
  // src/rollup.ts
package/dist/rspack.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkM2CH7D27cjs = require('./chunk-M2CH7D27.cjs');
3
+ var _chunk3YYDUMQWcjs = require('./chunk-3YYDUMQW.cjs');
4
4
  require('./chunk-ZBPRDZS4.cjs');
5
5
 
6
6
  // src/rspack.ts
7
7
  var _unplugin = require('unplugin');
8
- var rspackPlugin = _unplugin.createRspackPlugin.call(void 0, _chunkM2CH7D27cjs.unpluginFactory);
8
+ var rspackPlugin = _unplugin.createRspackPlugin.call(void 0, _chunk3YYDUMQWcjs.unpluginFactory);
9
9
  var rspack_default = rspackPlugin;
10
10
 
11
11
 
package/dist/rspack.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-KUBFLNSW.js";
3
+ } from "./chunk-MOKLFQZU.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
 
6
6
  // src/rspack.ts
package/dist/types.d.cts CHANGED
@@ -5,7 +5,7 @@ type BabelConfig = {
5
5
  };
6
6
  type StylexOptions = {
7
7
  filename?: string;
8
- aliases?: string[];
8
+ aliases?: Record<string, string | string[]>;
9
9
  stylexImports?: string[];
10
10
  classNamePrefix?: string;
11
11
  unstable_moduleResolution?: {
package/dist/types.d.ts CHANGED
@@ -5,7 +5,7 @@ type BabelConfig = {
5
5
  };
6
6
  type StylexOptions = {
7
7
  filename?: string;
8
- aliases?: string[];
8
+ aliases?: Record<string, string | string[]>;
9
9
  stylexImports?: string[];
10
10
  classNamePrefix?: string;
11
11
  unstable_moduleResolution?: {
package/dist/vite.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkM2CH7D27cjs = require('./chunk-M2CH7D27.cjs');
3
+ var _chunk3YYDUMQWcjs = require('./chunk-3YYDUMQW.cjs');
4
4
  require('./chunk-ZBPRDZS4.cjs');
5
5
 
6
6
  // src/vite.ts
7
7
  var _unplugin = require('unplugin');
8
- var vitePlugin = _unplugin.createVitePlugin.call(void 0, _chunkM2CH7D27cjs.unpluginFactory);
8
+ var vitePlugin = _unplugin.createVitePlugin.call(void 0, _chunk3YYDUMQWcjs.unpluginFactory);
9
9
  var vite_default = vitePlugin;
10
10
 
11
11
 
package/dist/vite.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-KUBFLNSW.js";
3
+ } from "./chunk-MOKLFQZU.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
 
6
6
  // src/vite.ts
package/dist/webpack.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkM2CH7D27cjs = require('./chunk-M2CH7D27.cjs');
3
+ var _chunk3YYDUMQWcjs = require('./chunk-3YYDUMQW.cjs');
4
4
  require('./chunk-ZBPRDZS4.cjs');
5
5
 
6
6
  // src/webpack.ts
7
7
  var _unplugin = require('unplugin');
8
- var webpackPlugin = _unplugin.createWebpackPlugin.call(void 0, _chunkM2CH7D27cjs.unpluginFactory);
8
+ var webpackPlugin = _unplugin.createWebpackPlugin.call(void 0, _chunk3YYDUMQWcjs.unpluginFactory);
9
9
  var webpack_default = webpackPlugin;
10
10
 
11
11
 
package/dist/webpack.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-KUBFLNSW.js";
3
+ } from "./chunk-MOKLFQZU.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
 
6
6
  // src/webpack.ts
package/jsr.json CHANGED
@@ -1,21 +1,15 @@
1
1
  {
2
2
  "name": "@eryue0220/unplugin-stylex",
3
- "version": "0.4.2",
3
+ "version": "0.5.2",
4
4
  "exports": {
5
5
  "./index": "./src/index.ts",
6
6
  "./esbuild": "./src/esbuild.ts",
7
7
  "./farm": "./src/farm.ts",
8
+ "./rolldown": "./src/rolldown.ts",
8
9
  "./rollup": "./src/rollup.ts",
9
10
  "./rspack": "./src/rspack.ts",
10
11
  "./vite": "./src/vite.ts",
11
12
  "./webpack": "./src/webpack.ts"
12
13
  },
13
- "exclude": [
14
- ".eslintrc.json",
15
- ".eslintignore",
16
- "test",
17
- "examples",
18
- "pnpm-lock.yaml",
19
- "pnpm-workspace.yaml"
20
- ]
21
- }
14
+ "exclude": [".eslintrc.json", ".eslintignore", "test", "examples", "pnpm-lock.yaml", "pnpm-workspace.yaml"]
15
+ }
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-stylex",
3
- "version": "0.5.0",
4
- "packageManager": "pnpm@8.11.0",
3
+ "version": "0.5.2",
5
4
  "description": "Unplugin for stylex",
6
5
  "repository": "https://github.com/eryue0220/unplugin-stylex",
7
6
  "keywords": [
@@ -10,8 +9,10 @@
10
9
  "stylex-plugin",
11
10
  "farm",
12
11
  "esbuild",
12
+ "rolldown",
13
13
  "rollup",
14
14
  "rspack",
15
+ "svelte",
15
16
  "vite"
16
17
  ],
17
18
  "author": "eryue0220<eryue0220@gmail.com>",
@@ -36,6 +37,11 @@
36
37
  "require": "./dist/farm.cjs",
37
38
  "import": "./dist/farm.js"
38
39
  },
40
+ "./rolldown": {
41
+ "types": "./dist/rolldown.d.ts",
42
+ "require": "./dist/rolldown.cjs",
43
+ "import": "./dist/rolldown.js"
44
+ },
39
45
  "./rollup": {
40
46
  "types": "./dist/rollup.d.ts",
41
47
  "require": "./dist/rollup.cjs",
@@ -63,42 +69,46 @@
63
69
  },
64
70
  "./*": "./*"
65
71
  },
66
- "scripts": {
67
- "dev": "tsup src/*ts --watch src",
68
- "build": "tsup src/*.ts --format cjs,esm --dts --splitting --clean",
69
- "test": "vitest",
70
- "test:update": "vitest -u",
71
- "test:cov": "vitest --coverage",
72
- "lint": "eslint . --ext .ts,.tsx,.js,.jsx",
73
- "check": "pnpm run lint && pnpm run typecheck",
74
- "typecheck": "tsc -p tsconfig.json --noEmit"
75
- },
76
72
  "engines": {
77
- "node": ">=16.14.0"
73
+ "node": ">=18"
78
74
  },
79
75
  "peerDependencies": {
80
76
  "@stylexjs/stylex": "0.x"
81
77
  },
82
78
  "dependencies": {
83
- "@babel/core": "^7.25.2",
84
- "@babel/plugin-syntax-flow": "^7.24.7",
85
- "@babel/plugin-syntax-jsx": "^7.24.7",
86
- "@babel/plugin-syntax-typescript": "^7.24.7",
87
- "@rollup/pluginutils": "^5.1.0",
88
- "@stylexjs/babel-plugin": "^0.5.1",
89
- "unplugin": "^1.12.1"
79
+ "@babel/core": "^7.26.0",
80
+ "@babel/plugin-syntax-flow": "^7.26.0",
81
+ "@babel/plugin-syntax-jsx": "^7.25.9",
82
+ "@babel/plugin-syntax-typescript": "^7.25.9",
83
+ "@rollup/pluginutils": "^5.1.3",
84
+ "@stylexjs/babel-plugin": "^0.9.3",
85
+ "unplugin": "^1.15.0"
90
86
  },
91
87
  "devDependencies": {
92
- "@stylistic/eslint-plugin-ts": "^1.8.1",
93
- "@types/node": "^20.14.14",
94
- "@typescript-eslint/eslint-plugin": "^6.21.0",
95
- "@typescript-eslint/parser": "^6.21.0",
88
+ "@biomejs/biome": "1.9.4",
89
+ "@changesets/changelog-github": "^0.5.0",
90
+ "@changesets/cli": "^2.27.10",
91
+ "@types/node": "^20.17.2",
96
92
  "@vitest/coverage-v8": "^1.6.0",
97
93
  "babel-plugin-syntax-hermes-parser": "^0.19.2",
98
- "eslint": "^8.57.0",
99
- "tsup": "^8.2.4",
100
- "typescript": "^5.5.4",
101
- "vite": "^5.4.0",
94
+ "jsr": "^0.13.2",
95
+ "tsup": "^8.3.5",
96
+ "typescript": "^5.6.3",
97
+ "vite": "^5.4.10",
102
98
  "vitest": "^1.6.0"
99
+ },
100
+ "scripts": {
101
+ "dev": "tsup src/*ts --watch src",
102
+ "build": "tsup src/*.ts --format cjs,esm --dts --splitting --clean",
103
+ "test": "vitest",
104
+ "test:update": "vitest -u",
105
+ "test:cov": "vitest --coverage",
106
+ "lint": "pnpm biome lint",
107
+ "check": "pnpm biome check . --line-width=120 --quote-style=single --indent-style=space --indent-width=2 --semicolons=as-needed",
108
+ "ci": "pnpm run lint && pnpm run check && pnpm run build",
109
+ "jsr": "pnpm dlx jsr publish",
110
+ "changeset": "pnpm dlx @changesets/cli add",
111
+ "changeset:version": "pnpm dlx @changesets/cli version && pnpm install",
112
+ "changeset:release": "pnpm run build && pnpm dlx @changesets/cli publish"
103
113
  }
104
- }
114
+ }
@@ -1,2 +1,3 @@
1
1
  packages:
2
+ - '.'
2
3
  - examples/*
package/tsconfig.json CHANGED
@@ -14,10 +14,6 @@
14
14
  "@/*": ["./src/*"]
15
15
  }
16
16
  },
17
- "include": [
18
- "src"
19
- ],
20
- "exclude": [
21
- "node_modules"
22
- ]
17
+ "include": ["src"],
18
+ "exclude": ["node_modules"]
23
19
  }