Skip to content

Commit 365cf68

Browse files
authored
ci: verify API surface is up to date after build (#1054)
1 parent baba23f commit 365cf68

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
cache: pnpm
3838
- run: pnpm install --frozen-lockfile
3939
- run: pnpm build
40+
- name: Verify API surface is up to date
41+
run: git diff --exit-code '**/api-surface*.md' || (echo "API surface is out of date. Run 'pnpm build' and commit the changes." && exit 1)
4042
- run: pnpm check
4143
test:
4244
runs-on: ${{ matrix.os }}

packages/sv-utils/api-surface.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ declare function addFragment(
639639
content: string,
640640
options?: {
641641
mode?: 'append' | 'prepend';
642+
language?: 'ts' | 'js';
642643
}
643644
): void;
644645
type TransformFn = (content: string) => string;
@@ -748,11 +749,13 @@ type Package = {
748749
keywords?: string[];
749750
workspaces?: string[];
750751
};
752+
751753
declare function fileExists(cwd: string, filePath: string): boolean;
752754

753755
declare function loadFile(cwd: string, filePath: string): string;
754756

755757
declare function saveFile(cwd: string, filePath: string, content: string): void;
758+
756759
declare function loadPackageJson(cwd: string): {
757760
source: string;
758761
data: Package;

packages/sv/api-surface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type FileType = {
2121
condition?: ConditionDefinition;
2222
content: (editor: FileEditor) => string;
2323
};
24-
/** @deprecated use `create({ cwd, ...options })` instead */
24+
/** @deprecated use `create({ cwd, ...options })` instead. */
2525
declare function create(cwd: string, options: Omit<Options, 'cwd'>): void;
2626
declare function create(options: Options): void;
2727
export {

0 commit comments

Comments
 (0)