styled-components-to-stylex-codemod 0.0.1 → 0.0.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 +44 -13
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +43 -13
- package/dist/logger-Ckk2VkqY.mjs +89 -0
- package/dist/{transform-types-CCX_WVPh.d.mts → transform-types-Cry4CAGJ.d.mts} +4 -4
- package/dist/transform.d.mts +1 -1
- package/dist/transform.mjs +1027 -330
- package/package.json +23 -14
- package/dist/logger-D09HOyqF.mjs +0 -32
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "styled-components-to-stylex-codemod",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Codemod to transform styled-components to StyleX",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codemod",
|
|
@@ -28,11 +28,29 @@
|
|
|
28
28
|
},
|
|
29
29
|
"./package.json": "./package.json"
|
|
30
30
|
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsdown",
|
|
33
|
+
"dev": "tsdown --watch",
|
|
34
|
+
"test": "vitest",
|
|
35
|
+
"test:run": "vitest run",
|
|
36
|
+
"test:coverage": "vitest run --coverage",
|
|
37
|
+
"lint": "oxlint --type-aware --deny-warnings",
|
|
38
|
+
"lint:fix": "oxfmt && pnpm lint --fix",
|
|
39
|
+
"typecheck:src": "tsc --noEmit",
|
|
40
|
+
"typecheck:fixtures": "tsc -p test-cases/tsconfig.json --noEmit",
|
|
41
|
+
"typecheck": "pnpm run typecheck:src && pnpm run typecheck:fixtures",
|
|
42
|
+
"ci": "pnpm run lint && pnpm run typecheck && pnpm run test:run",
|
|
43
|
+
"prepublishOnly": "pnpm run build",
|
|
44
|
+
"storybook": "storybook dev -p 6006",
|
|
45
|
+
"playground": "vite --config playground/vite.config.ts",
|
|
46
|
+
"build:playground": "vite build --config playground/vite.config.ts"
|
|
47
|
+
},
|
|
31
48
|
"dependencies": {
|
|
32
49
|
"jscodeshift": "^17.3.0",
|
|
33
50
|
"stylis": "^4.3.2"
|
|
34
51
|
},
|
|
35
52
|
"devDependencies": {
|
|
53
|
+
"@codemirror/lang-javascript": "^6.2.4",
|
|
36
54
|
"@emotion/is-prop-valid": "^1.4.0",
|
|
37
55
|
"@playwright/test": "^1.57.0",
|
|
38
56
|
"@storybook/react": "^10.1.10",
|
|
@@ -45,6 +63,7 @@
|
|
|
45
63
|
"@types/react": "^19.2.7",
|
|
46
64
|
"@types/react-dom": "^19.2.3",
|
|
47
65
|
"@types/stylis": "^4.2.5",
|
|
66
|
+
"@uiw/react-codemirror": "^4.25.4",
|
|
48
67
|
"@vitejs/plugin-react": "^5.1.2",
|
|
49
68
|
"@vitest/coverage-v8": "^4.0.16",
|
|
50
69
|
"lefthook": "^2.0.13",
|
|
@@ -58,22 +77,12 @@
|
|
|
58
77
|
"tsdown": "^0.18.3",
|
|
59
78
|
"typescript": "^5.9.3",
|
|
60
79
|
"vite": "^7.3.0",
|
|
80
|
+
"vite-plugin-node-polyfills": "^0.24.0",
|
|
61
81
|
"vitest": "^4.0.16"
|
|
62
82
|
},
|
|
63
83
|
"engines": {
|
|
64
84
|
"node": ">=22.20",
|
|
65
85
|
"pnpm": ">=10.22.0"
|
|
66
86
|
},
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
"dev": "tsdown --watch",
|
|
70
|
-
"test": "vitest",
|
|
71
|
-
"test:run": "vitest run",
|
|
72
|
-
"test:coverage": "vitest run --coverage",
|
|
73
|
-
"lint": "oxlint --type-aware --deny-warnings",
|
|
74
|
-
"lint:fix": "oxfmt && pnpm lint --fix",
|
|
75
|
-
"typecheck": "tsc --noEmit",
|
|
76
|
-
"ci": "pnpm run lint && pnpm run typecheck && pnpm run test:run",
|
|
77
|
-
"storybook": "storybook dev -p 6006"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
87
|
+
"packageManager": "pnpm@10.22.0"
|
|
88
|
+
}
|
package/dist/logger-D09HOyqF.mjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
//#region src/internal/logger.ts
|
|
2
|
-
let collected = [];
|
|
3
|
-
/**
|
|
4
|
-
* Clear collected warnings and return them.
|
|
5
|
-
*/
|
|
6
|
-
function flushWarnings() {
|
|
7
|
-
const result = collected;
|
|
8
|
-
collected = [];
|
|
9
|
-
return result;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Log a warning message to stderr.
|
|
13
|
-
* All codemod warnings go through this so tests can mock it.
|
|
14
|
-
*/
|
|
15
|
-
function logWarning(message) {
|
|
16
|
-
process.stderr.write(message);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Log transform warnings to stderr and collect them.
|
|
20
|
-
*/
|
|
21
|
-
function logWarnings(warnings, filePath) {
|
|
22
|
-
for (const warning of warnings) {
|
|
23
|
-
collected.push({
|
|
24
|
-
...warning,
|
|
25
|
-
filePath
|
|
26
|
-
});
|
|
27
|
-
logWarning(`[styled-components-to-stylex] Warning${warning.loc ? ` (${filePath}:${warning.loc.line}:${warning.loc.column})` : ` (${filePath})`}: ${warning.message}\n`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { logWarning as n, logWarnings as r, flushWarnings as t };
|