Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@rushstack/heft-config-file",
"comment": "Fix Node 16 compatibility by using non-built-in structuredClone",
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we want to support Node 16 reliably, Rush needs to re-add CI validation for this environment. As discussed with @D4N14L it is not necessary for the entire Rush Stack monorepo to build with Node 16 (which will encounter a typescript-eslint incompatibility). Instead, we could add a YAML step to the GitHub Action which merely invokes some Rush tests using Node 16 after building using the latest Node.

@sherlockfeng will consider implementing this, after evaluating the importance of Node 16 for his case.

"type": "patch"
}
],
"packageName": "@rushstack/heft-config-file"
}
4 changes: 4 additions & 0 deletions common/config/rush/browser-approved-packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
"name": "@rushstack/rush-vscode-command-webview",
"allowedCategories": [ "vscode-extensions" ]
},
{
"name": "@ungap/structured-clone",
"allowedCategories": [ "libraries" ]
},
{
"name": "axios",
"allowedCategories": [ "libraries" ]
Expand Down
29 changes: 16 additions & 13 deletions common/config/subspaces/build-tests-subspace/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
"pnpmShrinkwrapHash": "d9e805ea30f80e290b5d5ea83856c8b5d7302941",
"pnpmShrinkwrapHash": "e47112c7d099f189f37770e10351e406cf1ec451",
"preferredVersionsHash": "54149ea3f01558a859c96dee2052b797d4defe68",
"packageJsonInjectedDependenciesHash": "949bb6038c34cb0580b82a6f728b26a66fff3177"
"packageJsonInjectedDependenciesHash": "a1277b20787fa46cb118a7352d5ca6a922a1098b"
}
14 changes: 14 additions & 0 deletions common/config/subspaces/default/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion common/config/subspaces/default/repo-state.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
"pnpmShrinkwrapHash": "1cd4f5444a9d6a085d5418372291de283264d9fb",
"pnpmShrinkwrapHash": "cff3c4ef9a27a2377b9fb1f907c5441b3996d5fb",
"preferredVersionsHash": "54149ea3f01558a859c96dee2052b797d4defe68"
}
6 changes: 4 additions & 2 deletions libraries/heft-config-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
"@rushstack/node-core-library": "workspace:*",
"@rushstack/rig-package": "workspace:*",
"@rushstack/terminal": "workspace:*",
"@ungap/structured-clone": "~1.3.0",
"jsonpath-plus": "~10.3.0"
},
"devDependencies": {
"local-eslint-config": "workspace:*",
"@rushstack/heft": "0.71.2",
"decoupled-local-node-rig": "workspace:*"
"@types/ungap__structured-clone": "~1.2.0",
"decoupled-local-node-rig": "workspace:*",
"local-eslint-config": "workspace:*"
}
}
6 changes: 5 additions & 1 deletion libraries/heft-config-file/src/ConfigurationFileBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import * as nodeJsPath from 'path';
import { JSONPath } from 'jsonpath-plus';
import { JsonSchema, JsonFile, Import, FileSystem } from '@rushstack/node-core-library';
import structuredClone from '@ungap/structured-clone';
import type { ITerminal } from '@rushstack/terminal';

interface IConfigurationJson {
Expand Down Expand Up @@ -624,7 +625,10 @@ export abstract class ConfigurationFileBase<TConfigurationFile, TExtraOptions ex
projectFolderPath: string | undefined
): IConfigurationJson & TConfigurationFile {
// Deep copy the configuration file because different callers might contextualize properties differently.
const result: IConfigurationJson & TConfigurationFile = structuredClone(entry.configurationFile);
// TODO: Replace this version of structuredClone with the built-in version once Node 16 support is dropped on the TikTok side
const result: IConfigurationJson & TConfigurationFile = structuredClone<
IConfigurationJson & TConfigurationFile
>(entry.configurationFile);

const { resolvedConfigurationFilePath } = entry;

Expand Down