File tree Expand file tree Collapse file tree
.agents/skills/rstack-cli-best-practices Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ Prefer Rstack-exported paths:
7575
7676| Instead of | Prefer |
7777| ------------------------- | ------------------------ |
78+ | ` @rsbuild/core ` | ` rstack/app ` |
7879| ` @rslib/core ` | ` rstack/lib ` |
7980| ` @rstest/core ` | ` rstack/test ` |
8081| ` @rslint/core ` | ` rstack/lint ` |
Original file line number Diff line number Diff line change @@ -90,11 +90,12 @@ pnpm doc
9090
9191Rstack re-exports the APIs of its underlying tools through dedicated entry points:
9292
93- | Tool | Import path |
94- | ------ | ------------- |
95- | Rslib | ` rstack/lib ` |
96- | Rslint | ` rstack/lint ` |
97- | Rstest | ` rstack/test ` |
93+ | Tool | Import path |
94+ | ------- | ------------- |
95+ | Rsbuild | ` rstack/app ` |
96+ | Rslib | ` rstack/lib ` |
97+ | Rslint | ` rstack/lint ` |
98+ | Rstest | ` rstack/test ` |
9899
99100For example, import Rstest APIs without adding ` @rstest/core ` as a direct dependency:
100101
Original file line number Diff line number Diff line change 1919 "types" : " ./dist/index.d.ts" ,
2020 "default" : " ./dist/index.js"
2121 },
22+ "./app" : {
23+ "types" : " ./dist/app.d.ts" ,
24+ "default" : " ./dist/app.js"
25+ },
2226 "./test" : {
2327 "types" : " ./dist/test.d.ts" ,
2428 "default" : " ./dist/test.js"
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export default defineConfig({
1111 rslintConfig : './src/rslintConfig.ts' ,
1212 rspressConfig : './src/rspressConfig.ts' ,
1313 rstestConfig : './src/rstestConfig.ts' ,
14+ app : './src/app.ts' ,
1415 lib : './src/lib.ts' ,
1516 lint : './src/lint.ts' ,
1617 test : './src/test.ts' ,
Original file line number Diff line number Diff line change 1+ /**
2+ * Re-export @rsbuild/core APIs so users can import application APIs from `rstack/app`.
3+ *
4+ * @example
5+ * ```ts
6+ * import { createRsbuild } from 'rstack/app';
7+ * ```
8+ */
9+ export * from '@rsbuild/core' ;
Original file line number Diff line number Diff line change 1+ import * as rsbuild from '@rsbuild/core' ;
2+ import { expect , test } from 'rstack/test' ;
3+
4+ test ( 'should expose all Rsbuild APIs from `rstack/app`' , async ( ) => {
5+ const app = await import ( 'rstack/app' ) ;
6+
7+ expect ( app ) . toEqual ( rsbuild ) ;
8+ } ) ;
Original file line number Diff line number Diff line change 77 "types" : [" node" ],
88 "paths" : {
99 "rstack" : [" ../src/index.ts" ],
10+ "rstack/app" : [" ../src/app.ts" ],
1011 "rstack/lib" : [" ../src/lib.ts" ],
1112 "rstack/lint" : [" ../src/lint.ts" ],
1213 "rstack/test" : [" ../src/test.ts" ],
You can’t perform that action at this time.
0 commit comments