@stylexswc/rollup-plugin 0.18.2-rc.2 → 0.18.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.
package/README.md CHANGED
@@ -10,13 +10,14 @@ with
10
10
  a Rust implementation of the StyleX transform, instead of the official Babel
11
11
  plugin. Your StyleX code stays exactly the same — only the build step changes,
12
12
  with per-file transforms 5x to 10x faster than Babel
13
- ([performance](https://github.com/Dwlad90/stylex-swc-plugin#performance)).
14
- The extracted CSS is processed with [Lightning CSS](https://lightningcss.dev)
15
- before it is written to disk.
13
+ ([performance](https://github.com/Dwlad90/stylex-swc-plugin#performance)). The
14
+ extracted CSS is processed with [Lightning CSS](https://lightningcss.dev) before
15
+ it is written to disk.
16
16
 
17
17
  This is a community project and is not affiliated with Meta. It tracks the
18
18
  official StyleX releases
19
19
  <!-- stylex-compatibility:start -->(currently compatible with StyleX v0.19.0)<!-- stylex-compatibility:end -->
20
+
20
21
  and requires Node.js 20 or newer.
21
22
 
22
23
  ## Installation
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
+ import type { StyleXOptions, UseLayersType } from '@stylexswc/rs-compiler';
1
2
  import type { CustomAtRules, TransformOptions } from 'lightningcss';
2
3
  import type { Plugin } from 'rollup';
3
- import type { StyleXOptions, UseLayersType } from '@stylexswc/rs-compiler';
4
4
  export type PluginOptions = {
5
5
  rsOptions?: StyleXOptions;
6
6
  fileName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,MAAM,EAA2C,MAAM,QAAQ,CAAC;AAM9E,OAAO,KAAK,EAAE,aAAa,EAAsB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU/F,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,mBAAmB,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;IAC7F,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,SAAc,EACd,QAAuB,EACvB,YAAoB,EACpB,mBAAmB,EACnB,UAAiB,GAClB,GAAE,aAAkB,GAAG,MAAM,CAuI7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAsB,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG/F,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,KAAK,EAAE,MAAM,EAA2C,MAAM,QAAQ,CAAC;AAU9E,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,mBAAmB,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC,CAAC;IAC7F,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,SAAc,EACd,QAAuB,EACvB,YAAoB,EACpB,mBAAmB,EACnB,UAAiB,GAClB,GAAE,aAAkB,GAAG,MAAM,CAuI7B"}
package/dist/index.js CHANGED
@@ -4,17 +4,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = stylexPlugin;
7
+ const node_crypto_1 = __importDefault(require("node:crypto"));
8
+ const babel_plugin_1 = __importDefault(require("@stylexjs/babel-plugin"));
7
9
  const rs_compiler_1 = require("@stylexswc/rs-compiler");
8
- const lightningcss_1 = require("lightningcss");
9
10
  const browserslist_1 = __importDefault(require("browserslist"));
11
+ const lightningcss_1 = require("lightningcss");
10
12
  const lightningcss_2 = require("lightningcss");
11
- const babel_plugin_1 = __importDefault(require("@stylexjs/babel-plugin"));
12
- const crypto_1 = __importDefault(require("crypto"));
13
13
  function replaceFileName(original, css) {
14
14
  if (!original.includes('[hash]')) {
15
15
  return original;
16
16
  }
17
- const hash = crypto_1.default.createHash('sha256').update(css).digest('hex').slice(0, 8);
17
+ const hash = node_crypto_1.default.createHash('sha256').update(css).digest('hex').slice(0, 8);
18
18
  return original.replace(/\[hash\]/g, hash);
19
19
  }
20
20
  function stylexPlugin({ rsOptions = {}, fileName = 'stylex.css', useCSSLayers = false, lightningcssOptions, extractCSS = true, } = {}) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stylexswc/rollup-plugin",
3
3
  "description": "StyleX plugin for Rollup powered by a Rust NAPI-RS/SWC compiler. Fast StyleX transforms and CSS extraction without Babel.",
4
- "version": "0.18.2-rc.2",
4
+ "version": "0.18.2",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "sideEffects": false,
@@ -19,18 +19,16 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@stylexjs/babel-plugin": "^0.19.0",
22
- "@stylexswc/rs-compiler": "0.18.2-rc.2",
22
+ "@stylexswc/rs-compiler": "0.18.2",
23
23
  "lightningcss": "^1.32.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@rollup/plugin-commonjs": "^29.0.3",
27
27
  "@rollup/plugin-node-resolve": "^16.0.3",
28
- "@types/jest": "^30.0.0",
29
28
  "@types/node": "^26.1.0",
30
29
  "browserslist": "^4.28.4",
31
- "jest": "^30.4.2",
32
- "jest-chain-transform": "^0.0.8",
33
- "rollup": "^4.62.3"
30
+ "rollup": "^4.62.3",
31
+ "vitest": "^4.1.10"
34
32
  },
35
33
  "bugs": "https://github.com/Dwlad90/stylex-swc-plugin/issues",
36
34
  "homepage": "https://github.com/Dwlad90/stylex-swc-plugin/tree/develop/packages/rollup-plugin#readme",
@@ -56,12 +54,8 @@
56
54
  "build": "scripty --ts --flatten",
57
55
  "check:artifacts": "scripty",
58
56
  "clean": "del-cli dist",
59
- "lint": "eslint . --color",
60
- "lint:check": "eslint . --color --format json --output-file dist/eslint_report.json",
61
57
  "postbuild": "pnpm run check:artifacts",
62
- "precommit": "lint-staged",
63
- "prepush": "lint-prepush",
64
- "test": "jest",
58
+ "test": "vitest run",
65
59
  "typecheck": "scripty --ts"
66
60
  }
67
61
  }