Skip to content

Commit

Permalink
Fix tsup.config: add node types, add line break at the end of package…
Browse files Browse the repository at this point in the history
….json files in parity with vscode
  • Loading branch information
Raiondesu committed Dec 20, 2023
1 parent 239b176 commit a662ff7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
"packageManager": "[email protected]",
"devDependencies": {
"@types/node": "^20.10.5",
"colorette": "^2.0.20",
"cross-env": "^7.0.3",
"fdir": "^6.1.1",
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "tsconfig/base",
"include": ["@types/node", "tsup.config.ts"]
}
6 changes: 3 additions & 3 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default defineConfig(() => Promise.all(entries.map(async entry => {
require: './dist/' + path.replace('.js', '.cjs'),
types: './src/' + path.replace('.js', '.ts')
}
}), {});
}), {} as Record<string, Record<string, string>>);

console.log(pathsLog);
JSON.stringify(exportPaths, null, 2)
Expand All @@ -87,10 +87,10 @@ export default defineConfig(() => Promise.all(entries.map(async entry => {
'*': Object.keys(exportPaths).reduce((obj, p) => ({
...obj,
[p.replace('./', '')]: [exportPaths[p].types],
}), {}),
}), {} as Record<string, string[]>),
};

await writeFile(cwd('./package.json'), JSON.stringify(packageInfo, null, 2));
await writeFile(cwd('./package.json'), JSON.stringify(packageInfo, null, 2) + '\n');
},
} satisfies Options);
})));

0 comments on commit a662ff7

Please sign in to comment.