-
-
Notifications
You must be signed in to change notification settings - Fork 3
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 2 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,4 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/ai-commit-msg` | ||
| */ | ||
| /* 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` | ||
| */ | ||
| /* no exports */ions | ||
| export async function run() {} | ||
| // #endregion | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| 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,4 +1,5 @@ | ||
| 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" }, | ||
|
|
@@ -7,6 +8,7 @@ export default defineConfig({ | |
| exports: true, | ||
| external: ["virtual:iconify-svgmap"], | ||
| format: ["esm", "cjs"], | ||
| plugins: [ApiSnapshot()], | ||
| publint: true, | ||
| target: "esnext", | ||
| tsconfig: "tsconfig.json", | ||
|
|
||
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,13 @@ | ||
| import { defineConfig } from "tsdown"; | ||
| import ApiSnapshot from "tsnapi/rolldown"; | ||
|
|
||
| export default defineConfig({ | ||
| attw: true, | ||
| dts: true, | ||
| entry: ["src/index.ts"], | ||
| exports: true, | ||
| format: ["esm", "cjs"], | ||
| plugins: [ApiSnapshot()], | ||
|
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. The |
||
| publint: true, | ||
| target: "esnext", | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/eslint-config` | ||
| */ | ||
| // #region Types | ||
| export type BuilderOptions = Partial<{ | ||
| autoEnable: boolean; | ||
| overrides: Array<Config>; | ||
| overrides_prepend: Array<Config>; | ||
| }>; | ||
| export type CommonOptions = Partial<{}>; | ||
| export type ConfigDependency = keyof (typeof __json_default_export)["devDependencies"]; | ||
| export type ConfigOptions = Partial<{ [K in keyof typeof index_d_exports]: boolean | Parameters<(typeof index_d_exports)[K]>[0] }>; | ||
| export type Preset = keyof typeof presets_d_exports; | ||
| export type StephansamaConfig = keyof typeof index_d_exports; | ||
| // #endregion | ||
|
|
||
| // #region Functions | ||
| export declare function config(_: Options): Promise<Config[]>; | ||
| // #endregion | ||
|
|
||
| // #region Other | ||
| export { index_d_exports as configs } | ||
| export { glob_d_exports as globs } | ||
| export { presets_d_exports as presets } | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/eslint-config` | ||
| */ | ||
| // #region Functions | ||
| export async function config(_) {} | ||
| // #endregion | ||
|
|
||
| // #region Variables | ||
| export var configs | ||
| export var globs | ||
| export var presets | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/multipublish` | ||
| */ | ||
| /* no exports */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/multipublish` | ||
| */ | ||
| /* no exports */ions | ||
| export async function run() {} | ||
| // #endregion | ||
|
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. Similar to another snapshot file in this PR, this generated file appears to have some issues:
This indicates a recurring issue with the snapshot generation. It's important to have correct and clean API snapshots. Could you please look into the
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/typed-env` | ||
| */ | ||
| // #region Functions | ||
| export declare function createEnvironment<Schema extends StandardSchemaV1>(_: Schema, _?: dotenvx.DotenvConfigOptions | true): { | ||
| generateExample(_: string): Promise<void>; | ||
| loadEnv: (_?: dotenvx.DotenvConfigOptions) => dotenvx.DotenvConfigOutput; | ||
| schema: Schema; | ||
| validate({ | ||
| env: environment | ||
| }?: { | ||
| env?: Record<string, string | undefined>; | ||
| }): Promise<StandardSchemaV1.InferOutput<Schema>>; | ||
| }; | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/typed-env` | ||
| */ | ||
| // #region Functions | ||
| export function createEnvironment(_, _) {} | ||
| // #endregion |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,13 @@ | ||
| import { defineConfig } from "tsdown"; | ||
| import ApiSnapshot from "tsnapi/rolldown"; | ||
|
|
||
| export default defineConfig({ | ||
| attw: true, | ||
| dts: true, | ||
| entry: ["src/index.ts"], | ||
| exports: true, | ||
| format: ["esm", "cjs"], | ||
| plugins: [ApiSnapshot()], | ||
| publint: true, | ||
| target: "esnext", | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/typed-events/errors` | ||
| */ | ||
| // #region Classes | ||
| export declare class TypedBroadcastChannelError extends ValidatorError { | ||
| constructor(_: string, _: readonly StandardSchemaV1.Issue[]); | ||
| } | ||
| export declare class TypedBroadcastEventError extends ValidatorError { | ||
| constructor(_: string, _: readonly StandardSchemaV1.Issue[]); | ||
| } | ||
| export declare class TypedEventError extends ValidatorError { | ||
| constructor(_: string, _: readonly StandardSchemaV1.Issue[]); | ||
| } | ||
| export declare class TypedMessageError extends ValidatorError { | ||
| constructor(_: string, _: readonly StandardSchemaV1.Issue[]); | ||
| } | ||
|
Comment on lines
+5
to
+16
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
# Find ValidatorError definition in the typed-events package
ast-grep --pattern 'class ValidatorError $$$'
# Alternative: search for ValidatorError export
rg -t ts "export.*class ValidatorError" core/typed-events/Repository: stephansama/packages Length of output: 145 🏁 Script executed: cat -n core/typed-events/__snapshots__/tsnapi/errors.snapshot.d.ts | head -30Repository: stephansama/packages Length of output: 840 🏁 Script executed: # Find the source file that might generate this snapshot
find core/typed-events -name "*.ts" -not -path "*/node_modules/*" -not -path "*/__snapshots__/*" | xargs rg -l "TypedBroadcastChannelError|TypedBroadcastEventError|TypedEventError|TypedMessageError" | head -10Repository: stephansama/packages Length of output: 236 🏁 Script executed: # Check if StandardSchemaV1 is imported or defined anywhere in the typed-events package
rg -t ts "StandardSchemaV1" core/typed-events/src/ --max-count 20Repository: stephansama/packages Length of output: 3866 🏁 Script executed: cat -n core/typed-events/src/errors.tsRepository: stephansama/packages Length of output: 302 🏁 Script executed: # Also check what tsnapi configuration or export pattern exists
find core/typed-events -name "tsconfig.json" -o -name "tsnapi.config.*" | head -5Repository: stephansama/packages Length of output: 96 🏁 Script executed: # Check if ValidatorError is exported from the main index file
fd -t f "index.ts" core/typed-events/src/ -exec cat -n {} \;Repository: stephansama/packages Length of output: 295 🏁 Script executed: # Check the main package.json to see what the exports point to
cat -n core/typed-events/package.json | grep -A 10 '"exports"'Repository: stephansama/packages Length of output: 398 🏁 Script executed: # Verify what the snapshot file is testing - check if there's an errors export in package.json exports
cat -n core/typed-events/package.jsonRepository: stephansama/packages Length of output: 2638 🏁 Script executed: # Check if ValidatorError is exported from the main index.ts file
cat core/typed-events/src/index.tsRepository: stephansama/packages Length of output: 336 🏁 Script executed: # Check what the actual compiled/exported types include - look at how ValidatorError is made available
rg -t ts "export.*ValidatorError" core/typed-events/src/ -A 2Repository: stephansama/packages Length of output: 1909 🏁 Script executed: # Search for tsnapi configuration
find core/typed-events -type f -name "*tsnapi*" -o -name "*.config.*" | xargs ls -la 2>/dev/null | head -20Repository: stephansama/packages Length of output: 230 🏁 Script executed: # Check utils/index.ts to confirm what's exported
cat core/typed-events/src/utils/index.tsRepository: stephansama/packages Length of output: 200 🏁 Script executed: # Verify if ValidatorError should be in the public API
rg -t ts "ValidatorError" core/typed-events/src/ --max-count 30 | grep -E "(export|import)" | head -20Repository: stephansama/packages Length of output: 1182 🏁 Script executed: # Check what the `@/utils` export includes by looking at the utils barrel export chain
cat core/typed-events/src/utils/types.ts | head -50Repository: stephansama/packages Length of output: 1394 🏁 Script executed: # Check if there are other snapshot files to see the pattern for imports
find core/typed-events/__snapshots__ -type f -name "*.snapshot.d.ts" | head -3 | xargs head -20Repository: stephansama/packages Length of output: 3032 The snapshot file is auto-generated and accurately reflects the public API. The issue is in the source code, not the snapshot. The 🤖 Prompt for AI Agents |
||
| // #endregion | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /** | ||
| * Generated by tsnapi — public API snapshot of `@stephansama/typed-events/errors` | ||
| */ | ||
| // #region Classes | ||
| export class TypedBroadcastChannelError extends ValidatorError { | ||
| constructor(_, _) {} | ||
| } | ||
| export class TypedBroadcastEventError extends ValidatorError { | ||
| constructor(_, _) {} | ||
| } | ||
| export class TypedEventError extends ValidatorError { | ||
| constructor(_, _) {} | ||
| } | ||
| export class TypedMessageError extends ValidatorError { | ||
| constructor(_, _) {} | ||
| } | ||
|
Comment on lines
+5
to
+16
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
# Find where ValidatorError is exported
rg -t ts -t js "export.*ValidatorError" core/typed-events/src/
# Check if there's a base errors module
fd -e ts -e js 'error' core/typed-events/src/
# Try to parse the snapshot to see if it's syntactically valid
node -e "import('./core/typed-events/__snapshots__/tsnapi/errors.snapshot.js').catch(e => console.log('Error:', e.message))"Repository: stephansama/packages Length of output: 823 🏁 Script executed: cat -n core/typed-events/__snapshots__/tsnapi/errors.snapshot.jsRepository: stephansama/packages Length of output: 644 🏁 Script executed: # Check the actual source file definitions
cat -n core/typed-events/src/errors.ts
# Check the source error classes
head -30 core/typed-events/src/message.ts
head -30 core/typed-events/src/event.tsRepository: stephansama/packages Length of output: 1960 🏁 Script executed: # Check if ValidatorError import is at the top of the snapshot file
head -20 core/typed-events/__snapshots__/tsnapi/errors.snapshot.jsRepository: stephansama/packages Length of output: 525 Fix missing import and syntax error in auto-generated snapshot. This auto-generated snapshot file cannot be loaded due to two issues:
Add the missing import and ensure the snapshot is correctly regenerated to match the source class definitions. 🤖 Prompt for AI Agents |
||
| // #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.
This generated snapshot appears to have a couple of issues:
ionsstring on line 4, which seems to be a generation artifact.runfunction, but the corresponding type definition snapshot (index.snapshot.d.ts) indicates there are no exports.This discrepancy and artifact suggest a potential issue in the
tsnapigeneration process for this package. Please investigate and fix the snapshot generation to ensure the API surface is correctly and cleanly represented.