Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cli): explain how npm users update the t3 command #25439

Closedonly21mil(GitHub profile, opens in a new tab)wants to merge 12 commits intomain fromrefs/pull/25439/headopened View on GitHub

Showing 3 changed files with 177 additions and 15 deletions (loading 1).

x
0 of 3 viewed, 3 left
36 additions and 15 deletionsapps/server/src/cli/invocation.tsModified
View file
@@ -49,22 +49,24 @@
* `T3CODE_NPM_LAUNCHER_PATH` is inherited by child shells, so accept it only for this package
* version to avoid claiming another `t3` invocation is the npm install.
*/
-export const resolveEntryPath = Effect.gen(function* () {
+export const resolveNpmLauncherPath = Effect.gen(function* () {
const npmLauncher = (yield* HostProcess.Environment).T3CODE_NPM_LAUNCHER_PATH?.trim();
- if (npmLauncher) {
- const fs = yield* FileSystem.FileSystem;
- const path = yield* Path.Path;
- const manifest = yield* fs
- .readFileString(path.join(path.dirname(npmLauncher), "../package.json"))
- .pipe(Effect.flatMap(decodeInstallManifest), Effect.option);
- if (
- Option.isSome(manifest) &&
- manifest.value.name === "t3" &&
- manifest.value.version === packageJson.version
- ) {
- return npmLauncher;
- }
- }
+ if (!npmLauncher) return Option.none<string>();
+ const fs = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const manifest = yield* fs
+ .readFileString(path.join(path.dirname(npmLauncher), "../package.json"))
+ .pipe(Effect.flatMap(decodeInstallManifest), Effect.option);
+ return Option.isSome(manifest) &&
+ manifest.value.name === "t3" &&
+ manifest.value.version === packageJson.version