zephyr-modernjs-plugin 0.0.49 → 0.0.50
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 +173 -8
- package/dist/package.json +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,14 +1,40 @@
|
|
|
1
|
-
# Zephyr
|
|
1
|
+
# Zephyr Modern.js Plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<div align="center">
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[Zephyr Cloud](https://zephyr-cloud.io) | [Zephyr Docs](https://docs.zephyr-cloud.io) | [Discord](https://zephyr-cloud.io/discord) | [Twitter](https://x.com/ZephyrCloudIO) | [LinkedIn](https://www.linkedin.com/company/zephyr-cloud/)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
|
|
7
|
+
<hr/>
|
|
8
|
+
<img src="https://cdn.prod.website-files.com/669061ee3adb95b628c3acda/66981c766e352fe1f57191e2_Opengraph-zephyr.png" alt="Zephyr Logo" />
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
A Modern.js plugin for deploying applications with Zephyr Cloud. This plugin integrates seamlessly with Modern.js framework to enable application federation and deployment capabilities.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# npm
|
|
17
|
+
npm install --save-dev zephyr-modernjs-plugin
|
|
18
|
+
|
|
19
|
+
# yarn
|
|
20
|
+
yarn add --dev zephyr-modernjs-plugin
|
|
21
|
+
|
|
22
|
+
# pnpm
|
|
23
|
+
pnpm add --dev zephyr-modernjs-plugin
|
|
24
|
+
|
|
25
|
+
# bun
|
|
26
|
+
bun add --dev zephyr-modernjs-plugin
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
Add the plugin to your Modern.js configuration:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// modern.config.ts
|
|
35
|
+
import { defineConfig } from '@modern-js/app-tools';
|
|
36
|
+
import { withZephyr } from 'zephyr-modernjs-plugin';
|
|
10
37
|
|
|
11
|
-
```ts
|
|
12
38
|
export default defineConfig({
|
|
13
39
|
output: {
|
|
14
40
|
distPath: {
|
|
@@ -28,7 +54,146 @@ export default defineConfig({
|
|
|
28
54
|
appTools({
|
|
29
55
|
bundler: 'rspack', // Set to 'webpack' to enable webpack
|
|
30
56
|
}),
|
|
31
|
-
withZephyr(), //
|
|
57
|
+
withZephyr(), // Must be last
|
|
32
58
|
],
|
|
33
59
|
});
|
|
34
60
|
```
|
|
61
|
+
|
|
62
|
+
## Required Configuration
|
|
63
|
+
|
|
64
|
+
The plugin requires the following Modern.js configuration to work properly:
|
|
65
|
+
|
|
66
|
+
### Output Configuration
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
output: {
|
|
70
|
+
distPath: {
|
|
71
|
+
html: './', // HTML files at root of dist
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### HTML Configuration
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
html: {
|
|
80
|
+
outputStructure: 'flat', // Flat structure for assets
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Source Configuration
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
source: {
|
|
88
|
+
mainEntryName: 'index', // Main entry point name
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Bundler Support
|
|
93
|
+
|
|
94
|
+
The plugin works with both Webpack and Rspack bundlers:
|
|
95
|
+
|
|
96
|
+
### With Rspack (Recommended)
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
plugins: [
|
|
100
|
+
appTools({
|
|
101
|
+
bundler: 'rspack',
|
|
102
|
+
}),
|
|
103
|
+
withZephyr(),
|
|
104
|
+
];
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### With Webpack
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
plugins: [
|
|
111
|
+
appTools({
|
|
112
|
+
bundler: 'webpack',
|
|
113
|
+
}),
|
|
114
|
+
withZephyr(),
|
|
115
|
+
];
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Configuration Options
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
withZephyr({
|
|
122
|
+
// Deployment options
|
|
123
|
+
deploy: true,
|
|
124
|
+
environment: 'production',
|
|
125
|
+
|
|
126
|
+
// Additional metadata
|
|
127
|
+
metadata: {
|
|
128
|
+
version: '1.0.0',
|
|
129
|
+
description: 'My Modern.js app',
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Features
|
|
135
|
+
|
|
136
|
+
- 🚀 Seamless deployment during Modern.js build
|
|
137
|
+
- ⚡ Support for both Webpack and Rspack bundlers
|
|
138
|
+
- 📦 Automatic asset optimization
|
|
139
|
+
- 🏗️ Application federation capabilities
|
|
140
|
+
- 🔧 Zero-config setup with required configuration
|
|
141
|
+
- 📊 Build analytics and monitoring
|
|
142
|
+
- 🌐 Global CDN distribution
|
|
143
|
+
|
|
144
|
+
## Project Structure
|
|
145
|
+
|
|
146
|
+
Your Modern.js project should follow this structure:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
my-modernjs-app/
|
|
150
|
+
├── src/
|
|
151
|
+
│ ├── routes/
|
|
152
|
+
│ │ ├── layout.tsx
|
|
153
|
+
│ │ └── page.tsx
|
|
154
|
+
│ └── index.ts
|
|
155
|
+
├── modern.config.ts
|
|
156
|
+
└── package.json
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Getting Started
|
|
160
|
+
|
|
161
|
+
1. Install the plugin in your Modern.js project
|
|
162
|
+
2. Add the required configuration to `modern.config.ts`
|
|
163
|
+
3. Add the plugin to your plugins array (ensure it's last)
|
|
164
|
+
4. Build your application with `npm run build`
|
|
165
|
+
5. Your app will be automatically deployed to Zephyr Cloud
|
|
166
|
+
|
|
167
|
+
## Build Scripts
|
|
168
|
+
|
|
169
|
+
Add these scripts to your `package.json`:
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"scripts": {
|
|
174
|
+
"dev": "modern dev",
|
|
175
|
+
"build": "modern build",
|
|
176
|
+
"serve": "modern serve"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Requirements
|
|
182
|
+
|
|
183
|
+
- Modern.js 2.x or higher
|
|
184
|
+
- Node.js 18 or higher
|
|
185
|
+
- Zephyr Cloud account (sign up at [zephyr-cloud.io](https://zephyr-cloud.io))
|
|
186
|
+
|
|
187
|
+
## Examples
|
|
188
|
+
|
|
189
|
+
Check out our [examples directory](../../examples/) for complete working examples:
|
|
190
|
+
|
|
191
|
+
- [modern-js](../../examples/modern-js/) - Complete Modern.js setup with Zephyr
|
|
192
|
+
|
|
193
|
+
## Contributing
|
|
194
|
+
|
|
195
|
+
We welcome contributions! Please read our [contributing guidelines](../../CONTRIBUTING.md) for more information.
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
199
|
+
Licensed under the Apache-2.0 License. See [LICENSE](LICENSE) for more information.
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zephyr-modernjs-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.50",
|
|
4
4
|
"description": "Modernjs plugin for Zephyr",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"@modern-js/app-tools": "^2.66.0",
|
|
20
20
|
"is-ci": "^4.1.0",
|
|
21
21
|
"tslib": "^2.8.1",
|
|
22
|
-
"zephyr-edge-contract": "0.0.
|
|
23
|
-
"zephyr-
|
|
24
|
-
"zephyr-
|
|
22
|
+
"zephyr-edge-contract": "0.0.50",
|
|
23
|
+
"zephyr-xpack-internal": "0.0.50",
|
|
24
|
+
"zephyr-agent": "0.0.50"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/is-ci": "3.0.4",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"ts-jest": "^29.2.6"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"zephyr-
|
|
35
|
-
"zephyr-
|
|
34
|
+
"zephyr-rspack-plugin": "0.0.50",
|
|
35
|
+
"zephyr-webpack-plugin": "0.0.50"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"zephyr-rspack-plugin": {
|