commit 5567154fb40c999f1b60e2d78003a4f2ddb8b99b Author: sdarbinyan Date: Tue Aug 18 00:38:08 2026 +0400 chore: initial scaffold for @marketplaces/auth and @marketplaces/payment diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..46861c0 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "access": "restricted", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4e9d577 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +on: + push: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + registry-url: https://registry.npmjs.org + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Test + run: npm test + + - name: Create release PR or publish + uses: changesets/action@v1 + with: + version: npm run version + publish: npm run release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a11c523 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +packages/*/dist +*.log diff --git a/README.md b/README.md new file mode 100644 index 0000000..f98b6c6 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# vitanovaPackages + +Shared `@marketplaces/auth` and `@marketplaces/payment` client packages, consumed by `marketplaces` and other projects as npm dependencies. Extracted per ADR-0001 (see the `marketplaces` repo: `docs/context/adrs/ADR-0001-extract-auth-and-payment-into-shared-marketplaces-packages.md`). + +## Layout + +npm workspaces monorepo: +- `packages/auth` — customer + admin auth client +- `packages/payment` — payment/finance client (thin — business logic stays backend) + +## Versioning & release + +[Changesets](https://github.com/changesets/changesets): `npm run changeset` to record an intended bump per PR, `.github/workflows/release.yml` opens a version PR on push to `main` and publishes on merge. + +`.github/workflows/release.yml` is written as GitHub Actions — if this host runs Gitea/Forgejo Actions the syntax is compatible; for Drone/Woodpecker or another CI it needs translating (same three steps: install, build+test, `changesets/action` equivalent). + +Needs repo secrets: `NPM_TOKEN` (publish), `GITHUB_TOKEN` (provided by GH Actions; on Gitea use the built-in token equivalent). + +## Status + +Scaffold only — no auth/payment implementation code has migrated in yet. Source is still live in the `marketplaces` repo (`src/app/core/auth`, `core/admin-auth`, `core/finance`, `core/pricing`) pending migration. diff --git a/package.json b/package.json new file mode 100644 index 0000000..0bb24da --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "vitanova-packages", + "version": "0.0.0", + "private": true, + "workspaces": ["packages/*"], + "scripts": { + "build": "npm run build --workspaces --if-present", + "test": "npm run test --workspaces --if-present", + "changeset": "changeset", + "version": "changeset version", + "release": "npm run build && changeset publish" + }, + "devDependencies": { + "@changesets/cli": "^2.27.0", + "typescript": "~6.0.3" + } +} diff --git a/packages/auth/package.json b/packages/auth/package.json new file mode 100644 index 0000000..d4c19b8 --- /dev/null +++ b/packages/auth/package.json @@ -0,0 +1,21 @@ +{ + "name": "@marketplaces/auth", + "version": "0.1.0", + "description": "Shared customer + admin auth client (VK ID/OTP/session, ed25519 admin verification, guards, interceptors) for marketplaces projects.", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": ["dist"], + "scripts": { + "build": "tsc -p tsconfig.json", + "test": "echo \"no tests yet\" && exit 0" + }, + "peerDependencies": { + "@angular/core": ">=22.0.0", + "@angular/common": ">=22.0.0", + "rxjs": ">=7.8.0" + }, + "publishConfig": { + "access": "restricted" + }, + "license": "UNLICENSED" +} diff --git a/packages/auth/src/index.ts b/packages/auth/src/index.ts new file mode 100644 index 0000000..65b6866 --- /dev/null +++ b/packages/auth/src/index.ts @@ -0,0 +1,5 @@ +// @marketplaces/auth — public API barrel. +// Scaffold only: code migrates here from src/app/core/auth and src/app/core/admin-auth +// per ADR-0001 (marketplaces repo: docs/context/adrs/ADR-0001-extract-auth-and-payment-into-shared-marketplaces-packages.md). +// Nothing is exported yet — the marketplaces repo still owns the live implementation until migration lands. +export {}; diff --git a/packages/auth/tsconfig.json b/packages/auth/tsconfig.json new file mode 100644 index 0000000..c233a2a --- /dev/null +++ b/packages/auth/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ES2022", + "moduleResolution": "bundler", + "declaration": true, + "outDir": "dist", + "rootDir": "src", + "strict": true, + "skipLibCheck": true, + "experimentalDecorators": true, + "useDefineForClassFields": false + }, + "include": ["src"] +} diff --git a/packages/payment/package.json b/packages/payment/package.json new file mode 100644 index 0000000..af18e90 --- /dev/null +++ b/packages/payment/package.json @@ -0,0 +1,21 @@ +{ + "name": "@marketplaces/payment", + "version": "0.1.0", + "description": "Shared payment/finance client (FX, pricing, checkout gateways) for marketplaces projects. Thin by design — payment business logic stays server-side per Phase 1/7 backend contracts.", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": ["dist"], + "scripts": { + "build": "tsc -p tsconfig.json", + "test": "echo \"no tests yet\" && exit 0" + }, + "peerDependencies": { + "@angular/core": ">=22.0.0", + "@angular/common": ">=22.0.0", + "rxjs": ">=7.8.0" + }, + "publishConfig": { + "access": "restricted" + }, + "license": "UNLICENSED" +} diff --git a/packages/payment/src/index.ts b/packages/payment/src/index.ts new file mode 100644 index 0000000..2a2718c --- /dev/null +++ b/packages/payment/src/index.ts @@ -0,0 +1,5 @@ +// @marketplaces/payment — public API barrel. +// Scaffold only: code migrates here from src/app/core/finance and src/app/core/pricing +// per ADR-0001 (marketplaces repo: docs/context/adrs/ADR-0001-extract-auth-and-payment-into-shared-marketplaces-packages.md). +// Nothing is exported yet — the marketplaces repo still owns the live implementation until migration lands. +export {}; diff --git a/packages/payment/tsconfig.json b/packages/payment/tsconfig.json new file mode 100644 index 0000000..c233a2a --- /dev/null +++ b/packages/payment/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ES2022", + "moduleResolution": "bundler", + "declaration": true, + "outDir": "dist", + "rootDir": "src", + "strict": true, + "skipLibCheck": true, + "experimentalDecorators": true, + "useDefineForClassFields": false + }, + "include": ["src"] +}