@aggrega-ai/aggrega-pdk-typescript 0.9.0 → 0.9.3

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 +37 -27
  2. package/package.json +10 -9
package/README.md CHANGED
@@ -17,6 +17,12 @@ A plugin is a small TypeScript project that depends on
17
17
  `@aggrega-ai/aggrega-pdk-typescript` for the typed socket payloads
18
18
  and `@extism/js-pdk` for the TypeScript declarations of the Extism
19
19
  plugin runtime (`Host`, `Memory`, the `extism:host` ambient module).
20
+ Both install from npm:
21
+
22
+ ```sh
23
+ npm install @aggrega-ai/aggrega-pdk-typescript
24
+ npm install --save-dev @extism/js-pdk
25
+ ```
20
26
 
21
27
  The plugin entry follows the Extism JS PDK CommonJS convention:
22
28
 
@@ -244,38 +250,42 @@ tools manually per those pointers.
244
250
 
245
251
  ## Standalone reuse
246
252
 
247
- The PDK's tests reference the JSON Schemas at relative path
248
- `../../aggrega-schemas/json/` (relative to this package
249
- root). This assumes the `aggrega-schemas` repository is checked out
250
- beside this repository. Standalone consumption (after publication to
251
- npm) bundles the schemas in the release artifact; the file-relative
252
- reference becomes publication-bundled.
253
-
254
- When running `npm test` from a checkout that does not have the
255
- schemas alongside, the schema-dependent tests **fail** with a clear
256
- diagnostic, because a run that could not read them has verified
257
- nothing. Where they are genuinely absent — a standalone checkout of
258
- this kit, or a packaging test — opt out with the same switch the Go
259
- and Rust kits use:
253
+ A clone of this repository builds and tests on its own: the package
254
+ takes `@aggrega-ai/aggrega-abi` from the npm registry at the released
255
+ version `package.json` names. From `typescript/`:
260
256
 
261
257
  ```sh
262
- AGGREGA_SKIP_SCHEMA_TESTS=1 npm test
258
+ npm install
259
+ npm test
263
260
  ```
264
261
 
265
- Each affected test is then reported as skipped, with the reason
266
- stated. The switch keys on the schemas being unreachable: with them in
267
- place it changes nothing, so it cannot quietly turn a real run into a
268
- skipped one.
269
-
270
- `npm test` first builds, which resolves this package's dependency on
271
- the shared ABI package from a sibling directory. Where that sibling is
272
- also absent, run the test file directly so the build step is not
273
- involved — the switch behaves the same way:
262
+ `npm test` builds first, then runs the tests.
263
+
264
+ Two groups of tests read files that live in sibling repositories rather
265
+ than in this one: the schema round-trip tests read the JSON Schemas at
266
+ `../../aggrega-schemas/json/` (relative to this package root), and the
267
+ wire tests read the shared payload vectors at
268
+ `../../aggrega-abi/testdata/`. Each group runs when that repository is
269
+ checked out beside this one (`aggrega-pdk/`, `aggrega-schemas/` and
270
+ `aggrega-abi/` as siblings) and is reported as skipped, with the missing
271
+ checkout named, when it is not. Check out `aggrega-abi` at the release tag
272
+ of the version `package.json` names for `@aggrega-ai/aggrega-abi`, and
273
+ `aggrega-schemas` at the release tag the `schemas-ref` line of
274
+ `.github/workflows/pdk.yml` names, so the files the tests read are the
275
+ ones the kit is built against. Only the tests read these files: the
276
+ published package carries the kit's compiled sources alone, and a plugin
277
+ that depends on it needs nothing checked out beside it.
278
+
279
+ Where the `aggrega-schemas` checkout is present but its schemas cannot be
280
+ read, the schema tests **fail** with a clear diagnostic, because a run
281
+ that could not read them has verified nothing. To skip them in that case
282
+ instead, use the same switch the Go and Rust kits use:
274
283
 
275
284
  ```sh
276
- AGGREGA_SKIP_SCHEMA_TESTS=1 node --test --experimental-strip-types \
277
- tests/round_trip.test.ts
285
+ AGGREGA_SKIP_SCHEMA_TESTS=1 npm test
278
286
  ```
279
287
 
280
- A checkout with `aggrega-schemas` beside it has the schemas in place,
281
- so neither the refusal nor the skip fires there.
288
+ Each affected test is then reported as skipped, with the reason stated.
289
+ The switch keys on the schemas being unreachable: with them in place it
290
+ changes nothing, so it cannot quietly turn a real run into a skipped
291
+ one.
package/package.json CHANGED
@@ -1,8 +1,14 @@
1
1
  {
2
2
  "name": "@aggrega-ai/aggrega-pdk-typescript",
3
- "version": "0.9.0",
3
+ "version": "0.9.3",
4
4
  "description": "Plugin Development Kit for authoring Aggrega Wasm plugins in TypeScript.",
5
5
  "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/aggrega-ai/aggrega-pdk.git",
9
+ "directory": "typescript"
10
+ },
11
+ "homepage": "https://aggrega.ai",
6
12
  "main": "./dist/index.js",
7
13
  "types": "./dist/index.d.ts",
8
14
  "files": [
@@ -10,15 +16,15 @@
10
16
  "LICENSE"
11
17
  ],
12
18
  "scripts": {
13
- "build": "npm --prefix ../../aggrega-abi/typescript install && npm --prefix ../../aggrega-abi/typescript run build && tsc && npm run typecheck",
19
+ "build": "node -e \"require('fs').copyFileSync('../LICENSE','LICENSE')\" && tsc && npm run typecheck",
14
20
  "typecheck": "tsc -p tsconfig.test.json && ./scripts/typecheck-examples.sh",
15
21
  "prepack": "npm run build",
16
- "check-pack-contents": "node -e \"const {execFileSync}=require('child_process');const pkg=require('./package.json');const want=[pkg.main,pkg.types].map(p=>p.replace('./',''));const have=JSON.parse(execFileSync('npm',['pack','--dry-run','--json','--ignore-scripts'],{encoding:'utf8'}))[0].files.map(f=>f.path);const missing=want.filter(p=>!have.includes(p));if(missing.length){console.error('packed tarball omits its declared entry point: '+missing.join(', '));process.exit(1);}console.log('packed tarball carries '+want.join(' and ')+' ('+have.length+' files)');\"",
22
+ "check-pack-contents": "node -e \"const {execFileSync}=require('child_process');const pkg=require('./package.json');const want=[pkg.main,pkg.types].map(p=>p.replace('./','')).concat('LICENSE');const have=JSON.parse(execFileSync('npm',['pack','--dry-run','--json','--ignore-scripts'],{encoding:'utf8'}))[0].files.map(f=>f.path);const missing=want.filter(p=>!have.includes(p));if(missing.length){console.error('packed tarball omits its declared entry point or licence text: '+missing.join(', '));process.exit(1);}console.log('packed tarball carries '+want.join(' and ')+' ('+have.length+' files)');\"",
17
23
  "pretest": "npm run build",
18
24
  "test": "npm run check-pack-contents && node --test --experimental-strip-types tests/round_trip.test.ts tests/describe.test.ts tests/parse_source_wire.test.ts tests/source_wire.test.ts tests/fetch_wire.test.ts"
19
25
  },
20
26
  "dependencies": {
21
- "@aggrega-ai/aggrega-abi": "0.9.0"
27
+ "@aggrega-ai/aggrega-abi": "0.9.1"
22
28
  },
23
29
  "devDependencies": {
24
30
  "@extism/js-pdk": "1.1.1",
@@ -27,11 +33,6 @@
27
33
  "ajv-formats": "^3.0.0",
28
34
  "typescript": "^5.6.0"
29
35
  },
30
- "repository": {
31
- "type": "git",
32
- "url": "git+https://github.com/aggrega-ai/aggrega-pdk.git",
33
- "directory": "typescript"
34
- },
35
36
  "publishConfig": {
36
37
  "access": "public"
37
38
  }