From cf4c8b878517b081251dd51ea2438cef69089d5c Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Fri, 4 Oct 2024 16:09:50 +0100 Subject: [PATCH 1/3] Add missing root file override in turbo command --- packages/cli-utils/src/commands/turbo/thread.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/cli-utils/src/commands/turbo/thread.ts b/packages/cli-utils/src/commands/turbo/thread.ts index 07bfac8f..7a4c98ce 100644 --- a/packages/cli-utils/src/commands/turbo/thread.ts +++ b/packages/cli-utils/src/commands/turbo/thread.ts @@ -22,11 +22,14 @@ async function* _runTurbo(params: TurboParams): AsyncIterableIterator Date: Fri, 4 Oct 2024 16:11:38 +0100 Subject: [PATCH 2/3] Remove redundant argument from `addSourceFile` entirely --- packages/cli-utils/src/commands/turbo/thread.ts | 13 +++++-------- packages/cli-utils/src/ts/factory.ts | 17 +++++++---------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/packages/cli-utils/src/commands/turbo/thread.ts b/packages/cli-utils/src/commands/turbo/thread.ts index 7a4c98ce..07bfac8f 100644 --- a/packages/cli-utils/src/commands/turbo/thread.ts +++ b/packages/cli-utils/src/commands/turbo/thread.ts @@ -22,14 +22,11 @@ async function* _runTurbo(params: TurboParams): AsyncIterableIterator; @@ -126,11 +126,11 @@ export const programFactory = (params: ProgramFactoryParams): ProgramFactory => return files; }, - addSourceFile(input, addRootName) { + addSourceFile(input) { const sourceFile = 'fileName' in input ? input : factory.createSourceFile(input, ts.ScriptKind.TSX); host.updateFile(sourceFile); - if (addRootName) rootNames.add(sourceFile.fileName); + rootNames.add(sourceFile.fileName); return factory; }, @@ -154,13 +154,10 @@ export const programFactory = (params: ProgramFactoryParams): ProgramFactory => const virtualCode = await transform(sourceFile); if (virtualCode) { factory - .addSourceFile( - { - fileId: virtualFileId, - sourceText: virtualCode.snapshot, - }, - /*addRootName*/ true - ) + .addSourceFile({ + fileId: virtualFileId, + sourceText: virtualCode.snapshot, + }) .addMappedFile(sourceFile, { mappings: virtualCode.mappings, fileId: virtualFileId, From 62fc440d3047e57c48348a18a48d524844e2974e Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Fri, 4 Oct 2024 16:12:30 +0100 Subject: [PATCH 3/3] Add changeset --- .changeset/mighty-dots-applaud.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/mighty-dots-applaud.md diff --git a/.changeset/mighty-dots-applaud.md b/.changeset/mighty-dots-applaud.md new file mode 100644 index 00000000..c95a0967 --- /dev/null +++ b/.changeset/mighty-dots-applaud.md @@ -0,0 +1,5 @@ +--- +'@gql.tada/cli-utils': patch +--- + +Fix `turbo` command's cache disabling override not being effective. This was a regression that meant the cached outputs would be reused during the next run of the `turbo` command.