diff --git a/test-packages/release/src/interdep.ts b/test-packages/release/src/interdep.ts index bade2de48..b5e1f06cf 100644 --- a/test-packages/release/src/interdep.ts +++ b/test-packages/release/src/interdep.ts @@ -1,5 +1,5 @@ import glob from 'globby'; -import { resolve } from 'path'; +import { resolve, join } from 'path'; import { readFileSync, readJSONSync } from 'fs-extra'; import yaml from 'js-yaml'; @@ -21,15 +21,15 @@ export function publishedInterPackageDeps(): Map { for (let pattern of (yaml.load(readFileSync(resolve(__dirname, '../../../pnpm-workspace.yaml'), 'utf8')) as any) .packages) { for (let dir of glob.sync(pattern, { cwd: rootDir, expandDirectories: false, onlyDirectories: true })) { - let pkgJSONPath = resolve(rootDir, dir, 'package.json'); - let pkg = readJSONSync(pkgJSONPath); + let absolutePkgJSONPath = resolve(rootDir, dir, 'package.json'); + let pkg = readJSONSync(absolutePkgJSONPath); if (pkg.private) { continue; } pkgJSONS.set(pkg.name, pkg); packages.set(pkg.name, { version: pkg.version, - pkgJSONPath, + pkgJSONPath: join(dir, 'package.json'), isDependencyOf: new Map(), isPeerDependencyOf: new Map(), }); diff --git a/test-packages/release/src/prepare.ts b/test-packages/release/src/prepare.ts index 6b4659054..dab07ab0a 100644 --- a/test-packages/release/src/prepare.ts +++ b/test-packages/release/src/prepare.ts @@ -3,6 +3,7 @@ import { readFileSync, writeFileSync } from 'fs'; import { resolve } from 'path'; import { planVersionBumps, saveSolution, Solution } from './plan'; import { readJSONSync, writeJSONSync } from 'fs-extra'; +import { relativeToAbsolute } from './utils'; const changelogPreamble = `# Embroider Changelog `; @@ -36,9 +37,9 @@ function versionSummary(solution: Solution): string { function updateVersions(solution: Solution) { for (let entry of solution.values()) { if (entry.impact) { - let pkg = readJSONSync(entry.pkgJSONPath); + let pkg = readJSONSync(relativeToAbsolute(entry.pkgJSONPath)); pkg.version = entry.newVersion; - writeJSONSync(entry.pkgJSONPath, pkg, { spaces: 2 }); + writeJSONSync(relativeToAbsolute(entry.pkgJSONPath), pkg, { spaces: 2 }); } } } diff --git a/test-packages/release/src/publish.ts b/test-packages/release/src/publish.ts index 14d7a2f8d..e1439789b 100644 --- a/test-packages/release/src/publish.ts +++ b/test-packages/release/src/publish.ts @@ -1,7 +1,7 @@ import execa from 'execa'; import { loadSolution, Solution } from './plan'; -import { dirname } from 'path'; import { Octokit } from '@octokit/rest'; +import { absoluteDirname } from './utils'; async function hasCleanRepo(): Promise { let result = await execa('git', ['status', '--porcelain=v1'], { cwd: __dirname }); @@ -27,7 +27,7 @@ async function makeTags(solution: Solution, reporter: IssueReporter): Promise