refactor: do not use a TS rollup plugin, but instead call tsc directly first

This commit is contained in:
Derrick Hammer 2023-06-30 01:11:14 -04:00
parent 2e05208469
commit 0d2816fb8e
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
8 changed files with 17396 additions and 16 deletions

3
.presetterrc.json Normal file
View File

@ -0,0 +1,3 @@
{
"preset": ["presetter-preset-esm"]
}

View File

@ -1,6 +1,7 @@
MIT License MIT License
Copyright (c) <year> <copyright holders> Copyright (c) 2020 Alvis HT Tang
Copyright (c) 2023 Hammer Technologies LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@ -7,8 +7,6 @@ output:
format: es format: es
sourcemap: true sourcemap: true
plugins: plugins:
- '@apply rollup-plugin-ts[default]'
- '@apply rollup-plugin-tsconfig-paths[default]'
- '@apply @rollup/plugin-node-resolve[default]' - '@apply @rollup/plugin-node-resolve[default]'
- - '@apply @rollup/plugin-commonjs[default]' - - '@apply @rollup/plugin-commonjs[default]'
- extensions: - extensions:

17377
npm-shrinkwrap.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -24,12 +24,7 @@
}, },
"scripts": { "scripts": {
"bootstrap": "presetter bootstrap && run prepare", "bootstrap": "presetter bootstrap && run prepare",
"build": "run build", "build": "run build"
"coverage": "run coverage --",
"lint": "run lint --",
"prepublishOnly": "run prepare && run prepublishOnly",
"test": "run test --",
"watch": "run watch --"
}, },
"peerDependencies": { "peerDependencies": {
"@rollup/plugin-commonjs": "^25.0.0", "@rollup/plugin-commonjs": "^25.0.0",
@ -38,18 +33,16 @@
"@rollup/plugin-json": "^6.0.0", "@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.0", "@rollup/plugin-node-resolve": "^15.0.0",
"@rollup/plugin-yaml": "^4.0.0", "@rollup/plugin-yaml": "^4.0.0",
"presetter": "workspace:*",
"rollup": "^3.0.0", "rollup": "^3.0.0",
"rollup-plugin-postcss": "^4.0.0", "rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-ts": "^3.0.0",
"rollup-plugin-tsconfig-paths": "^1.0.0",
"rollup-plugin-visualizer": "^5.0.0" "rollup-plugin-visualizer": "^5.0.0"
}, },
"devDependencies": { "devDependencies": {
"presetter": "workspace:*" "presetter": "^4.0.1",
"presetter-preset-esm": "^4.0.1"
}, },
"dependencies": { "dependencies": {
"presetter-types": "workspace:*", "presetter-types": "^4.0.1",
"type-fest": "^3.12.0" "type-fest": "^3.12.0"
} }
} }

View File

@ -66,6 +66,7 @@ export default function (): PresetAsset {
return template(content, variable); return template(content, variable);
/* eslint-enable @typescript-eslint/naming-convention */ /* eslint-enable @typescript-eslint/naming-convention */
}, },
'tsconfig.config.json': resolve(TEMPLATES, 'tsconfig.config.yaml'),
}, },
scripts: resolve(TEMPLATES, 'scripts.yaml'), scripts: resolve(TEMPLATES, 'scripts.yaml'),
noSymlinks: ['rollup.config.ts'], noSymlinks: ['rollup.config.ts'],

View File

@ -1,5 +1,6 @@
# replace the `prepare` template from presetter-preset # replace the `prepare` template from presetter-preset
# so that the build procedure will not be triggered upon package installation # so that the build procedure will not be triggered upon package installation
build: cross-env NODE_ENV=production run-s clean build:rollup build: cross-env NODE_ENV=production run-s clean build:rollup-config build:rollup
build:rollup: rollup --config rollup.config.ts --configPlugin rollup-plugin-ts build:rollup-config: tsc -p tsconfig.config.json rollup.config.ts
build:rollup: rollup --config rollup.config.js
develop: cross-env NODE_ENV=development run-s "build:rollup -- --watch {@}" -- develop: cross-env NODE_ENV=development run-s "build:rollup -- --watch {@}" --

View File

@ -0,0 +1,6 @@
extends: .
include:
- '.'
compilerOptions:
# emittance
outDir: '.'