@arpixel/api-contract 0.1.0 → 0.1.1

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 (2) hide show
  1. package/README.md +81 -55
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -89,13 +89,14 @@ Actual frontend impact
89
89
  Generate frontend-ready TypeScript from an OpenAPI specification:
90
90
 
91
91
  ```bash
92
- npx api-contract generate openapi.yaml
92
+ npx @arpixel/api-contract generate openapi.yaml
93
93
  ```
94
94
 
95
95
  The default output is:
96
96
 
97
97
  ```text
98
98
  api-contract/generated/
99
+
99
100
  ├── types.ts
100
101
  └── api.ts
101
102
  ```
@@ -105,13 +106,14 @@ The output directory is resolved relative to the current working directory.
105
106
  ### Custom output
106
107
 
107
108
  ```bash
108
- npx api-contract generate openapi.yaml --output src/api/generated
109
+ npx @arpixel/api-contract generate openapi.yaml --output src/api/generated
109
110
  ```
110
111
 
111
112
  Produces:
112
113
 
113
114
  ```text
114
115
  src/api/generated/
116
+
115
117
  ├── types.ts
116
118
  └── api.ts
117
119
  ```
@@ -145,7 +147,7 @@ export interface ApiMethods {
145
147
  Compare two OpenAPI specifications:
146
148
 
147
149
  ```bash
148
- npx api-contract diff old.yaml new.yaml
150
+ npx @arpixel/api-contract diff old.yaml new.yaml
149
151
  ```
150
152
 
151
153
  The comparison identifies structural contract changes including:
@@ -169,7 +171,7 @@ Changes are classified as **breaking** or **non-breaking** according to the supp
169
171
  ### Human-readable output
170
172
 
171
173
  ```bash
172
- npx api-contract diff examples/old.yaml examples/new.yaml
174
+ npx @arpixel/api-contract diff examples/old.yaml examples/new.yaml
173
175
  ```
174
176
 
175
177
  Example:
@@ -183,19 +185,24 @@ Modified: 1
183
185
  Breaking: 2
184
186
 
185
187
  BREAKING
188
+
186
189
  DELETE /devices/{id} was removed.
190
+
187
191
  Device.status changed from optional to required.
188
192
 
189
193
  NON-BREAKING
194
+
190
195
  POST /devices was added.
196
+
191
197
  Device.serialNumber was added.
198
+
192
199
  DeviceStatus enum value "suspended" was added.
193
200
  ```
194
201
 
195
202
  ### Machine-readable output
196
203
 
197
204
  ```bash
198
- npx api-contract diff examples/old.yaml examples/new.yaml --format json
205
+ npx @arpixel/api-contract diff examples/old.yaml examples/new.yaml --format json
199
206
  ```
200
207
 
201
208
  The JSON output provides a stable V1 structure:
@@ -233,17 +240,17 @@ The AI-assisted impact workflow takes the deterministic diff and analyzes the fr
233
240
 
234
241
  ```text
235
242
  api-contract diff
236
-
243
+
237
244
  Contract changes
238
-
245
+
239
246
  AI coding agent
240
-
247
+
241
248
  Frontend repository
242
-
249
+
243
250
  Search + dependency tracing
244
-
251
+
245
252
  Actual consumers
246
-
253
+
247
254
  Impact report
248
255
  ```
249
256
 
@@ -308,27 +315,29 @@ The three capabilities can be used independently or together.
308
315
 
309
316
  ```text
310
317
  OpenAPI
311
-
312
- ┌─────────────────┼─────────────────┐
313
- │ │ │
314
- ▼ ▼ ▼
315
- GENERATE COMPARE ANALYZE
316
- │ │ │
317
- ▼ ▼ │
318
- TypeScript client What changed?
319
- types.ts + api.ts Breaking?
320
-
321
-
322
- Structured diff ─────────┘
318
+
319
+
320
+
321
+ ┌────────────────┼────────────────┐
322
+ │ │ │
323
+ ▼ ▼ ▼
324
+ GENERATE COMPARE ANALYZE
325
+ │ │
326
+ ▼ ▼
327
+ TypeScript client What changed?
328
+ types.ts + api.ts Breaking?
329
+ │ │
330
+ ▼ │
331
+ Structured diff ──────┘
323
332
 
324
333
 
325
- AI agent
334
+ AI agent
326
335
 
327
336
 
328
- Frontend repository
337
+ Frontend repository
329
338
 
330
339
 
331
- Impact report
340
+ Impact report
332
341
  ```
333
342
 
334
343
  A typical API evolution workflow becomes:
@@ -357,17 +366,17 @@ The architecture is:
357
366
 
358
367
  ```text
359
368
  api-contract
360
-
369
+
361
370
  ├── generate
362
371
  ├── diff
363
372
 
364
373
  └── deterministic contract data
365
374
 
366
375
 
367
- AI agent
376
+ AI agent
368
377
 
369
378
 
370
- repository-aware analysis
379
+ repository-aware analysis
371
380
  ```
372
381
 
373
382
  This means:
@@ -387,6 +396,7 @@ The repository includes integration artifacts:
387
396
 
388
397
  ```text
389
398
  integrations/vscode/
399
+
390
400
  ├── api-contract-generate.prompt.md
391
401
  ├── api-contract-generate.agent.md
392
402
  ├── api-contract-impact.prompt.md
@@ -396,20 +406,18 @@ integrations/vscode/
396
406
  Install these integrations for your user account with:
397
407
 
398
408
  ```bash
399
- npx api-contract init --host vscode
409
+ npx @arpixel/api-contract init --host vscode
400
410
  ```
401
411
 
402
- This installs the prompts under `~/.api-contract/prompts/` and the agents under
403
- `~/.copilot/agents/`. The command does not modify VS Code settings.
412
+ This installs the prompts under `~/.api-contract/prompts/` and the agents under `~/.copilot/agents/`. The command does not modify VS Code settings.
404
413
 
405
414
  ### Prompt usage
406
415
 
407
416
  Choose one of these options for the prompts:
408
417
 
409
- 1. **Repository-local** — Copy `~/.api-contract/prompts/` into
410
- `<repository>/.github/prompts/` to make the prompts available to that repository.
411
- 2. **Global** — Add `~/.api-contract/prompts` as a directory in VS Code's
412
- `chat.promptFilesLocations` setting. Add the directory, not individual file paths.
418
+ 1. **Repository-local** — Copy `~/.api-contract/prompts/` into `<repository>/.github/prompts/` to make the prompts available to that repository.
419
+
420
+ 2. **Global** — Add `~/.api-contract/prompts` as a directory in VS Code's `chat.promptFilesLocations` setting. Add the directory, not individual file paths.
413
421
 
414
422
  The agents installed under `~/.copilot/agents/` can be selected from the VS Code Chat agent experience.
415
423
 
@@ -468,7 +476,7 @@ The analysis is read-only by default and does not modify source code unless expl
468
476
  ```text
469
477
  OpenAPI
470
478
 
471
- OpenAPI parser
479
+ OpenAPI parser
472
480
 
473
481
  ┌─────────────────┼─────────────────┐
474
482
  │ │ │
@@ -476,20 +484,20 @@ The analysis is read-only by default and does not modify source code unless expl
476
484
  GENERATE COMPARE ANALYZE*
477
485
  │ │ │
478
486
  ▼ ▼ │
479
- TypeScript Structured diff
480
- client │ │
481
- │ │
482
- ▼ │
483
- AI coding agent ◄────┘
484
-
485
-
486
- Frontend repository
487
-
488
-
489
- Impact analysis
487
+ TypeScript Structured diff
488
+ client │ │
489
+ │ │
490
+ ▼ │
491
+ AI coding agent ◄────┘
492
+
493
+
494
+ Frontend repository
495
+
496
+
497
+ Impact analysis
490
498
 
491
499
 
492
- types.ts + api.ts
500
+ types.ts + api.ts
493
501
 
494
502
  * Analyze is an AI-assisted workflow built on top of
495
503
  the deterministic CLI output.
@@ -528,25 +536,43 @@ Impact analysis should prefer concrete repository evidence over assumptions base
528
536
  No global installation is required:
529
537
 
530
538
  ```bash
531
- npx api-contract --help
539
+ npx @arpixel/api-contract --help
532
540
  ```
533
541
 
534
542
  Generate:
535
543
 
536
544
  ```bash
537
- npx api-contract generate openapi.yaml
545
+ npx @arpixel/api-contract generate openapi.yaml
538
546
  ```
539
547
 
540
548
  Compare:
541
549
 
542
550
  ```bash
543
- npx api-contract diff old.yaml new.yaml
551
+ npx @arpixel/api-contract diff old.yaml new.yaml
544
552
  ```
545
553
 
546
554
  Install the optional VS Code/Copilot integration:
547
555
 
548
556
  ```bash
549
- npx api-contract init --host vscode
557
+ npx @arpixel/api-contract init --host vscode
558
+ ```
559
+
560
+ ## Install as a project dependency
561
+
562
+ Install the CLI in your project:
563
+
564
+ ```bash
565
+ npm install -D @arpixel/api-contract
566
+ ```
567
+
568
+ Then use the `api-contract` binary:
569
+
570
+ ```bash
571
+ npx api-contract generate openapi.yaml
572
+ ```
573
+
574
+ ```bash
575
+ npx api-contract diff old.yaml new.yaml
550
576
  ```
551
577
 
552
578
  ## Requirements
@@ -594,6 +620,7 @@ npm run dev -- diff examples/old.yaml examples/new.yaml
594
620
 
595
621
  ```text
596
622
  api-contract/
623
+
597
624
  ├── src/
598
625
  │ ├── cli.ts
599
626
  │ ├── commands/
@@ -663,7 +690,7 @@ api-contract/
663
690
  * mock generation
664
691
  * LLM/API-key management inside the CLI
665
692
  * direct repository modification by the CLI
666
- * host-specific agent installation
693
+ * host-specific agent installation beyond the currently supported VS Code/Copilot integration
667
694
 
668
695
  The goal of V1 is to provide a small, deterministic, composable foundation for working with evolving API contracts and connecting contract changes to frontend code.
669
696
 
@@ -687,7 +714,6 @@ Potential future capabilities include:
687
714
  * additional breaking-change rules
688
715
  * improved API client generation
689
716
  * additional AI-agent host integrations
690
- * repository initialization/install commands
691
717
  * broader frontend framework support
692
718
 
693
719
  The roadmap is intentionally exploratory. The current focus is keeping the three core workflows — **Generate, Compare, Analyze** — deterministic, composable, and useful.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arpixel/api-contract",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Generate API clients. Compare contracts. Analyze frontend impact.",
5
5
  "type": "module",
6
6
  "bin": {