| @@ -1,21 +1,13 @@ |
| 1 | 1 | // @effect-diagnostics nodeBuiltinImport:off |
| 2 | | −import { execFileSync } from "node:child_process"; |
| 3 | | −import { |
| 4 | | − cpSync, |
| 5 | | − existsSync, |
| 6 | | − mkdirSync, |
| 7 | | − mkdtempSync, |
| 8 | | − readFileSync, |
| 9 | | − rmSync, |
| 10 | | − writeFileSync, |
| 11 | | −} from "node:fs"; |
| 12 | | −import { tmpdir } from "node:os"; |
| 13 | | −import { dirname, join, resolve } from "node:path"; |
| 14 | | −import { fileURLToPath } from "node:url"; |
| 2 | +import * as NodeChildProcess from "node:child_process"; |
| 3 | +import * as NodeFS from "node:fs"; |
| 4 | +import * as NodeOS from "node:os"; |
| 5 | +import * as NodePath from "node:path"; |
| 6 | +import * as NodeURL from "node:url"; |
| 15 | 7 | import * as Console from "effect/Console"; |
| 16 | 8 | import * as Effect from "effect/Effect"; |
| 17 | 9 | |
| 18 | | −const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), ".."); |
| 10 | +const repoRoot = NodePath.resolve(NodePath.dirname(NodeURL.fileURLToPath(import.meta.url)), ".."); |
| 19 | 11 | |
| 20 | 12 | const workspaceFiles = [ |
| 21 | 13 | "package.json", |
| @@ -44,26 +36,26 @@ const workspaceFiles = [ · 22 unmodified lines |
| 44 | 36 | |
| 45 | 37 | function copyWorkspaceManifestFixture(targetRoot: string): void { |
| 46 | 38 | for (const relativePath of workspaceFiles) { |
| 47 | | − const sourcePath = resolve(repoRoot, relativePath); |
| 48 | | − const destinationPath = resolve(targetRoot, relativePath); |
| 49 | | − mkdirSync(dirname(destinationPath), { recursive: true }); |
| 50 | | − cpSync(sourcePath, destinationPath); |
| 39 | + const sourcePath = NodePath.resolve(repoRoot, relativePath); |
| 40 | + const destinationPath = NodePath.resolve(targetRoot, relativePath); |
| 41 | + NodeFS.mkdirSync(NodePath.dirname(destinationPath), { recursive: true }); |
| 42 | + NodeFS.cpSync(sourcePath, destinationPath); |
| 51 | 43 | } |
| 52 | 44 | |
| 53 | | − const patchesDirectory = resolve(repoRoot, "patches"); |
| 54 | | − if (existsSync(patchesDirectory)) { |
| 55 | | − cpSync(patchesDirectory, resolve(targetRoot, "patches"), { recursive: true }); |
| 45 | + const patchesDirectory = NodePath.resolve(repoRoot, "patches"); |
| 46 | + if (NodeFS.existsSync(patchesDirectory)) { |
| 47 | + NodeFS.cpSync(patchesDirectory, NodePath.resolve(targetRoot, "patches"), { recursive: true }); |
| 56 | 48 | } |
| 57 | 49 | } |
| 58 | 50 | |
| 59 | 51 | function writeMacManifestFixtures(targetRoot: string): { arm64Path: string; x64Path: string } { |
| 60 | | − const assetDirectory = resolve(targetRoot, "release-assets"); |
| 61 | | − mkdirSync(assetDirectory, { recursive: true }); |
| 52 | + const assetDirectory = NodePath.resolve(targetRoot, "release-assets"); |
| 53 | + NodeFS.mkdirSync(assetDirectory, { recursive: true }); |
| 62 | 54 | |
| 63 | | − const arm64Path = resolve(assetDirectory, "latest-mac.yml"); |
| 64 | | − const x64Path = resolve(assetDirectory, "latest-mac-x64.yml"); |
| 55 | + const arm64Path = NodePath.resolve(assetDirectory, "latest-mac.yml"); |
| 56 | + const x64Path = NodePath.resolve(assetDirectory, "latest-mac-x64.yml"); |
| 65 | 57 | |
| 66 | | − writeFileSync( |
| 58 | + NodeFS.writeFileSync( |
| 67 | 59 | arm64Path, |
| 68 | 60 | `version: 9.9.9-smoke.0 |
| 69 | 61 | files: |
| @@ -79,7 +71,7 @@ releaseDate: '2026-03-08T10:32:14.587Z' · 9 unmodified lines |
| 79 | 71 | `, |
| 80 | 72 | ); |
| 81 | 73 | |
| 82 | | − writeFileSync( |
| 74 | + NodeFS.writeFileSync( |
| 83 | 75 | x64Path, |
| 84 | 76 | `version: 9.9.9-smoke.0 |
| 85 | 77 | files: |
| @@ -102,13 +94,13 @@ function writeWindowsManifestFixtures( · 16 unmodified lines |
| 102 | 94 | targetRoot: string, |
| 103 | 95 | channel: string, |
| 104 | 96 | ): { arm64Path: string; x64Path: string } { |
| 105 | | − const assetDirectory = resolve(targetRoot, "release-assets"); |
| 106 | | − mkdirSync(assetDirectory, { recursive: true }); |
| 97 | + const assetDirectory = NodePath.resolve(targetRoot, "release-assets"); |
| 98 | + NodeFS.mkdirSync(assetDirectory, { recursive: true }); |
| 107 | 99 | |
| 108 | | − const arm64Path = resolve(assetDirectory, `${channel}-win-arm64.yml`); |
| 109 | | − const x64Path = resolve(assetDirectory, `${channel}-win-x64.yml`); |
| 100 | + const arm64Path = NodePath.resolve(assetDirectory, `${channel}-win-arm64.yml`); |
| 101 | + const x64Path = NodePath.resolve(assetDirectory, `${channel}-win-x64.yml`); |
| 110 | 102 | |
| 111 | | − writeFileSync( |
| 103 | + NodeFS.writeFileSync( |
| 112 | 104 | arm64Path, |
| 113 | 105 | `version: 9.9.9-smoke.0 |
| 114 | 106 | files: |
| @@ -124,7 +116,7 @@ releaseDate: '2026-03-08T10:32:14.587Z' · 9 unmodified lines |
| 124 | 116 | `, |
| 125 | 117 | ); |
| 126 | 118 | |
| 127 | | − writeFileSync( |
| 119 | + NodeFS.writeFileSync( |
| 128 | 120 | x64Path, |
| 129 | 121 | `version: 9.9.9-smoke.0 |
| 130 | 122 | files: |
| @@ -147,11 +139,11 @@ function writeWindowsBuilderDebugFixtures(targetRoot: string): { · 16 unmodified lines |
| 147 | 139 | arm64Path: string; |
| 148 | 140 | x64Path: string; |
| 149 | 141 | } { |
| 150 | | − const assetDirectory = resolve(targetRoot, "release-assets"); |
| 151 | | − mkdirSync(assetDirectory, { recursive: true }); |
| 142 | + const assetDirectory = NodePath.resolve(targetRoot, "release-assets"); |
| 143 | + NodeFS.mkdirSync(assetDirectory, { recursive: true }); |
| 152 | 144 | |
| 153 | | − const arm64Path = resolve(assetDirectory, "builder-debug-win-arm64.yml"); |
| 154 | | − const x64Path = resolve(assetDirectory, "builder-debug-win-x64.yml"); |
| 145 | + const arm64Path = NodePath.resolve(assetDirectory, "builder-debug-win-arm64.yml"); |
| 146 | + const x64Path = NodePath.resolve(assetDirectory, "builder-debug-win-x64.yml"); |
| 155 | 147 | const debugFixture = `arm64: |
| 156 | 148 | firstOrDefaultFilePatterns: |
| 157 | 149 | - '**/*' |
| @@ -160,8 +152,8 @@ nsis: · 2 unmodified lines |
| 160 | 152 | !include "example.nsh" |
| 161 | 153 | `; |
| 162 | 154 | |
| 163 | | − writeFileSync(arm64Path, debugFixture); |
| 164 | | − writeFileSync(x64Path, debugFixture); |
| 155 | + NodeFS.writeFileSync(arm64Path, debugFixture); |
| 156 | + NodeFS.writeFileSync(x64Path, debugFixture); |
| 165 | 157 | |
| 166 | 158 | return { arm64Path, x64Path }; |
| 167 | 159 | } |
| @@ -172,13 +164,13 @@ function assertContains(haystack: string, needle: string, message: string): void · 4 unmodified lines |
| 172 | 164 | } |
| 173 | 165 | |
| 174 | 166 | function assertExists(path: string, message: string): void { |
| 175 | | − if (!existsSync(path)) { |
| 167 | + if (!NodeFS.existsSync(path)) { |
| 176 | 168 | throw new Error(message); |
| 177 | 169 | } |
| 178 | 170 | } |
| 179 | 171 | |
| 180 | 172 | function assertPackageVersion(path: string, version: string): void { |
| 181 | | − const packageJson = JSON.parse(readFileSync(path, "utf8")) as { |
| 173 | + const packageJson = JSON.parse(NodeFS.readFileSync(path, "utf8")) as { |
| 182 | 174 | readonly version?: unknown; |
| 183 | 175 | }; |
| 184 | 176 | |
| @@ -188,20 +180,20 @@ function assertPackageVersion(path: string, version: string): void { · 3 unmodified lines |
| 188 | 180 | } |
| 189 | 181 | |
| 190 | 182 | function assertMissing(path: string, message: string): void { |
| 191 | | − if (existsSync(path)) { |
| 183 | + if (NodeFS.existsSync(path)) { |
| 192 | 184 | throw new Error(message); |
| 193 | 185 | } |
| 194 | 186 | } |
| 195 | 187 | |
| 196 | | −const tempRoot = mkdtempSync(join(tmpdir(), "t3-release-smoke-")); |
| 188 | +const tempRoot = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-release-smoke-")); |
| 197 | 189 | |
| 198 | 190 | try { |
| 199 | 191 | copyWorkspaceManifestFixture(tempRoot); |
| 200 | 192 | |
| 201 | | − execFileSync( |
| 193 | + NodeChildProcess.execFileSync( |
| 202 | 194 | process.execPath, |
| 203 | 195 | [ |
| 204 | | − resolve(repoRoot, "scripts/update-release-package-versions.ts"), |
| 196 | + NodePath.resolve(repoRoot, "scripts/update-release-package-versions.ts"), |
| 205 | 197 | "9.9.9-smoke.0", |
| 206 | 198 | "--root", |
| 207 | 199 | tempRoot, |
| @@ -212,14 +204,14 @@ try { · 4 unmodified lines |
| 212 | 204 | }, |
| 213 | 205 | ); |
| 214 | 206 | |
| 215 | | − rmSync(resolve(tempRoot, "pnpm-lock.yaml"), { force: true }); |
| 207 | + NodeFS.rmSync(NodePath.resolve(tempRoot, "pnpm-lock.yaml"), { force: true }); |
| 216 | 208 | |
| 217 | | − execFileSync("vp", ["install", "--lockfile-only", "--ignore-scripts"], { |
| 209 | + NodeChildProcess.execFileSync("vp", ["install", "--lockfile-only", "--ignore-scripts"], { |
| 218 | 210 | cwd: tempRoot, |
| 219 | 211 | stdio: "inherit", |
| 220 | 212 | }); |
| 221 | 213 | |
| 222 | | − const lockfile = readFileSync(resolve(tempRoot, "pnpm-lock.yaml"), "utf8"); |
| 214 | + const lockfile = NodeFS.readFileSync(NodePath.resolve(tempRoot, "pnpm-lock.yaml"), "utf8"); |
| 223 | 215 | assertContains(lockfile, "lockfileVersion:", "Expected pnpm-lock.yaml to be regenerated."); |
| 224 | 216 | |
| 225 | 217 | for (const relativePath of [ |
| @@ -228,13 +220,13 @@ try { · 2 unmodified lines |
| 228 | 220 | "apps/web/package.json", |
| 229 | 221 | "packages/contracts/package.json", |
| 230 | 222 | ]) { |
| 231 | | − assertPackageVersion(resolve(tempRoot, relativePath), "9.9.9-smoke.0"); |
| 223 | + assertPackageVersion(NodePath.resolve(tempRoot, relativePath), "9.9.9-smoke.0"); |
| 232 | 224 | } |
| 233 | 225 | |
| 234 | | − const nightlyReleaseMetadata = execFileSync( |
| 226 | + const nightlyReleaseMetadata = NodeChildProcess.execFileSync( |
| 235 | 227 | process.execPath, |
| 236 | 228 | [ |
| 237 | | − resolve(repoRoot, "scripts/resolve-nightly-release.ts"), |
| 229 | + NodePath.resolve(repoRoot, "scripts/resolve-nightly-release.ts"), |
| 238 | 230 | "--date", |
| 239 | 231 | "20260413", |
| 240 | 232 | "--run-number", |
| @@ -266,10 +258,10 @@ try { · 25 unmodified lines |
| 266 | 258 | ); |
| 267 | 259 | |
| 268 | 260 | const { arm64Path, x64Path } = writeMacManifestFixtures(tempRoot); |
| 269 | | − execFileSync( |
| 261 | + NodeChildProcess.execFileSync( |
| 270 | 262 | process.execPath, |
| 271 | 263 | [ |
| 272 | | − resolve(repoRoot, "scripts/merge-update-manifests.ts"), |
| 264 | + NodePath.resolve(repoRoot, "scripts/merge-update-manifests.ts"), |
| 273 | 265 | "--platform", |
| 274 | 266 | "mac", |
| 275 | 267 | arm64Path, |
| @@ -281,7 +273,7 @@ try { · 5 unmodified lines |
| 281 | 273 | }, |
| 282 | 274 | ); |
| 283 | 275 | |
| 284 | | − const mergedManifest = readFileSync(arm64Path, "utf8"); |
| 276 | + const mergedManifest = NodeFS.readFileSync(arm64Path, "utf8"); |
| 285 | 277 | assertContains( |
| 286 | 278 | mergedManifest, |
| 287 | 279 | "T3-Code-9.9.9-smoke.0-arm64.zip", |
| @@ -297,21 +289,21 @@ try { · 9 unmodified lines |
| 297 | 289 | tempRoot, |
| 298 | 290 | "latest", |
| 299 | 291 | ); |
| 300 | | − const mergedWindowsManifestPath = resolve(tempRoot, "release-assets/latest.yml"); |
| 292 | + const mergedWindowsManifestPath = NodePath.resolve(tempRoot, "release-assets/latest.yml"); |
| 301 | 293 | const { arm64Path: nightlyWinArm64Path, x64Path: nightlyWinX64Path } = |
| 302 | 294 | writeWindowsManifestFixtures(tempRoot, "nightly"); |
| 303 | | − const mergedNightlyWindowsManifestPath = resolve(tempRoot, "release-assets/nightly.yml"); |
| 295 | + const mergedNightlyWindowsManifestPath = NodePath.resolve(tempRoot, "release-assets/nightly.yml"); |
| 304 | 296 | const { arm64Path: previewWinArm64Path, x64Path: previewWinX64Path } = |
| 305 | 297 | writeWindowsManifestFixtures(tempRoot, "preview"); |
| 306 | | − const mergedPreviewWindowsManifestPath = resolve(tempRoot, "release-assets/preview.yml"); |
| 298 | + const mergedPreviewWindowsManifestPath = NodePath.resolve(tempRoot, "release-assets/preview.yml"); |
| 307 | 299 | const { arm64Path: winDebugArm64Path, x64Path: winDebugX64Path } = |
| 308 | 300 | writeWindowsBuilderDebugFixtures(tempRoot); |
| 309 | | − execFileSync( |
| 301 | + NodeChildProcess.execFileSync( |
| 310 | 302 | "bash", |
| 311 | 303 | [ |
| 312 | 304 | "-lc", |
| 313 | 305 | ` |
| 314 | | − release_assets_dir=${JSON.stringify(resolve(tempRoot, "release-assets"))} |
| 306 | + release_assets_dir=${JSON.stringify(NodePath.resolve(tempRoot, "release-assets"))} |
| 315 | 307 | shopt -s nullglob |
| 316 | 308 | found_windows_manifest=false |
| 317 | 309 | for x64_manifest in "$release_assets_dir"/*-win-x64.yml; do |
| @@ -327,7 +319,7 @@ try { · 9 unmodified lines |
| 327 | 319 | fi |
| 328 | 320 | |
| 329 | 321 | found_windows_manifest=true |
| 330 | | − ${JSON.stringify(process.execPath)} ${JSON.stringify(resolve(repoRoot, "scripts/merge-update-manifests.ts"))} --platform win \ |
| 322 | + ${JSON.stringify(process.execPath)} ${JSON.stringify(NodePath.resolve(repoRoot, "scripts/merge-update-manifests.ts"))} --platform win \ |
| 331 | 323 | "$arm64_manifest" \ |
| 332 | 324 | "$x64_manifest" \ |
| 333 | 325 | "$output_manifest" |
| @@ -346,7 +338,7 @@ try { · 12 unmodified lines |
| 346 | 338 | }, |
| 347 | 339 | ); |
| 348 | 340 | |
| 349 | | − const mergedWindowsManifest = readFileSync(mergedWindowsManifestPath, "utf8"); |
| 341 | + const mergedWindowsManifest = NodeFS.readFileSync(mergedWindowsManifestPath, "utf8"); |
| 350 | 342 | assertContains( |
| 351 | 343 | mergedWindowsManifest, |
| 352 | 344 | "T3-Code-9.9.9-smoke.0-arm64.exe", |
| @@ -357,7 +349,10 @@ try { · 4 unmodified lines |
| 357 | 349 | "T3-Code-9.9.9-smoke.0-x64.exe", |
| 358 | 350 | "Merged Windows manifest is missing the x64 asset.", |
| 359 | 351 | ); |
| 360 | | − const mergedNightlyWindowsManifest = readFileSync(mergedNightlyWindowsManifestPath, "utf8"); |
| 352 | + const mergedNightlyWindowsManifest = NodeFS.readFileSync( |
| 353 | + mergedNightlyWindowsManifestPath, |
| 354 | + "utf8", |
| 355 | + ); |
| 361 | 356 | assertContains( |
| 362 | 357 | mergedNightlyWindowsManifest, |
| 363 | 358 | "T3-Code-9.9.9-smoke.0-arm64.exe", |
| @@ -368,7 +363,10 @@ try { · 4 unmodified lines |
| 368 | 363 | "T3-Code-9.9.9-smoke.0-x64.exe", |
| 369 | 364 | "Merged nightly Windows manifest is missing the x64 asset.", |
| 370 | 365 | ); |
| 371 | | − const mergedPreviewWindowsManifest = readFileSync(mergedPreviewWindowsManifestPath, "utf8"); |
| 366 | + const mergedPreviewWindowsManifest = NodeFS.readFileSync( |
| 367 | + mergedPreviewWindowsManifestPath, |
| 368 | + "utf8", |
| 369 | + ); |
| 372 | 370 | assertContains( |
| 373 | 371 | mergedPreviewWindowsManifest, |
| 374 | 372 | "T3-Code-9.9.9-smoke.0-arm64.exe", |
| @@ -411,5 +409,5 @@ try { · 36 unmodified lines |
| 411 | 409 | |
| 412 | 410 | Effect.runSync(Console.log("Release smoke checks passed.")); |
| 413 | 411 | } finally { |
| 414 | | − rmSync(tempRoot, { recursive: true, force: true }); |
| 412 | + NodeFS.rmSync(tempRoot, { recursive: true, force: true }); |
| 415 | 413 | } |