Skip to content

Commit 1bf3576

Browse files
Update deps (#172)
* Update dependencies * formatting --------- Co-authored-by: Naresh <[email protected]>
1 parent 50bc24c commit 1bf3576

File tree

197 files changed

+12028
-9570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

197 files changed

+12028
-9570
lines changed

.changeset/chilly-pugs-cross.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cloudflare/sandbox': patch
3+
---
4+
5+
Update dependencies

.changeset/giant-paths-enjoy.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@cloudflare/sandbox': patch
3+
---
4+
5+
Fix type generation
6+
7+
We inline types from `@repo/shared` so that it includes the types we reexport. Fixes #165

.github/changeset-publish.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { execSync } from "node:child_process";
1+
import { execSync } from 'node:child_process';
22

3-
execSync("npx tsx ./.github/resolve-workspace-versions.ts", {
4-
stdio: "inherit",
3+
execSync('npx tsx ./.github/resolve-workspace-versions.ts', {
4+
stdio: 'inherit'
55
});
6-
execSync("npx changeset publish", {
7-
stdio: "inherit",
6+
execSync('npx changeset publish', {
7+
stdio: 'inherit'
88
});

.github/changeset-version.ts

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,106 @@
1-
import { execSync } from "node:child_process";
2-
import * as fs from "node:fs";
3-
import fg from "fast-glob";
1+
import { execSync } from 'node:child_process';
2+
import * as fs from 'node:fs';
3+
import fg from 'fast-glob';
44

55
// This script is used by the `release.yml` workflow to update the version of the packages being released.
66
// The standard step is only to run `changeset version` but this does not update the package-lock.json file.
77
// So we also run `npm install`, which does this update.
88
// This is a workaround until this is handled automatically by `changeset version`.
99
// See https://github.com/changesets/changesets/issues/421.
10-
execSync("npx changeset version", {
11-
stdio: "inherit",
10+
execSync('npx changeset version', {
11+
stdio: 'inherit'
1212
});
13-
execSync("npm install", {
14-
stdio: "inherit",
13+
execSync('npm install', {
14+
stdio: 'inherit'
1515
});
1616

1717
// Update all version references across the codebase after changeset updates package.json
1818
try {
19-
const packageJson = JSON.parse(fs.readFileSync("./packages/sandbox/package.json", "utf-8"));
19+
const packageJson = JSON.parse(
20+
fs.readFileSync('./packages/sandbox/package.json', 'utf-8')
21+
);
2022
const newVersion = packageJson.version;
2123

22-
console.log(`\n🔍 Searching for version references to update to ${newVersion}...\n`);
24+
console.log(
25+
`\n🔍 Searching for version references to update to ${newVersion}...\n`
26+
);
2327

2428
// Patterns to match version references in different contexts
2529
const versionPatterns = [
2630
// SDK version constant
2731
{
2832
pattern: /export const SDK_VERSION = '[\d.]+';/g,
2933
replacement: `export const SDK_VERSION = '${newVersion}';`,
30-
description: "SDK version constant in version.ts",
34+
description: 'SDK version constant in version.ts'
3135
},
3236
// Docker image versions (production and test)
3337
{
3438
pattern: /FROM docker\.io\/cloudflare\/sandbox:[\d.]+/g,
3539
replacement: `FROM docker.io/cloudflare/sandbox:${newVersion}`,
36-
description: "Production Docker image",
40+
description: 'Production Docker image'
3741
},
3842
{
3943
pattern: /# FROM docker\.io\/cloudflare\/sandbox:[\d.]+/g,
4044
replacement: `# FROM docker.io/cloudflare/sandbox:${newVersion}`,
41-
description: "Commented production Docker image",
45+
description: 'Commented production Docker image'
4246
},
4347
{
4448
pattern: /FROM cloudflare\/sandbox-test:[\d.]+/g,
4549
replacement: `FROM cloudflare/sandbox-test:${newVersion}`,
46-
description: "Test Docker image",
50+
description: 'Test Docker image'
4751
},
4852
{
4953
pattern: /docker\.io\/cloudflare\/sandbox-test:[\d.]+/g,
5054
replacement: `docker.io/cloudflare/sandbox-test:${newVersion}`,
51-
description: "Test Docker image (docker.io)",
55+
description: 'Test Docker image (docker.io)'
5256
},
5357
// Image tags in docker commands
5458
{
5559
pattern: /cloudflare\/sandbox:[\d.]+/g,
5660
replacement: `cloudflare/sandbox:${newVersion}`,
57-
description: "Docker image reference",
61+
description: 'Docker image reference'
5862
},
5963
{
6064
pattern: /cloudflare\/sandbox-test:[\d.]+/g,
6165
replacement: `cloudflare/sandbox-test:${newVersion}`,
62-
description: "Test Docker image reference",
66+
description: 'Test Docker image reference'
6367
},
6468
// Example package.json dependencies
6569
{
6670
pattern: /"@cloudflare\/sandbox":\s*"\^[\d.]+"/g,
6771
replacement: `"@cloudflare/sandbox": "^${newVersion}"`,
68-
description: "Example package.json @cloudflare/sandbox dependencies",
69-
},
72+
description: 'Example package.json @cloudflare/sandbox dependencies'
73+
}
7074
];
7175

7276
// Files to search and update
7377
const filePatterns = [
74-
"**/*.md", // All markdown files
75-
"**/Dockerfile", // All Dockerfiles
76-
"**/Dockerfile.*", // Dockerfile variants
77-
"**/*.ts", // TypeScript files (for documentation comments)
78-
"**/*.js", // JavaScript files
79-
"**/*.json", // JSON configs (but not package.json/package-lock.json)
80-
"**/*.yaml", // YAML configs
81-
"**/*.yml", // YML configs
82-
"examples/**/package.json", // Example package.json files (exception to ignore rule below)
78+
'**/*.md', // All markdown files
79+
'**/Dockerfile', // All Dockerfiles
80+
'**/Dockerfile.*', // Dockerfile variants
81+
'**/*.ts', // TypeScript files (for documentation comments)
82+
'**/*.js', // JavaScript files
83+
'**/*.json', // JSON configs (but not package.json/package-lock.json)
84+
'**/*.yaml', // YAML configs
85+
'**/*.yml', // YML configs
86+
'examples/**/package.json' // Example package.json files (exception to ignore rule below)
8387
];
8488

8589
// Ignore patterns
8690
const ignorePatterns = [
87-
"**/node_modules/**",
88-
"**/dist/**",
89-
"**/build/**",
90-
"**/.git/**",
91-
"**/package.json", // Don't modify package.json (changeset does this)
92-
"**/package-lock.json", // Don't modify package-lock.json (npm install does this)
93-
"**/.github/changeset-version.ts", // Don't modify this script itself
91+
'**/node_modules/**',
92+
'**/dist/**',
93+
'**/build/**',
94+
'**/.git/**',
95+
'**/package.json', // Don't modify package.json (changeset does this)
96+
'**/package-lock.json', // Don't modify package-lock.json (npm install does this)
97+
'**/.github/changeset-version.ts' // Don't modify this script itself
9498
];
9599

96100
// Find all matching files
97101
const files = await fg(filePatterns, {
98102
ignore: ignorePatterns,
99-
onlyFiles: true,
103+
onlyFiles: true
100104
});
101105

102106
console.log(`📁 Found ${files.length} files to check\n`);
@@ -105,7 +109,7 @@ try {
105109
let totalReplacementsCount = 0;
106110

107111
for (const file of files) {
108-
let content = fs.readFileSync(file, "utf-8");
112+
let content = fs.readFileSync(file, 'utf-8');
109113
let fileModified = false;
110114
let fileReplacementsCount = 0;
111115

@@ -123,14 +127,21 @@ try {
123127
fs.writeFileSync(file, content);
124128
updatedFilesCount++;
125129
totalReplacementsCount += fileReplacementsCount;
126-
console.log(` ✅ ${file} (${fileReplacementsCount} replacement${fileReplacementsCount > 1 ? 's' : ''})`);
130+
console.log(
131+
` ✅ ${file} (${fileReplacementsCount} replacement${
132+
fileReplacementsCount > 1 ? 's' : ''
133+
})`
134+
);
127135
}
128136
}
129137

130-
console.log(`\n✨ Updated ${totalReplacementsCount} version reference${totalReplacementsCount !== 1 ? 's' : ''} across ${updatedFilesCount} file${updatedFilesCount !== 1 ? 's' : ''}`);
138+
console.log(
139+
`\n✨ Updated ${totalReplacementsCount} version reference${
140+
totalReplacementsCount !== 1 ? 's' : ''
141+
} across ${updatedFilesCount} file${updatedFilesCount !== 1 ? 's' : ''}`
142+
);
131143
console.log(` New version: ${newVersion}\n`);
132-
133144
} catch (error) {
134-
console.error("❌ Failed to update file versions:", error);
145+
console.error('❌ Failed to update file versions:', error);
135146
// Don't fail the whole release for this
136147
}

.github/resolve-workspace-versions.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// this looks for all package.jsons in /packages/**/package.json
22
// and replaces it with the actual version ids
33

4-
import * as fs from "node:fs";
5-
import fg from "fast-glob";
4+
import * as fs from 'node:fs';
5+
import fg from 'fast-glob';
66

77
// we do this in 2 passes
88
// first let's cycle through all packages and get thier version numbers
@@ -11,12 +11,12 @@ import fg from "fast-glob";
1111
const packageJsons: Record<string, any> = {};
1212

1313
for await (const file of await fg.glob(
14-
"./(packages|examples|guides)/*/package.json"
14+
'./(packages|examples|guides)/*/package.json'
1515
)) {
16-
const packageJson = JSON.parse(fs.readFileSync(file, "utf8"));
16+
const packageJson = JSON.parse(fs.readFileSync(file, 'utf8'));
1717
packageJsons[packageJson.name] = {
1818
file,
19-
packageJson,
19+
packageJson
2020
};
2121
}
2222

@@ -28,17 +28,17 @@ for (const [packageName, { file, packageJson }] of Object.entries(
2828
)) {
2929
let changed = false;
3030
for (const field of [
31-
"dependencies",
32-
"devDependencies",
33-
"peerDependencies",
34-
"optionalDependencies",
31+
'dependencies',
32+
'devDependencies',
33+
'peerDependencies',
34+
'optionalDependencies'
3535
]) {
3636
for (const [dependencyName, dependencyVersion] of Object.entries(
3737
packageJson[field] || {}
3838
)) {
3939
if (dependencyName in packageJsons) {
4040
let actualVersion = packageJsons[dependencyName].packageJson.version;
41-
if (!actualVersion.startsWith("0.0.0-")) {
41+
if (!actualVersion.startsWith('0.0.0-')) {
4242
actualVersion = `^${actualVersion}`;
4343
}
4444

.github/version-script.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import * as fs from "node:fs";
2-
import { execSync } from "node:child_process";
1+
import * as fs from 'node:fs';
2+
import { execSync } from 'node:child_process';
33
async function main() {
44
try {
5-
console.log("Getting current git hash...");
6-
const stdout = execSync("git rev-parse --short HEAD").toString();
7-
console.log("Git hash:", stdout.trim());
5+
console.log('Getting current git hash...');
6+
const stdout = execSync('git rev-parse --short HEAD').toString();
7+
console.log('Git hash:', stdout.trim());
88

9-
for (const path of ["./packages/sandbox/package.json"]) {
10-
const packageJson = JSON.parse(fs.readFileSync(path, "utf-8"));
9+
for (const path of ['./packages/sandbox/package.json']) {
10+
const packageJson = JSON.parse(fs.readFileSync(path, 'utf-8'));
1111
packageJson.version = `0.0.0-${stdout.trim()}`;
1212
fs.writeFileSync(path, `${JSON.stringify(packageJson, null, 2)}\n`);
1313
}

.github/workflows/claude-code-review.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,3 @@ jobs:
6464
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
6565
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
6666
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh api:*)"'
67-

.github/workflows/claude.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ jobs:
5555
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
5656
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
5757
# claude_args: '--allowed-tools Bash(gh pr:*)'
58-

.github/workflows/cleanup-stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/setup-node@v4
2222
with:
2323
node-version: 24
24-
cache: "npm"
24+
cache: 'npm'
2525

2626
- name: Install dependencies
2727
run: npm ci

.github/workflows/cleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/setup-node@v4
1919
with:
2020
node-version: 24
21-
cache: "npm"
21+
cache: 'npm'
2222

2323
- name: Install dependencies
2424
run: npm ci

0 commit comments

Comments
 (0)