Open StarFishing opened 1 year ago
@StarFishing Could you add some repro steps to this issue so that we can debug it more easily?
Show some code that compiles successfully using the old version of rush-sdk
, but the same code fails when using the latest rush-sdk
. Thanks!
Supplement the reproduction steps
RushConfiguration
is exported directly from rush-sdk
's index. Which exports specifically are you looking for? rush-sdk
is intended to be very stable, since it's a wrapper around rush-lib
provided to plugins at runtime, so the plugin may not exactly match the version of rush-lib
specified in rush.json
.
The issue with adding this back is that exports
seems to require an exhaustive list, so we'd have to do this with a pre-pack script (similar to https://github.com/microsoft/rushstack/blob/main/libraries/rush-lib/scripts/plugins-prepublish.js). @StarFishing - would you be willing to put that together?
I used these api.
import { RushConfiguration } from '@rushstack/rush-sdk/lib/api/RushConfiguration';
import { PublishUtilities } from '@rushstack/rush-sdk/lib/logic/PublishUtilities';
import { Utilities } from '@rushstack/rush-sdk/lib/utilities/Utilities';
import { ChangeFile } from '@rushstack/rush-sdk/lib/api/ChangeFile';
If this way is abandoned, it seems that the package needs to be adjusted readme
The other day I encountered this issue too while implementing a repo tool on top of Rush SDK.
The quick workaround that I use is to do a rush-pnpm patch @rushstack/rush-sdk
, edit its package.json to remove the "exports" field.
Problem: rush-sdk has added the
exports
field in hispackage.json
field, which will make it unable to work as expected.Summary
rush-sdk provide the ability to call the internal API, but the increase of the
exports
field leads to errors in the following usage methods.Repro steps
Add a new node package and create a entry: src/index.ts
rush version: 5.100.2 @rushstack/rush-sdk:5.100.2 usage:
Expected result: I can still use the internal API in the way of path import.
rush version: 5.104.0 @rushstack/rush-sdk:5.104.0 usage:
Actual result: I got the error that the path has not been exported.
Details
Standard questions
Please answer these questions to help us investigate your issue more quickly:
node -v
)?