-
-
Notifications
You must be signed in to change notification settings - Fork 1
Stephansama/ste 179 use tsnapi to create api snapshots #272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
34ebd12
7324c35
766fd37
6f27c50
1134546
21ad3b1
544b713
021873f
35b05a5
f97e768
ff7d2d1
ab5a9df
94938f8
c9a5888
997dd5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| "@stephansama/catppuccin-jsonresume-theme": patch | ||
| "@stephansama/prettier-plugin-handlebars": patch | ||
| "@stephansama/find-makefile-targets": patch | ||
| "@stephansama/astro-iconify-svgmap": patch | ||
| "@stephansama/remark-asciinema": patch | ||
| "@stephansama/typed-nocodb-api": patch | ||
| "@stephansama/typed-templates": patch | ||
| "@stephansama/ai-commit-msg": patch | ||
| "@stephansama/eslint-config": patch | ||
| "@stephansama/multipublish": patch | ||
| "@stephansama/typed-events": patch | ||
| "@stephansama/auto-readme": patch | ||
| "@stephansama/single-file": patch | ||
| "@stephansama/types-lhci": patch | ||
| "@stephansama/typed-env": patch | ||
| "create-stephansama-example": patch | ||
| --- | ||
|
|
||
| added tsnapi snapshots to preserve api state |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| !patches/* | ||
| **/tests/fixtures/** | ||
| __snapshots__ | ||
| core/catppuccin-xsl/templates/**/*.hbs | ||
| pnpm-lock.yaml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/ai-commit-msg/cli` | ||
| */ | ||
| /* no exports */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/ai-commit-msg/cli` | ||
| */ | ||
| /* no exports */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/ai-commit-msg` | ||
| */ | ||
| // #region Functions | ||
| export declare function run(): Promise<void>; | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/ai-commit-msg` | ||
| */ | ||
| // #region Functions | ||
| export async function run() {} | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/ai-commit-msg/schema.json` | ||
| */ | ||
| /* no exports */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/ai-commit-msg/schema.json` | ||
| */ | ||
| /* no exports */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/ai-commit-msg/schema` | ||
| */ | ||
| // #region Types | ||
| export type Config = Partial<z.infer<typeof configSchema>>; | ||
| export type Model = (typeof models)[number]; | ||
| export type Provider = (typeof providers)[number]; | ||
| // #endregion | ||
|
|
||
| // #region Variables | ||
| export declare const configSchema: z.ZodObject<{ | ||
| baseURL: z.ZodOptional<z.ZodString>; | ||
| headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; | ||
| model: z.ZodString; | ||
| prompt: z.ZodDefault<z.ZodString>; | ||
| provider: z.ZodEnum<{ | ||
| google: "google"; | ||
| openai: "openai"; | ||
| ollama: "ollama"; | ||
| }>; | ||
| skipNextRun: z.ZodOptional<z.ZodBoolean>; | ||
| useConventionalCommits: z.ZodDefault<z.ZodBoolean>; | ||
| verbose: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>; | ||
| }, z.core.$strip>; | ||
| export declare const defaultPrompt: string; | ||
| export declare const environmentSchema: { | ||
| google: z.ZodObject<{ | ||
| GOOGLE_GENERATIVE_AI_API_KEY: z.ZodString; | ||
| }, z.core.$strip>; | ||
| ollama: z.ZodObject<{}, z.core.$strip>; | ||
| openai: z.ZodObject<{ | ||
| OPENAI_API_KEY: z.ZodString; | ||
| }, z.core.$strip>; | ||
| }; | ||
| export declare const models: readonly ["gemini-2.5-flash"]; | ||
| export declare const providers: readonly ["google", "openai", "ollama"]; | ||
| export declare const providerSchema: z.ZodEnum<{ | ||
| google: "google"; | ||
| openai: "openai"; | ||
| ollama: "ollama"; | ||
| }>; | ||
| // #endregion | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/ai-commit-msg/schema` | ||
| */ | ||
| // #region Variables | ||
| export var configSchema /* const */ | ||
| export var defaultPrompt /* const */ | ||
| export var environmentSchema /* const */ | ||
| export var models /* const */ | ||
| export var providers /* const */ | ||
| export var providerSchema /* const */ | ||
| // #endregion |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,20 +20,18 @@ | |
| "sideEffects": false, | ||
| "type": "module", | ||
| "exports": { | ||
| ".": { | ||
| "import": "./config/schema.mjs", | ||
| "require": "./config/schema.cjs" | ||
| }, | ||
| ".": "./dist/index.mjs", | ||
| "./cli": "./dist/cli.mjs", | ||
| "./package.json": "./package.json", | ||
| "./schema": "./dist/schema.mjs", | ||
| "./schema.json": "./config/schema.json" | ||
| }, | ||
| "main": "./config/schema.cjs", | ||
| "module": "./config/schema.mjs", | ||
| "types": "./config/schema.d.cts", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type declaration extension mismatch with ESM-only build. The 🔧 Suggested fix- "types": "./config/schema.d.cts",
+ "types": "./config/schema.d.mts",Ensure the build output generates 🤖 Prompt for AI Agents |
||
| "bin": "./cli.mjs", | ||
| "bin": { | ||
| "ai-commit-msg": "./dist/cli.mjs" | ||
| }, | ||
| "files": [ | ||
| "./dist", | ||
| "./config" | ||
| "./dist" | ||
| ], | ||
| "scripts": { | ||
| "build": "tsdown", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| import { run } from "./index"; | ||
|
|
||
| await run(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,45 +1,40 @@ | ||
| import * as fs from "node:fs"; | ||
| import path from "node:path"; | ||
| import { defineConfig } from "tsdown"; | ||
| import ApiSnapshot from "tsnapi/rolldown"; | ||
| import * as z from "zod"; | ||
|
|
||
| export default defineConfig([ | ||
| { | ||
| attw: true, | ||
| dts: false, | ||
| entry: "./src/index.ts", | ||
| format: ["esm", "cjs"], | ||
| skipNodeModulesBundle: true, | ||
| target: "esnext", | ||
| export default defineConfig({ | ||
| attw: { excludeEntrypoints: ["schema.json"], profile: "esm-only" }, | ||
| deps: { skipNodeModulesBundle: true }, | ||
| dts: true, | ||
| entry: { | ||
| cli: "./src/cli.ts", | ||
| index: "./src/index.ts", | ||
| schema: "./src/schema.ts", | ||
| }, | ||
| { | ||
| attw: true, | ||
| dts: true, | ||
| entry: "./src/schema.ts", | ||
| exports: { | ||
| customExports(exports) { | ||
| exports["./schema.json"] = "./config/schema.json"; | ||
| return exports; | ||
| }, | ||
| enabled: true, | ||
| }, | ||
| format: ["esm", "cjs"], | ||
| hooks: { | ||
| async "build:done"() { | ||
| const { configSchema } = await import("./config/schema.mjs"); | ||
|
|
||
| const jsonSchema = z.toJSONSchema(configSchema); | ||
| exports: { | ||
| bin: "./src/cli.ts", | ||
| customExports(exports) { | ||
| exports["./schema.json"] = "./config/schema.json"; | ||
|
|
||
| const jsonString = JSON.stringify(jsonSchema); | ||
| return Object.fromEntries( | ||
| Object.entries(exports).toSorted(([a], [b]) => a.localeCompare(b)), | ||
| ); | ||
| }, | ||
| enabled: true, | ||
| }, | ||
|
|
||
| await fs.promises.writeFile( | ||
| path.join("./config/", "schema.json"), | ||
| jsonString, | ||
| ); | ||
| }, | ||
| hooks: { | ||
| async "build:done"() { | ||
| const { configSchema } = await import("./dist/schema.mjs"); | ||
| const jsonSchema = z.toJSONSchema(configSchema); | ||
| const jsonString = JSON.stringify(jsonSchema); | ||
| const jsonPath = path.join("./dist/", "schema.json"); | ||
| await fs.promises.writeFile(jsonPath, jsonString); | ||
| }, | ||
| outDir: "config", | ||
| skipNodeModulesBundle: true, | ||
| target: "esnext", | ||
| }, | ||
| ]); | ||
| plugins: [ApiSnapshot()], | ||
| target: "esnext", | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/astro-iconify-svgmap/cli` | ||
| */ | ||
| /* no exports */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/astro-iconify-svgmap/cli` | ||
| */ | ||
| /* no exports */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/astro-iconify-svgmap/get` | ||
| */ | ||
| // #region Functions | ||
| export declare function getIcon(_: string, _: string): Promise<string>; | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/astro-iconify-svgmap/get` | ||
| */ | ||
| // #region Functions | ||
| export async function getIcon(_, _) {} | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/astro-iconify-svgmap` | ||
| */ | ||
| // #region Functions | ||
| export declare function createIntegration(_?: Options): AstroIntegration; | ||
| // #endregion | ||
|
|
||
| // #region Default Export | ||
| declare function _default(_?: Options): Plugin; | ||
| export default _default | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/astro-iconify-svgmap` | ||
| */ | ||
| // #region Functions | ||
| export function createIntegration(_) {} | ||
| // #endregion | ||
|
|
||
| // #region Default Export | ||
| function _default(_) {} | ||
| export default _default | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,14 @@ | ||
| import { defineConfig } from "tsdown"; | ||
| import ApiSnapshot from "tsnapi/rolldown"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify tsnapi is declared somewhere in the workspace for this package
echo "=== Searching for tsnapi declarations ==="
fd -t f 'package.json' --exec rg -l '"tsnapi"' {} \;
echo ""
echo "=== pnpm-workspace catalog entries (if any) ==="
fd -t f 'pnpm-workspace.yaml' --exec cat {} \;
echo ""
echo "=== Direct usages of tsnapi across repo ==="
rg -nP '\btsnapi(/|"|\b)' -g '!**/dist/**' -g '!**/__snapshots__/**'Repository: stephansama/packages Length of output: 7136 🏁 Script executed: cat -n core/astro-iconify-svgmap/package.json | sed -n '40,60p'Repository: stephansama/packages Length of output: 694 Add The file imports Add 🤖 Prompt for AI Agents |
||
|
|
||
| export default defineConfig({ | ||
| attw: { profile: "node16" }, | ||
| attw: { profile: "esm-only" }, | ||
| dts: true, | ||
| entry: ["src/cli.ts", "src/index.ts", "src/get.ts"], | ||
| exports: true, | ||
| external: ["virtual:iconify-svgmap"], | ||
| format: ["esm", "cjs"], | ||
| format: ["esm"], | ||
| plugins: [ApiSnapshot()], | ||
| publint: true, | ||
| target: "esnext", | ||
| tsconfig: "tsconfig.json", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/auto-readme/cli` | ||
| */ | ||
| /* no exports */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/auto-readme/cli` | ||
| */ | ||
| /* no exports */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/auto-readme` | ||
| */ | ||
| // #region Functions | ||
| export declare function run(): Promise<void>; | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/auto-readme` | ||
| */ | ||
| // #region Functions | ||
| export async function run() {} | ||
| // #endregion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial | 💤 Low value
🧩 Analysis chain
🏁 Script executed:
Repository: stephansama/packages
Length of output: 2470
🏁 Script executed:
Repository: stephansama/packages
Length of output: 1820
🏁 Script executed:
Repository: stephansama/packages
Length of output: 1093
🏁 Script executed:
Repository: stephansama/packages
Length of output: 380
🏁 Script executed:
# Check git history for recent changes to models definition git log --oneline -n 20 -- core/ai-commit-msg/src/schema.tsRepository: stephansama/packages
Length of output: 162
🏁 Script executed:
rg "models" core/ai-commit-msg/src/ -n --type=tsRepository: stephansama/packages
Length of output: 232
🏁 Script executed:
Repository: stephansama/packages
Length of output: 46
The snapshot correctly reflects the source code, but the underlying source definition is incomplete.
The
modelsconstant incore/ai-commit-msg/src/schema.tsis hardcoded to["gemini-2.5-flash"], but this constant is unused in the codebase (no imports found) and inconsistent with the default config, which uses"llama2"with the"ollama"provider. TheconfigSchemaalso accepts any arbitrary string for the model field, making the hardcoded constant list ineffective. Either the constant should be removed if unused, or it should be updated to reflect all supported models across the three providers (google, openai, ollama).🤖 Prompt for AI Agents