@bsv/create-dpp-app 0.1.0-beta.1 → 0.1.0-beta.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.
Files changed (143) hide show
  1. package/NOTICE +2 -0
  2. package/PATENTS +12 -0
  3. package/README.md +26 -6
  4. package/dist/index.js +36 -8
  5. package/package.json +9 -5
  6. package/template/Dockerfile +4 -2
  7. package/template/README.md +297 -42
  8. package/template/_env.example +82 -13
  9. package/template/_github/workflows/ci.yml +3 -3
  10. package/template/apps/api/API.md +86 -16
  11. package/template/apps/api/package.json +9 -4
  12. package/template/apps/api/src/bound-profiles.ts +590 -0
  13. package/template/apps/api/src/claims.ts +175 -56
  14. package/template/apps/api/src/cli.ts +64 -7
  15. package/template/apps/api/src/config.ts +124 -10
  16. package/template/apps/api/src/custody.ts +241 -69
  17. package/template/apps/api/src/dev-index.ts +58 -9
  18. package/template/apps/api/src/env-file.ts +55 -0
  19. package/template/apps/api/src/epcis/exchange.ts +434 -0
  20. package/template/apps/api/src/epcis/mongo-storage.ts +381 -0
  21. package/template/apps/api/src/epcis/routes.ts +364 -0
  22. package/template/apps/api/src/epcis/sources.ts +142 -0
  23. package/template/apps/api/src/go-live.ts +226 -0
  24. package/template/apps/api/src/http-error.ts +15 -0
  25. package/template/apps/api/src/identifiers.ts +1 -1
  26. package/template/apps/api/src/index-client.ts +131 -6
  27. package/template/apps/api/src/index-projects.ts +53 -0
  28. package/template/apps/api/src/lifecycle-authority.ts +49 -0
  29. package/template/apps/api/src/lifecycle.ts +485 -0
  30. package/template/apps/api/src/main.ts +10 -2
  31. package/template/apps/api/src/parties.ts +2 -2
  32. package/template/apps/api/src/platform.ts +72 -17
  33. package/template/apps/api/src/portability/commands.ts +224 -0
  34. package/template/apps/api/src/portability/export.ts +708 -0
  35. package/template/apps/api/src/portability/package.ts +270 -0
  36. package/template/apps/api/src/portability/restore.ts +863 -0
  37. package/template/apps/api/src/profiles.ts +38 -13
  38. package/template/apps/api/src/reader.ts +172 -3
  39. package/template/apps/api/src/resolver.ts +159 -0
  40. package/template/apps/api/src/sector-examples.ts +390 -0
  41. package/template/apps/api/src/server.ts +253 -60
  42. package/template/apps/api/src/store.ts +198 -21
  43. package/template/apps/api/src/validation-engine.ts +172 -0
  44. package/template/apps/api/src/wallet.ts +30 -17
  45. package/template/apps/api/src/worker.ts +20 -13
  46. package/template/apps/api/src/writer.ts +383 -131
  47. package/template/apps/api/test/bound-http.test.ts +496 -0
  48. package/template/apps/api/test/bound-profiles.test.ts +547 -0
  49. package/template/apps/api/test/config.test.ts +148 -3
  50. package/template/apps/api/test/custody-journal.test.ts +415 -0
  51. package/template/apps/api/test/custody-recovery-profile.test.ts +224 -0
  52. package/template/apps/api/test/custom-profile.test.ts +167 -0
  53. package/template/apps/api/test/env-file.test.ts +53 -0
  54. package/template/apps/api/test/epcis-fixtures.ts +270 -0
  55. package/template/apps/api/test/epcis-http.test.ts +1179 -0
  56. package/template/apps/api/test/epcis-mongo-storage.test.ts +313 -0
  57. package/template/apps/api/test/epcis-separation.test.ts +253 -0
  58. package/template/apps/api/test/epcis-web.test.ts +230 -0
  59. package/template/apps/api/test/exit-exercise.test.ts +1038 -0
  60. package/template/apps/api/test/external-index.test.ts +3 -2
  61. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/background.ttl +33 -0
  62. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/binding.json +141 -0
  63. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/context.jsonld +36 -0
  64. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/product.schema.json +44 -0
  65. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/shapes.ttl +112 -0
  66. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/conflicting-gtin.json +44 -0
  67. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/conflicting-serial.json +44 -0
  68. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/granularity-mismatch.json +44 -0
  69. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/item-gtin-13.json +43 -0
  70. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/item.json +42 -0
  71. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/missing-required-property.json +43 -0
  72. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/model-as-subject.json +44 -0
  73. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/no-passport-identifier.json +43 -0
  74. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/other-product.json +44 -0
  75. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/part-not-dishwasher-safe.json +45 -0
  76. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/altered-artefact.json +19 -0
  77. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/altered-background.ttl +33 -0
  78. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/conflicting-binding.json +141 -0
  79. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/conflicting-second-registration.json +19 -0
  80. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/untrusted-binding.json +13 -0
  81. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/unlisted-context.json +47 -0
  82. package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/wrong-binding-digest.json +44 -0
  83. package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/binding.json +88 -0
  84. package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/product.schema.json +25 -0
  85. package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/item.json +26 -0
  86. package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/missing-required-property.json +27 -0
  87. package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/no-passport-identifier.json +27 -0
  88. package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/other-product.json +28 -0
  89. package/template/apps/api/test/go-live.test.ts +179 -0
  90. package/template/apps/api/test/gs1-global-setup.ts +33 -0
  91. package/template/apps/api/test/gs1-test-env.ts +5 -0
  92. package/template/apps/api/test/identifier-host.test.ts +256 -0
  93. package/template/apps/api/test/index-projects.test.ts +81 -0
  94. package/template/apps/api/test/lifecycle-claims.test.ts +546 -0
  95. package/template/apps/api/test/lifecycle-fixtures.ts +167 -0
  96. package/template/apps/api/test/lifecycle.test.ts +17 -6
  97. package/template/apps/api/test/manifest-notice.test.ts +36 -0
  98. package/template/apps/api/test/network-guard.ts +113 -0
  99. package/template/apps/api/test/portability.test.ts +655 -0
  100. package/template/apps/api/test/profile-bundle-resolver.test.ts +198 -0
  101. package/template/apps/api/test/retired-profiles.test.ts +216 -0
  102. package/template/apps/api/test/sector-cutover.test.ts +95 -0
  103. package/template/apps/api/test/sector-forms.test.ts +420 -0
  104. package/template/apps/api/test/unjoined-index.test.ts +62 -0
  105. package/template/apps/api/test/validation-engine.test.ts +328 -0
  106. package/template/apps/api/test/wallet-monitor.test.ts +38 -0
  107. package/template/apps/api/test/writer-journal.test.ts +327 -0
  108. package/template/apps/api/vitest.config.ts +3 -0
  109. package/template/apps/web/src/app.tsx +8 -4
  110. package/template/apps/web/src/components/bound/bound-passport-form.tsx +368 -0
  111. package/template/apps/web/src/components/bound/field-view.tsx +237 -0
  112. package/template/apps/web/src/components/bound/pieces.tsx +169 -0
  113. package/template/apps/web/src/components/bound/readings.tsx +152 -0
  114. package/template/apps/web/src/components/bound/structured-value.tsx +114 -0
  115. package/template/apps/web/src/components/claim-dialog.tsx +344 -0
  116. package/template/apps/web/src/components/epcis-events.tsx +119 -0
  117. package/template/apps/web/src/components/layout.tsx +17 -0
  118. package/template/apps/web/src/components/lifecycle-claims.tsx +199 -0
  119. package/template/apps/web/src/components/passport-form.tsx +2 -2
  120. package/template/apps/web/src/components/read-passport.tsx +4 -3
  121. package/template/apps/web/src/components/reading.tsx +32 -39
  122. package/template/apps/web/src/lib/api.ts +136 -26
  123. package/template/apps/web/src/lib/bound/battery-form.ts +269 -0
  124. package/template/apps/web/src/lib/bound/display.ts +122 -0
  125. package/template/apps/web/src/lib/bound/fields.ts +128 -0
  126. package/template/apps/web/src/lib/bound/form-model.ts +521 -0
  127. package/template/apps/web/src/lib/bound/forms.ts +15 -0
  128. package/template/apps/web/src/lib/bound/identity.ts +48 -0
  129. package/template/apps/web/src/lib/bound/textile-form.ts +236 -0
  130. package/template/apps/web/src/lib/bound/units.ts +37 -0
  131. package/template/apps/web/src/lib/epcis.ts +345 -0
  132. package/template/apps/web/src/lib/format.ts +27 -4
  133. package/template/apps/web/src/lib/lifecycle.ts +350 -0
  134. package/template/apps/web/src/pages/accept.tsx +8 -3
  135. package/template/apps/web/src/pages/events.tsx +388 -0
  136. package/template/apps/web/src/pages/new-passport.tsx +25 -2
  137. package/template/apps/web/src/pages/operations.tsx +22 -3
  138. package/template/apps/web/src/pages/passport.tsx +226 -162
  139. package/template/apps/web/src/pages/public-passport.tsx +50 -10
  140. package/template/apps/web/src/pages/wallet.tsx +1 -1
  141. package/template/apps/web/vite.config.ts +12 -4
  142. package/template/deploy/compose.yml +14 -2
  143. package/template/package.json +9 -3
package/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ dpp
2
+ Copyright 2026 BSV Association
package/PATENTS ADDED
@@ -0,0 +1,12 @@
1
+ THE FOREGOING LICENSE APPLIES SOLELY TO COPYRIGHT IN THE SOFTWARE INDICATED, AS
2
+ BSV ASSOCIATION (THE “LICENSOR”) HOLDS NO PATENT RIGHTS. THE LICENSOR SHALL NOT,
3
+ AND SHALL PROCURE ANY ENTITY LICENSING INTELLECTUAL PROPERTY TO THE LICENSOR
4
+ SHALL NOT, ASSERT ANY PATENT RIGHTS AGAINST YOU IN CONNECTION WITH YOUR USE OF
5
+ THE SOFTWARE OR ANY WORK DERIVED FROM IT. HOWEVER, THE SOFTWARE IS PROVIDED "AS
6
+ IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
7
+ TO THE WARRANTIES REGARDING ENTITLEMENT, MERCHANTABILITY, FITNESS FOR A
8
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE LICENSOR, AUTHORS
9
+ OR COPYRIGHT HOLDERS THEREOF BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
11
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
12
+ SOFTWARE.
package/README.md CHANGED
@@ -5,21 +5,25 @@ Scaffold a Digital Product Passport application on BSV in one command.
5
5
  This starter and its renamed protocol dependency are source candidates pending publication. The npm command below applies after both are published; use the development commands below to test them from this checkout.
6
6
 
7
7
  ```sh
8
- npm create @bsv/dpp-app@0.1.0-beta.1 my-app
8
+ npm create @bsv/dpp-app@0.1.0-beta.2 my-app
9
9
  cd my-app
10
10
  npm test
11
11
  npm run dev
12
12
  ```
13
13
 
14
- You get a working application: a React web app with a brand dashboard, passport pages, hand-on acceptance and public verification; an Express API that owns a platform wallet, writes and reads passports with the `@bsv/dpp` packages, keeps a journal and runs the unattended duties; and a Compose service for the application database. The first run is an offline test of a whole passport lifecycle, with no wallet, funds, Docker or network. The template's README explains the rest, including the route to writing real passports.
14
+ You get a working application: a React web app with a brand dashboard, passport pages, hand-on acceptance and public verification; an Express API that owns a platform wallet, writes and reads passports with the `@bsv/dpp` packages, keeps a journal and runs the unattended duties; and a Compose service for the application database. The first run is a test of a whole passport lifecycle, with no wallet, funds or Docker. The template's README explains the rest, including the route to writing real passports.
15
+
16
+ In this source candidate the application also imports EPCIS 2.0 documents, pulls events from a configured source and exports what it received, byte for byte, by calling `@bsv/dpp-credentials/epcis-exchange`. Its tests of that fetch two things once and keep them: the three EPCIS files GS1 publishes, from `https://ref.gs1.org`, and a MongoDB server binary for the storage tests. The generated README's **EPCIS exchange** section covers the pages, the settings and the store.
17
+
18
+ It writes and reads passports under the manifest profile `general@2` and under profiles held by a binding: the current `eu-battery@2` and `eu-textile@2`, each with a form for its nested product data, and a profile of your own registered from a folder whose binding digest you trust. Under a binding the product document is split into a public part, on chain for good, and a restricted part, sealed off chain. The earlier sector manifest profiles are retired: the application offers none of them and refuses a write under one with `profile-retired`. The generated README's **Product documents under a binding** section covers the forms, the two views a reader is shown and the validation engine. Existing `eu-battery@1` and `eu-textile@1` passports remain readable and can be maintained under their signed bindings. Explicit new issuance under either historical binding names its version 2 successor.
15
19
 
16
20
  ## Choose the index connection
17
21
 
18
22
  | You want to | What to use |
19
23
  | --- | --- |
20
24
  | Build the application | `@bsv/create-dpp-app`, this starter |
21
- | Connect to an existing compatible index | Its URL, network and scoped access settings; no index starter required |
22
- | Operate your own index | A separate project created by `@bsv/create-dpp-index`, which includes its runtime |
25
+ | Connect to an existing compatible index | Its URL, network and scoped access settings |
26
+ | Operate your own index | The repository's operator preset, [`deploy/`](../../deploy/README.md): the index image and MongoDB on Docker Compose, whose `dpp-index connection` writes the file `npm run connect-index -- --from <file>` reads |
23
27
 
24
28
  The app's Compose file starts only its database, so connecting a separately operated index cannot start another index accidentally. The app includes overlay library components for its offline exercises; those components do not deploy a persistent index. Do not manually install another overlay package as part of app setup. See the generated README's **Connect an index** section and [service choices](../../docs/start/choose-components-and-services.md).
25
29
 
@@ -30,13 +34,18 @@ The app's Compose file starts only its database, so connecting a separately oper
30
34
  - API: Express 5; MongoDB for records, journal and sign-in; Better Auth for sign-in with organisations as brands; a journal-driven worker loop for proofs and re-announcements.
31
35
  - Wallet: `@bsv/wallet-toolbox` as a library, service-owned, keys in a SQLite file.
32
36
  - Custody: managed, the platform signs for signed-in users; the party interface keeps self-custody open.
33
- - Identifiers: GS1 Digital Links under the demonstration prefix 952 until you set a licensed one.
37
+ - Identifiers: GS1 Digital Links under the demonstration prefix 952 until you set a licensed one. The API answers each one at its own path as a GS1-Conformant Resolver for GTINs, with the resolver helpers of `@bsv/dpp-profiles`: a browser is redirected with 307 to the passport page at `/passport/01/<gtin>/21/<serial>`, and a client that asks for the linkset gets it.
38
+ - Validation: Ajv for manifest profiles; `jsonld`, `n3` and `shacl-engine`, at the versions `@bsv/dpp-profiles` is tested with, for profiles held by a binding. Nothing is fetched while validating. With `VALIDATOR_URL` set, the same two engines are asked of a validator service through `@bsv/dpp-profiles/validator-client` instead, and a service that does not answer blocks a write as missing libraries do.
39
+ - EPCIS: `@bsv/dpp-credentials/epcis-exchange` for import, pull and export, over a MongoDB storage adapter the template carries. An event is supplied data, kept apart from every passport: an import signs nothing and never reaches the wallet.
40
+ - Lifecycle claims: EPCIS lifecycle claims, `dpp-epcis-lifecycle@1` from `@bsv/dpp-credentials/epcis-lifecycle`, signed from an event a member enters or one the exchange retained, bound to the passports the event names and verified one finding at a time; native `dpp-lifecycle-v1` claims issued before are read and labelled historical, and no new one is issued.
41
+
42
+ - Moving: `export` and `restore` commands that carry the whole application as one signed `dpp-evidence-package@1` and restore it into another deployment, calling the profile bundle of `@bsv/dpp-profiles` and the recovery snapshot of `@bsv/dpp-credentials/epcis-exchange`. No package carries a key or a credential.
34
43
 
35
44
  Every opinion is a file you can change. The standard itself prefers none of them.
36
45
 
37
46
  ## Versions
38
47
 
39
- Each release of this package scaffolds one DPP release set, named under `dpp` in `package.json`, with the exact package versions it pins. This source candidate uses `dpp-release-2026-10-10`: protocol and profiles `0.3.0-beta.9`, overlay `0.4.0-beta.12` and SDK `2.8.10`, matching the index starter. The generated app imports `@bsv/dpp-protocol` directly. Once published, a new release set requires a new starter version.
48
+ Each release of this package scaffolds one DPP release set, named under `dpp` in `package.json`, with the exact package versions it pins. This source candidate uses `dpp-release-2026-11`: protocol and profiles `0.3.0-beta.10`, overlay `0.4.0-beta.13`, credentials `0.2.0-beta.6` and SDK `2.8.10`, the runtime the repository's index image builds. The generated app imports `@bsv/dpp-protocol` directly. Once published, a new release set requires a new starter version.
40
49
 
41
50
  ## Development
42
51
 
@@ -69,6 +78,17 @@ For the CI image check, `--prepare-only --directory /tmp/my-app` creates the app
69
78
 
70
79
  The template lives in `template/`; files that tooling treats specially ship with a leading underscore (`_gitignore`, `_env.example`) and are renamed when scaffolded. Make template changes there, then regenerate and check a fresh app.
71
80
 
81
+ Two things in the template are copies or inventions, and the package's tests hold them to their sources:
82
+
83
+ - `template/apps/api/test/fixtures/custom-profile/` is a byte-for-byte copy of the repository's `examples/custom-profile/`, so a generated app can test a profile registered from a folder with no checkout beside it.
84
+ - The battery and textile examples in `template/apps/api/src/sector-examples.ts` were written for the starter: invented organisations and values, under the GS1 demonstration prefix 952. The template carries no third-party product document.
85
+
86
+ The web app has no test runner. The modules that decide what a form writes and where a finding is shown, under `template/apps/web/src/lib/bound/`, touch neither the page nor the network, and the API's tests exercise them (`apps/api/test/sector-forms.test.ts`). The same holds for the words the events page puts on an import, a pull and an event, in `template/apps/web/src/lib/epcis.ts` (`apps/api/test/epcis-web.test.ts`). The pages themselves are type-checked by the build.
87
+
88
+ The generated app's exit exercise, `apps/api/test/exit-exercise.test.ts`, builds one deployment, exports it, stops its database and its index, and restores into a second deployment with another store and another source of profiles. `npm run starter:check -- --exit-record deploy/evidence/exit-exercise.json` writes the record of that run. Both deployments are in one test process, with the reference index's code, the test wallet and the development session standing in for an index, a wallet and sign-in: the record says so.
89
+
90
+ The generated app's EPCIS tests need the pinned GS1 files and one MongoDB node in memory. `npm run starter:check` hands the generated app the repository's own GS1 cache, `node_modules/.cache/dpp-gs1`, when a test run has filled it; otherwise the app's test set-up fetches the files from `https://ref.gs1.org`. The MongoDB binary is the one the `@bsv/dpp-overlay` tests use, from the same cache.
91
+
72
92
  ## Licence
73
93
 
74
94
  Apache 2.0.
package/dist/index.js CHANGED
@@ -2,13 +2,14 @@
2
2
  /**
3
3
  * create-dpp-app: copy the bundled template into a new directory and name it.
4
4
  *
5
- * npm create @bsv/dpp-app@0.1.0-beta.1 my-app
5
+ * npm create @bsv/dpp-app@0.1.0-beta.2 my-app
6
6
  * npx @bsv/create-dpp-app my-app [--no-install] [--yes]
7
7
  *
8
8
  * The template ships inside this package, so scaffolding needs no network;
9
9
  * installing the dependencies does. Every version the template pins comes
10
10
  * from one DPP release set, named in this package's manifest under "dpp".
11
11
  */
12
+ import { randomBytes } from 'node:crypto';
12
13
  import { spawnSync } from 'node:child_process';
13
14
  import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, writeFileSync } from 'node:fs';
14
15
  import { basename, dirname, join, resolve } from 'node:path';
@@ -22,7 +23,7 @@ const positional = args.filter((a) => !a.startsWith('--'));
22
23
  if (flags.has('--help') || flags.has('-h')) {
23
24
  console.log(`create-dpp-app ${manifest.version}: scaffold a Digital Product Passport application on BSV.
24
25
 
25
- usage: npm create @bsv/dpp-app@0.1.0-beta.1 <directory> [--no-install] [--yes]
26
+ usage: npm create @bsv/dpp-app@0.1.0-beta.2 <directory> [--no-install] [--yes]
26
27
 
27
28
  <directory> where to create the application; must be empty or hold only .git
28
29
  --no-install do not run npm install afterwards
@@ -71,6 +72,33 @@ function restoreDotfiles(dir) {
71
72
  }
72
73
  }
73
74
  restoreDotfiles(target);
75
+ // Secrets exist from the first run: .env is written from .env.example with
76
+ // fresh values, so nothing is copied from an example file and the API's
77
+ // placeholder check never fires on a scaffolded project. The wallet root key
78
+ // stays empty: the first go-live generates it. The default index is the
79
+ // hosted testnet one, which go-live registers with.
80
+ const envPath = join(target, '.env');
81
+ if (existsSync(envPath)) {
82
+ console.error(`${envPath} already exists; it was not touched.`);
83
+ }
84
+ else {
85
+ const example = readFileSync(join(target, '.env.example'), 'utf8');
86
+ const generated = {
87
+ AUTH_SECRET: randomBytes(32).toString('hex'),
88
+ BRAND_ROOT_SECRET: randomBytes(32).toString('hex'),
89
+ MANAGED_IDENTITY_SECRET: randomBytes(32).toString('hex'),
90
+ NETWORK: 'test',
91
+ INDEX_URL: 'https://dpp-overlay-testnet.bsvb.net',
92
+ };
93
+ const env = example
94
+ .split('\n')
95
+ .map((line) => {
96
+ const match = /^([A-Z_]+)=/.exec(line);
97
+ return match != null && generated[match[1]] != null ? `${match[1]}=${generated[match[1]]}` : line;
98
+ })
99
+ .join('\n');
100
+ writeFileSync(envPath, env, { mode: 0o600 });
101
+ }
74
102
  const rootManifestPath = join(target, 'package.json');
75
103
  const rootManifest = JSON.parse(readFileSync(rootManifestPath, 'utf8'));
76
104
  rootManifest.name = projectName;
@@ -88,10 +116,10 @@ Done. Next:
88
116
 
89
117
  cd ${positional[0] ?? 'my-dpp'}${install ? '' : '\n npm install'}
90
118
  npm test # the offline dry run: issue, update, hand on, retire, claim; no wallet, funds or Docker
91
- cp .env.example .env
92
- npm run dev # web on http://localhost:5173, API on http://localhost:3000, a local index in-process
119
+ npm run dev # web on http://localhost:5173, API on http://localhost:3000, an index in this process
120
+ npm run go-live # register with the testnet index, check wallet, funds and admission, then publish for real
93
121
 
94
- For deployment you need an index: the service your app announces passports to and readers look them up in.
95
- Connect to one that exists, or create your own with @bsv/create-dpp-index (README, Connect an index).
96
- The app's Compose file starts only its database. No separate overlay installation is needed.
97
- Read README.md for the live route: a funded wallet, index access, and the identifier you will write under.`);
122
+ .env holds fresh secrets and points at the default testnet index; go-live makes the wallet key and stores the tokens.
123
+ An index is the service your app announces passports to and readers look them up in. The default one is hosted;
124
+ npm run connect-index takes another provider's, or your own run from the DPP operator preset.
125
+ Read README.md for what go-live checks and for mainnet.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bsv/create-dpp-app",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.2",
4
4
  "description": "Scaffold a Digital Product Passport application on BSV: a web app, an API that writes and reads passports with the @bsv/dpp packages, and an offline dry run as its first test",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -8,6 +8,8 @@
8
8
  "create-dpp-app": "dist/index.js"
9
9
  },
10
10
  "files": [
11
+ "PATENTS",
12
+ "NOTICE",
11
13
  "dist",
12
14
  "template",
13
15
  "README.md",
@@ -17,17 +19,19 @@
17
19
  "node": ">=22"
18
20
  },
19
21
  "scripts": {
22
+ "prepack": "node -e \"const fs=require('fs');for(const f of ['NOTICE','PATENTS'])fs.copyFileSync('../../'+f,f)\"",
20
23
  "build": "tsc -p tsconfig.json",
21
24
  "typecheck": "tsc -p tsconfig.json --noEmit",
22
25
  "test": "node --test test/*.test.mjs",
23
26
  "scaffold:check": "node scripts/scaffold-check.mjs"
24
27
  },
25
28
  "dpp": {
26
- "releaseSet": "dpp-release-2026-10-10",
29
+ "releaseSet": "dpp-release-2026-11",
27
30
  "packages": {
28
- "@bsv/dpp-protocol": "0.3.0-beta.9",
29
- "@bsv/dpp-profiles": "0.3.0-beta.9",
30
- "@bsv/dpp-overlay": "0.4.0-beta.12",
31
+ "@bsv/dpp-protocol": "0.3.0-beta.10",
32
+ "@bsv/dpp-profiles": "0.3.0-beta.10",
33
+ "@bsv/dpp-overlay": "0.4.0-beta.13",
34
+ "@bsv/dpp-credentials": "0.2.0-beta.6",
31
35
  "@bsv/sdk": "2.8.10"
32
36
  }
33
37
  },
@@ -4,11 +4,12 @@
4
4
  #
5
5
  # The base image is a build argument so a build can take the same Docker
6
6
  # Official Image from a mirror, for example
7
- # --build-arg BASE_IMAGE=public.ecr.aws/docker/library/node:22-bookworm-slim
7
+ # --build-arg BASE_IMAGE=public.ecr.aws/docker/library/node:22.23.4-bookworm-slim
8
8
  # where Docker Hub rate limits apply. The default is Docker Hub's.
9
- ARG BASE_IMAGE=node:22-bookworm-slim
9
+ ARG BASE_IMAGE=node:22.23.4-bookworm-slim
10
10
 
11
11
  FROM ${BASE_IMAGE} AS build
12
+ RUN test "$(node --version)" = "v22.23.4"
12
13
  RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ && rm -rf /var/lib/apt/lists/*
13
14
  WORKDIR /app
14
15
  COPY package.json package-lock.json* ./
@@ -20,6 +21,7 @@ COPY . .
20
21
  RUN npm run build && npm prune --omit=dev
21
22
 
22
23
  FROM ${BASE_IMAGE}
24
+ RUN test "$(node --version)" = "v22.23.4"
23
25
  ENV NODE_ENV=production
24
26
  WORKDIR /app
25
27
  COPY --from=build /app/node_modules ./node_modules