@nuxtlib/cf-deployment 1.0.2 → 1.0.3
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/dist/module.json +1 -1
- package/dist/module.mjs +20 -44
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -131,57 +131,33 @@ function getWorkflowHeaderBlock(branches) {
|
|
|
131
131
|
return lines.join("\n");
|
|
132
132
|
}
|
|
133
133
|
function getBuildStepsBlock(packageManager, nodeVersion) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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 cacheDependencyPath = packageManager === "pnpm" ? "pnpm-lock.yaml" : packageManager === "yarn" ? "yarn.lock" : "package-lock.json";
|
|
135
|
+
const installCommand = packageManager === "pnpm" ? "pnpm install --frozen-lockfile" : packageManager === "yarn" ? "yarn install --frozen-lockfile" : "npm ci";
|
|
136
|
+
const buildCommand = packageManager === "pnpm" ? "pnpm run build" : packageManager === "yarn" ? "yarn build" : "npm run build";
|
|
137
|
+
const lines = [
|
|
172
138
|
" - name: Setup Node",
|
|
173
139
|
" uses: actions/setup-node@v4",
|
|
174
140
|
" with:",
|
|
175
141
|
` node-version: ${nodeVersion}`,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
""
|
|
142
|
+
` cache: ${packageManager}`,
|
|
143
|
+
` cache-dependency-path: ${cacheDependencyPath}`,
|
|
144
|
+
""
|
|
145
|
+
];
|
|
146
|
+
if (packageManager !== "npm") {
|
|
147
|
+
lines.push(
|
|
148
|
+
" - name: Enable Corepack",
|
|
149
|
+
" run: corepack enable",
|
|
150
|
+
""
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
lines.push(
|
|
179
154
|
" - name: Install deps",
|
|
180
|
-
|
|
155
|
+
` run: ${installCommand}`,
|
|
181
156
|
"",
|
|
182
157
|
" - name: Build Nuxt app",
|
|
183
|
-
|
|
184
|
-
|
|
158
|
+
` run: ${buildCommand}`
|
|
159
|
+
);
|
|
160
|
+
return lines.join("\n");
|
|
185
161
|
}
|
|
186
162
|
function getDeployCommand(packageManager) {
|
|
187
163
|
if (packageManager === "pnpm") {
|
package/package.json
CHANGED