test-ecosystem-ci
v0.0.3
Published
Run CI across the ecosystem
Readme
ecosystem-ci
Run CI across the ecosystem
Install
npm i -D ecosystem-ciUsage
- Create an
ecosystem-ci.config.tsfile at the root of your project. The config exportsdefineConfigand describes where your package lives, how to replace its dependency inside downstream repositories, and which actions to run in each ecosystem package.
import { defineConfig } from 'ecosystem-ci'
export default defineConfig({
// required: name of the package to test in downstream repositories
name: 'my-package',
// optional: override the default '.' location
packageLocation: './packages/my-package',
// optional: override the default "file:../../packages/my-package" replacement
npmImportReplacement: 'file:../../packages/my-package',
// describe the ecosystem repositories to test against
ecosystem: [
{
name: 'vite',
repository: {
github: {
repo: 'vitejs/vite',
branch: 'main',
},
},
// optional: for pnpm monorepos, force my-package to be used when vite depends on it
pnpmOverrides: {
'vite@*>my-package': 'file:../../packages/my-package',
},
// optional: patch files before running actions
patchFiles: {
'package.json': (content) =>
content.replace('workspace:*', 'file:../../packages/my-package'),
},
// actions to run in the cloned repository
actions: [
'pnpm install --no-frozen-lockfile',
'pnpm run build',
// you can also use a functions instead of string commands
() => {},
'pnpm run test-unit',
],
},
],
})- Run the CLI in the same directory to clone and test your ecosystem:
npx ecosystem-ci