Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Revert "Removes the logic updates"
This reverts commit fa65615.
  • Loading branch information
arcanis committed Jun 12, 2023
commit f62c0d85af7ae18af99cfb5c2ef5fc8f82eda9fe
6 changes: 2 additions & 4 deletions packages/yarnpkg-cli/sources/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,10 @@ export async function main({binaryVersion, pluginConfiguration}: {binaryVersion:

async function exec(cli: Cli<CommandContext>): Promise<void> {
// Non-exhaustive known requirements:
// - 18.12 is the first LTS release we support
// - We don't officially support 14.15, but haven't removed the code to support it yet
// https://github.com/yarnpkg/berry/pull/5445#pullrequestreview-1428580851
// - 18.12 is the first LTS release

const version = process.versions.node;
const range = `>=14.15.0`;
const range = `>=18.12.0`;

// YARN_IGNORE_NODE is special because this code needs to execute as early as possible.
// It's not a regular core setting because Configuration.find may use functions not available
Expand Down
5 changes: 2 additions & 3 deletions packages/yarnpkg-fslib/sources/FakeFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ export type WatchFileCallback = (
) => void;

export type StatWatcher = EventEmitter & {
// Node 14+
ref?: () => StatWatcher;
unref?: () => StatWatcher;
ref: () => StatWatcher;
unref: () => StatWatcher;
};

export type ExtractHintOptions = {
Expand Down
2 changes: 1 addition & 1 deletion packages/yarnpkg-pnp/sources/esm-loader/built-loader.js

Large diffs are not rendered by default.

23 changes: 0 additions & 23 deletions packages/yarnpkg-pnp/sources/esm-loader/hooks/getFormat.ts

This file was deleted.

19 changes: 0 additions & 19 deletions packages/yarnpkg-pnp/sources/esm-loader/hooks/getSource.ts

This file was deleted.

11 changes: 3 additions & 8 deletions packages/yarnpkg-pnp/sources/esm-loader/loader.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {getFormat as getFormatHook} from './hooks/getFormat';
import {getSource as getSourceHook} from './hooks/getSource';
import {load as loadHook} from './hooks/load';
import {resolve as resolveHook} from './hooks/resolve';
import {HAS_CONSOLIDATED_HOOKS} from './loaderFlags';
import {load as loadHook} from './hooks/load';
import {resolve as resolveHook} from './hooks/resolve';
import './fspatch';

export const resolve = resolveHook;
export const getFormat = HAS_CONSOLIDATED_HOOKS ? undefined : getFormatHook;
export const getSource = HAS_CONSOLIDATED_HOOKS ? undefined : getSourceHook;
export const load = HAS_CONSOLIDATED_HOOKS ? loadHook : undefined;
export const load = loadHook;
7 changes: 2 additions & 5 deletions packages/yarnpkg-pnp/sources/esm-loader/loaderFlags.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
const [major, minor] = process.versions.node.split(`.`).map(value => parseInt(value, 10));

// The hooks were consolidated in https://github.com/nodejs/node/pull/37468
export const HAS_CONSOLIDATED_HOOKS = major > 16 || (major === 16 && minor >= 12);

// JSON modules were unflagged in https://github.com/nodejs/node/pull/41736
export const HAS_UNFLAGGED_JSON_MODULES = major > 17 || (major === 17 && minor >= 5) || (major === 16 && minor >= 15);
export const HAS_UNFLAGGED_JSON_MODULES = major > 17 || (major === 17 && minor >= 5);

// JSON modules requires import assertions after https://github.com/nodejs/node/pull/40250
export const HAS_JSON_IMPORT_ASSERTION_REQUIREMENT = major > 17 || (major === 17 && minor >= 1) || (major === 16 && minor > 14);
export const HAS_JSON_IMPORT_ASSERTION_REQUIREMENT = major > 17 || (major === 17 && minor >= 1);
Copy link
Member

Choose a reason for hiding this comment

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

Should be able to remove these flags since they'll always be true.


// The message switched to using an array in https://github.com/nodejs/node/pull/45348
export const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || (major === 19 && minor >= 2) || (major === 18 && minor >= 13);
Expand Down