Skip to content

Commit 4dfdf60

Browse files
dependabot[bot]Wrangler automated PR updateredmundhung
authored
[C3] Bump create-vike from 0.0.677 to 0.0.681 in /packages/create-cloudflare/src/frameworks (#15422)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Wrangler automated PR updater <wrangler@cloudflare.com> Co-authored-by: Edmund Hung <edmund@cloudflare.com>
1 parent ea28cc3 commit 4dfdf60

4 files changed

Lines changed: 50 additions & 1 deletion

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"create-cloudflare": patch
3+
---
4+
5+
Update dependencies of "create-cloudflare"
6+
7+
The following dependency versions have been updated:
8+
9+
| Dependency | From | To |
10+
| ----------- | ------- | ------- |
11+
| create-vike | 0.0.677 | 0.0.681 |
12+
13+
Preserve framework-generated `dangerouslyAllowAllBuilds` settings instead of adding a conflicting pnpm `allowBuilds` configuration.

‎packages/create-cloudflare/src/frameworks/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"create-react-router": "8.3.1",
1313
"create-rwsdk": "3.1.3",
1414
"create-solid": "0.11.0",
15-
"create-vike": "0.0.677",
15+
"create-vike": "0.0.681",
1616
"create-vinext-app": "1.0.0-beta.2",
1717
"create-vite": "9.2.0",
1818
"create-vue": "3.23.0",

‎packages/create-cloudflare/src/helpers/__tests__/pnpmBuildApprovals.test.ts‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,22 @@ describe("writePnpmBuildApprovals", () => {
167167
expect(written).toMatch(/^ {2}esbuild: true$/m);
168168
expect(written).toMatch(/^ {2}workerd: true$/m);
169169
});
170+
171+
test("preserves a framework's opt-in to all dependency builds", ({
172+
expect,
173+
}) => {
174+
mockPackageManager("pnpm", "10.33.0");
175+
vi.mocked(existsSync).mockImplementation(
176+
(path) => path.toString() === yamlPath
177+
);
178+
vi.mocked(readFile).mockReturnValue(
179+
["packages:", " - .", "dangerouslyAllowAllBuilds: true", ""].join("\n")
180+
);
181+
182+
writePnpmBuildApprovals(projectPath);
183+
184+
expect(vi.mocked(writeFile)).not.toHaveBeenCalled();
185+
});
170186
});
171187

172188
describe("mergeAllowBuilds", () => {
@@ -208,6 +224,19 @@ describe("mergeAllowBuilds", () => {
208224

209225
expect(mergeAllowBuilds(input)).toBe(input);
210226
});
227+
228+
test("does not combine allowBuilds with dangerouslyAllowAllBuilds", ({
229+
expect,
230+
}) => {
231+
const input = [
232+
"packages:",
233+
" - .",
234+
"dangerouslyAllowAllBuilds: true",
235+
"",
236+
].join("\n");
237+
238+
expect(mergeAllowBuilds(input)).toBe(input);
239+
});
211240
});
212241

213242
describe("isPnpmIgnoredBuildsError", () => {

‎packages/create-cloudflare/src/helpers/pnpmBuildApprovals.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ const ALLOW_BUILDS_ENTRY = /^( {2})(['"]?)([^'":]+)\2:\s*(.*)$/;
5858

5959
/** Exported for unit testing. */
6060
export const mergeAllowBuilds = (original: string): string => {
61+
// A framework generator may explicitly opt into running all dependency
62+
// build scripts. Adding `allowBuilds` would be redundant and pnpm rejects
63+
// the combination as conflicting build policies.
64+
if (/^dangerouslyAllowAllBuilds:[ \t]*true[ \t]*$/m.test(original)) {
65+
return original;
66+
}
67+
6168
const eol = detectEol(original);
6269
const lines = original.split(/\r?\n/);
6370

0 commit comments

Comments
 (0)