-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(package): enhance build configuration
- enhance build configuration: add new configuration for library export - change test runner: jest > vitest - change package manager: npm > pnpm
- Loading branch information
Showing
27 changed files
with
7,562 additions
and
12,630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,124 @@ | ||
{ | ||
// common configuration | ||
// tsconfig.json path: you must pass path with filename, like this "./tsconfig.json" | ||
"project": "./tsconfig.json", | ||
|
||
// Export filename, if you not pass this field that use "index.ts" or "index.d.ts" | ||
"exportFilename": "index.ts", | ||
|
||
// create, single command configuration | ||
// add ctix comment at first line of creted index.ts file, that remark created from ctix | ||
"useSemicolon": true, | ||
|
||
// timestamp write on ctix comment right-side, only works in useComment option set true | ||
"useTimestamp": false, | ||
|
||
// add ctix comment at first line of creted index.ts file, that remark created from ctix | ||
"useComment": false, | ||
|
||
// quote mark " or ' | ||
"quote": "'", | ||
|
||
// overwrite index.ts file also index.ts file already exist that create backup file | ||
"overwrite": true, | ||
|
||
// keep file extension in export statement path | ||
"keepFileExt": false, | ||
|
||
// only create command configuration | ||
// If set true this option, skip empty directory | ||
"skipEmptyDir": true, | ||
|
||
// only single command configuration | ||
// Output directory. It works only single mode. | ||
"output": "./src", | ||
|
||
// Use rootDir or rootDirs configuration in tsconfig.json. | ||
"useRootDir": false, | ||
|
||
// only remove command configuration | ||
// remove with backup file | ||
"includeBackup": true | ||
// Stream of cli spinner, you can pass stdout or stderr | ||
// | ||
// @mode all | ||
// @default stdout | ||
"spinnerStream": "stdout", | ||
|
||
// Stream of cli progress, you can pass stdout or stderr | ||
// | ||
// @mode all | ||
// @default stdout | ||
"progressStream": "stdout", | ||
|
||
// Stream of cli reasoner. Reasoner show name conflict error and already exist index.ts file error. | ||
// You can pass stdout or stderr | ||
// | ||
// @mode all | ||
// @default stderr | ||
"reasonerStream": "stderr", | ||
|
||
"options": [ | ||
{ | ||
// build mode | ||
// - create: create an `index.ts` file in each directory | ||
// - bundle: bundle all export information in one `index.ts` file | ||
"mode": "bundle", | ||
|
||
// tsconfig.json path: you must pass path with filename, like this "./tsconfig.json" | ||
// only work root directory or cli parameter | ||
// | ||
// @mode all | ||
"project": "tsconfig.json", | ||
|
||
// Export filename, if you not pass this field that use "index.ts" or "index.d.ts" | ||
// | ||
// @mode create, bundle, remove | ||
// @default index.ts | ||
"exportFilename": "index.ts", | ||
|
||
// add ctix comment at first line of creted index.ts file, that remark created from ctix | ||
// | ||
// @mode create, bundle | ||
// @default false | ||
"useSemicolon": true, | ||
|
||
// add ctix comment at first line of creted index.ts file, that remark created from ctix | ||
// | ||
// @mode create, bundle | ||
// @default false | ||
"useBanner": false, | ||
|
||
// If specified as true, adds the created date to the top of the `index.ts` file, | ||
// this option only works if the `useBanner` option is enabled | ||
// | ||
// @mode create, bundle | ||
// @default false | ||
"useTimestamp": false, | ||
|
||
// quote mark " or ' | ||
// @mode create, bundle | ||
// | ||
// @default ' | ||
"quote": "'", | ||
|
||
// Use to add a literal like `"use strict"` to the top. It will be added before the banner. | ||
// | ||
// @mode create, bundle | ||
"directive": "", | ||
|
||
// keep file extension in export statement path | ||
// | ||
// if this option set true that see below | ||
// export * from './test.ts' | ||
// | ||
// @mode create, bundle | ||
// @default none | ||
"fileExt": "none", | ||
|
||
// overwrite each index.ts file | ||
// @mode create, bundle | ||
// @default false | ||
"overwrite": false, | ||
|
||
// Create a backup file if the `index.ts` file already exists. | ||
// This option only works if the `overwrite` option is enabled. | ||
// | ||
// @mode create, bundle | ||
// @defulat true | ||
"backup": true, | ||
|
||
// When generating the `index.ts` file, decide how you want to generate it | ||
// | ||
// @mode create, bundle | ||
// @default auto | ||
"generationStyle": "auto", | ||
|
||
// A list of files to use when generating the index.ts file. If no value is set, | ||
// the value of the include setting set in the tsconfig.json file will be used | ||
// | ||
// @mode create, bundle | ||
"include": ["src/**/*.ts"], | ||
|
||
// A list of files to exclude when generating the index.ts file. If no value is set, | ||
// the value of the exclude setting set in the tsconfig.json file is used | ||
// | ||
// @mode create, bundle | ||
"exclude": ["examples/**/*", "dist/**", ".configs/**", "src/test-tools/**/*", "**/__tests__/**"], | ||
|
||
// Output directory. Default value is same project directory | ||
// @mode bundle | ||
"output": "src", | ||
|
||
// remove with backup file | ||
// @mode remove | ||
// @default false | ||
"removeBackup": true, | ||
|
||
// answer `yes` to all questions | ||
// @mode remove | ||
// @default false | ||
"forceYes": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import readPackage from 'read-pkg'; | ||
import { dts } from 'rollup-plugin-dts'; | ||
|
||
const pkg = readPackage.sync(); | ||
|
||
const resolveOnly = (module) => { | ||
return ( | ||
pkg?.dependencies?.[module] != null && | ||
pkg?.devDependencies?.[module] != null && | ||
pkg?.peerDependencies?.[module] != null | ||
); | ||
}; | ||
|
||
const config = [ | ||
{ | ||
input: 'dist/types/origin/index.d.ts', | ||
output: [{ file: 'dist/types/index.d.ts', format: 'esm' }], | ||
plugins: [ | ||
nodeResolve({ resolveOnly }), | ||
dts({ | ||
tsconfig: './tsconfig.dts.json', | ||
}), | ||
], | ||
}, | ||
]; | ||
|
||
export default config; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.