Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/rolldown.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if (BUNDLE) {
}

const rolldownConfig = {
input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.js`),
input: path.resolve(__dirname, `../js/index.${ESM ? 'esm' : 'umd'}.ts`),
// oxc strips the types and lowers the syntax, so the dist path carries no
// Babel. The targets come from .browserslistrc, the same source Babel read.
transform: {
Expand Down
14 changes: 14 additions & 0 deletions build/tsconfig.entries.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
// The bundle entries are rolldown inputs, not part of the published type
// surface (build/tsconfig.dts.json emits from js/src only), so the per-file
// declaration constraints that keep js/src emittable do not apply here. The
// UMD entry cannot satisfy them anyway: a default-exported object of
// component classes is not inferable under isolatedDeclarations, and the
// explicit-value workaround collides with object-shorthand.
"declaration": false,
"isolatedDeclarations": false
},
"include": ["../js/index.esm.ts", "../js/index.umd.ts"]
}
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export default [
{
// The library sources are migrating to TypeScript file by file, so this
// block only applies where a `.ts` file already exists.
files: ['js/src/**/*.ts', 'js/tests/vitest.config.mts'],
files: ['js/index.esm.ts', 'js/index.umd.ts', 'js/src/**/*.ts', 'js/tests/vitest.config.mts'],
languageOptions: {
parser: tseslint.parser,
sourceType: 'module'
Expand Down
2 changes: 1 addition & 1 deletion js/index.esm.js → js/index.esm.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* CoreUI PRO index.esm.js
* CoreUI PRO index.esm.ts
* Licensed under MIT (https://coreui.io/pro/license/)
* --------------------------------------------------------------------------
*/
Expand Down
4 changes: 2 additions & 2 deletions js/index.umd.js → js/index.umd.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* --------------------------------------------------------------------------
* CoreUI PRO index.esm.js
* Licensed under MIT (Licensed under MIT (https://coreui.io/pro/license/)
* CoreUI PRO index.umd.ts
* Licensed under MIT (https://coreui.io/pro/license/)
* --------------------------------------------------------------------------
*/

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
"js-compile-bundle": "rolldown --environment BUNDLE:true --config build/rolldown.config.mjs --sourcemap",
"js-compile-bundle-bootstrap": "rolldown --environment BOOTSTRAP:true,BUNDLE:true --config build/rolldown.config.mjs --sourcemap",
"js-compile-plugins": "node build/build-plugins.mjs",
"js-typecheck": "tsc --noEmit",
"js-typecheck": "npm-run-all --aggregate-output --parallel js-typecheck-src js-typecheck-entries",
"js-typecheck-src": "tsc --noEmit",
"js-typecheck-entries": "tsc --project build/tsconfig.entries.json",
"js-typecheck-dist": "tsc --project js/tests/types/tsconfig.json",
"js-emit-types": "tsc --project build/tsconfig.dts.json",
"js-lint": "eslint --cache --cache-location .cache/.eslintcache --report-unused-disable-directives",
Expand Down
Loading