Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d275ca4
Use decoupled-local-node-rig to build heft-isolated-typescript-transp…
iclanton Apr 8, 2025
e9343b0
fixup! Use decoupled-local-node-rig to build heft-isolated-typescript…
iclanton Apr 8, 2025
84483b6
Sort globalPackageExtensions.
iclanton Apr 8, 2025
3dea2ed
Set up isolated transform in decoupled-local-node-rig.
iclanton Apr 8, 2025
35858ac
Set up isolated transform in local-node-rig.
iclanton Apr 8, 2025
5cc11d6
fixup! Set up isolated transform in decoupled-local-node-rig.
iclanton Apr 8, 2025
4822ed5
fixup! Set up isolated transform in decoupled-local-node-rig.
iclanton Apr 8, 2025
d033f3e
fixup! Set up isolated transform in decoupled-local-node-rig.
iclanton Apr 8, 2025
025ef9c
fixup! Set up isolated transform in decoupled-local-node-rig.
iclanton Apr 8, 2025
b960928
fixup! Set up isolated transform in decoupled-local-node-rig.
iclanton Apr 8, 2025
0660d4c
fixup! Set up isolated transform in decoupled-local-node-rig.
iclanton Apr 8, 2025
24e869f
fixup! Set up isolated transform in local-node-rig.
iclanton Apr 8, 2025
6725a74
fixup! Set up isolated transform in local-node-rig.
iclanton Apr 8, 2025
0280496
fixup! Set up isolated transform in decoupled-local-node-rig.
iclanton Apr 8, 2025
27bb6e1
Update Node projects' package.jsons.
iclanton Apr 20, 2025
287504c
Bump cyclics.
iclanton Apr 20, 2025
75e0707
fixup! Set up isolated transform in local-node-rig.
iclanton Apr 20, 2025
dc24246
fixup! Bump cyclics.
iclanton Apr 20, 2025
71033b9
Fix launching Heft from lib-commonjs.
iclanton Apr 20, 2025
1c371fa
Eliminate instances of 'import x = require('x')'
iclanton Apr 20, 2025
058984e
Fix exports from heft-jest-plugin.
iclanton Apr 20, 2025
580975f
Fix tests in heft-jest-plugin.
iclanton Apr 20, 2025
ac30465
Fix build of package-extractor.
iclanton Apr 20, 2025
39ab90c
Fix build and export issues in rush-lib.
iclanton Apr 20, 2025
2c47b74
Fix an issue with heft-jest-plugin/lib paths.
iclanton Apr 20, 2025
6f19abe
fixup! Fix an issue with heft-jest-plugin/lib paths.
iclanton Apr 20, 2025
aa27f9d
fixup! Fix build and export issues in rush-lib.
iclanton Apr 20, 2025
5c4a4f7
fixup! Update Node projects' package.jsons.
iclanton Apr 20, 2025
83722aa
Fix build and runtime issues in rush-sdk.
iclanton Apr 20, 2025
9a12b06
fixup! Fix build and runtime issues in rush-sdk.
iclanton Apr 21, 2025
49659fb
fixup! Fix build and runtime issues in rush-sdk.
iclanton Apr 21, 2025
e5fc93f
fixup! Fix build and export issues in rush-lib.
iclanton Apr 21, 2025
675592c
fixup! Fix build and runtime issues in rush-sdk.
iclanton Apr 21, 2025
1757fd7
fixup! Fix build and runtime issues in rush-sdk.
iclanton Apr 21, 2025
85e965a
fixup! Fix build and export issues in rush-lib.
iclanton Apr 21, 2025
26b77fa
fixup! Fix build and export issues in rush-lib.
iclanton Apr 21, 2025
8a68050
Fix build in rush-vscode-extension.
iclanton Apr 21, 2025
f1ee546
Fix task dependency order by replacing some 'typescript' instances wi…
iclanton Apr 21, 2025
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
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ common/autoinstallers/*/.npmrc
*.lock

# Common toolchain intermediate files
temp/
lib/
dist-storybook/
dist/
lib-amd/
lib-commonjs/
lib-dts/
lib-es6/
lib-esm/
lib-esnext/
lib-commonjs/
lib-shim/
dist/
dist-storybook/
lib/
temp/
*.tsbuildinfo

# Heft temporary files
Expand Down
2 changes: 1 addition & 1 deletion apps/api-documenter/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",

"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
"mainEntryPointFilePath": "<projectFolder>/lib-dts/index.d.ts",

"apiReport": {
"enabled": true,
Expand Down
23 changes: 22 additions & 1 deletion apps/api-documenter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,29 @@
"bin": {
"api-documenter": "./bin/api-documenter"
},
"main": "lib/index.js",
"main": "lib-commonjs/index.js",
"module": "lib-esm/index.js",
"typings": "dist/rollup.d.ts",
"exports": {
".": {
"import": "./lib-esm/index.js",
"require": "./lib-commonjs/index.js",
"types": "./dist/rollup.d.ts"
},
"./lib/*": {
"import": "./lib-esm/*.js",
"require": "./lib-commonjs/*.js",
"types": "./lib-dts/*.d.ts"
},
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"lib/*": [
"lib-dts/*"
]
}
},
"dependencies": {
"@microsoft/api-extractor-model": "workspace:*",
"@microsoft/tsdoc": "~0.15.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// See LICENSE in the project root for license information.

import * as path from 'path';
import yaml = require('js-yaml');
import yaml from 'js-yaml';

import type { ApiModel } from '@microsoft/api-extractor-model';
import { FileSystem } from '@rushstack/node-core-library';
Expand Down
2 changes: 1 addition & 1 deletion apps/api-documenter/src/documenters/YamlDocumenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import * as path from 'path';

import yaml = require('js-yaml');
import yaml from 'js-yaml';
import {
JsonFile,
JsonSchema,
Expand Down
2 changes: 1 addition & 1 deletion apps/api-documenter/src/utils/ToSdpConvertHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type {
} from '../yaml/ISDPYamlFile';
import path from 'path';
import { FileSystem, Encoding, NewlineKind } from '@rushstack/node-core-library';
import yaml = require('js-yaml');
import yaml from 'js-yaml';

export function convertUDPYamlToSDP(folderPath: string): void {
convert(folderPath, folderPath);
Expand Down
1 change: 0 additions & 1 deletion apps/api-extractor/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@
# ---------------------------------------------------------------------------
# DO NOT MODIFY ABOVE THIS LINE! Add any project-specific overrides below.
# ---------------------------------------------------------------------------
!/extends/*.json
2 changes: 1 addition & 1 deletion apps/api-extractor/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",

"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
"mainEntryPointFilePath": "<projectFolder>/lib-dts/index.d.ts",

"apiReport": {
"enabled": true,
Expand Down
25 changes: 23 additions & 2 deletions apps/api-extractor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,29 @@
"directory": "apps/api-extractor"
},
"homepage": "https://api-extractor.com",
"main": "lib/index.js",
"main": "lib-commonjs/index.js",
"module": "lib-esm/index.js",
"typings": "dist/rollup.d.ts",
"exports": {
".": {
"import": "./lib-esm/index.js",
"require": "./lib-commonjs/index.js",
"types": "./dist/rollup.d.ts"
},
"./lib/*": {
"import": "./lib-esm/*.js",
"require": "./lib-commonjs/*.js",
"types": "./lib-dts/*.d.ts"
},
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"lib/*": [
"lib-dts/*"
]
}
},
"bin": {
"api-extractor": "./bin/api-extractor"
},
Expand All @@ -53,7 +74,7 @@
},
"devDependencies": {
"decoupled-local-node-rig": "workspace:*",
"@rushstack/heft": "0.71.2",
"@rushstack/heft": "0.73.1",
"@types/lodash": "4.14.116",
"@types/minimatch": "3.0.5",
"@types/resolve": "1.20.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/api-extractor/src/api/ExtractorConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import * as path from 'path';
import * as resolve from 'resolve';
import lodash = require('lodash');
import lodash from 'lodash';
import {
JsonFile,
JsonSchema,
Expand Down
2 changes: 1 addition & 1 deletion apps/heft/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@

!/includes/**
!UPGRADING.md

lib-*/root-lib/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file accepts comments, so put a file about what the heck this pattern is matching

2 changes: 1 addition & 1 deletion apps/heft/bin/heft
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env node
require('../lib/startWithVersionSelector.js');
require('../lib-commonjs/startWithVersionSelector.js');
2 changes: 1 addition & 1 deletion apps/heft/config/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",

"mainEntryPointFilePath": "<projectFolder>/lib/index.d.ts",
"mainEntryPointFilePath": "<projectFolder>/lib-dts/index.d.ts",
"apiReport": {
"enabled": true,
"reportFolder": "../../../common/reviews/api"
Expand Down
37 changes: 37 additions & 0 deletions apps/heft/config/heft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* Defines configuration used by core Heft.
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json",

/**
* Optionally specifies another JSON config file that this file extends from. This provides a way for standard
* settings to be shared across multiple projects.
*
* To delete an inherited setting, set it to `null` in this file.
*/
"extends": "decoupled-local-node-rig/profiles/default/config/heft.json",

"phasesByName": {
"build": {
"tasksByName": {
"copy-lib-start": {
"taskDependencies": ["transpile"],
"taskPlugin": {
"pluginPackage": "@rushstack/heft",
"pluginName": "copy-files-plugin",
"options": {
"copyOperations": [
{
"sourcePath": "lib-commonjs/root-lib",
"destinationFolders": ["lib"],
"fileExtensions": [".js", ".map"]
Comment on lines +26 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this some back-compat chicanery?

}
]
}
}
}
}
}
}
}
18 changes: 9 additions & 9 deletions apps/heft/heft-plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"taskPlugins": [
{
"pluginName": "copy-files-plugin",
"entryPoint": "./lib/plugins/CopyFilesPlugin",
"optionsSchema": "./lib/schemas/copy-files-options.schema.json"
"entryPoint": "./lib-commonjs/plugins/CopyFilesPlugin",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should really add the .js file extension as well

"optionsSchema": "./lib-commonjs/schemas/copy-files-options.schema.json"
},
{
"pluginName": "delete-files-plugin",
"entryPoint": "./lib/plugins/DeleteFilesPlugin",
"optionsSchema": "./lib/schemas/delete-files-options.schema.json"
"entryPoint": "./lib-commonjs/plugins/DeleteFilesPlugin",
"optionsSchema": "./lib-commonjs/schemas/delete-files-options.schema.json"
},
{
"pluginName": "node-service-plugin",
"entryPoint": "./lib/plugins/NodeServicePlugin",
"entryPoint": "./lib-commonjs/plugins/NodeServicePlugin",
"parameterScope": "node-service",
"parameters": [
{
Expand All @@ -28,13 +28,13 @@
},
{
"pluginName": "run-script-plugin",
"entryPoint": "./lib/plugins/RunScriptPlugin",
"optionsSchema": "./lib/schemas/run-script-options.schema.json"
"entryPoint": "./lib-commonjs/plugins/RunScriptPlugin",
"optionsSchema": "./lib-commonjs/schemas/run-script-options.schema.json"
},
{
"entryPoint": "./lib/plugins/SetEnvironmentVariablesPlugin",
"entryPoint": "./lib-commonjs/plugins/SetEnvironmentVariablesPlugin",
"pluginName": "set-environment-variables-plugin",
"optionsSchema": "./lib/schemas/set-environment-variables-plugin.schema.json"
"optionsSchema": "./lib-commonjs/schemas/set-environment-variables-plugin.schema.json"
}
]
}
27 changes: 24 additions & 3 deletions apps/heft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,29 @@
"node": ">=10.13.0"
},
"homepage": "https://rushstack.io/pages/heft/overview/",
"main": "lib/index.js",
"types": "dist/heft.d.ts",
"main": "lib-commonjs/index.js",
"module": "lib-esm/index.js",
"typings": "dist/heft.d.ts",
"exports": {
".": {
"import": "./lib-esm/index.js",
"require": "./lib-commonjs/index.js",
"types": "./dist/heft.d.ts"
},
"./lib/*": {
"import": "./lib-esm/*.js",
"require": "./lib-commonjs/*.js",
"types": "./lib-dts/*.d.ts"
},
"./package.json": "./package.json"
},
"typesVersions": {
"*": {
"lib/*": [
"lib-dts/*"
]
}
},
"bin": {
"heft": "./bin/heft"
},
Expand All @@ -49,7 +70,7 @@
},
"devDependencies": {
"@microsoft/api-extractor": "workspace:*",
"@rushstack/heft": "0.71.2",
"@rushstack/heft": "0.73.1",
"@types/watchpack": "2.4.0",
"decoupled-local-node-rig": "workspace:*",
"local-eslint-config": "workspace:*"
Expand Down
7 changes: 7 additions & 0 deletions apps/heft/src/root-lib/start.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

// For compatibility globally-installed copies of Heft have the `startWithVersionSelector.js` script that points
// at 'lib/start.js'

require('../lib-commonjs/start');
8 changes: 4 additions & 4 deletions apps/heft/src/startWithVersionSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function tryGetPackageFolderFor(resolvedFileOrFolderPath: string): string | unde
// }

// Is resolvedFileOrFolderPath itself a folder with a package.json file? If so, return it.
if (fs.existsSync(path.join(resolvedFileOrFolderPath, 'package.json'))) {
if (fs.existsSync(`${resolvedFileOrFolderPath}/package.json`)) {
// this._packageFolderCache.set(resolvedFileOrFolderPath, resolvedFileOrFolderPath);
return resolvedFileOrFolderPath;
}
Expand Down Expand Up @@ -69,7 +69,7 @@ function tryStartLocalHeft(): boolean {
if (projectFolder) {
let heftEntryPoint: string;
try {
const packageJsonPath: string = path.join(projectFolder, 'package.json');
const packageJsonPath: string = `${projectFolder}/package.json`;
const packageJsonContent: string = fs.readFileSync(packageJsonPath).toString();
let packageJson: IPackageJson;
try {
Expand All @@ -89,9 +89,9 @@ function tryStartLocalHeft(): boolean {

// To avoid a loading the "resolve" NPM package, let's assume that the Heft dependency must be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both the CJS and the ESM resolvers that Node uses can be invoked externally without npm packages. require.resolve is sufficient here.

// installed as "<projectFolder>/node_modules/@rushstack/heft".
const heftFolder: string = path.join(projectFolder, 'node_modules', Constants.heftPackageName);
const heftFolder: string = `${projectFolder}/node_modules/${Constants.heftPackageName}`;

heftEntryPoint = path.join(heftFolder, 'lib', 'start.js');
heftEntryPoint = `${heftFolder}/lib-commonjs/start.js`;
if (!fs.existsSync(heftEntryPoint)) {
throw new Error('Unable to find Heft entry point: ' + heftEntryPoint);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/rundown/src/launcher.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.

import moduleApi = require('module');
import moduleApi from 'module';
import process from 'process';

import { LauncherAction } from './LauncherTypes'; // "import type" doesn't work with const enums
Expand Down
2 changes: 1 addition & 1 deletion build-tests-subspace/rush-lib-test/src/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ console.log('rush-lib-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 '@microsoft/rush-lib/lib/';
import { RushConfiguration } from '@microsoft/rush-lib/lib/index';

const config: RushConfiguration = RushConfiguration.loadFromDefaultLocation();
console.log(config.commonFolder);
Expand Down
4 changes: 2 additions & 2 deletions build-tests-subspace/rush-sdk-test/config/heft.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"build": {
"tasksByName": {
"run-start": {
"taskDependencies": ["typescript"],
"taskDependencies": ["transpile"],
"taskPlugin": {
"pluginPackage": "@rushstack/heft",
"pluginName": "run-script-plugin",
"options": {
"scriptPath": "./lib/run-start.js"
"scriptPath": "./lib-commonjs/run-start.js"
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions common/config/rush/nonbrowser-approved-packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@
"name": "@rushstack/heft-dev-cert-plugin",
"allowedCategories": [ "libraries", "tests" ]
},
{
"name": "@rushstack/heft-isolated-typescript-transpile-plugin",
"allowedCategories": [ "libraries" ]
},
{
"name": "@rushstack/heft-jest-plugin",
"allowedCategories": [ "libraries", "tests" ]
Expand Down
Loading
Loading