Skip to content

Commit cd3f414

Browse files
committed
Update isolate demo tests to avoid pnpm dependency
1 parent 27114d0 commit cd3f414

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/isolated-demo-test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as core from '@actions/core';
2-
import { findWorkspacePackages } from '@pnpm/workspace.find-packages';
32
import { execSync } from 'child_process';
43
import * as fs from 'fs/promises';
54
import os from 'os';
@@ -53,7 +52,13 @@ const ensureTmpDirExists = async () => {
5352
}
5453
};
5554

56-
const workspacePackages = await findWorkspacePackages(path.resolve('.'));
55+
const workspacePackages = new Map<string, string>();
56+
for (const packageSource of await fs.readdir('packages')) {
57+
const packageJson = JSON.parse(await fs.readFile(path.join(packageSource, 'package.json'), 'utf-8'));#
58+
workspacePackages.set(packageJson.name, packageJson.version);
59+
}
60+
61+
//const workspacePackages = await findWorkspacePackages(path.resolve('.'));
5762

5863
// Function to update dependencies in package.json
5964
const updateDependencies = async (packageJsonPath: string) => {
@@ -62,8 +67,8 @@ const updateDependencies = async (packageJsonPath: string) => {
6267
const updateDeps = async (deps: { [key: string]: string }) => {
6368
for (const dep in deps) {
6469
if (deps[dep].startsWith('workspace:')) {
65-
const matchingPackage = workspacePackages.find((p) => p.manifest.name == dep);
66-
deps[dep] = `^${matchingPackage!.manifest.version!}`;
70+
const version = workspacePackages.get(dep);
71+
deps[dep] = `^${version!}`;
6772
}
6873
}
6974
};

0 commit comments

Comments
 (0)