Skip to content

Commit

Permalink
fix: Include .tstoolkitrc.ts in scaffolded files + add @rollup/plugin…
Browse files Browse the repository at this point in the history
…-commonjs + exclude test files from build
  • Loading branch information
tristanmenzel committed Feb 13, 2024
1 parent 208347e commit e200db5
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@makerx/ts-toolkit",
"version": "4.0.0-beta.6",
"version": "4.0.0-beta.7",
"description": "This cli facilitates the creation of boilerplate files in a new typescript repo",
"type": "module",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/init/check-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const nodePackages: Record<string, string> = {
'@rollup/plugin-json': 'latest',
'@rollup/plugin-node-resolve': 'latest',
'@rollup/plugin-typescript': 'latest',
'@rollup/plugin-commonjs': 'latest',
'npm-run-all': 'latest',
copyfiles: 'latest',
rimraf: 'latest',
Expand Down
1 change: 1 addition & 0 deletions src/init/config-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const baseFiles: ConfigFile[] = [
]

const nodeFiles: ConfigFile[] = [
{ name: '.tstoolkitrc.ts', templateDir: 'node' },
{ name: 'rollup.config.ts', templateDir: 'node' },
{ name: 'tsconfig.json', templateDir: 'node' },
{ name: 'tsconfig.build.json', templateDir: 'node' },
Expand Down
11 changes: 11 additions & 0 deletions src/templates/node/.tstoolkitrc.ts.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {TsToolkitConfig} from "./src";

const config: TsToolkitConfig = {
packageConfig: {
srcDir: 'src',
outDir: 'dist',
moduleType: 'module',
main: 'index.ts',
}
}
export default config
2 changes: 2 additions & 0 deletions src/templates/node/rollup.config.ts.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import nodeResolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import json from '@rollup/plugin-json'
import type { RollupOptions } from 'rollup'
Expand Down Expand Up @@ -34,6 +35,7 @@ const config: RollupOptions = {
typescript({
tsconfig: 'tsconfig.build.json',
}),
commonjs(),
nodeResolve(),
json(),
],
Expand Down
3 changes: 2 additions & 1 deletion src/templates/node/tsconfig.build.json.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"noEmit": false,
"declaration": true
},
"include": ["src/**/*.ts"]
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"]
}
3 changes: 2 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"noEmit": false,
"declaration": true
},
"include": ["src/**/*.ts"]
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"]
}

0 comments on commit e200db5

Please sign in to comment.