@nuxtlib/cf-deployment 1.0.2 → 1.0.4
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 +5 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +17 -44
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,8 @@ export default defineNuxtConfig({
|
|
|
28
28
|
2. In Cloudflare, go to `API Tokens` -> `Create Token` -> choose `Edit Cloudflare Workers`, scope it to your account, create the token, and copy it.
|
|
29
29
|

|
|
30
30
|
|
|
31
|
+
3. Before first deploy, delete any existing DNS record that matches your environment hostnames. Wrangler will try to create those records during deploy and can fail on conflicts.
|
|
32
|
+
|
|
31
33
|
#### If your domain isn't registered in Clouflare yet
|
|
32
34
|
Go to Cloudflare, add your domain and point nameservers to Cloudflare. Wait until the zone is `Active`.
|
|
33
35
|
|
|
@@ -211,10 +213,12 @@ Branch behavior:
|
|
|
211
213
|
- Branch names are normalized for env keys: lowercased, non `[a-z0-9_]` characters become `_`.
|
|
212
214
|
- Duplicate normalized env keys get suffixes (`main`, `main_2`, `main_3`, ...).
|
|
213
215
|
- Route patterns remove scheme and trailing slash (`https://app.example.com/` -> `app.example.com`).
|
|
216
|
+
- Nuxt build output must stay at `.output`; some modules override output to `dist`, which breaks this deploy flow unless you set it back to `.output`.
|
|
214
217
|
|
|
215
218
|
|
|
216
219
|
## Roadmap
|
|
217
220
|
- CF Resource binding generation (KV, R2, D1, Queues, Durable Objects)
|
|
218
221
|
- Domain provisioning
|
|
219
222
|
- Rollback strategies
|
|
220
|
-
- Improvement of internal files modularity and test coverage
|
|
223
|
+
- Improvement of internal files modularity and test coverage
|
|
224
|
+
- Enforcment of output build dir
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -131,57 +131,30 @@ function getWorkflowHeaderBlock(branches) {
|
|
|
131
131
|
return lines.join("\n");
|
|
132
132
|
}
|
|
133
133
|
function getBuildStepsBlock(packageManager, nodeVersion) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
" uses: pnpm/action-setup@v4",
|
|
138
|
-
" with:",
|
|
139
|
-
" version: 10",
|
|
140
|
-
"",
|
|
141
|
-
" - name: Setup Node",
|
|
142
|
-
" uses: actions/setup-node@v4",
|
|
143
|
-
" with:",
|
|
144
|
-
` node-version: ${nodeVersion}`,
|
|
145
|
-
" cache: pnpm",
|
|
146
|
-
" cache-dependency-path: pnpm-lock.yaml",
|
|
147
|
-
"",
|
|
148
|
-
" - name: Install deps",
|
|
149
|
-
" run: pnpm install --frozen-lockfile",
|
|
150
|
-
"",
|
|
151
|
-
" - name: Build Nuxt app",
|
|
152
|
-
" run: pnpm run build"
|
|
153
|
-
].join("\n");
|
|
154
|
-
}
|
|
155
|
-
if (packageManager === "yarn") {
|
|
156
|
-
return [
|
|
157
|
-
" - name: Setup Node",
|
|
158
|
-
" uses: actions/setup-node@v4",
|
|
159
|
-
" with:",
|
|
160
|
-
` node-version: ${nodeVersion}`,
|
|
161
|
-
" cache: yarn",
|
|
162
|
-
" cache-dependency-path: yarn.lock",
|
|
163
|
-
"",
|
|
164
|
-
" - name: Install deps",
|
|
165
|
-
" run: yarn install --frozen-lockfile",
|
|
166
|
-
"",
|
|
167
|
-
" - name: Build Nuxt app",
|
|
168
|
-
" run: yarn build"
|
|
169
|
-
].join("\n");
|
|
170
|
-
}
|
|
171
|
-
return [
|
|
134
|
+
const installCommand = packageManager === "pnpm" ? "pnpm install --frozen-lockfile" : packageManager === "yarn" ? "yarn install --frozen-lockfile" : "npm ci";
|
|
135
|
+
const buildCommand = packageManager === "pnpm" ? "pnpm run build" : packageManager === "yarn" ? "yarn build" : "npm run build";
|
|
136
|
+
const lines = [
|
|
172
137
|
" - name: Setup Node",
|
|
173
138
|
" uses: actions/setup-node@v4",
|
|
174
139
|
" with:",
|
|
175
140
|
` node-version: ${nodeVersion}`,
|
|
176
|
-
"
|
|
177
|
-
|
|
178
|
-
|
|
141
|
+
""
|
|
142
|
+
];
|
|
143
|
+
if (packageManager !== "npm") {
|
|
144
|
+
lines.push(
|
|
145
|
+
" - name: Enable Corepack",
|
|
146
|
+
" run: corepack enable",
|
|
147
|
+
""
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
lines.push(
|
|
179
151
|
" - name: Install deps",
|
|
180
|
-
|
|
152
|
+
` run: ${installCommand}`,
|
|
181
153
|
"",
|
|
182
154
|
" - name: Build Nuxt app",
|
|
183
|
-
|
|
184
|
-
|
|
155
|
+
` run: ${buildCommand}`
|
|
156
|
+
);
|
|
157
|
+
return lines.join("\n");
|
|
185
158
|
}
|
|
186
159
|
function getDeployCommand(packageManager) {
|
|
187
160
|
if (packageManager === "pnpm") {
|
package/package.json
CHANGED