Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] Support deep references to internal Apis #4825

Merged
merged 9 commits into from
Jul 11, 2024
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
22 changes: 22 additions & 0 deletions build-tests-subspace/rush-sdk-test/config/heft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json",

"extends": "local-node-rig/profiles/default/config/heft.json",

"phasesByName": {
"build": {
"tasksByName": {
"run-start": {
"taskDependencies": ["typescript"],
"taskPlugin": {
"pluginPackage": "@rushstack/heft",
"pluginName": "run-script-plugin",
"options": {
"scriptPath": "./lib/run-start.js"
}
}
}
}
}
}
}
6 changes: 6 additions & 0 deletions build-tests-subspace/rush-sdk-test/src/run-start.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

export async function runAsync(): Promise<void> {
await import('./start.js');
}
2 changes: 1 addition & 1 deletion build-tests-subspace/rush-sdk-test/src/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ console.log('rush-sdk-test loading Rush configuration...');

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

const config: RushConfiguration = RushConfiguration.loadFromDefaultLocation();
console.log(config.commonFolder);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Support deep references to internal Apis",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
14 changes: 12 additions & 2 deletions libraries/rush-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@
"main": "lib-shim/index.js",
"typings": "dist/rush-lib.d.ts",
"exports": {
".": "./lib-shim/index.js",
"./loader": "./lib-shim/loader.js"
".": {
"types": "./dist/rush-lib.d.ts",
"default": "./lib-shim/index.js"
},
"./loader": {
"types": "./dist/loader.d.ts",
"default": "./lib-shim/loader.js"
},
"./lib/*": {
"types": "./lib/*.d.ts",
"default": "./lib/*.js"
}
octogonz marked this conversation as resolved.
Show resolved Hide resolved
},
"typesVersions": {
"*": {
Expand Down
Loading