@stylexswc/postcss-plugin 0.6.2-rc.2 → 0.6.2-rc.4
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/dist/bundler.d.ts +1 -1
- package/dist/bundler.d.ts.map +1 -1
- package/dist/bundler.js +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/package.json +10 -6
package/dist/bundler.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { StyleXOptions } from '@stylexswc/rs-compiler';
|
|
|
2
2
|
import type { TransformOptions, StyleXPluginOption } from './types';
|
|
3
3
|
export default function createBundler(): {
|
|
4
4
|
shouldTransform: (sourceCode: string) => boolean;
|
|
5
|
-
transform: (id: string, sourceCode: string,
|
|
5
|
+
transform: (id: string, sourceCode: string, rsOptions: StyleXOptions, options: TransformOptions) => import("@stylexswc/rs-compiler").StyleXTransformResult;
|
|
6
6
|
remove: (id: string) => void;
|
|
7
7
|
bundle: ({ useCSSLayers }: Pick<StyleXPluginOption, "useCSSLayers">) => string;
|
|
8
8
|
};
|
package/dist/bundler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAgC,MAAM,wBAAwB,CAAC;AAErF,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGpE,MAAM,CAAC,OAAO,UAAU,aAAa;kCAIE,MAAM;oBAMrC,MAAM,cACE,MAAM,
|
|
1
|
+
{"version":3,"file":"bundler.d.ts","sourceRoot":"","sources":["../src/bundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAgC,MAAM,wBAAwB,CAAC;AAErF,OAAO,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGpE,MAAM,CAAC,OAAO,UAAU,aAAa;kCAIE,MAAM;oBAMrC,MAAM,cACE,MAAM,aACP,aAAa,WACf,gBAAgB;iBAmCP,MAAM;+BAKQ,IAAI,CAAC,kBAAkB,EAAE,cAAc,CAAC;EAc3E"}
|
package/dist/bundler.js
CHANGED
|
@@ -14,24 +14,24 @@ function createBundler() {
|
|
|
14
14
|
return sourceCode.includes('stylex');
|
|
15
15
|
}
|
|
16
16
|
// Transforms the source code using Babel, extracting StyleX rules and storing them.
|
|
17
|
-
function transform(id, sourceCode,
|
|
17
|
+
function transform(id, sourceCode, rsOptions, options) {
|
|
18
18
|
const { shouldSkipTransformError } = options;
|
|
19
|
-
let
|
|
19
|
+
let transformResult = {
|
|
20
20
|
code: sourceCode,
|
|
21
21
|
map: undefined,
|
|
22
22
|
metadata: { stylex: [] },
|
|
23
23
|
};
|
|
24
24
|
try {
|
|
25
|
-
|
|
25
|
+
transformResult = (0, rs_compiler_1.transform)(id, sourceCode, rsOptions);
|
|
26
26
|
}
|
|
27
27
|
catch (error) {
|
|
28
28
|
if (shouldSkipTransformError) {
|
|
29
29
|
console.warn(`[@stylexswc/postcss-plugin] Failed to transform "${id}": ${error.message}`);
|
|
30
|
-
return
|
|
30
|
+
return transformResult;
|
|
31
31
|
}
|
|
32
32
|
throw error;
|
|
33
33
|
}
|
|
34
|
-
const { code, map, metadata } =
|
|
34
|
+
const { code, map, metadata } = transformResult;
|
|
35
35
|
const stylex = metadata.stylex;
|
|
36
36
|
if (stylex != null && stylex.length > 0) {
|
|
37
37
|
styleXRulesMap.set(id, stylex);
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAQlD,QAAA,MAAM,MAAM;0DAQT,kBAAkB;;yBAiBC,OAAO,CAAC,IAAI,UAAU,OAAO,CAAC,MAAM;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAQlD,QAAA,MAAM,MAAM;0DAQT,kBAAkB;;yBAiBC,OAAO,CAAC,IAAI,UAAU,OAAO,CAAC,MAAM;;;CA6DzD,CAAC;AAKF,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,14 @@ rsOptions = {}, include, exclude, useCSSLayers = false, }) => {
|
|
|
33
33
|
include,
|
|
34
34
|
exclude,
|
|
35
35
|
cwd,
|
|
36
|
-
rsOptions
|
|
36
|
+
rsOptions: {
|
|
37
|
+
useRemForFontSize: true,
|
|
38
|
+
runtimeInjection: false,
|
|
39
|
+
genConditionalClasses: true,
|
|
40
|
+
treeshakeCompensation: true,
|
|
41
|
+
importSources: ['stylex', '@stylexjs/stylex'],
|
|
42
|
+
...rsOptions,
|
|
43
|
+
},
|
|
37
44
|
useCSSLayers,
|
|
38
45
|
isDev,
|
|
39
46
|
});
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexswc/postcss-plugin",
|
|
3
3
|
"description": "StyleX PostCSS plugin with NAPI-RS compiler",
|
|
4
|
-
"version": "0.6.2-rc.
|
|
4
|
+
"version": "0.6.2-rc.4",
|
|
5
5
|
"config": {
|
|
6
6
|
"scripty": {
|
|
7
7
|
"path": "../../scripts/packages"
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@stylexjs/babel-plugin": "^0.
|
|
11
|
+
"@stylexjs/babel-plugin": "^0.10.0",
|
|
12
12
|
"fast-glob": "^3.3.2",
|
|
13
13
|
"glob-parent": "^6.0.2",
|
|
14
14
|
"is-glob": "^4.0.3",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@babel/types": "^7.23.9",
|
|
19
|
-
"@stylexswc/eslint-config": "0.6.2-rc.
|
|
20
|
-
"@stylexswc/rs-compiler": "0.6.2-rc.
|
|
21
|
-
"@stylexswc/typescript-config": "0.6.2-rc.
|
|
19
|
+
"@stylexswc/eslint-config": "0.6.2-rc.4",
|
|
20
|
+
"@stylexswc/rs-compiler": "0.6.2-rc.4",
|
|
21
|
+
"@stylexswc/typescript-config": "0.6.2-rc.4",
|
|
22
22
|
"@types/babel__core": "^7.20.5",
|
|
23
23
|
"@types/glob-parent": "^5.1.3",
|
|
24
24
|
"@types/is-glob": "^4.0.4",
|
|
@@ -45,9 +45,13 @@
|
|
|
45
45
|
"sideEffects": false,
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "scripty --ts",
|
|
48
|
+
"check:artifacts": "scripty",
|
|
48
49
|
"clean": "del-cli dist",
|
|
50
|
+
"lint": "eslint . --color",
|
|
51
|
+
"lint:check": "eslint . --color --format json --output-file dist/eslint_report.json",
|
|
49
52
|
"precommit": "lint-staged",
|
|
50
53
|
"prepush": "lint-prepush",
|
|
51
|
-
"test": "echo \"Error: no test specified\" && exit 0"
|
|
54
|
+
"test": "echo \"Error: no test specified\" && exit 0",
|
|
55
|
+
"typecheck": "scripty"
|
|
52
56
|
}
|
|
53
57
|
}
|