v0.5.0
Highlights ✨
This release brings exciting new features and improvements to Rslib:
-
Support DTS Redirect: Rslib now supports to control the redirect of the import paths in output TypeScript declaration files. (#742)
- redirect.dts.path: Redirect the import path in the DTS output file to the corresponding relative path based on the
compilerOptions.paths
configured intsconfig.json
.
// For `compilerOptions.paths` set to `{ "@/*": ["src/*"] }` in `tsconfig.json` import { foo } from '@/foo'; // source code of './src/bar.ts' ↓ import { foo } from './foo'; // expected output of './dist/bar.d.ts' import { foo } from '@/foo'; // source code of './src/utils/index.ts' ↓ import { foo } from '../foo'; // expected output './dist/utils/index.d.ts'
- redirect.dts.extension: Redirect the import path in the DTS output file to the corresponding JavaScript extension which can be resolved to corresponding DTS file.
// For `.d.mts` TypeScript Declaration files import { foo } from './foo'; // source code of './src/bar.ts' ↓ import { foo } from './foo.mjs'; // expected output of './dist/bar.d.mts' import { foo } from './foo.ts'; // source code of './src/bar.ts' ↓ import { foo } from './foo.mjs'; // expected output of './dist/bar.d.mts'
- redirect.dts.path: Redirect the import path in the DTS output file to the corresponding relative path based on the
-
Support
outBase
in Bundleless Mode: When building a project where source files exist across multiple directories with bundleless mode, the output directory structure will be replicated relative to theoutBase
directory in the output directory, see lib.outBase for more details. (#745) -
Add Documents about Assets: Documents related to asset module have been added for common scenarios in component library development, see Import static assets, Import SVGR and Import JSON files for more details. (#741)
-
Support pkg.pr.new: With pkg.pr.new, each of commits in main branch will trigger an instant preview release without publishing anything to NPM. This enables users to access features and bug-fixes without the need to wait for release cycles. (#766)
What's Changed
New Features 🎉
- feat: support DTS redirect by @Timeless0911 in #742
- feat: support outBase config by @fi3ework in #745
Bug Fixes 🐞
- fix: windows issue in dts redirect by @Timeless0911 in #746
- fix: clean dts distPath earlier by @Timeless0911 in #752
- fix: correct detect transformed module external request by @fi3ework in #754
- fix(bundleless): only try to redirect files under outBase dir by @fi3ework in #760
- fix(CI): should filter workspaces in pkg-pr-new by @Timeless0911 in #767
Document 📖
- docs: display GitHub button on homepage by @chenjiahan in #751
- docs(assets): add assets, json, svgr usage document by @SoonIter in #741
- docs: add why Rslib chapter by @Timeless0911 in #755
- docs: add bundleless externals note by @Timeless0911 in #763
Other Changes
- chore(CI): modify test ci yaml to make pr merge correctly by @Timeless0911 in #747
- chore(deps): update dependency @microsoft/api-extractor to ^7.50.0 by @renovate in #749
- chore(deps): update all patch dependencies by @renovate in #748
- chore(deps): update dependency prettier to ^3.5.0 by @renovate in #750
- chore(deps): update all patch dependencies by @renovate in #753
- chore(deps): update all patch dependencies by @renovate in #756
- chore(deps): update all patch dependencies by @renovate in #757
- chore(deps): update dependency @ast-grep/napi to ^0.35.0 by @renovate in #758
- chore(CI): support pkg.pr.new by @Timeless0911 in #766
- chore(deps): update all patch dependencies by @renovate in #765
- chore(deps): update dependency rspress to v1.42.0 by @renovate in #768
- chore(deps): update dependency preact to ^10.26.2 by @renovate in #769
- Release v0.5.0 by @Timeless0911 in #770
Full Changelog: v0.4.1...v0.5.0