Skip to content

Commit

Permalink
fix(core): remove duplicate js-yaml packages
Browse files Browse the repository at this point in the history
(cherry picked from commit f1ae1bc)
  • Loading branch information
Phillip9587 authored and FrozenPandaz committed May 21, 2024
1 parent 3bbb244 commit 2eaf79b
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 58 deletions.
2 changes: 1 addition & 1 deletion e2e/utils/create-project-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import * as isCI from 'is-ci';

import { angularCliVersion as defaultAngularCliVersion } from '@nx/workspace/src/utils/versions';
import { dump } from '@zkochan/js-yaml';
import { dump } from 'js-yaml';
import { execSync, ExecSyncOptions } from 'child_process';

import { performance, PerformanceMeasure } from 'perf_hooks';
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"jest-runtime": "^29.4.1",
"jest-util": "^29.4.1",
"js-tokens": "^4.0.0",
"js-yaml": "4.1.0",
"js-yaml": "npm:@zkochan/js-yaml@0.0.7",
"jsonc-eslint-parser": "^2.1.0",
"jsonc-parser": "3.2.0",
"kill-port": "^1.6.1",
Expand Down Expand Up @@ -320,7 +320,6 @@
"@widgetbot/react-embed": "^1.9.0",
"@yarnpkg/lockfile": "^1.1.0",
"@yarnpkg/parsers": "3.0.0-rc.46",
"@zkochan/js-yaml": "0.0.6",
"axios": "^1.6.0",
"classnames": "^2.3.1",
"cliui": "^8.0.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/eslint/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"typescript",
"eslint",
"@angular-devkit/core",
"@typescript-eslint/eslint-plugin"
"@typescript-eslint/eslint-plugin",
"js-yaml" // The rule is failing with alias dependencies see
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"generators": "./generators.json",
"executors": "./executors.json",
"peerDependencies": {
"js-yaml": "4.1.0"
"js-yaml": "npm:@zkochan/js-yaml@0.0.7"
},
"dependencies": {
"@nx/devkit": "file:../devkit",
Expand Down
3 changes: 2 additions & 1 deletion packages/nx/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"events", // This is coming from @storybook/builder-manager since it uses the browser polyfill
"process", // This is coming from @storybook/builder-manager since it uses the browser polyfill
"prettier", // This is coming from @storybook/builder-manager since it uses the browser polyfill
"util" // This is coming from @storybook/builder-manager since it uses the browser polyfill
"util", // This is coming from @storybook/builder-manager since it uses the browser polyfill
"js-yaml" // The rule is failing with alias dependencies
]
}
]
Expand Down
3 changes: 1 addition & 2 deletions packages/nx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"dependencies": {
"@yarnpkg/lockfile": "^1.1.0",
"@yarnpkg/parsers": "3.0.0-rc.46",
"@zkochan/js-yaml": "0.0.6",
"axios": "^1.6.0",
"chalk": "^4.1.0",
"cli-cursor": "3.1.0",
Expand All @@ -49,7 +48,7 @@
"fs-extra": "^11.1.0",
"ignore": "^5.0.4",
"jest-diff": "^29.4.1",
"js-yaml": "4.1.0",
"js-yaml": "npm:@zkochan/js-yaml@0.0.7",
"jsonc-parser": "3.2.0",
"lines-and-columns": "~2.0.3",
"minimatch": "9.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/nx/src/command-line/release/utils/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export async function resolveGithubToken(): Promise<string | null> {
);
if (existsSync(ghCLIPath)) {
const yamlContents = await fsp.readFile(ghCLIPath, 'utf8');
const { load } = require('@zkochan/js-yaml');
const { load } = require('js-yaml');
const ghCLIConfig = load(yamlContents);
if (ghCLIConfig['github.com']) {
// Web based session (the token is already embedded in the config)
Expand Down
6 changes: 3 additions & 3 deletions packages/nx/src/plugins/js/lock-file/utils/pnpm-normalizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function loadPnpmHoistedDepsDefinition() {

if (existsSync(fullPath)) {
const content = readFileSync(fullPath, 'utf-8');
const { load } = require('@zkochan/js-yaml');
const { load } = require('js-yaml');
return load(content)?.hoistedDependencies ?? {};
} else {
throw new Error(`Could not find ".modules.yaml" at "${fullPath}"`);
Expand All @@ -38,7 +38,7 @@ export function loadPnpmHoistedDepsDefinition() {
* https://github.com/pnpm/pnpm/blob/af3e5559d377870d4c3d303429b3ed1a4e64fedc/lockfile/lockfile-file/src/read.ts#L91
*/
export function parseAndNormalizePnpmLockfile(content: string): Lockfile {
const { load } = require('@zkochan/js-yaml');
const { load } = require('js-yaml');
const lockFileData = load(content);
return revertFromInlineSpecifiersFormatIfNecessary(
convertFromLockfileFileMutable(lockFileData)
Expand Down Expand Up @@ -87,7 +87,7 @@ export function stringifyToPnpmYaml(lockfile: Lockfile): string {
const adaptedLockfile = isLockfileV6
? convertToInlineSpecifiersFormat(lockfile)
: lockfile;
const { dump } = require('@zkochan/js-yaml');
const { dump } = require('js-yaml');
return dump(
sortLockfileKeys(
normalizeLockfile(adaptedLockfile as Lockfile, isLockfileV6)
Expand Down
97 changes: 51 additions & 46 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit 2eaf79b

Please sign in to comment.