fix: install shared packages over git, unbreaking CI
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
Some checks failed
Architecture Governance / architecture (push) Has been cancelled
The Verdaccio registry introduced earlier is unreachable from CI (listens on 127.0.0.1:4873 behind a firewall allowing only 80/443/SSH), which broke the architecture-governance workflow - its npm ci step could no longer resolve @marketplaces/auth. Packages are now published to git release branches (release/auth, release/payment in vitanovaPackages) whose root is the package itself, and installed with git+<repo>#release/auth. No registry, token, tunnel, or CI secret - anonymous git read is enough. - package.json: git dependency; .npmrc removed (no scope mapping needed) - vitanovaPackages release.yml rebuilt to force-push release branches - ADR-0001 amended with the distribution change and why the registry lost - BACKEND-HANDOFF: added the multi-tenancy section (hostname -> tenantKey -> per-tenant bootstrap config), corrected the install and deploy notes, and recorded that no CD pipeline exists - PACKAGE-EXTRACTION / PACKAGES-USAGE rewritten for the git-branch flow Verified: npm ci, arch:check:boundaries, ng build, 103/103 tests, all with no credentials configured. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,31 +4,21 @@ How to install and consume the shared packages in `marketplaces` or any other pr
|
||||
|
||||
## 1. Install
|
||||
|
||||
Both packages live on a private Verdaccio registry on the dev server, **not npmjs**. Two things are needed: a scope mapping and an auth token.
|
||||
Nothing to set up. The packages are installed straight over git from release branches in [vitanovaPackages](https://sources.vitanova.network/sdarbinyan/vitanovaPackages.git), where the repo root *is* the package:
|
||||
|
||||
Scope mapping goes in the project's `.npmrc` (already committed in `marketplaces`):
|
||||
|
||||
```
|
||||
@marketplaces:registry=http://127.0.0.1:4873/
|
||||
```json
|
||||
"@marketplaces/auth": "git+https://sources.vitanova.network/sdarbinyan/vitanovaPackages.git#release/auth"
|
||||
```
|
||||
|
||||
The token is per-developer and **never committed**. Open a tunnel to the registry, then log in once:
|
||||
That is already in `marketplaces`' `package.json`, so a fresh clone plus `npm install` just works — **no npm registry, no auth token, no SSH tunnel, no CI secret.** Anonymous git read is the only requirement.
|
||||
|
||||
To add it to another project:
|
||||
|
||||
```bash
|
||||
ssh -L 4873:127.0.0.1:4873 seto@213.21.246.138
|
||||
npm install "git+https://sources.vitanova.network/sdarbinyan/vitanovaPackages.git#release/auth"
|
||||
```
|
||||
|
||||
```bash
|
||||
npm login --registry=http://127.0.0.1:4873/ --scope=@marketplaces
|
||||
```
|
||||
|
||||
Then install normally:
|
||||
|
||||
```bash
|
||||
npm install @marketplaces/auth
|
||||
```
|
||||
|
||||
Versions are pinned exactly (`"@marketplaces/auth": "0.1.0"`, no `^`/`~`) — see [ADR-0001](context/adrs/ADR-0001-extract-auth-and-payment-into-shared-marketplaces-packages.md) on registry-outage blast radius.
|
||||
**On pinning:** a branch ref tracks the tip, so `npm install` can pick up a new build. That is deliberate while the package churns. For reproducible installs, replace `#release/auth` with a commit SHA. See [ADR-0001](context/adrs/ADR-0001-extract-auth-and-payment-into-shared-marketplaces-packages.md) on blast radius.
|
||||
|
||||
## 2. Required providers
|
||||
|
||||
@@ -129,8 +119,8 @@ Published at `0.1.0` but **scaffold only** — no implementation yet, nothing ex
|
||||
1. Clone [vitanovaPackages](https://sources.vitanova.network/sdarbinyan/vitanovaPackages.git).
|
||||
2. Edit under `packages/auth/src` (or `packages/payment/src`), export from `index.ts`.
|
||||
3. `npx changeset` at the repo root — pick the package and bump type, write one line about the change.
|
||||
4. Commit, push, open a PR to `main`.
|
||||
5. On merge, CI opens a version-bump PR; merging *that* publishes the new version. (Currently blocked — see [PACKAGE-EXTRACTION.md](PACKAGE-EXTRACTION.md) §2/§4 for the registry-reachability follow-up. Until then, publish manually through the tunnel.)
|
||||
6. In `marketplaces`, bump the pinned version and run the build + test suite before merging.
|
||||
4. Commit, push, open a PR to `main`. CI builds, tests, and rejects the PR if the changeset is missing.
|
||||
5. On merge, CI rebuilds and force-pushes `release/auth` / `release/payment`, and opens a "Version Packages" PR if there are unreleased changesets.
|
||||
6. In `marketplaces`, run `npm update @marketplaces/auth`, then the build + test suite before merging.
|
||||
|
||||
Do not edit `node_modules/@marketplaces/*` directly — it is overwritten on every install.
|
||||
Never commit to a `release/*` branch — they are generated and force-pushed. Never edit `node_modules/@marketplaces/*` — overwritten on every install.
|
||||
|
||||
Reference in New Issue
Block a user