unplugin-stylex 0.4.2 → 0.5.1

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,7 @@
1
+ # unplugin-stylex
2
+
3
+ ## 0.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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/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,15 +16,12 @@ 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
- if (options.invalidExts && options.validExts) {
22
- throw new Error("Only one of invalidExts or validExts may be specified at a time");
23
- }
24
22
  return {
25
23
  ...options,
26
24
  dev: isDev,
27
- invalidExts: options.invalidExts ? [".json", ".html", ".jade", ".json5", ..._nullishCoalesce(options.invalidExts, () => ( []))] : [],
28
25
  // .js, .jsx, .mjs, .cjs, .ts, .tsx, .mts, .cts
29
26
  validExts: _nullishCoalesce(options.validExts, () => ( /\.[mc]?[jt]sx?$/)),
30
27
  stylex: {
@@ -35,9 +32,9 @@ function getOptions(options) {
35
32
  useCSSLayers: stylex2.useCSSLayers || false,
36
33
  unstable_moduleResolution: stylex2.unstable_moduleResolution || { type: "commonJS", rootDir: process.cwd() },
37
34
  babelConfig: {
38
- babelrc: (stylex2.babelConfig || {}).babelrc || false,
39
- plugins: (stylex2.babelConfig || {}).plugins || [],
40
- 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), () => ( []))
41
38
  },
42
39
  ...stylex2
43
40
  }
@@ -51,8 +48,8 @@ var _pluginsyntaxjsx = require('@babel/plugin-syntax-jsx'); var _pluginsyntaxjsx
51
48
 
52
49
 
53
50
  // src/core/plugins.ts
54
- var _pluginsyntaxtypescript = require('@babel/plugin-syntax-typescript'); var _pluginsyntaxtypescript2 = _interopRequireDefault(_pluginsyntaxtypescript);
55
51
  var _pluginsyntaxflow = require('@babel/plugin-syntax-flow'); var _pluginsyntaxflow2 = _interopRequireDefault(_pluginsyntaxflow);
52
+ var _pluginsyntaxtypescript = require('@babel/plugin-syntax-typescript'); var _pluginsyntaxtypescript2 = _interopRequireDefault(_pluginsyntaxtypescript);
56
53
  function getSyntaxPlugins(extname2) {
57
54
  const TSPlugin = extname2 === ".tsx" ? [[_pluginsyntaxtypescript2.default, { isTSX: true }]] : [_pluginsyntaxtypescript2.default];
58
55
  return [".js", ".jsx"].includes(extname2) ? [_pluginsyntaxflow2.default] : TSPlugin;
@@ -76,15 +73,12 @@ async function transformer(context) {
76
73
  _pluginsyntaxjsx2.default,
77
74
  _babelplugin2.default.withOptions(stylexBabelPluginOptions)
78
75
  ];
79
- const { code, map, metadata } = await _core.transformAsync.call(void 0,
80
- inputCode,
81
- {
82
- babelrc: (_b = stylex2.babelConfig) == null ? void 0 : _b.babelrc,
83
- filename: id,
84
- presets: (_c = stylex2.babelConfig) == null ? void 0 : _c.presets,
85
- plugins
86
- }
87
- );
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
+ });
88
82
  if (metadata.stylex && metadata.stylex.length > 0) {
89
83
  stylexRules[id] = metadata.stylex;
90
84
  }
@@ -107,17 +101,14 @@ var unpluginFactory = (rawOptions = {}) => {
107
101
  return {
108
102
  name: PLUGIN_NAME,
109
103
  transformInclude(id) {
110
- const invalidExts = options.invalidExts;
111
104
  const validExts = options.validExts;
112
105
  const extname2 = path.extname(id);
113
106
  const questionMarkIndex = extname2.indexOf("?");
114
107
  const validExtName = questionMarkIndex > -1 ? extname2.slice(0, questionMarkIndex) : extname2;
115
- if (invalidExts.length > 0) {
116
- return !invalidExts.includes(validExtName);
117
- }
118
108
  return validExts instanceof RegExp ? validExts.test(validExtName) : validExts.includes(validExtName);
119
109
  },
120
110
  async transform(code, id) {
111
+ var _a;
121
112
  const dir = path.dirname(id);
122
113
  const basename2 = path.basename(id);
123
114
  const file = path.join(dir, basename2.includes("?") ? basename2.split("?")[0] : basename2);
@@ -132,7 +123,7 @@ var unpluginFactory = (rawOptions = {}) => {
132
123
  };
133
124
  try {
134
125
  const result = await transformer(context);
135
- if (result.stylexRules && result.stylexRules[id]) {
126
+ if ((_a = result.stylexRules) == null ? void 0 : _a[id]) {
136
127
  stylexRules[id] = result.stylexRules[id];
137
128
  }
138
129
  return result;
@@ -164,7 +155,7 @@ var unpluginFactory = (rawOptions = {}) => {
164
155
  },
165
156
  buildEnd() {
166
157
  var _a;
167
- 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}`;
168
159
  const collectedCSS = buildStylexRules(stylexRules, options.stylex.useCSSLayers);
169
160
  if (!collectedCSS) return;
170
161
  this.emitFile({
@@ -175,15 +166,12 @@ var unpluginFactory = (rawOptions = {}) => {
175
166
  },
176
167
  transformIndexHtml(html, ctx) {
177
168
  var _a, _b;
178
- 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}`;
179
170
  const css = (_b = ctx.bundle) == null ? void 0 : _b[fileName];
180
171
  if (!css) {
181
172
  return html;
182
173
  }
183
- const publicPath = path.posix.join(
184
- _nullishCoalesce(viteConfig.base, () => ( "/")),
185
- fileName.replace(/\\/g, "/")
186
- );
174
+ const publicPath = path.posix.join(_nullishCoalesce((viteConfig == null ? void 0 : viteConfig.base), () => ( "/")), fileName.replace(/\\/g, "/"));
187
175
  return [
188
176
  {
189
177
  tag: "link",
@@ -199,10 +187,10 @@ var unpluginFactory = (rawOptions = {}) => {
199
187
  };
200
188
  };
201
189
  var unplugin = _unplugin.createUnplugin.call(void 0, unpluginFactory);
202
- var src_default = unplugin;
190
+ var index_default = unplugin;
203
191
 
204
192
 
205
193
 
206
194
 
207
195
 
208
- exports.unpluginFactory = unpluginFactory; exports.unplugin = unplugin; exports.src_default = src_default;
196
+ exports.unpluginFactory = unpluginFactory; exports.unplugin = unplugin; exports.index_default = index_default;
@@ -16,15 +16,12 @@ 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
- if (options.invalidExts && options.validExts) {
22
- throw new Error("Only one of invalidExts or validExts may be specified at a time");
23
- }
24
22
  return {
25
23
  ...options,
26
24
  dev: isDev,
27
- invalidExts: options.invalidExts ? [".json", ".html", ".jade", ".json5", ...options.invalidExts ?? []] : [],
28
25
  // .js, .jsx, .mjs, .cjs, .ts, .tsx, .mts, .cts
29
26
  validExts: options.validExts ?? /\.[mc]?[jt]sx?$/,
30
27
  stylex: {
@@ -35,9 +32,9 @@ function getOptions(options) {
35
32
  useCSSLayers: stylex2.useCSSLayers || false,
36
33
  unstable_moduleResolution: stylex2.unstable_moduleResolution || { type: "commonJS", rootDir: process.cwd() },
37
34
  babelConfig: {
38
- babelrc: (stylex2.babelConfig || {}).babelrc || false,
39
- plugins: (stylex2.babelConfig || {}).plugins || [],
40
- 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) ?? []
41
38
  },
42
39
  ...stylex2
43
40
  }
@@ -51,8 +48,8 @@ import jsxSyntaxPlugin from "@babel/plugin-syntax-jsx";
51
48
  import stylexBabelPlugin from "@stylexjs/babel-plugin";
52
49
 
53
50
  // src/core/plugins.ts
54
- import typescriptSyntaxPlugin from "@babel/plugin-syntax-typescript";
55
51
  import flowSyntaxPlugin from "@babel/plugin-syntax-flow";
52
+ import typescriptSyntaxPlugin from "@babel/plugin-syntax-typescript";
56
53
  function getSyntaxPlugins(extname2) {
57
54
  const TSPlugin = extname2 === ".tsx" ? [[typescriptSyntaxPlugin, { isTSX: true }]] : [typescriptSyntaxPlugin];
58
55
  return [".js", ".jsx"].includes(extname2) ? [flowSyntaxPlugin] : TSPlugin;
@@ -76,15 +73,12 @@ async function transformer(context) {
76
73
  jsxSyntaxPlugin,
77
74
  stylexBabelPlugin.withOptions(stylexBabelPluginOptions)
78
75
  ];
79
- const { code, map, metadata } = await transformAsync(
80
- inputCode,
81
- {
82
- babelrc: (_b = stylex2.babelConfig) == null ? void 0 : _b.babelrc,
83
- filename: id,
84
- presets: (_c = stylex2.babelConfig) == null ? void 0 : _c.presets,
85
- plugins
86
- }
87
- );
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
+ });
88
82
  if (metadata.stylex && metadata.stylex.length > 0) {
89
83
  stylexRules[id] = metadata.stylex;
90
84
  }
@@ -107,17 +101,14 @@ var unpluginFactory = (rawOptions = {}) => {
107
101
  return {
108
102
  name: PLUGIN_NAME,
109
103
  transformInclude(id) {
110
- const invalidExts = options.invalidExts;
111
104
  const validExts = options.validExts;
112
105
  const extname2 = path.extname(id);
113
106
  const questionMarkIndex = extname2.indexOf("?");
114
107
  const validExtName = questionMarkIndex > -1 ? extname2.slice(0, questionMarkIndex) : extname2;
115
- if (invalidExts.length > 0) {
116
- return !invalidExts.includes(validExtName);
117
- }
118
108
  return validExts instanceof RegExp ? validExts.test(validExtName) : validExts.includes(validExtName);
119
109
  },
120
110
  async transform(code, id) {
111
+ var _a;
121
112
  const dir = path.dirname(id);
122
113
  const basename2 = path.basename(id);
123
114
  const file = path.join(dir, basename2.includes("?") ? basename2.split("?")[0] : basename2);
@@ -132,7 +123,7 @@ var unpluginFactory = (rawOptions = {}) => {
132
123
  };
133
124
  try {
134
125
  const result = await transformer(context);
135
- if (result.stylexRules && result.stylexRules[id]) {
126
+ if ((_a = result.stylexRules) == null ? void 0 : _a[id]) {
136
127
  stylexRules[id] = result.stylexRules[id];
137
128
  }
138
129
  return result;
@@ -164,7 +155,7 @@ var unpluginFactory = (rawOptions = {}) => {
164
155
  },
165
156
  buildEnd() {
166
157
  var _a;
167
- 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}`;
168
159
  const collectedCSS = buildStylexRules(stylexRules, options.stylex.useCSSLayers);
169
160
  if (!collectedCSS) return;
170
161
  this.emitFile({
@@ -175,15 +166,12 @@ var unpluginFactory = (rawOptions = {}) => {
175
166
  },
176
167
  transformIndexHtml(html, ctx) {
177
168
  var _a, _b;
178
- 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}`;
179
170
  const css = (_b = ctx.bundle) == null ? void 0 : _b[fileName];
180
171
  if (!css) {
181
172
  return html;
182
173
  }
183
- const publicPath = path.posix.join(
184
- viteConfig.base ?? "/",
185
- fileName.replace(/\\/g, "/")
186
- );
174
+ const publicPath = path.posix.join((viteConfig == null ? void 0 : viteConfig.base) ?? "/", fileName.replace(/\\/g, "/"));
187
175
  return [
188
176
  {
189
177
  tag: "link",
@@ -199,10 +187,10 @@ var unpluginFactory = (rawOptions = {}) => {
199
187
  };
200
188
  };
201
189
  var unplugin = createUnplugin(unpluginFactory);
202
- var src_default = unplugin;
190
+ var index_default = unplugin;
203
191
 
204
192
  export {
205
193
  unpluginFactory,
206
194
  unplugin,
207
- src_default
195
+ index_default
208
196
  };
package/dist/esbuild.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3EBHAME6cjs = require('./chunk-3EBHAME6.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, _chunk3EBHAME6cjs.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-PUVKJQNA.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 _chunk3EBHAME6cjs = require('./chunk-3EBHAME6.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, _chunk3EBHAME6cjs.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-PUVKJQNA.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 _chunk3EBHAME6cjs = require('./chunk-3EBHAME6.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 = _chunk3EBHAME6cjs.src_default; exports.unplugin = _chunk3EBHAME6cjs.unplugin; exports.unpluginFactory = _chunk3EBHAME6cjs.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-PUVKJQNA.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
  };
package/dist/rollup.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3EBHAME6cjs = require('./chunk-3EBHAME6.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, _chunk3EBHAME6cjs.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-PUVKJQNA.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 _chunk3EBHAME6cjs = require('./chunk-3EBHAME6.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, _chunk3EBHAME6cjs.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-PUVKJQNA.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
@@ -19,7 +19,6 @@ type StylexOptions = {
19
19
  runtimeInjection?: boolean;
20
20
  };
21
21
  type UnpluginStylexOptions = {
22
- invalidExts?: string[];
23
22
  validExts?: RegExp | string[];
24
23
  dev?: boolean;
25
24
  stylex?: StylexOptions;
package/dist/types.d.ts CHANGED
@@ -19,7 +19,6 @@ type StylexOptions = {
19
19
  runtimeInjection?: boolean;
20
20
  };
21
21
  type UnpluginStylexOptions = {
22
- invalidExts?: string[];
23
22
  validExts?: RegExp | string[];
24
23
  dev?: boolean;
25
24
  stylex?: StylexOptions;
package/dist/vite.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3EBHAME6cjs = require('./chunk-3EBHAME6.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, _chunk3EBHAME6cjs.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-PUVKJQNA.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 _chunk3EBHAME6cjs = require('./chunk-3EBHAME6.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, _chunk3EBHAME6cjs.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-PUVKJQNA.js";
3
+ } from "./chunk-MOKLFQZU.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.4.2",
3
+ "version": "0.5.1",
4
4
  "exports": {
5
5
  "./index": "./src/index.ts",
6
6
  "./esbuild": "./src/esbuild.ts",
@@ -10,12 +10,5 @@
10
10
  "./vite": "./src/vite.ts",
11
11
  "./webpack": "./src/webpack.ts"
12
12
  },
13
- "exclude": [
14
- ".eslintrc.json",
15
- ".eslintignore",
16
- "test",
17
- "examples",
18
- "pnpm-lock.yaml",
19
- "pnpm-workspace.yaml"
20
- ]
21
- }
13
+ "exclude": [".eslintrc.json", ".eslintignore", "test", "examples", "pnpm-lock.yaml", "pnpm-workspace.yaml"]
14
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unplugin-stylex",
3
- "version": "0.4.2",
4
- "packageManager": "pnpm@8.11.0",
3
+ "version": "0.5.1",
4
+ "packageManager": "pnpm@9.12.2",
5
5
  "description": "Unplugin for stylex",
6
6
  "repository": "https://github.com/eryue0220/unplugin-stylex",
7
7
  "keywords": [
@@ -10,8 +10,10 @@
10
10
  "stylex-plugin",
11
11
  "farm",
12
12
  "esbuild",
13
+ "rolldown",
13
14
  "rollup",
14
15
  "rspack",
16
+ "svelte",
15
17
  "vite"
16
18
  ],
17
19
  "author": "eryue0220<eryue0220@gmail.com>",
@@ -69,36 +71,40 @@
69
71
  "test": "vitest",
70
72
  "test:update": "vitest -u",
71
73
  "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"
74
+ "lint": "pnpm biome lint .",
75
+ "check": "pnpm biome check . --line-width=120 --quote-style=single --indent-style=space --indent-width=2 --semicolons=as-needed",
76
+ "ci": "pnpm run lint && pnpm run check",
77
+ "jsr": "pnpm dlx jsr publish",
78
+ "changeset": "pnpm dlx @changesets/cli add",
79
+ "changeset:version": "pnpm dlx @changesets/cli version && pnpm install",
80
+ "changeset:release": "pnpm run build && pnpm dlx @changesets/cli publish"
75
81
  },
76
82
  "engines": {
77
- "node": ">=16.14.0"
83
+ "node": ">=18"
78
84
  },
79
85
  "peerDependencies": {
80
- "@stylexjs/stylex": "^0.5.1"
86
+ "@stylexjs/stylex": "0.x"
81
87
  },
82
88
  "dependencies": {
83
- "@babel/core": "^7.24.7",
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.11.0"
89
+ "@babel/core": "^7.26.0",
90
+ "@babel/plugin-syntax-flow": "^7.26.0",
91
+ "@babel/plugin-syntax-jsx": "^7.25.9",
92
+ "@babel/plugin-syntax-typescript": "^7.25.9",
93
+ "@rollup/pluginutils": "^5.1.3",
94
+ "@stylexjs/babel-plugin": "^0.9.3",
95
+ "unplugin": "^1.15.0"
90
96
  },
91
97
  "devDependencies": {
92
- "@stylistic/eslint-plugin-ts": "^1.8.1",
93
- "@types/node": "^20.14.10",
94
- "@typescript-eslint/eslint-plugin": "^6.21.0",
95
- "@typescript-eslint/parser": "^6.21.0",
98
+ "@biomejs/biome": "1.9.4",
99
+ "@changesets/changelog-github": "^0.5.0",
100
+ "@changesets/cli": "^2.27.10",
101
+ "@types/node": "^20.17.2",
96
102
  "@vitest/coverage-v8": "^1.6.0",
97
103
  "babel-plugin-syntax-hermes-parser": "^0.19.2",
98
- "eslint": "^8.57.0",
99
- "tsup": "^8.1.0",
100
- "typescript": "^5.5.3",
101
- "vite": "^5.3.3",
104
+ "jsr": "^0.13.2",
105
+ "tsup": "^8.3.5",
106
+ "typescript": "^5.6.3",
107
+ "vite": "^5.4.10",
102
108
  "vitest": "^1.6.0"
103
109
  }
104
110
  }
@@ -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
  }