@voxgig/sdkgen 4.44.0 → 4.44.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/voxgig-sdkgen +1 -1
- package/dist/cmp/PublishWorkflow.js +1 -1
- package/dist/cmp/PublishWorkflow.js.map +1 -1
- package/dist/cmp/ReadmeTop.js +1 -1
- package/dist/cmp/ReadmeTop.js.map +1 -1
- package/dist/helpers/packageMeta.d.ts +2 -1
- package/dist/helpers/packageMeta.js +12 -0
- package/dist/helpers/packageMeta.js.map +1 -1
- package/dist/sdkgen.d.ts +2 -2
- package/dist/sdkgen.js +3 -2
- package/dist/sdkgen.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/project/.sdk/src/cmp/go-cli/Main_go-cli.ts +3 -3
- package/project/.sdk/src/cmp/go-mcp/Main_go-mcp.ts +3 -3
- package/project/sdkgen-package.json +1 -1
- package/src/cmp/PublishWorkflow.ts +2 -2
- package/src/cmp/ReadmeTop.ts +2 -1
- package/src/helpers/packageMeta.ts +15 -0
- package/src/sdkgen.ts +2 -0
|
@@ -116,7 +116,7 @@ const Main = cmp(function Main(props: any) {
|
|
|
116
116
|
ex.push(`./${bin} --help`)
|
|
117
117
|
ex.push('')
|
|
118
118
|
ex.push('# 3. Provide credentials once, via the environment')
|
|
119
|
-
ex.push(`export ${apiKeyEnv}=
|
|
119
|
+
ex.push(`export ${apiKeyEnv}=apikey_xxx`)
|
|
120
120
|
ex.push('')
|
|
121
121
|
ex.push('# 4. Each command line is ONE boru expression, run against the API:')
|
|
122
122
|
if (firstHas('list')) ex.push(`./${bin} list ${firstEntity}`)
|
|
@@ -172,7 +172,7 @@ record is printed back.`)
|
|
|
172
172
|
Configuration is read from the environment — nothing is written to disk:
|
|
173
173
|
|
|
174
174
|
\`\`\`sh
|
|
175
|
-
export ${apiKeyEnv}=
|
|
175
|
+
export ${apiKeyEnv}=apikey_xxx # API key
|
|
176
176
|
export ${baseEnv}=https://api.example.com # optional: override the API base URL
|
|
177
177
|
./${bin} ${cliExampleExpr}
|
|
178
178
|
\`\`\`
|
|
@@ -233,7 +233,7 @@ ${exampleBlock}
|
|
|
233
233
|
2. **Set your API key** (read from the environment):
|
|
234
234
|
|
|
235
235
|
\`\`\`sh
|
|
236
|
-
export ${apiKeyEnv}=
|
|
236
|
+
export ${apiKeyEnv}=apikey_xxx
|
|
237
237
|
\`\`\`
|
|
238
238
|
|
|
239
239
|
3. **Run a query.** Evaluate an boru expression against the API (or run with no
|
|
@@ -278,7 +278,7 @@ ${writeText}
|
|
|
278
278
|
make build
|
|
279
279
|
|
|
280
280
|
# 2. Provide credentials via the environment
|
|
281
|
-
export ${apiKeyEnv}=
|
|
281
|
+
export ${apiKeyEnv}=apikey_xxx
|
|
282
282
|
|
|
283
283
|
# 3a. Install into Claude Code over stdio (most common)
|
|
284
284
|
claude mcp add --scope user ${slugLower} \\
|
|
@@ -303,7 +303,7 @@ ${callText}> The rest of this guide follows the [Diátaxis](https://diataxis.fr)
|
|
|
303
303
|
2. **Set your API key:**
|
|
304
304
|
|
|
305
305
|
\`\`\`sh
|
|
306
|
-
export ${apiKeyEnv}=
|
|
306
|
+
export ${apiKeyEnv}=apikey_xxx
|
|
307
307
|
\`\`\`
|
|
308
308
|
|
|
309
309
|
3. **Install it into Claude Code** (stdio transport):
|
|
@@ -322,7 +322,7 @@ ${restart}
|
|
|
322
322
|
Configuration is read from the environment — nothing is written to disk:
|
|
323
323
|
|
|
324
324
|
\`\`\`sh
|
|
325
|
-
export ${apiKeyEnv}=
|
|
325
|
+
export ${apiKeyEnv}=apikey_xxx # API key
|
|
326
326
|
export ${baseEnv}=https://api.example.com # optional: override the API base URL
|
|
327
327
|
\`\`\`
|
|
328
328
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getModelPath
|
|
9
9
|
} from '../types'
|
|
10
10
|
|
|
11
|
-
import { packageName, packageVersion, repoInfo } from '../helpers/packageMeta'
|
|
11
|
+
import { hasPackageName, packageName, packageVersion, repoInfo } from '../helpers/packageMeta'
|
|
12
12
|
|
|
13
13
|
import { npmTrustScript } from '../admin/npm-trust'
|
|
14
14
|
|
|
@@ -28,7 +28,7 @@ const PublishWorkflow = cmp(function PublishWorkflow(props: any) {
|
|
|
28
28
|
if (false === t.active) {
|
|
29
29
|
return
|
|
30
30
|
}
|
|
31
|
-
if ('npm' === (t.publish?.registry?.name || '')) {
|
|
31
|
+
if ('npm' === (t.publish?.registry?.name || '') && hasPackageName(model, t.name)) {
|
|
32
32
|
npmTargets.push(t)
|
|
33
33
|
}
|
|
34
34
|
})
|
package/src/cmp/ReadmeTop.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { isConsumer } from '../helpers/alongside'
|
|
|
26
26
|
import {
|
|
27
27
|
installCommand as pkgInstall,
|
|
28
28
|
packageName,
|
|
29
|
+
hasPackageName,
|
|
29
30
|
registryState,
|
|
30
31
|
vendorCommand,
|
|
31
32
|
apiName,
|
|
@@ -172,7 +173,7 @@ const ReadmeTop = cmp(function ReadmeTop(props: any) {
|
|
|
172
173
|
const docTargets = ordered.filter((t: any) => !isCliOrMcp(t))
|
|
173
174
|
|
|
174
175
|
const pkgTargets = activeTargets
|
|
175
|
-
.
|
|
176
|
+
.filter((t: any) => hasPackageName(model, t.name))
|
|
176
177
|
.sort((a: any, b: any) => orderOf(a.name) - orderOf(b.name))
|
|
177
178
|
|
|
178
179
|
const langList = sdkTargets.map((t: any) => t.title).join(', ')
|
|
@@ -3,6 +3,7 @@ import { each } from 'jostraca'
|
|
|
3
3
|
|
|
4
4
|
import { KIT, nom } from '@voxgig/apidef'
|
|
5
5
|
|
|
6
|
+
import { isConsumer } from './alongside'
|
|
6
7
|
import { kindCollection } from './kindCollection'
|
|
7
8
|
import { modelText } from './text'
|
|
8
9
|
|
|
@@ -279,6 +280,19 @@ function packageName(model: any, eco: string): string {
|
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
282
|
|
|
283
|
+
|
|
284
|
+
// For any other consumer packageName would answer the SDK's own name.
|
|
285
|
+
const NAMED_CONSUMERS = ['go-cli', 'go-mcp', 'py-data']
|
|
286
|
+
|
|
287
|
+
function hasPackageName(model: any, target: string): boolean {
|
|
288
|
+
const declared = model?.main?.[KIT]?.target?.[target]
|
|
289
|
+
if (!isConsumer(declared)) {
|
|
290
|
+
return true
|
|
291
|
+
}
|
|
292
|
+
const pkg = declared?.publish?.registry?.package
|
|
293
|
+
return (null != pkg && '' !== pkg) || NAMED_CONSUMERS.includes(originName(model, target))
|
|
294
|
+
}
|
|
295
|
+
|
|
282
296
|
// Copy-paste install command for a target, using the REAL package name.
|
|
283
297
|
// Only a package that is actually live on its registry (isPublished) gets a
|
|
284
298
|
// registry install command; everything else (pending / inactive / tag-only,
|
|
@@ -416,6 +430,7 @@ export {
|
|
|
416
430
|
repoInfo,
|
|
417
431
|
apiName,
|
|
418
432
|
packageName,
|
|
433
|
+
hasPackageName,
|
|
419
434
|
installCommand,
|
|
420
435
|
registryState,
|
|
421
436
|
isPublished,
|
package/src/sdkgen.ts
CHANGED
|
@@ -127,6 +127,7 @@ import {
|
|
|
127
127
|
import type { Manifest, ManifestRead } from './helpers/manifest'
|
|
128
128
|
import {
|
|
129
129
|
packageName,
|
|
130
|
+
hasPackageName,
|
|
130
131
|
sdkName,
|
|
131
132
|
installCommand,
|
|
132
133
|
registryState,
|
|
@@ -1299,6 +1300,7 @@ export {
|
|
|
1299
1300
|
prefixLeadingDigit,
|
|
1300
1301
|
|
|
1301
1302
|
packageName,
|
|
1303
|
+
hasPackageName,
|
|
1302
1304
|
sdkName,
|
|
1303
1305
|
installCommand,
|
|
1304
1306
|
registryState,
|