@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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0 <5.0.0"
6
6
  },
7
- "version": "1.0.2",
7
+ "version": "1.0.3",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
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
- if (packageManager === "pnpm") {
135
- return [
136
- " - name: Install pnpm",
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 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
- " cache: npm",
177
- " cache-dependency-path: package-lock.json",
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
- " run: npm ci",
155
+ ` run: ${installCommand}`,
181
156
  "",
182
157
  " - name: Build Nuxt app",
183
- " run: npm run build"
184
- ].join("\n");
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtlib/cf-deployment",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A Nuxt module for Cloudflare Workers deployment with GitHub Actions integration.",
5
5
  "repository": "https://github.com/nuxtlibv2/cf-deployment",
6
6
  "license": "MIT",