with-zephyr 0.0.1 → 0.0.59
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 +61 -59
- package/dist/index.js +48781 -0
- package/package.json +59 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# zephyr
|
|
1
|
+
# with-zephyr
|
|
2
2
|
|
|
3
3
|
A codemod tool that automatically adds the `withZephyr` plugin to bundler configurations in your project.
|
|
4
4
|
|
|
@@ -20,10 +20,13 @@ Get your project Zephyr-ready in seconds:
|
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
# 1. Run the codemod to add Zephyr plugins to your bundler configs
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
#
|
|
26
|
-
|
|
23
|
+
curl -fsSL https://with.zephyr-cloud.io | node
|
|
24
|
+
|
|
25
|
+
# Alternative methods:
|
|
26
|
+
npx with-zephyr
|
|
27
|
+
pnpm dlx with-zephyr
|
|
28
|
+
yarn dlx with-zephyr
|
|
29
|
+
bunx with-zephyr
|
|
27
30
|
|
|
28
31
|
# 2. That's it! Your bundler is now configured for Zephyr deployments
|
|
29
32
|
# Visit https://app.zephyr-cloud.io to deploy your micro-frontends
|
|
@@ -31,7 +34,7 @@ npx zephyr-codemod --install
|
|
|
31
34
|
|
|
32
35
|
## Supported Bundlers
|
|
33
36
|
|
|
34
|
-
This codemod supports **
|
|
37
|
+
This codemod supports **11+ bundlers** with their respective Zephyr plugins:
|
|
35
38
|
|
|
36
39
|
- **Webpack** ([`zephyr-webpack-plugin`](https://www.npmjs.com/package/zephyr-webpack-plugin))
|
|
37
40
|
- **Rspack** ([`zephyr-rspack-plugin`](https://www.npmjs.com/package/zephyr-rspack-plugin))
|
|
@@ -41,25 +44,23 @@ This codemod supports **10+ bundlers** with their respective Zephyr plugins:
|
|
|
41
44
|
- **Modern.js** ([`zephyr-modernjs-plugin`](https://www.npmjs.com/package/zephyr-modernjs-plugin))
|
|
42
45
|
- **RSPress** ([`zephyr-rspress-plugin`](https://www.npmjs.com/package/zephyr-rspress-plugin))
|
|
43
46
|
- **Parcel** ([`parcel-reporter-zephyr`](https://www.npmjs.com/package/parcel-reporter-zephyr))
|
|
44
|
-
- **RSBuild** ([`zephyr-
|
|
47
|
+
- **RSBuild** ([`zephyr-rsbuild-plugin`](https://www.npmjs.com/package/zephyr-rsbuild-plugin))
|
|
48
|
+
- **RSLib** ([`zephyr-rsbuild-plugin`](https://www.npmjs.com/package/zephyr-rsbuild-plugin))
|
|
45
49
|
- **Re.Pack** (React Native) ([`zephyr-repack-plugin`](https://www.npmjs.com/package/zephyr-repack-plugin))
|
|
46
50
|
|
|
47
51
|
## Installation
|
|
48
52
|
|
|
49
|
-
**No installation required!** Use directly with
|
|
53
|
+
**No installation required!** Use directly with one command:
|
|
50
54
|
|
|
51
55
|
```bash
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
#
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
# yarn
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
# bun
|
|
62
|
-
bunx zephyr-codemod
|
|
56
|
+
# Recommended: Use the hosted version
|
|
57
|
+
curl -fsSL https://with.zephyr-cloud.io | node
|
|
58
|
+
|
|
59
|
+
# Alternative: Use with your package manager
|
|
60
|
+
npx with-zephyr # npm
|
|
61
|
+
pnpm dlx with-zephyr # pnpm
|
|
62
|
+
yarn dlx with-zephyr # yarn
|
|
63
|
+
bunx with-zephyr # bun
|
|
63
64
|
```
|
|
64
65
|
|
|
65
66
|
> **💡 Tip:** Using `npx`/`dlx`/`bunx` ensures you always get the latest version without cluttering your global packages.
|
|
@@ -71,10 +72,15 @@ bunx zephyr-codemod
|
|
|
71
72
|
Run the codemod in your project directory:
|
|
72
73
|
|
|
73
74
|
```bash
|
|
74
|
-
|
|
75
|
+
# Recommended: Use the hosted version
|
|
76
|
+
curl -fsSL https://with.zephyr-cloud.io | node
|
|
77
|
+
|
|
78
|
+
# Alternative: Use with package managers
|
|
79
|
+
npx with-zephyr
|
|
75
80
|
```
|
|
76
81
|
|
|
77
82
|
This will:
|
|
83
|
+
|
|
78
84
|
1. Search for bundler configuration files in the current directory and subdirectories
|
|
79
85
|
2. Detect which bundler each config file is for
|
|
80
86
|
3. Add the appropriate `withZephyr` plugin configuration
|
|
@@ -84,24 +90,24 @@ This will:
|
|
|
84
90
|
|
|
85
91
|
```bash
|
|
86
92
|
# Show what would be changed without modifying files
|
|
87
|
-
npx zephyr
|
|
93
|
+
npx with-zephyr --dry-run
|
|
88
94
|
|
|
89
|
-
# Automatically install missing plugin packages
|
|
90
|
-
npx zephyr
|
|
95
|
+
# Automatically install missing plugin packages
|
|
96
|
+
npx with-zephyr --install
|
|
91
97
|
|
|
92
98
|
# Specify a different directory
|
|
93
|
-
npx zephyr
|
|
99
|
+
npx with-zephyr ./my-project
|
|
94
100
|
|
|
95
101
|
# Only process specific bundlers
|
|
96
|
-
npx zephyr
|
|
102
|
+
npx with-zephyr --bundlers webpack vite
|
|
97
103
|
|
|
98
104
|
# Combine options
|
|
99
|
-
npx zephyr
|
|
105
|
+
npx with-zephyr ./src --dry-run --bundlers rollup --install
|
|
100
106
|
|
|
101
107
|
# Use with other package managers
|
|
102
|
-
pnpm dlx zephyr
|
|
103
|
-
yarn dlx zephyr
|
|
104
|
-
bunx zephyr
|
|
108
|
+
pnpm dlx with-zephyr --install
|
|
109
|
+
yarn dlx with-zephyr --dry-run
|
|
110
|
+
bunx with-zephyr --bundlers vite rollup
|
|
105
111
|
```
|
|
106
112
|
|
|
107
113
|
### Options
|
|
@@ -118,64 +124,55 @@ bunx zephyr-codemod --bundlers vite rollup
|
|
|
118
124
|
#### Webpack Configuration
|
|
119
125
|
|
|
120
126
|
**Before:**
|
|
127
|
+
|
|
121
128
|
```javascript
|
|
122
129
|
const { composePlugins, withNx, withReact } = require('@nx/webpack');
|
|
123
130
|
|
|
124
|
-
module.exports = composePlugins(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
(config) => {
|
|
128
|
-
return config;
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
+
module.exports = composePlugins(withNx(), withReact(), (config) => {
|
|
132
|
+
return config;
|
|
133
|
+
});
|
|
131
134
|
```
|
|
132
135
|
|
|
133
136
|
**After:**
|
|
137
|
+
|
|
134
138
|
```javascript
|
|
135
139
|
const { withZephyr } = require('zephyr-webpack-plugin');
|
|
136
140
|
const { composePlugins, withNx, withReact } = require('@nx/webpack');
|
|
137
141
|
|
|
138
|
-
module.exports = composePlugins(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
withZephyr(),
|
|
142
|
-
(config) => {
|
|
143
|
-
return config;
|
|
144
|
-
}
|
|
145
|
-
);
|
|
142
|
+
module.exports = composePlugins(withNx(), withReact(), withZephyr(), (config) => {
|
|
143
|
+
return config;
|
|
144
|
+
});
|
|
146
145
|
```
|
|
147
146
|
|
|
148
147
|
#### Vite Configuration
|
|
149
148
|
|
|
150
149
|
**Before:**
|
|
150
|
+
|
|
151
151
|
```typescript
|
|
152
152
|
import { defineConfig } from 'vite';
|
|
153
153
|
import react from '@vitejs/plugin-react';
|
|
154
154
|
|
|
155
155
|
export default defineConfig({
|
|
156
|
-
plugins: [
|
|
157
|
-
react(),
|
|
158
|
-
],
|
|
156
|
+
plugins: [react()],
|
|
159
157
|
});
|
|
160
158
|
```
|
|
161
159
|
|
|
162
160
|
**After:**
|
|
161
|
+
|
|
163
162
|
```typescript
|
|
164
163
|
import { withZephyr } from 'vite-plugin-zephyr';
|
|
165
164
|
import { defineConfig } from 'vite';
|
|
166
165
|
import react from '@vitejs/plugin-react';
|
|
167
166
|
|
|
168
167
|
export default defineConfig({
|
|
169
|
-
plugins: [
|
|
170
|
-
react(),
|
|
171
|
-
withZephyr(),
|
|
172
|
-
],
|
|
168
|
+
plugins: [react(), withZephyr()],
|
|
173
169
|
});
|
|
174
170
|
```
|
|
175
171
|
|
|
176
172
|
#### Rollup Configuration
|
|
177
173
|
|
|
178
174
|
**Before:**
|
|
175
|
+
|
|
179
176
|
```javascript
|
|
180
177
|
module.exports = (config) => {
|
|
181
178
|
return config;
|
|
@@ -183,6 +180,7 @@ module.exports = (config) => {
|
|
|
183
180
|
```
|
|
184
181
|
|
|
185
182
|
**After:**
|
|
183
|
+
|
|
186
184
|
```javascript
|
|
187
185
|
const { withZephyr } = require('rollup-plugin-zephyr');
|
|
188
186
|
|
|
@@ -201,8 +199,9 @@ The codemod can automatically install missing Zephyr plugin packages using the `
|
|
|
201
199
|
The tool automatically detects your package manager by checking for:
|
|
202
200
|
|
|
203
201
|
1. **Lock files** (in order of priority):
|
|
202
|
+
|
|
204
203
|
- `pnpm-lock.yaml` → pnpm
|
|
205
|
-
- `yarn.lock` → yarn
|
|
204
|
+
- `yarn.lock` → yarn
|
|
206
205
|
- `package-lock.json` → npm
|
|
207
206
|
- `bun.lockb` → bun
|
|
208
207
|
|
|
@@ -221,13 +220,13 @@ The tool automatically detects your package manager by checking for:
|
|
|
221
220
|
|
|
222
221
|
```bash
|
|
223
222
|
# Install packages and update configs in one command
|
|
224
|
-
npx zephyr
|
|
223
|
+
npx with-zephyr --install
|
|
225
224
|
|
|
226
225
|
# Preview what packages would be installed
|
|
227
|
-
npx zephyr
|
|
226
|
+
npx with-zephyr --dry-run --install
|
|
228
227
|
|
|
229
228
|
# The tool will show you which packages need to be installed if you don't use --install
|
|
230
|
-
npx zephyr
|
|
229
|
+
npx with-zephyr
|
|
231
230
|
# Output: 💡 Tip: Use --install to automatically install missing packages:
|
|
232
231
|
# vite-plugin-zephyr
|
|
233
232
|
# zephyr-webpack-plugin
|
|
@@ -244,6 +243,8 @@ The codemod automatically detects and processes these configuration files:
|
|
|
244
243
|
- `rolldown.config.js/ts/mjs`
|
|
245
244
|
- `modern.config.js/ts/mjs`
|
|
246
245
|
- `rspress.config.js/ts/mjs`
|
|
246
|
+
- `rsbuild.config.js/ts/mjs`
|
|
247
|
+
- `rslib.config.js/ts/mjs`
|
|
247
248
|
- `.parcelrc/.parcelrc.json`
|
|
248
249
|
|
|
249
250
|
## Integration Patterns
|
|
@@ -251,22 +252,27 @@ The codemod automatically detects and processes these configuration files:
|
|
|
251
252
|
The codemod recognizes and handles various configuration patterns:
|
|
252
253
|
|
|
253
254
|
### Webpack/Rspack
|
|
255
|
+
|
|
254
256
|
- `composePlugins()` calls (Nx style)
|
|
255
257
|
- `plugins: []` arrays
|
|
256
258
|
- Direct `module.exports` assignments
|
|
257
259
|
|
|
258
260
|
### Vite/Rolldown
|
|
261
|
+
|
|
259
262
|
- `defineConfig()` calls
|
|
260
263
|
- `plugins: []` arrays
|
|
261
264
|
|
|
262
265
|
### Rollup
|
|
266
|
+
|
|
263
267
|
- Function-based configs with `config.plugins.push()`
|
|
264
268
|
- `plugins: []` arrays
|
|
265
269
|
|
|
266
270
|
### Modern.js/RSPress
|
|
271
|
+
|
|
267
272
|
- `defineConfig()` calls with `plugins: []` arrays
|
|
268
273
|
|
|
269
274
|
### Parcel
|
|
275
|
+
|
|
270
276
|
- JSON configuration with `reporters` array
|
|
271
277
|
|
|
272
278
|
## Safety Features
|
|
@@ -328,7 +334,3 @@ src/
|
|
|
328
334
|
## Contributing
|
|
329
335
|
|
|
330
336
|
Found a configuration pattern that isn't supported? Please open an issue or submit a pull request!
|
|
331
|
-
|
|
332
|
-
## License
|
|
333
|
-
|
|
334
|
-
Apache-2.0
|