Renumber the 15 reference docs into pillar groups (recipe -> anatomy): - 01 Build Recipe (entry), 02 Composition Root - domains: 10 Layering Rules - contract: 20 Spec-First Routing, 21 CRUD Template, 22 Auth Integration - interfaces/infra: 30 Infra Adapters - UI: 40 UI: Auto-Rendered Admin & Custom Pages (new; @aetoskia packages, client template, x- catalog via react-openapi MCP module) - pipelines: 50 Pipeline Scaffold, 51 Worker & Progress, 52 Human-in-the-Loop - delivery/meta: 90 Drone Pipelines, 91 Versioning & Changelog, 92 Genericity Matrix, 93 Library Registry, 94 Repository Inventory MCP module names are unchanged (NN_ prefix stripped); all cross-references (wiki, templates, hooks, registry) updated; lib index rewritten pillar-first; build recipe bootstraps the client template. Bundle + HTML sites regenerated.
90 lines
2.5 KiB
YAML
90 lines
2.5 KiB
YAML
---
|
|
kind: pipeline
|
|
type: docker
|
|
name: build-and-publish-npm
|
|
|
|
platform:
|
|
os: linux
|
|
arch: arm64
|
|
|
|
workspace:
|
|
path: /drone/src
|
|
|
|
steps:
|
|
- name: check-version
|
|
image: node:22-alpine
|
|
environment:
|
|
NPM_REPO_URL:
|
|
from_secret: NPM_REPO_URL
|
|
NPM_USERNAME:
|
|
from_secret: NPM_USERNAME
|
|
NPM_PASSWORD:
|
|
from_secret: NPM_PASSWORD
|
|
commands:
|
|
- apk add --no-cache curl
|
|
- PACKAGE_NAME=$(node -p "require('./package.json').name")
|
|
- VERSION=$(node -p "require('./package.json').version")
|
|
- |
|
|
if [ "$DRONE_TAG" != "$VERSION" ]; then
|
|
echo "Tag '$DRONE_TAG' does not match package.json version '$VERSION'; refusing to publish."
|
|
exit 1
|
|
fi
|
|
- echo "registry=$NPM_REPO_URL" > /tmp/.npmrc
|
|
- echo "_auth=$(echo -n "$NPM_USERNAME:$NPM_PASSWORD" | base64 | tr -d '\n')" >> /tmp/.npmrc
|
|
- echo "Checking if $PACKAGE_NAME@$VERSION exists on $NPM_REPO_URL ..."
|
|
- |
|
|
if npm view "$PACKAGE_NAME@$VERSION" version --userconfig /tmp/.npmrc >/dev/null 2>&1; then
|
|
echo "$PACKAGE_NAME@$VERSION already exists; skipping build."
|
|
exit 78
|
|
else
|
|
echo "New version detected: $PACKAGE_NAME@$VERSION"
|
|
fi
|
|
|
|
- name: quality-gate
|
|
image: node:22-alpine
|
|
environment:
|
|
NPM_REPO_URL:
|
|
from_secret: NPM_REPO_URL
|
|
NPM_USERNAME:
|
|
from_secret: NPM_USERNAME
|
|
NPM_PASSWORD:
|
|
from_secret: NPM_PASSWORD
|
|
commands:
|
|
- |
|
|
if [ -z "$NPM_REPO_URL" ] || [ -z "$NPM_USERNAME" ] || [ -z "$NPM_PASSWORD" ]; then
|
|
echo "NPM_REPO_URL / NPM_USERNAME / NPM_PASSWORD are not set" >&2
|
|
exit 1
|
|
fi
|
|
- echo "registry=$NPM_REPO_URL" > .npmrc
|
|
- echo "_auth=$(echo -n "$NPM_USERNAME:$NPM_PASSWORD" | base64 | tr -d '\n')" >> .npmrc
|
|
- npm install
|
|
- echo "Running quality gate..."
|
|
- npm run quality-gate
|
|
|
|
- name: build-package
|
|
image: node:22-alpine
|
|
commands:
|
|
- npm install
|
|
- echo "Building npm package..."
|
|
- npm run build
|
|
- ls -l dist
|
|
|
|
- name: publish-to-private-npm
|
|
image: node:22-alpine
|
|
environment:
|
|
NPM_REPO_URL:
|
|
from_secret: NPM_REPO_URL
|
|
NPM_USERNAME:
|
|
from_secret: NPM_USERNAME
|
|
NPM_PASSWORD:
|
|
from_secret: NPM_PASSWORD
|
|
commands:
|
|
- echo "registry=$NPM_REPO_URL" > .npmrc
|
|
- echo "_auth=$(echo -n "$NPM_USERNAME:$NPM_PASSWORD" | base64 | tr -d '\n')" >> .npmrc
|
|
- echo "Publishing to private npm at $NPM_REPO_URL ..."
|
|
- npm publish --access restricted
|
|
|
|
trigger:
|
|
event:
|
|
- tag
|