Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(release): preserve updates from npm-based services #11732

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/11732/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 7 changed files with 136 additions and 1 deletion (loading 4).

x
0 of 7 viewed, 7 left
48 additions and 0 deletionsapps/server/src/cloud/pinnedRuntime.test.tsModified
View file
@@ -1,3 +1,4 @@
+import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
import * as NodeServices from "@effect/platform-node/NodeServices";
import { assert, it } from "@effect/vitest";
import * as Deferred from "effect/Deferred";
@@ -94,6 +95,19 @@
assert.deepEqual(commands, ["tar"]);
assert.equal(yield* fs.readFileString(paths.sentinelPath), `${version}\n`);
assert.isFalse(yield* fs.exists(path.join(paths.versionDir, "t3-runtime-archive")));
+ if ((yield* HostProcessPlatform) !== "win32") {
+ // The old launcher must still be able to start this archive after the
+ // first npm-to-executable update, including from the final directory.
+ yield* fs.writeFileString(paths.entryPath, '#!/bin/sh\nprintf "%s\\n" "$@"\n');
+ yield* fs.chmod(paths.entryPath, 0o755);
+ const runner = yield* ProcessRunner.make();
+ const legacyStart = yield* runner.run({
+ command: process.execPath,
+ args: [path.join(paths.versionDir, "node_modules/t3/dist/bin.mjs"), "serve"],
+ });
+ assert.equal(Number(legacyStart.code), 0, legacyStart.stderr);
+ assert.equal(legacyStart.stdout.trim(), "serve");
+ }
}),
​
@@ -209,6 +223,40 @@
}),
​