diff --git a/examples/workflow-test/configs/utils.ts b/examples/workflow-test/configs/utils.ts index 8f05d01..62cad5a 100644 --- a/examples/workflow-test/configs/utils.ts +++ b/examples/workflow-test/configs/utils.ts @@ -45,16 +45,6 @@ export function getRepoPath(repoName: string): string { return path.resolve(getRepoDir(), repoName); } -// TEMPORARY: remove once all GLSP repos are migrated to pnpm. -// During the migration a cloned integration repo may still be yarn-based. The package manager -// determines how a binary is launched in a sub-package: pnpm's script shorthand only runs -// package.json scripts, so the `theia` binary must be invoked via `pnpm exec`, whereas yarn classic -// runs binaries directly and has no `exec` command. Detect the lockfile so callers can adapt. -// Mirrors the yarn.lock-based detection in scripts/setup.ts. -export function isYarnRepo(repoName: string): boolean { - return existsSync(path.resolve(getRepoPath(repoName), 'yarn.lock')); -} - export function getPort(envVar: string): number { const val = process.env[envVar]; if (val) { diff --git a/examples/workflow-test/configs/webserver.config.ts b/examples/workflow-test/configs/webserver.config.ts index 97d85a6..142c6c8 100644 --- a/examples/workflow-test/configs/webserver.config.ts +++ b/examples/workflow-test/configs/webserver.config.ts @@ -15,7 +15,7 @@ ********************************************************************************/ import { PlaywrightTestConfig } from '@playwright/test'; -import { ProjectName, getBrowserServerBundlePath, getPort, getRepoDir, isYarnRepo, needsGlspServer } from './utils'; +import { ProjectName, getBrowserServerBundlePath, getPort, getRepoDir, needsGlspServer } from './utils'; type WebServerConfig = Extract, unknown[]>[number]; @@ -41,7 +41,6 @@ export function buildWebServers(activeProjects: ProjectName[]): PlaywrightTestCo const standaloneBrowserPort = getPort('STANDALONE_BROWSER_PORT'); const theiaPort = getPort('THEIA_PORT'); const browserServerBundle = getBrowserServerBundlePath(); - const theiaBin = isYarnRepo('glsp-theia-integration') ? 'theia' : 'exec theia'; const configs: Partial> = { standalone: { command: `${repo} client start --external-server --no-open`, @@ -56,12 +55,7 @@ export function buildWebServers(activeProjects: ProjectName[]): PlaywrightTestCo path: '/diagram.html' }, theia: { - // TEMPORARY: drop the `isYarnRepo` branch once glsp-theia-integration is migrated to pnpm. - // The command resolves to ` browser theia start ...` in the cloned repo. Under - // pnpm the `theia` binary must be launched via `pnpm exec` (the script shorthand only runs - // package.json scripts, else it fails with ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL); yarn classic - // runs binaries directly and has no `exec` command. - command: `${repo} theia run browser ${theiaBin} start --WF_GLSP=${glspServerPort} --WF_PATH=workflow --glspDebug`, + command: `${repo} theia run browser exec theia start --WF_GLSP=${glspServerPort} --WF_PATH=workflow --glspDebug`, port: theiaPort } }; diff --git a/examples/workflow-test/scripts/setup.ts b/examples/workflow-test/scripts/setup.ts index 650df18..d63b678 100644 --- a/examples/workflow-test/scripts/setup.ts +++ b/examples/workflow-test/scripts/setup.ts @@ -14,7 +14,7 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ import { execSync } from 'child_process'; -import { copyFileSync, existsSync, readFileSync, writeFileSync } from 'fs'; +import { copyFileSync, readFileSync, writeFileSync } from 'fs'; import { resolve } from 'path'; const args = process.argv.slice(2); @@ -56,36 +56,6 @@ if (vscode || all) { run(`${repo} clone ${repos.join(' ')}`); -if (repos.includes('glsp-vscode-integration')) { - // The glsp-vscode-integration repo is a lerna monorepo that gets cloned into the `.repositories` - // directory of this (also lerna-based) repo. Without an `nx.json` marking the repo root, lerna - // walks up the directory tree, detects the nesting and fails. Adding an empty `nx.json` tells - // lerna to stop the lookup at the repo root. - const nxJson = resolve(rootDir, '.repositories', 'glsp-vscode-integration', 'nx.json'); - console.log(`Adding ${nxJson}`); - writeFileSync(nxJson, '{}'); -} - -// TEMPORARY: remove once all GLSP repos are migrated to pnpm. -// Yarn classic (1.x) walks up the directory tree looking for a `packageManager` field. Since this -// repo's root package.json declares `pnpm@`, a `yarn install` inside a cloned (yarn-based) -// repo under `.repositories` would find that pnpm pin, misparse it as `yarn@pnpm@`, and -// abort. Pin each cloned yarn repo to the local yarn version so the lookup stops at the repo itself. -const yarnVersion = execSync('yarn --version', { cwd: rootDir }).toString().trim(); -for (const cloned of repos) { - const repoDir = resolve(rootDir, '.repositories', cloned); - const pkgPath = resolve(repoDir, 'package.json'); - if (!existsSync(resolve(repoDir, 'yarn.lock')) || !existsSync(pkgPath)) { - continue; - } - const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8')); - if (!pkg.packageManager) { - pkg.packageManager = `yarn@${yarnVersion}`; - writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`); - console.log(`Pinned ${cloned} packageManager to yarn@${yarnVersion}`); - } -} - if (!skipBuild) { run(`${repo} build`); if (repos.includes('glsp-vscode-integration')) {