EXTEND_EXAMPLE
constEXTEND_EXAMPLE: “import type { ProviderContext, RunnerProvider } from ‘@sksizer/detect-runners’\n\nexport const acmeProvider: RunnerProvider = {\n id: ‘acme’,\n kind: ‘parse’,\n binary: ‘acme’,\n chain: [{ label: ‘task’, hint: ‘the acme task to run’ }],\n\n async collect(ctx: ProviderContext) {\n // Discovery goes through ctx, never through node:fs.\n const [marker] = await ctx.files(‘acme.json’)\n if (marker === undefined || !(await ctx.exists(marker))) {\n // Not an error, and not a separate lifecycle phase. Bail cheaply.\n return { status: ‘absent’, tasks: [], diagnostics: [] }\n }\n\n return {\n status: ‘ok’,\n aspect: { id: ‘acme’, evidence: [{ kind: ‘files’, detail: marker }] },\n tasks: [\n {\n id: ‘acme:build’,\n runner: ‘acme’,\n path: [‘acme’, ‘build’],\n argv: [‘acme’, ‘run’, ‘build’],\n cwd: ’.’,\n display: ‘acme run build’,\n parameters: [],\n source: marker,\n origin: ‘declared’,\n tags: [],\n persistent: { value: false, declared: false },\n executes: ‘local’,\n },\n ],\n diagnostics: [],\n }\n },\n}\n”
The provider example, as a string.
It is kept in TWO places on purpose. tests/guide-example.ts holds the same
code as a real module, inside the package tsconfig.json, so the root
tsc --noEmit typechecks it for real; tests/guide.test.ts then asserts the
two are identical. An example that only ever exists inside a string is an
example nothing proves still compiles.
The ONLY permitted difference is the import line: a consumer writes the package name, and the in-repo copy cannot — the package does not self-link under its own name.