@anakonn/ankk 0.1.0-beta.0

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.
Files changed (3) hide show
  1. package/README.md +103 -0
  2. package/dist/index.js +17512 -0
  3. package/package.json +50 -0
package/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # @anakonn/ankk
2
+
3
+ `@anakonn/ankk` provides the Bun-first `ankk` command for
4
+ `apps/api-public /v1`.
5
+
6
+ ## Install
7
+
8
+ The CLI currently requires Bun.
9
+
10
+ ```bash
11
+ bunx @anakonn/ankk --json health
12
+ ```
13
+
14
+ Or install globally:
15
+
16
+ ```bash
17
+ bun install -g @anakonn/ankk
18
+ ankk --json health
19
+ ```
20
+
21
+ ## Publish
22
+
23
+ Public npm publish runs only from the repository `main` branch. After `preview`
24
+ is promoted to `main`, run the manual GitLab CI job `publish:cli:npm:beta` with
25
+ a masked, protected `NPM_TOKEN` variable configured.
26
+
27
+ The current repository is hosted on self-managed GitLab. npm Trusted Publishing
28
+ is preferred, but npm currently documents GitLab support for GitLab.com shared
29
+ runners. Until this project publishes from a supported runner, use a granular
30
+ npm token with the smallest practical scope:
31
+
32
+ - Token name: `ankk-cli-publish` or similar.
33
+ - Package/scope access: `@anakonn/ankk` only, after the package exists.
34
+ - Permission: publish/write access required by `npm publish`.
35
+ - Organization access: none unless npm requires it for the `@anakonn` scope.
36
+ - Expiration: finite.
37
+ - GitLab variable: `NPM_TOKEN`, masked and protected.
38
+
39
+ If this is the first ever publish and npm cannot scope a token to an
40
+ unpublished package, publish `@anakonn/ankk` once manually with 2FA, then
41
+ replace CI with a package-scoped token for later beta publishes.
42
+
43
+ When publishing moves to a supported Trusted Publishing runner, configure npm
44
+ Trusted Publisher with:
45
+
46
+ - Provider: GitLab CI/CD.
47
+ - Namespace: `anakonn`.
48
+ - Project name: `ankk`.
49
+ - Top-level CI file path: `.gitlab-ci.yml`.
50
+ - Allowed actions: `npm publish`.
51
+
52
+ Then remove `NPM_TOKEN` from CI and add GitLab `id_tokens` for `NPM_ID_TOKEN`
53
+ with audience `npm:registry.npmjs.org`.
54
+
55
+ ## OpenAPI Generation
56
+
57
+ The committed OpenAPI snapshot is generated from the local `apps/api-public`
58
+ Elysia app, not from production. This lets API and CLI changes ship in the same
59
+ MR before `https://api-public.ankk.app` has the new contract.
60
+
61
+ ```bash
62
+ (cd apps/cli && bun run generate:openapi)
63
+ (cd apps/cli && bun run coverage:openapi)
64
+ ```
65
+
66
+ Use live production pull only for dogfooding or deployed-contract comparison:
67
+
68
+ ```bash
69
+ (cd apps/cli && bun run src/entry/index.ts --json openapi pull --dry-run)
70
+ ```
71
+
72
+ ## Smoke
73
+
74
+ Use environment variables or `~/.ankk/config.json` for credentials. Do not paste
75
+ or commit full `spk_` API keys in logs, docs, issue comments, or shell snippets.
76
+
77
+ ```bash
78
+ bunx turbo run check --filter=@anakonn/ankk
79
+ bunx turbo run test --filter=@anakonn/ankk
80
+ (cd apps/cli && bun run coverage:openapi)
81
+ (cd apps/cli && bun run src/entry/index.ts --json health)
82
+ (cd apps/cli && bun run src/entry/index.ts --json openapi pull --dry-run)
83
+ ```
84
+
85
+ Authenticated smoke, when a safe API key is already available in the local
86
+ environment:
87
+
88
+ ```bash
89
+ (cd apps/cli && ANKK_API_KEY=... bun run smoke:dogfood)
90
+ (cd apps/cli && ANKK_API_KEY=... bun run src/entry/index.ts --json brands list)
91
+ (cd apps/cli && ANKK_API_KEY=... bun run src/entry/index.ts --json brands info get --brand-ref <brand_ref>)
92
+ ```
93
+
94
+ Optional patch smoke is disabled by default. To enable it, set both
95
+ `ANKK_BRAND_REF` and `ANKK_BRAND_INFO_PATCH_FILE`. Keep the patch payload under
96
+ `tmp/` and inspect it before running.
97
+
98
+ ```bash
99
+ (cd apps/cli && ANKK_API_KEY=... ANKK_BRAND_REF=<brand_ref> ANKK_BRAND_INFO_PATCH_FILE=../../tmp/brand-info-patch.json bun run smoke:dogfood)
100
+ ```
101
+
102
+ For write commands, prefer `--file path` or `--file -` and keep fixture payloads
103
+ under the repository `tmp/` directory when they are temporary.