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

feat: update pnpm to v10 #9389

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions e2e/harmony/deps-graph.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs';
import { generateRandomStr } from '@teambit/toolbox.string.random';
import { DEPS_GRAPH } from '@teambit/harmony.modules.feature-toggle';
import { addDistTag } from '@pnpm/registry-mock';
import { type LockfileFileV9 } from '@pnpm/lockfile.types';
import { type LockfileFile } from '@pnpm/lockfile.types';
import path from 'path';
import chai, { expect } from 'chai';
import stripAnsi from 'strip-ansi';
Expand Down Expand Up @@ -157,7 +157,7 @@ chai.use(require('chai-fs'));
});
describe('sign component and use dependency graph to generate a lockfile', () => {
let signOutput: string;
let lockfile: LockfileFileV9;
let lockfile: LockfileFile;
let signRemote;
before(async () => {
helper.command.export();
Expand Down
6,154 changes: 3,039 additions & 3,115 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import path from 'path';
import { DependenciesGraph } from '@teambit/objects';
import { type LockfileFileV9 } from '@pnpm/lockfile.types';
import { type LockfileFile } from '@pnpm/lockfile.types';
import { convertLockfileToGraph, convertGraphToLockfile } from './lockfile-deps-graph-converter';
import { expect } from 'chai';

describe('convertLockfileToGraph simple case', () => {
const lockfile: LockfileFileV9 = {
const lockfile: LockfileFile = {
importers: {
'.': {},
'node_modules/.bit_roots/env': {
Expand Down
16 changes: 8 additions & 8 deletions scopes/dependencies/pnpm/lockfile-deps-graph-converter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'path';
import { type ProjectManifest } from '@pnpm/types';
import { type LockfileFileV9, type InlineSpecifiersResolvedDependencies } from '@pnpm/lockfile.types';
import { type LockfileFile, type LockfileFileProjectResolvedDependencies } from '@pnpm/lockfile.types';
import * as dp from '@pnpm/dependency-path';
import { pick, partition } from 'lodash';
import {
Expand All @@ -15,7 +15,7 @@ import { getLockfileImporterId } from '@pnpm/lockfile.fs';
import normalizePath from 'normalize-path';

function convertLockfileToGraphFromCapsule(
lockfile: LockfileFileV9,
lockfile: LockfileFile,
{
componentRelativeDir,
componentIdByPkgName,
Expand All @@ -34,7 +34,7 @@ function convertLockfileToGraphFromCapsule(
}

function importerDepsToNeighbours(
importerDependencies: InlineSpecifiersResolvedDependencies,
importerDependencies: LockfileFileProjectResolvedDependencies,
lifecycle: 'dev' | 'runtime',
optional: boolean
): DependencyNeighbour[] {
Expand All @@ -47,7 +47,7 @@ function importerDepsToNeighbours(
}

export function convertLockfileToGraph(
lockfile: LockfileFileV9,
lockfile: LockfileFile,
{ pkgName, componentRootDir, componentRelativeDir, componentIdByPkgName }: Omit<CalcDepsGraphOptions, 'rootDir'>
): DependenciesGraph {
if (componentRootDir == null || pkgName == null) {
Expand Down Expand Up @@ -77,7 +77,7 @@ export function convertLockfileToGraph(
}

function _convertLockfileToGraph(
lockfile: LockfileFileV9,
lockfile: LockfileFile,
{
componentIdByPkgName,
directDependencies,
Expand All @@ -94,7 +94,7 @@ function _convertLockfileToGraph(
}

function buildEdges(
lockfile: LockfileFileV9,
lockfile: LockfileFile,
{ directDependencies }: { directDependencies: DependencyNeighbour[] }
): DependencyEdge[] {
const edges: DependencyEdge[] = [];
Expand Down Expand Up @@ -144,7 +144,7 @@ function extractDependenciesFromSnapshot(snapshot: any): DependencyNeighbour[] {
}

function buildPackages(
lockfile: LockfileFileV9,
lockfile: LockfileFile,
{ componentIdByPkgName }: { componentIdByPkgName: ComponentIdByPkgName }
): PackagesMap {
const packages: PackagesMap = new Map();
Expand Down Expand Up @@ -186,7 +186,7 @@ export function convertGraphToLockfile(
graph: DependenciesGraph,
manifests: Record<string, ProjectManifest>,
rootDir: string
): LockfileFileV9 {
): LockfileFile {
const packages = {};
const snapshots = {};
const allEdgeIds = new Set(graph.edges.map(({ id }) => id));
Expand Down
2 changes: 1 addition & 1 deletion scopes/dependencies/pnpm/lynx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ export async function install(
pruneLockfileImporters: true,
lockfileOnly: options.lockfileOnly ?? false,
modulesCacheMaxAge: Infinity, // pnpm should never prune the virtual store. Bit does it on its own.
neverBuiltDependencies: options.neverBuiltDependencies,
neverBuiltDependencies: options.neverBuiltDependencies ?? [],
registries: registriesMap,
resolutionMode: 'highest',
rawConfig: authConfig,
Expand Down
7 changes: 3 additions & 4 deletions scopes/dependencies/pnpm/pnpm.package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { VIRTUAL_STORE_DIR_MAX_LENGTH } from '@teambit/dependencies.pnpm.dep-path';
import { DEPS_GRAPH, isFeatureEnabled } from '@teambit/harmony.modules.feature-toggle';
import { Logger } from '@teambit/logger';
import { type LockfileFileV9 } from '@pnpm/lockfile.types';
import { type LockfileFile } from '@pnpm/lockfile.types';
import fs from 'fs';
import { memoize, omit } from 'lodash';
import { PeerDependencyIssuesByProjects } from '@pnpm/core';
Expand Down Expand Up @@ -85,7 +85,7 @@ export class PnpmPackageManager implements PackageManager {
manifests: Record<string, ProjectManifest>,
rootDir: string
) {
const lockfile: LockfileFileV9 = convertGraphToLockfile(dependenciesGraph, manifests, rootDir);
const lockfile: LockfileFile = convertGraphToLockfile(dependenciesGraph, manifests, rootDir);
Object.assign(lockfile, {
bit: {
restoredFromModel: true,
Expand Down Expand Up @@ -416,8 +416,7 @@ export class PnpmPackageManager implements PackageManager {
},
failOnMissingDependencies: false,
skipped: new Set(),
}),
{ forceSharedFormat: true }
})
);
const graph = convertLockfileToGraph(partialLockfile, opts);
return graph;
Expand Down
4 changes: 2 additions & 2 deletions scopes/scope/objects/models/dependencies-graph.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import semver from 'semver';
import { PackageInfo } from '@pnpm/lockfile.types';
import { LockfilePackageInfo } from '@pnpm/lockfile.types';
import * as dp from '@pnpm/dependency-path';

export type PackagesMap = Map<string, PackageAttributes>;

export type PackageAttributes = PackageInfo & {
export type PackageAttributes = LockfilePackageInfo & {
component?: {
scope: string;
name: string;
Expand Down
63 changes: 29 additions & 34 deletions workspace.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,35 @@
"@mdx-js/react": "1.6.22",
"@monaco-editor/react": "4.4.6",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.4",
"@pnpm/client": "900.0.1",
"@pnpm/client": "1000.0.10",
"@pnpm/colorize-semver-diff": "1.0.1",
"@pnpm/config": "900.0.0",
"@pnpm/core": "900.0.1",
"@pnpm/default-reporter": "900.0.0",
"@pnpm/dependency-path": "900.0.0",
"@pnpm/error": "900.0.0",
"@pnpm/fetch": "900.0.0",
"@pnpm/list": "^900.0.0",
"@pnpm/lockfile.filtering": "^900.0.0",
"@pnpm/lockfile.fs": "^900.0.0",
"@pnpm/lockfile.types": "^900.0.0",
"@pnpm/logger": "900.0.0",
"@pnpm/modules-yaml": "900.0.0",
"@pnpm/network.ca-file": "3.0.0",
"@pnpm/config": "1002.5.2",
"@pnpm/core": "1004.0.3",
"@pnpm/default-reporter": "1001.3.6",
"@pnpm/dependency-path": "1000.0.5",
"@pnpm/error": "1000.0.2",
"@pnpm/fetch": "1000.1.5",
"@pnpm/list": "^1000.0.11",
"@pnpm/lockfile.filtering": "^1001.0.6",
"@pnpm/lockfile.fs": "^1001.1.6",
"@pnpm/lockfile.types": "^1001.0.4",
"@pnpm/logger": "1000.0.0",
"@pnpm/modules-yaml": "1000.1.4",
"@pnpm/network.ca-file": "3.0.2",
"@pnpm/node-fetch": "^1.0.0",
"@pnpm/package-store": "900.0.0",
"@pnpm/parse-overrides": "900.0.0",
"@pnpm/pick-registry-for-package": "900.0.0",
"@pnpm/plugin-commands-publishing": "900.0.1",
"@pnpm/plugin-commands-rebuild": "900.0.1",
"@pnpm/registry-mock": "3.44.0",
"@pnpm/reviewing.dependencies-hierarchy": "^900.0.0",
"@pnpm/package-store": "1000.0.8",
"@pnpm/parse-overrides": "1000.0.2",
"@pnpm/pick-registry-for-package": "1000.0.4",
"@pnpm/plugin-commands-publishing": "1000.1.13",
"@pnpm/plugin-commands-rebuild": "1002.0.4",
"@pnpm/registry-mock": "3.48.0",
"@pnpm/reviewing.dependencies-hierarchy": "^1001.0.8",
"@pnpm/semver-diff": "1.1.0",
"@pnpm/sort-packages": "900.0.0",
"@pnpm/store-connection-manager": "900.0.1",
"@pnpm/types": "900.0.0",
"@pnpm/worker": "900.0.0",
"@pnpm/workspace.pkgs-graph": "900.0.1",
"@pnpm/sort-packages": "1000.0.4",
"@pnpm/store-connection-manager": "1000.0.14",
"@pnpm/types": "1000.2.1",
"@pnpm/worker": "1000.0.8",
"@pnpm/workspace.pkgs-graph": "1000.0.8",
"@react-hook/latest": "1.0.3",
"@svgr/webpack": "8.1.0",
"@teambit/any-fs": "0.0.5",
Expand Down Expand Up @@ -128,8 +128,8 @@
"@teambit/component.ui.component-compare.status-resolver": "^0.0.9",
"@teambit/component.ui.component-compare.utils.group-by-version": "^0.0.8",
"@teambit/component.ui.component-compare.utils.sort-logs": "^0.0.8",
"@teambit/component.ui.component-deprecated": "^0.0.40",
"@teambit/component.ui.component-compare.utils.sort-tabs": "0.0.104",
"@teambit/component.ui.component-deprecated": "^0.0.40",
"@teambit/component.ui.component-meta": "^0.0.367",
"@teambit/component.ui.component-size": "^0.0.77",
"@teambit/component.ui.component-status-resolver": "^0.0.510",
Expand All @@ -153,7 +153,7 @@
"@teambit/defender.ui.test-loader": "^0.0.504",
"@teambit/defender.ui.test-table": "^0.0.510",
"@teambit/dependencies.modules.packages-excluder": "^1.0.8",
"@teambit/dependencies.pnpm.dep-path": "^0.0.2",
"@teambit/dependencies.pnpm.dep-path": "1.0.0",
"@teambit/design.buttons.action-button": "^0.0.3",
"@teambit/design.controls.menu": "^0.0.1",
"@teambit/design.elements.icon": "1.0.5",
Expand Down Expand Up @@ -287,8 +287,8 @@
"@teambit/ui-foundation.ui.tree.tree-node": "0.0.517",
"@teambit/ui-foundation.ui.use-box.bottom-link": "^0.0.119",
"@teambit/ui-foundation.ui.use-box.dropdown": "^0.0.143",
"@teambit/ui-foundation.ui.use-box.scope-menu": "^0.0.147",
"@teambit/ui-foundation.ui.use-box.menu": "^1.0.16",
"@teambit/ui-foundation.ui.use-box.scope-menu": "^0.0.147",
"@teambit/ui-foundation.ui.use-box.tab": "^0.0.122",
"@teambit/workspace.content.variants": "1.95.9",
"@teambit/workspace.content.workspace-overview": "1.95.0",
Expand Down Expand Up @@ -604,7 +604,6 @@
}
},
"linkCoreAspects": false,
// "packageManager": "teambit.fusepm/aspects/fusepm",
"packageManager": "teambit.dependencies/pnpm",
"rootComponents": true,
"overrides": {
Expand All @@ -626,17 +625,13 @@
},
"nodeVersion": "22.14.0",
"engineStrict": true,
// This is a temporary workaround to fix "bit compile" on macOS and Windows.
// "bit compile" breaks node_modules when hard links are used.
"packageImportMethod": "copy",
"packageManagerArgs": [],
"devFilePatterns": [
"**/*.spec.ts"
],
"strictPeerDependencies": true,
"autoInstallPeers": true,
// Setting this to false, to make sure we are not consuming anything that exists only on the bit.dev registry
// "installFromBitDevRegistry": false,
"savePrefix": "",
"extraArgs": [],
"peerDependencyRules": {
Expand Down