-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
26 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
import path from 'node:path' | ||
import fs from 'node:fs' | ||
import { runInRepo } from '../utils' | ||
import { RunOptions } from '../types' | ||
|
||
export async function test(options: RunOptions) { | ||
await runInRepo({ | ||
...options, | ||
repo: 'vuejs/ecosystem-ci', | ||
build: async () => { | ||
const dir = path.resolve(options.workspace, 'ecosystem-ci') | ||
const pkgFile = path.join(dir, 'package.json') | ||
const pkg = JSON.parse(await fs.promises.readFile(pkgFile, 'utf-8')) | ||
if (pkg.name !== '@vue/ecosystem-ci') { | ||
throw new Error( | ||
`invalid checkout, expected package.json with "name": "@vue/ecosystem-ci" in ${dir}`, | ||
) | ||
} | ||
pkg.scripts.selftestscript = | ||
"[ -d ../../core/packages/vue/dist ] || (echo 'vue build failed' && exit 1)" | ||
await fs.promises.writeFile( | ||
pkgFile, | ||
JSON.stringify(pkg, null, 2), | ||
'utf-8', | ||
) | ||
}, | ||
test: 'pnpm run selftestscript', | ||
verify: false, | ||
patchFiles: { | ||
'package.json': (content) => { | ||
const pkg = JSON.parse(content) | ||
if (pkg.name !== '@vue/ecosystem-ci') { | ||
throw new Error( | ||
`invalid checkout, expected package.json with "name": "@vue/ecosystem-ci" in ${path.resolve( | ||
options.workspace, | ||
'ecosystem-ci', | ||
)}`, | ||
) | ||
} | ||
pkg.scripts.selftestscript = | ||
"[ -d ../../core/packages/vue/dist ] || (echo 'vue build failed' && exit 1)" | ||
return JSON.stringify(pkg, null, 2) | ||
}, | ||
}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters