Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
fix(runner-ts): Add path to the cacheKeys to fix #14 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim authored Sep 1, 2020
1 parent 9af113b commit 38f3151
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Object {
"collectedOutput": Array [
Object {
"cacheKeys": Array [
"index.ts",
"3.8.3",
"{\\"target\\":\\"es5\\",\\"module\\":\\"commonjs\\",\\"moduleResolution\\":\\"node\\",\\"declaration\\":true,\\"sourceMap\\":true,\\"noEmitOnError\\":true,\\"skipLibCheck\\":true}",
"export const foo: number = 420;",
Expand Down Expand Up @@ -57,6 +58,7 @@ Object {
"collectedOutput": Array [
Object {
"cacheKeys": Array [
"index.ts",
"3.8.3",
"{\\"declaration\\":true,\\"sourceMap\\":true,\\"noEmitOnError\\":true,\\"skipLibCheck\\":true,\\"target\\":\\"es5\\",\\"module\\":\\"esnext\\",\\"moduleResolution\\":\\"node\\"}",
"export const greet = (str: string) => \`Hello, \${str}\`",
Expand Down Expand Up @@ -109,6 +111,7 @@ Object {
"collectedOutput": Array [
Object {
"cacheKeys": Array [
"index.ts",
"3.8.3",
"{\\"declaration\\":true,\\"sourceMap\\":true,\\"noEmitOnError\\":true,\\"skipLibCheck\\":true,\\"target\\":\\"es5\\",\\"module\\":\\"esnext\\",\\"moduleResolution\\":\\"node\\"}",
"export const greet = (str: string) => \`Hello, \${str}\`",
Expand Down Expand Up @@ -161,6 +164,7 @@ Object {
"collectedOutput": Array [
Object {
"cacheKeys": Array [
"nested/index.ts",
"3.8.3",
"{\\"target\\":\\"es5\\",\\"module\\":\\"commonjs\\",\\"moduleResolution\\":\\"node\\",\\"declaration\\":true,\\"sourceMap\\":true,\\"noEmitOnError\\":true,\\"skipLibCheck\\":true}",
"export const foo: number = 420;",
Expand Down Expand Up @@ -191,6 +195,7 @@ exports.foo = 420;
},
Object {
"cacheKeys": Array [
"main/index.ts",
"3.8.3",
"{\\"target\\":\\"es5\\",\\"module\\":\\"commonjs\\",\\"moduleResolution\\":\\"node\\",\\"declaration\\":true,\\"sourceMap\\":true,\\"noEmitOnError\\":true,\\"skipLibCheck\\":true}",
"import { foo } from \\"../nested\\"; console.log(foo);",
Expand Down
4 changes: 2 additions & 2 deletions plugins/runner-ts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export default defineRunner(tsRunnerOptions, async ctx => {
const outputs = [];

for (const file of filesToProcess) {
const { absolutePath, baseDir, path, data } = file;
const { absolutePath, baseDir, path } = file;
const fileName = absolutePath ?? path;

const sourceFile = host.getSourceFile(
Expand All @@ -182,7 +182,7 @@ export default defineRunner(tsRunnerOptions, async ctx => {

const outputContainer = ctx.createOutputContainer(
file,
[...cacheKeys, ...allDepsContent],
[path, ...cacheKeys, ...allDepsContent],
directDepsRealPaths
);

Expand Down

0 comments on commit 38f3151

Please sign in to comment.