diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef4c6226e..78635b75c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,8 @@ jobs: cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm build + - name: Verify API surface is up to date + run: git diff --exit-code '**/api-surface*.md' || (echo "API surface is out of date. Run 'pnpm build' and commit the changes." && exit 1) - run: pnpm check test: runs-on: ${{ matrix.os }} diff --git a/packages/sv-utils/api-surface.md b/packages/sv-utils/api-surface.md index 21dfcbb01..f80fad301 100644 --- a/packages/sv-utils/api-surface.md +++ b/packages/sv-utils/api-surface.md @@ -639,6 +639,7 @@ declare function addFragment( content: string, options?: { mode?: 'append' | 'prepend'; + language?: 'ts' | 'js'; } ): void; type TransformFn = (content: string) => string; @@ -748,11 +749,13 @@ type Package = { keywords?: string[]; workspaces?: string[]; }; + declare function fileExists(cwd: string, filePath: string): boolean; declare function loadFile(cwd: string, filePath: string): string; declare function saveFile(cwd: string, filePath: string, content: string): void; + declare function loadPackageJson(cwd: string): { source: string; data: Package; diff --git a/packages/sv/api-surface.md b/packages/sv/api-surface.md index f83add881..a08e7098e 100644 --- a/packages/sv/api-surface.md +++ b/packages/sv/api-surface.md @@ -21,7 +21,7 @@ type FileType = { condition?: ConditionDefinition; content: (editor: FileEditor) => string; }; -/** @deprecated use `create({ cwd, ...options })` instead */ +/** @deprecated use `create({ cwd, ...options })` instead. */ declare function create(cwd: string, options: Omit): void; declare function create(options: Options): void; export {