with-zephyr 0.0.0-canary.20 → 0.0.0-canary.24
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 +27 -19
- package/dist/index.js +2 -8
- package/dist/zephyr-manifest.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -93,6 +93,9 @@ This will:
|
|
|
93
93
|
# Show what would be changed without modifying files
|
|
94
94
|
npx with-zephyr --dry-run
|
|
95
95
|
|
|
96
|
+
# Automatically install missing plugin packages
|
|
97
|
+
npx with-zephyr --install
|
|
98
|
+
|
|
96
99
|
# Specify a different directory
|
|
97
100
|
npx with-zephyr ./my-project
|
|
98
101
|
|
|
@@ -100,10 +103,10 @@ npx with-zephyr ./my-project
|
|
|
100
103
|
npx with-zephyr --bundlers webpack vite
|
|
101
104
|
|
|
102
105
|
# Combine options
|
|
103
|
-
npx with-zephyr ./src --dry-run --bundlers rollup
|
|
106
|
+
npx with-zephyr ./src --dry-run --bundlers rollup --install
|
|
104
107
|
|
|
105
108
|
# Use with other package managers
|
|
106
|
-
pnpm dlx with-zephyr
|
|
109
|
+
pnpm dlx with-zephyr --install
|
|
107
110
|
yarn dlx with-zephyr --dry-run
|
|
108
111
|
bunx with-zephyr --bundlers vite rollup
|
|
109
112
|
```
|
|
@@ -113,8 +116,7 @@ bunx with-zephyr --bundlers vite rollup
|
|
|
113
116
|
- `[directory]` - Directory to search for config files (default: current directory)
|
|
114
117
|
- `-d, --dry-run` - Show what would be changed without modifying files
|
|
115
118
|
- `-b, --bundlers <bundlers...>` - Only process specific bundlers
|
|
116
|
-
|
|
117
|
-
> The codemod automatically installs missing Zephyr plugins using your detected package manager (npm/yarn/pnpm/bun). In `--dry-run` it will only list what would be installed.
|
|
119
|
+
- `-i, --install` - Automatically install missing plugin packages
|
|
118
120
|
|
|
119
121
|
## Examples
|
|
120
122
|
|
|
@@ -191,7 +193,7 @@ module.exports = (config) => {
|
|
|
191
193
|
|
|
192
194
|
## Package Management
|
|
193
195
|
|
|
194
|
-
The codemod automatically
|
|
196
|
+
The codemod can automatically install missing Zephyr plugin packages using the `--install` flag.
|
|
195
197
|
|
|
196
198
|
### Package Manager Detection
|
|
197
199
|
|
|
@@ -215,10 +217,21 @@ The tool automatically detects your package manager by checking for:
|
|
|
215
217
|
- **pnpm**: `pnpm add --save-dev <package>`
|
|
216
218
|
- **bun**: `bun add --dev <package>`
|
|
217
219
|
|
|
218
|
-
### Package Installation
|
|
220
|
+
### Usage with Package Installation
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Install packages and update configs in one command
|
|
224
|
+
npx with-zephyr --install
|
|
219
225
|
|
|
220
|
-
|
|
221
|
-
|
|
226
|
+
# Preview what packages would be installed
|
|
227
|
+
npx with-zephyr --dry-run --install
|
|
228
|
+
|
|
229
|
+
# The tool will show you which packages need to be installed if you don't use --install
|
|
230
|
+
npx with-zephyr
|
|
231
|
+
# Output: 💡 Tip: Use --install to automatically install missing packages:
|
|
232
|
+
# vite-plugin-zephyr
|
|
233
|
+
# zephyr-webpack-plugin
|
|
234
|
+
```
|
|
222
235
|
|
|
223
236
|
## Configuration File Detection
|
|
224
237
|
|
|
@@ -293,7 +306,7 @@ Refer to the individual plugin documentation for specific setup instructions.
|
|
|
293
306
|
|
|
294
307
|
### Building
|
|
295
308
|
|
|
296
|
-
The codemod is written in TypeScript and
|
|
309
|
+
The codemod is written in TypeScript and bundled with tsup:
|
|
297
310
|
|
|
298
311
|
```bash
|
|
299
312
|
# Install dependencies
|
|
@@ -307,22 +320,17 @@ pnpm run dev
|
|
|
307
320
|
|
|
308
321
|
# Type checking
|
|
309
322
|
pnpm run typecheck
|
|
310
|
-
|
|
311
|
-
# Run the locally built CLI (no publish needed)
|
|
312
|
-
pnpm nx build with-zephyr
|
|
313
|
-
node ./libs/with-zephyr/dist/index.js --bundlers rspack /path/to/project
|
|
314
|
-
node ./libs/with-zephyr/dist/index.js --bundlers repack /path/to/react-native-project
|
|
315
323
|
```
|
|
316
324
|
|
|
317
325
|
### Project Structure
|
|
318
326
|
|
|
319
327
|
```
|
|
320
328
|
src/
|
|
321
|
-
├──
|
|
322
|
-
├──
|
|
323
|
-
├──
|
|
324
|
-
├──
|
|
325
|
-
└──
|
|
329
|
+
├── index.ts # Main CLI entry point
|
|
330
|
+
├── types.ts # TypeScript type definitions
|
|
331
|
+
├── bundler-configs.ts # Bundler configuration definitions
|
|
332
|
+
├── transformers.ts # AST transformation functions
|
|
333
|
+
└── package-manager.ts # Package management utilities
|
|
326
334
|
```
|
|
327
335
|
|
|
328
336
|
## Contributing
|
package/dist/index.js
CHANGED
|
@@ -48114,11 +48114,6 @@ const rspack_rspackConfig = {
|
|
|
48114
48114
|
matcher: /export\s+default\s+withZephyr\s*\(\s*\)\s*\(/,
|
|
48115
48115
|
transform: 'skipAlreadyWrapped'
|
|
48116
48116
|
},
|
|
48117
|
-
{
|
|
48118
|
-
type: 'define-config',
|
|
48119
|
-
matcher: /export\s+default\s+defineConfig\s*\(/,
|
|
48120
|
-
transform: 'wrapExportDefault'
|
|
48121
|
-
},
|
|
48122
48117
|
{
|
|
48123
48118
|
type: 'compose-plugins',
|
|
48124
48119
|
matcher: /composePlugins\s*\(/,
|
|
@@ -48617,9 +48612,8 @@ function wrapModuleExports(ast) {
|
|
|
48617
48612
|
function wrapExportDefault(ast) {
|
|
48618
48613
|
(0, traverse_lib["default"])(ast, {
|
|
48619
48614
|
ExportDefaultDeclaration (path) {
|
|
48620
|
-
|
|
48621
|
-
|
|
48622
|
-
declaration
|
|
48615
|
+
if (types_lib.isObjectExpression(path.node.declaration)) path.node.declaration = types_lib.callExpression(types_lib.callExpression(types_lib.identifier('withZephyr'), []), [
|
|
48616
|
+
path.node.declaration
|
|
48623
48617
|
]);
|
|
48624
48618
|
}
|
|
48625
48619
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "with-zephyr",
|
|
3
|
-
"version": "0.0.0-canary.
|
|
3
|
+
"version": "0.0.0-canary.24",
|
|
4
4
|
"description": "A codemod to automatically add withZephyr plugin to bundler configurations",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/node": "^24.5.2",
|
|
39
39
|
"@rslib/core": "^0.13.3",
|
|
40
40
|
"typescript": "^5.9.2",
|
|
41
|
-
"zephyr-rsbuild-plugin": "0.0.0-canary.
|
|
41
|
+
"zephyr-rsbuild-plugin": "0.0.0-canary.24"
|
|
42
42
|
},
|
|
43
43
|
"keywords": [
|
|
44
44
|
"zephyr",
|