with-zephyr 0.0.0-canary.3 → 0.0.0-canary.30
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 +22 -28
- package/dist/index.js +804 -728
- package/package.json +5 -4
- package/dist/zephyr-manifest.json +0 -6
package/README.md
CHANGED
|
@@ -34,13 +34,14 @@ bunx with-zephyr
|
|
|
34
34
|
|
|
35
35
|
## Supported Bundlers
|
|
36
36
|
|
|
37
|
-
This codemod supports **
|
|
37
|
+
This codemod supports **12+ bundlers** with their respective Zephyr plugins:
|
|
38
38
|
|
|
39
39
|
- **Webpack** ([`zephyr-webpack-plugin`](https://www.npmjs.com/package/zephyr-webpack-plugin))
|
|
40
40
|
- **Rspack** ([`zephyr-rspack-plugin`](https://www.npmjs.com/package/zephyr-rspack-plugin))
|
|
41
41
|
- **Vite** ([`vite-plugin-zephyr`](https://www.npmjs.com/package/vite-plugin-zephyr))
|
|
42
42
|
- **Rollup** ([`rollup-plugin-zephyr`](https://www.npmjs.com/package/rollup-plugin-zephyr))
|
|
43
43
|
- **Rolldown** ([`zephyr-rolldown-plugin`](https://www.npmjs.com/package/zephyr-rolldown-plugin))
|
|
44
|
+
- **Astro** ([`zephyr-astro-integration`](https://www.npmjs.com/package/zephyr-astro-integration))
|
|
44
45
|
- **Modern.js** ([`zephyr-modernjs-plugin`](https://www.npmjs.com/package/zephyr-modernjs-plugin))
|
|
45
46
|
- **RSPress** ([`zephyr-rspress-plugin`](https://www.npmjs.com/package/zephyr-rspress-plugin))
|
|
46
47
|
- **Parcel** ([`parcel-reporter-zephyr`](https://www.npmjs.com/package/parcel-reporter-zephyr))
|
|
@@ -92,9 +93,6 @@ This will:
|
|
|
92
93
|
# Show what would be changed without modifying files
|
|
93
94
|
npx with-zephyr --dry-run
|
|
94
95
|
|
|
95
|
-
# Automatically install missing plugin packages
|
|
96
|
-
npx with-zephyr --install
|
|
97
|
-
|
|
98
96
|
# Specify a different directory
|
|
99
97
|
npx with-zephyr ./my-project
|
|
100
98
|
|
|
@@ -102,10 +100,10 @@ npx with-zephyr ./my-project
|
|
|
102
100
|
npx with-zephyr --bundlers webpack vite
|
|
103
101
|
|
|
104
102
|
# Combine options
|
|
105
|
-
npx with-zephyr ./src --dry-run --bundlers rollup
|
|
103
|
+
npx with-zephyr ./src --dry-run --bundlers rollup
|
|
106
104
|
|
|
107
105
|
# Use with other package managers
|
|
108
|
-
pnpm dlx with-zephyr
|
|
106
|
+
pnpm dlx with-zephyr
|
|
109
107
|
yarn dlx with-zephyr --dry-run
|
|
110
108
|
bunx with-zephyr --bundlers vite rollup
|
|
111
109
|
```
|
|
@@ -115,7 +113,8 @@ bunx with-zephyr --bundlers vite rollup
|
|
|
115
113
|
- `[directory]` - Directory to search for config files (default: current directory)
|
|
116
114
|
- `-d, --dry-run` - Show what would be changed without modifying files
|
|
117
115
|
- `-b, --bundlers <bundlers...>` - Only process specific bundlers
|
|
118
|
-
|
|
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
118
|
|
|
120
119
|
## Examples
|
|
121
120
|
|
|
@@ -192,7 +191,7 @@ module.exports = (config) => {
|
|
|
192
191
|
|
|
193
192
|
## Package Management
|
|
194
193
|
|
|
195
|
-
The codemod
|
|
194
|
+
The codemod automatically installs missing Zephyr plugin packages when not running in `--dry-run` mode.
|
|
196
195
|
|
|
197
196
|
### Package Manager Detection
|
|
198
197
|
|
|
@@ -216,21 +215,10 @@ The tool automatically detects your package manager by checking for:
|
|
|
216
215
|
- **pnpm**: `pnpm add --save-dev <package>`
|
|
217
216
|
- **bun**: `bun add --dev <package>`
|
|
218
217
|
|
|
219
|
-
###
|
|
220
|
-
|
|
221
|
-
```bash
|
|
222
|
-
# Install packages and update configs in one command
|
|
223
|
-
npx with-zephyr --install
|
|
218
|
+
### Package Installation Behavior
|
|
224
219
|
|
|
225
|
-
|
|
226
|
-
npx with-zephyr --dry-run
|
|
227
|
-
|
|
228
|
-
# The tool will show you which packages need to be installed if you don't use --install
|
|
229
|
-
npx with-zephyr
|
|
230
|
-
# Output: 💡 Tip: Use --install to automatically install missing packages:
|
|
231
|
-
# vite-plugin-zephyr
|
|
232
|
-
# zephyr-webpack-plugin
|
|
233
|
-
```
|
|
220
|
+
- `npx with-zephyr` will install any required Zephyr plugins that are missing.
|
|
221
|
+
- `npx with-zephyr --dry-run` will list the packages it would install without making changes.
|
|
234
222
|
|
|
235
223
|
## Configuration File Detection
|
|
236
224
|
|
|
@@ -241,6 +229,7 @@ The codemod automatically detects and processes these configuration files:
|
|
|
241
229
|
- `vite.config.js/ts/mjs`
|
|
242
230
|
- `rollup.config.js/ts/mjs`
|
|
243
231
|
- `rolldown.config.js/ts/mjs`
|
|
232
|
+
- `astro.config.js/ts/mjs/mts`
|
|
244
233
|
- `modern.config.js/ts/mjs`
|
|
245
234
|
- `rspress.config.js/ts/mjs`
|
|
246
235
|
- `rsbuild.config.js/ts/mjs`
|
|
@@ -304,7 +293,7 @@ Refer to the individual plugin documentation for specific setup instructions.
|
|
|
304
293
|
|
|
305
294
|
### Building
|
|
306
295
|
|
|
307
|
-
The codemod is written in TypeScript and
|
|
296
|
+
The codemod is written in TypeScript and built with Rspack/RSLib:
|
|
308
297
|
|
|
309
298
|
```bash
|
|
310
299
|
# Install dependencies
|
|
@@ -318,17 +307,22 @@ pnpm run dev
|
|
|
318
307
|
|
|
319
308
|
# Type checking
|
|
320
309
|
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
|
|
321
315
|
```
|
|
322
316
|
|
|
323
317
|
### Project Structure
|
|
324
318
|
|
|
325
319
|
```
|
|
326
320
|
src/
|
|
327
|
-
├──
|
|
328
|
-
├──
|
|
329
|
-
├──
|
|
330
|
-
├──
|
|
331
|
-
└──
|
|
321
|
+
├── bundlers/ # Per-bundler configs + registry
|
|
322
|
+
├── transformers/ # AST transforms (imports, plugin arrays, wrappers, etc.)
|
|
323
|
+
├── package-manager.ts # Package management utilities
|
|
324
|
+
├── index.ts # CLI entry point and orchestration
|
|
325
|
+
└── types.ts # Shared types
|
|
332
326
|
```
|
|
333
327
|
|
|
334
328
|
## Contributing
|