Skip to content
Merged
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 packages/create-rslib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ create({
const packageName = getPackageName(distFolder);
replacePackageNamePlaceholder(
distFolder,
['docs/Button.mdx', 'tsconfig.json'],
['docs/Button.mdx', 'docs/tsconfig.json'],
packageName,
);

Expand Down
8 changes: 8 additions & 0 deletions packages/create-rslib/template-node-ts/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "..",
"types": ["node"]
},
"include": ["./"]
}
16 changes: 12 additions & 4 deletions packages/create-rslib/template-node-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{
"compilerOptions": {
"lib": ["ES2022"],
"target": "ES2022",
"noEmit": true,
"skipLibCheck": true,
"types": ["node"],
"useDefineForClassFields": true,
"rootDir": "src",

/* modules */
"isolatedModules": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"moduleResolution": "bundler",
"useDefineForClassFields": true,
"resolveJsonModule": true,
"allowImportingTsExtensions": true,
"types": ["node"],
"rootDir": "src"

/* type checking */
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src"]
}
1 change: 1 addition & 0 deletions packages/create-rslib/template-react-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^7.0.1",
"@testing-library/react": "^16.3.2",
"@types/node": "^24.13.3",
"@types/react": "^19.2.18",
"@types/react-dom": "^19.2.4",
"happy-dom": "^20.11.2",
Expand Down
5 changes: 3 additions & 2 deletions packages/create-rslib/template-react-ts/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"types": ["@rslib/core/types", "@testing-library/jest-dom"]
"rootDir": "..",
"types": ["@rslib/core/types", "node", "@testing-library/jest-dom"]
},
"include": [".", "../rstest.setup.ts"]
"include": ["./"]
}
18 changes: 14 additions & 4 deletions packages/create-rslib/template-react-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
"compilerOptions": {
"lib": ["DOM", "ES2022"],
"jsx": "react-jsx",
"target": "ES2022",
"noEmit": true,
"skipLibCheck": true,
"types": ["@rslib/core/types"],
Comment thread
Timeless0911 marked this conversation as resolved.
"useDefineForClassFields": true,
"rootDir": "src",

/* modules */
"isolatedModules": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"moduleResolution": "bundler",
"useDefineForClassFields": true,
"types": ["@rslib/core/types"],
"rootDir": "src"
"resolveJsonModule": true,
"allowImportingTsExtensions": true,

/* type checking */
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src"]
}
10 changes: 10 additions & 0 deletions packages/create-rslib/template-rspress/react-ts/docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "..",
"paths": {
"{{ packageName }}": [".."]
}
},
"include": ["./"]
}
16 changes: 0 additions & 16 deletions packages/create-rslib/template-rspress/react-ts/tsconfig.json

This file was deleted.

1 change: 1 addition & 0 deletions packages/create-rslib/template-solid-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@solidjs/testing-library": "^0.8.10",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^7.0.1",
"@types/node": "^24.13.3",
"happy-dom": "^20.11.2",
"solid-js": "^1.9.14",
"typescript": "^6.0.3"
Expand Down
5 changes: 3 additions & 2 deletions packages/create-rslib/template-solid-ts/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"types": ["@rslib/core/types", "@testing-library/jest-dom"]
"rootDir": "..",
"types": ["@rslib/core/types", "node", "@testing-library/jest-dom"]
},
"include": [".", "../rstest.setup.ts"]
"include": ["./"]
}
18 changes: 14 additions & 4 deletions packages/create-rslib/template-solid-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,23 @@
"lib": ["DOM", "ES2022"],
"jsx": "preserve",
"jsxImportSource": "solid-js",
"target": "ES2022",
"noEmit": true,
"skipLibCheck": true,
"types": ["@rslib/core/types"],
Comment thread
Timeless0911 marked this conversation as resolved.
"useDefineForClassFields": true,
"rootDir": "src",

/* modules */
"isolatedModules": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"moduleResolution": "bundler",
"useDefineForClassFields": true,
"types": ["@rslib/core/types"],
"rootDir": "src"
"resolveJsonModule": true,
"allowImportingTsExtensions": true,

/* type checking */
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src"]
}
9 changes: 9 additions & 0 deletions packages/create-rslib/template-svelte-ts/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"noEmit": true,
"rootDir": "..",
"types": ["@rslib/core/types", "node", "svelte"]
},
"include": ["./"]
}
25 changes: 17 additions & 8 deletions packages/create-rslib/template-svelte-ts/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
{
"extends": "@tsconfig/svelte/tsconfig.json",
"compilerOptions": {
"target": "ES2022",
"lib": ["DOM", "ES2022"],
"module": "preserve",
"moduleDetection": "force",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"types": ["node"],
"target": "ES2022",
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "dist",
Comment thread
Timeless0911 marked this conversation as resolved.
"skipLibCheck": true,
"types": ["@rslib/core/types", "svelte"],
"useDefineForClassFields": true,
"rootDir": "src",

/* modules */
"isolatedModules": true,
"noUnusedLocals": true
"moduleDetection": "force",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"allowImportingTsExtensions": true,

/* type checking */
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src", "scripts", "*.config.ts"]
"include": ["src"]
}
1 change: 1 addition & 0 deletions packages/create-rslib/template-vue-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@rstest/adapter-rslib": "^0.11.8",
"@rstest/core": "^0.11.8",
"@testing-library/jest-dom": "^7.0.1",
"@types/node": "^24.13.3",
"@vue/test-utils": "^2.4.11",
"happy-dom": "^20.11.2",
"typescript": "^6.0.3",
Expand Down
6 changes: 4 additions & 2 deletions packages/create-rslib/template-vue-ts/tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"types": ["@rslib/core/types", "@testing-library/jest-dom"]
"noEmit": true,
"rootDir": "..",
"types": ["@rslib/core/types", "node", "@testing-library/jest-dom"]
},
"include": [".", "../rstest.setup.ts"]
"include": ["./"]
}
18 changes: 10 additions & 8 deletions packages/create-rslib/template-vue-ts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
"compilerOptions": {
"lib": ["DOM", "ES2022"],
"jsx": "preserve",
"skipLibCheck": true,
"jsxImportSource": "vue",
"useDefineForClassFields": true,
"target": "ES2022",
"declaration": true,
"outDir": "dist",
"emitDeclarationOnly": true,
"outDir": "dist",
"skipLibCheck": true,
"types": ["@rslib/core/types"],
"useDefineForClassFields": true,
"rootDir": "src",

/* modules */
"isolatedModules": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"moduleResolution": "bundler",
"types": ["@rslib/core/types"],
"resolveJsonModule": true,
"allowImportingTsExtensions": true,

/* type checking */
"noUnusedLocals": true,
"noUnusedParameters": true,

"rootDir": "src"
"noUnusedParameters": true
},
"include": ["src"]
}
4 changes: 2 additions & 2 deletions packages/create-rslib/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ describe('rspress template', () => {
expect(buttonMdxContent).not.toContain('{{ packageName }}');
expect(buttonMdxContent).toContain(`from '${projectName}'`);

// Verify tsconfig.json has the actual package name in paths
const tsconfigPath = join(dir, 'tsconfig.json');
// Verify docs/tsconfig.json has the actual package name in paths
const tsconfigPath = join(dir, 'docs/tsconfig.json');
expect(existsSync(tsconfigPath)).toBeTruthy();
const tsconfigContent = readFileSync(tsconfigPath, 'utf-8');
expect(tsconfigContent).not.toContain('{{ packageName }}');
Expand Down