Skip to content

Commit d05b564

Browse files
L-Qunchengcyber
andauthored
[rush] Support deep references to internal Apis (#4825)
* feat: support deep references to internal api * rush change * update exports * update exports * update exports * update exports * chore: update exports * feat: rush-sdk build test for runtime import issue --------- Co-authored-by: qun <[email protected]> Co-authored-by: Cheng Liu <[email protected]>
1 parent dff22a1 commit d05b564

File tree

5 files changed

+51
-3
lines changed

5 files changed

+51
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json",
3+
4+
"extends": "local-node-rig/profiles/default/config/heft.json",
5+
6+
"phasesByName": {
7+
"build": {
8+
"tasksByName": {
9+
"run-start": {
10+
"taskDependencies": ["typescript"],
11+
"taskPlugin": {
12+
"pluginPackage": "@rushstack/heft",
13+
"pluginName": "run-script-plugin",
14+
"options": {
15+
"scriptPath": "./lib/run-start.js"
16+
}
17+
}
18+
}
19+
}
20+
}
21+
}
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
4+
export async function runAsync(): Promise<void> {
5+
await import('./start.js');
6+
}

build-tests-subspace/rush-sdk-test/src/start.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ console.log('rush-sdk-test loading Rush configuration...');
77

88
// Important: Since we're calling an internal API, we need to use the unbundled .d.ts files
99
// instead of the normal .d.ts rollup
10-
import { RushConfiguration } from '@rushstack/rush-sdk/lib/';
10+
import { RushConfiguration } from '@rushstack/rush-sdk/lib/index';
1111

1212
const config: RushConfiguration = RushConfiguration.loadFromDefaultLocation();
1313
console.log(config.commonFolder);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/rush",
5+
"comment": "Support deep references to internal Apis",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@microsoft/rush"
10+
}

libraries/rush-sdk/package.json

+12-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,18 @@
1111
"main": "lib-shim/index.js",
1212
"typings": "dist/rush-lib.d.ts",
1313
"exports": {
14-
".": "./lib-shim/index.js",
15-
"./loader": "./lib-shim/loader.js"
14+
".": {
15+
"types": "./dist/rush-lib.d.ts",
16+
"default": "./lib-shim/index.js"
17+
},
18+
"./loader": {
19+
"types": "./dist/loader.d.ts",
20+
"default": "./lib-shim/loader.js"
21+
},
22+
"./lib/*": {
23+
"types": "./lib/*.d.ts",
24+
"default": "./lib/*.js"
25+
}
1626
},
1727
"typesVersions": {
1828
"*": {

0 commit comments

Comments
 (0)