@percepta/create 3.6.2 → 4.0.0
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.
- package/README.md +37 -6
- package/dist/{git-ops-C2CIjuce.js → git-ops-BD7JNnal.js} +1 -1
- package/dist/{git-ops-C2CIjuce.js.map → git-ops-BD7JNnal.js.map} +1 -1
- package/dist/github-RCIMUq70.js +131 -0
- package/dist/github-RCIMUq70.js.map +1 -0
- package/dist/index.js +68 -125
- package/dist/index.js.map +1 -1
- package/dist/{init-sI9aIrkU.js → init-COp0nGdk.js} +4 -2
- package/dist/{init-sI9aIrkU.js.map → init-COp0nGdk.js.map} +1 -1
- package/dist/manifest-CqIDnbgs.js +58 -0
- package/dist/manifest-CqIDnbgs.js.map +1 -0
- package/dist/register-app-C7ZBpAaZ.js +103 -0
- package/dist/register-app-C7ZBpAaZ.js.map +1 -0
- package/dist/register-os-blueprint-DGjBUZYa.js +90 -0
- package/dist/register-os-blueprint-DGjBUZYa.js.map +1 -0
- package/dist/{status-CKe4aKso.js → status-BXYaQ4a2.js} +3 -3
- package/dist/{status-CKe4aKso.js.map → status-BXYaQ4a2.js.map} +1 -1
- package/dist/{sync-D1vkoofl.js → sync-BayU4w1j.js} +3 -3
- package/dist/{sync-D1vkoofl.js.map → sync-BayU4w1j.js.map} +1 -1
- package/dist/template-versions-CEIP9vhl.js +35 -0
- package/dist/template-versions-CEIP9vhl.js.map +1 -0
- package/dist/{upstream-gUHLWSR1.js → upstream-CZEzLrS4.js} +3 -3
- package/dist/{upstream-gUHLWSR1.js.map → upstream-CZEzLrS4.js.map} +1 -1
- package/dist/validate-dssldJAj.js +14 -0
- package/dist/validate-dssldJAj.js.map +1 -0
- package/package.json +1 -1
- package/template-versions.json +2 -2
- package/templates/infra/os.blueprint.yaml.template +138 -0
- package/templates/library/README.md +5 -2
- package/templates/library/gitignore.template +1 -0
- package/templates/library/package.json.template +17 -13
- package/templates/library/src/index.test.ts +8 -0
- package/templates/library/tsconfig.json +1 -17
- package/templates/library/tsdown.config.ts +3 -0
- package/templates/library/vitest.config.ts +3 -0
- package/templates/monorepo/.dockerignore +1 -0
- package/templates/monorepo/.github/CODEOWNERS +67 -0
- package/templates/monorepo/.github/actions/ci/action.yml +56 -0
- package/templates/monorepo/.github/workflows/build-and-publish.yml +22 -0
- package/templates/monorepo/.github/workflows/pr-build.yml +21 -0
- package/templates/monorepo/.node-version +1 -0
- package/templates/monorepo/README.md +41 -3
- package/templates/monorepo/auth/README.md +6 -3
- package/templates/monorepo/auth/package.json +5 -7
- package/templates/monorepo/auth/src/auth.ts +0 -1
- package/templates/monorepo/auth/src/config/database.ts +1 -1
- package/templates/monorepo/auth/tsconfig.json +1 -10
- package/templates/{webapp → monorepo}/docker-compose.yml +2 -2
- package/templates/monorepo/gitignore.template +1 -0
- package/templates/monorepo/oxfmt.config.ts.template +3 -0
- package/templates/monorepo/oxlint.config.ts.template +3 -0
- package/templates/monorepo/package.json.template +22 -11
- package/templates/monorepo/scripts/setup-local-databases.mjs +183 -0
- package/templates/monorepo/turbo.json +20 -0
- package/templates/webapp/.node-version +0 -1
- package/templates/webapp/AGENTS.md +33 -35
- package/templates/webapp/README.md +34 -38
- package/templates/webapp/agent-skills/database.md +21 -21
- package/templates/webapp/agent-skills/langfuse.md +7 -7
- package/templates/webapp/agent-skills/llm.md +4 -2
- package/templates/webapp/agent-skills/oneshot.md +7 -6
- package/templates/webapp/agent-skills/ryvn.md +12 -16
- package/templates/webapp/deploy/README.md +10 -51
- package/templates/webapp/drizzle.config.ts +2 -23
- package/templates/webapp/env.example.template +8 -14
- package/templates/webapp/globals.d.ts +1 -0
- package/templates/webapp/oxfmt.config.ts.template +5 -0
- package/templates/webapp/package.json.template +18 -33
- package/templates/webapp/scripts/seed.ts +1 -1
- package/templates/webapp/scripts/start.sh +12 -16
- package/templates/webapp/src/app/global-error.tsx +1 -1
- package/templates/webapp/src/config/getEnvConfig.ts +4 -10
- package/templates/webapp/src/config/isDev.ts +0 -2
- package/templates/webapp/src/drizzle/db.ts +6 -21
- package/templates/webapp/src/lib/auth-client.ts +6 -3
- package/templates/webapp/src/startup-checks.ts +28 -7
- package/templates/webapp/tsconfig.json +1 -12
- package/templates/webapp/vitest.config.ts +3 -7
- package/templates/library/eslint.config.js +0 -10
- package/templates/monorepo/auth/scripts/setup-database.ts +0 -11
- package/templates/monorepo/eslint.config.js +0 -10
- package/templates/monorepo/tsconfig.json +0 -16
- package/templates/webapp/.github/workflows/__APP_NAME__-terraform-ryvn-release.yaml +0 -92
- package/templates/webapp/.github/workflows/ci.yml +0 -149
- package/templates/webapp/.prettierrc.mjs +0 -5
- package/templates/webapp/agent-skills/deploy.md +0 -92
- package/templates/webapp/deploy/ryvn/__APP_NAME__-terraform.service.yaml +0 -10
- package/templates/webapp/deploy/ryvn/environments/percepta-test/installations/__APP_NAME__-terraform.env.percepta-test.serviceinstallation.yaml +0 -11
- package/templates/webapp/deploy/ryvn/environments/percepta-test/installations/__APP_NAME__.env.percepta-test.serviceinstallation.yaml +0 -154
- package/templates/webapp/eslint.config.mjs +0 -100
- package/templates/webapp/npmrc.template +0 -4
- package/templates/webapp/terraform/README.md +0 -147
- package/templates/webapp/terraform/deploy.sh +0 -97
- package/templates/webapp/terraform/main.tf +0 -101
- package/templates/webapp/terraform/modules/cloudtrail/main.tf +0 -27
- package/templates/webapp/terraform/modules/cloudtrail/outputs.tf +0 -10
- package/templates/webapp/terraform/modules/cloudtrail/variables.tf +0 -15
- package/templates/webapp/terraform/modules/networking/main.tf +0 -118
- package/templates/webapp/terraform/modules/networking/outputs.tf +0 -38
- package/templates/webapp/terraform/modules/networking/variables.tf +0 -24
- package/templates/webapp/terraform/modules/rds/main.tf +0 -227
- package/templates/webapp/terraform/modules/rds/outputs.tf +0 -73
- package/templates/webapp/terraform/modules/rds/variables.tf +0 -61
- package/templates/webapp/terraform/modules/s3-logging/main.tf +0 -148
- package/templates/webapp/terraform/modules/s3-logging/outputs.tf +0 -10
- package/templates/webapp/terraform/modules/s3-logging/variables.tf +0 -16
- package/templates/webapp/terraform/modules/secrets/main.tf +0 -39
- package/templates/webapp/terraform/modules/secrets/outputs.tf +0 -9
- package/templates/webapp/terraform/modules/secrets/variables.tf +0 -51
- package/templates/webapp/terraform/outputs.tf +0 -102
- package/templates/webapp/terraform/providers.tf +0 -32
- package/templates/webapp/terraform/schema/main.tf +0 -4
- package/templates/webapp/terraform/schema/outputs.tf +0 -9
- package/templates/webapp/terraform/schema/variables.tf +0 -19
- package/templates/webapp/terraform/schema/versions.tf +0 -38
- package/templates/webapp/terraform/terraform.tfvars.example +0 -65
- package/templates/webapp/terraform/variables.tf +0 -129
|
@@ -5,25 +5,29 @@
|
|
|
5
5
|
"description": "__APP_TITLE__",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"type": "module",
|
|
8
|
-
"main": "dist/index.
|
|
9
|
-
"
|
|
8
|
+
"main": "./dist/index.cjs",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
|
|
14
|
+
"require": { "types": "./dist/index.d.cts", "default": "./dist/index.cjs" }
|
|
15
|
+
},
|
|
16
|
+
"./package.json": "./package.json"
|
|
17
|
+
},
|
|
10
18
|
"files": [
|
|
11
|
-
"dist
|
|
19
|
+
"dist"
|
|
12
20
|
],
|
|
13
21
|
"scripts": {
|
|
14
|
-
"build": "
|
|
15
|
-
"dev": "
|
|
22
|
+
"build": "tsdown",
|
|
23
|
+
"dev": "tsdown --watch",
|
|
16
24
|
"clean": "rimraf dist",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"test": "echo \"No tests configured yet\""
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"test": "vitest run"
|
|
20
27
|
},
|
|
21
28
|
"devDependencies": {
|
|
29
|
+
"@percepta/build": "^1.0.0",
|
|
22
30
|
"@types/node": "^24.1.0",
|
|
23
|
-
"
|
|
24
|
-
"rimraf": "^5.0.5",
|
|
25
|
-
"tsup": "^8.4.0",
|
|
26
|
-
"typescript": "^5.8.3",
|
|
27
|
-
"typescript-eslint": "^8.33.0"
|
|
31
|
+
"vitest": "^4.0.0"
|
|
28
32
|
}
|
|
29
33
|
}
|
|
@@ -1,19 +1,3 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"lib": ["ES2022"],
|
|
5
|
-
"module": "NodeNext",
|
|
6
|
-
"moduleResolution": "NodeNext",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"declarationMap": true,
|
|
13
|
-
"sourceMap": true,
|
|
14
|
-
"outDir": "dist",
|
|
15
|
-
"rootDir": "src"
|
|
16
|
-
},
|
|
17
|
-
"include": ["src/**/*"],
|
|
18
|
-
"exclude": ["node_modules", "dist"]
|
|
2
|
+
"extends": "@percepta/build/tsconfig/library"
|
|
19
3
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# CODEOWNERS itself:
|
|
2
|
+
/.github/CODEOWNERS @Percepta-Core/build-foundations
|
|
3
|
+
|
|
4
|
+
# Workspace configuration:
|
|
5
|
+
/pnpm-workspace.yaml @Percepta-Core/build-foundations
|
|
6
|
+
/pnpm-lock.yaml @Percepta-Core/build-foundations
|
|
7
|
+
/turbo.json @Percepta-Core/build-foundations
|
|
8
|
+
/package.json @Percepta-Core/build-foundations
|
|
9
|
+
**/turbo.json @Percepta-Core/build-foundations
|
|
10
|
+
**/package.json @Percepta-Core/build-foundations
|
|
11
|
+
**/.npmrc @Percepta-Core/build-foundations
|
|
12
|
+
**/.nvmrc @Percepta-Core/build-foundations
|
|
13
|
+
**/.node-version @Percepta-Core/build-foundations
|
|
14
|
+
|
|
15
|
+
# TypeScript configuration:
|
|
16
|
+
**/tsconfig*.json @Percepta-Core/build-foundations
|
|
17
|
+
|
|
18
|
+
# Linting and formatting:
|
|
19
|
+
**/oxlint.config.* @Percepta-Core/build-foundations
|
|
20
|
+
**/oxfmt.config.* @Percepta-Core/build-foundations
|
|
21
|
+
**/eslint.config.* @Percepta-Core/build-foundations
|
|
22
|
+
**/prettier.config.* @Percepta-Core/build-foundations
|
|
23
|
+
|
|
24
|
+
# Test runners and test infrastructure:
|
|
25
|
+
**/vitest*.config.* @Percepta-Core/build-foundations
|
|
26
|
+
**/vitest.setup.* @Percepta-Core/build-foundations
|
|
27
|
+
**/jest.config.* @Percepta-Core/build-foundations
|
|
28
|
+
**/playwright.config.* @Percepta-Core/build-foundations
|
|
29
|
+
|
|
30
|
+
# Bundlers, transpilers, framework configs, codegen:
|
|
31
|
+
**/tsdown.config.* @Percepta-Core/build-foundations
|
|
32
|
+
**/vite.config.* @Percepta-Core/build-foundations
|
|
33
|
+
**/rollup.config.* @Percepta-Core/build-foundations
|
|
34
|
+
**/webpack.config.* @Percepta-Core/build-foundations
|
|
35
|
+
**/esbuild.config.* @Percepta-Core/build-foundations
|
|
36
|
+
**/next.config.* @Percepta-Core/build-foundations
|
|
37
|
+
**/babel.config.* @Percepta-Core/build-foundations
|
|
38
|
+
**/swc.config.* @Percepta-Core/build-foundations
|
|
39
|
+
**/postcss.config.* @Percepta-Core/build-foundations
|
|
40
|
+
**/tailwind.config.* @Percepta-Core/build-foundations
|
|
41
|
+
**/drizzle.config.* @Percepta-Core/build-foundations
|
|
42
|
+
**/orval.config.* @Percepta-Core/build-foundations
|
|
43
|
+
|
|
44
|
+
# CI/CD:
|
|
45
|
+
/.github/ @Percepta-Core/build-foundations
|
|
46
|
+
**/.github/ @Percepta-Core/build-foundations
|
|
47
|
+
|
|
48
|
+
# Git hooks, repo metadata:
|
|
49
|
+
/.husky/ @Percepta-Core/build-foundations
|
|
50
|
+
**/.gitattributes @Percepta-Core/build-foundations
|
|
51
|
+
**/.gitignore @Percepta-Core/build-foundations
|
|
52
|
+
|
|
53
|
+
# Container, orchestration, deploy infrastructure:
|
|
54
|
+
/Dockerfile @Percepta-Core/build-foundations
|
|
55
|
+
/Dockerfile.* @Percepta-Core/build-foundations
|
|
56
|
+
**/Dockerfile @Percepta-Core/build-foundations
|
|
57
|
+
**/Dockerfile.* @Percepta-Core/build-foundations
|
|
58
|
+
/docker-compose*.yml @Percepta-Core/build-foundations
|
|
59
|
+
/docker-compose*.yaml @Percepta-Core/build-foundations
|
|
60
|
+
/.dockerignore @Percepta-Core/build-foundations
|
|
61
|
+
**/.dockerignore @Percepta-Core/build-foundations
|
|
62
|
+
|
|
63
|
+
# Workspace developer tooling (IDE, agents, in-editor settings):
|
|
64
|
+
/.vscode/ @Percepta-Core/build-foundations
|
|
65
|
+
/.cursor/ @Percepta-Core/build-foundations
|
|
66
|
+
/.codeium/ @Percepta-Core/build-foundations
|
|
67
|
+
/.windsurfrules @Percepta-Core/build-foundations
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
description: Install dependencies, then build, typecheck, lint, format-check, migration-check, and test the workspace. Relies on Turbo's remote cache (when a token is provided) to dedupe work across invocations.
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
turbo-token:
|
|
6
|
+
description: Turborepo remote cache token. Optional; without it, Turbo runs without remote cache.
|
|
7
|
+
required: false
|
|
8
|
+
turbo-team:
|
|
9
|
+
description: Turborepo team slug paired with `turbo-token`.
|
|
10
|
+
required: false
|
|
11
|
+
|
|
12
|
+
runs:
|
|
13
|
+
using: composite
|
|
14
|
+
steps:
|
|
15
|
+
- name: Setup PNPM
|
|
16
|
+
uses: pnpm/action-setup@v4
|
|
17
|
+
|
|
18
|
+
- name: Setup Node
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version-file: .node-version
|
|
22
|
+
cache: pnpm
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
shell: bash
|
|
26
|
+
env:
|
|
27
|
+
NPM_TOKEN: ${{ env.NPM_TOKEN }}
|
|
28
|
+
run: pnpm install --frozen-lockfile
|
|
29
|
+
|
|
30
|
+
- name: Fail if lockfile changed
|
|
31
|
+
shell: bash
|
|
32
|
+
run: git diff --exit-code pnpm-lock.yaml
|
|
33
|
+
|
|
34
|
+
- name: Build, typecheck, test
|
|
35
|
+
shell: bash
|
|
36
|
+
env:
|
|
37
|
+
NODE_OPTIONS: --max-old-space-size=4096
|
|
38
|
+
TURBO_TOKEN: ${{ inputs.turbo-token }}
|
|
39
|
+
TURBO_TEAM: ${{ inputs.turbo-team }}
|
|
40
|
+
run: pnpm exec turbo run build typecheck test --continue
|
|
41
|
+
|
|
42
|
+
- name: Lint
|
|
43
|
+
shell: bash
|
|
44
|
+
run: pnpm lint
|
|
45
|
+
|
|
46
|
+
- name: Format check
|
|
47
|
+
shell: bash
|
|
48
|
+
run: pnpm format --check
|
|
49
|
+
|
|
50
|
+
- name: Generate migration check
|
|
51
|
+
shell: bash
|
|
52
|
+
run: pnpm -r run db:generate
|
|
53
|
+
|
|
54
|
+
- name: Check for journal changes
|
|
55
|
+
shell: bash
|
|
56
|
+
run: git diff --exit-code -- '**/drizzle/migrations/meta/_journal.json'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Build and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
env:
|
|
8
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
ci:
|
|
12
|
+
name: CI
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout repository
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Run CI
|
|
19
|
+
uses: ./.github/actions/ci
|
|
20
|
+
with:
|
|
21
|
+
turbo-token: ${{ secrets.TURBO_TOKEN }}
|
|
22
|
+
turbo-team: ${{ vars.TURBO_TEAM }}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: PR Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request: {}
|
|
5
|
+
|
|
6
|
+
env:
|
|
7
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
ci:
|
|
11
|
+
name: CI
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout repository
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Run CI
|
|
18
|
+
uses: ./.github/actions/ci
|
|
19
|
+
with:
|
|
20
|
+
turbo-token: ${{ secrets.TURBO_TOKEN }}
|
|
21
|
+
turbo-team: ${{ vars.TURBO_TEAM }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
24.4.1
|
|
@@ -11,7 +11,7 @@ pnpm install
|
|
|
11
11
|
# Run development mode for all packages
|
|
12
12
|
pnpm dev
|
|
13
13
|
|
|
14
|
-
# Set up local services, access-control topology,
|
|
14
|
+
# Set up root local services, databases, access-control topology, and seed users
|
|
15
15
|
pnpm run setup
|
|
16
16
|
|
|
17
17
|
# Add another Mosaic package using this workspace's pinned generator
|
|
@@ -35,10 +35,23 @@ pnpm lint
|
|
|
35
35
|
```
|
|
36
36
|
access/ # Customer-level SpiceDB fixtures and generated merge artifacts
|
|
37
37
|
auth/ # Shared Better Auth users/groups package for this customer
|
|
38
|
+
docker-compose.yml # Root-owned local PostgreSQL and SpiceDB services
|
|
39
|
+
scripts/ # Root-owned local infrastructure helpers
|
|
38
40
|
packages/
|
|
39
41
|
└── your-package/ # Application and library packages
|
|
40
42
|
```
|
|
41
43
|
|
|
44
|
+
## Local Infrastructure
|
|
45
|
+
|
|
46
|
+
Local development infrastructure is owned by the monorepo root. `pnpm run setup`
|
|
47
|
+
starts the root Docker Compose services, creates the shared `auth` database,
|
|
48
|
+
discovers app `DATABASE_URL`s from `packages/*/.env.local`, creates those app
|
|
49
|
+
databases, runs auth and app migrations, and seeds local users/grants.
|
|
50
|
+
|
|
51
|
+
When you add another webapp with `pnpm mosaic add webapp my-app`, the generated
|
|
52
|
+
app gets its own local `DATABASE_URL`. Re-running `pnpm run setup` creates that
|
|
53
|
+
database before running migrations.
|
|
54
|
+
|
|
42
55
|
## Access Control
|
|
43
56
|
|
|
44
57
|
Application builders define app-local Zed schemas in each package's
|
|
@@ -56,7 +69,7 @@ PR CI merges the customer schema and runs static schema/manifest validation.
|
|
|
56
69
|
`access:apply` is reserved for trusted deploy jobs and should run once per
|
|
57
70
|
target environment with that environment's SpiceDB credentials.
|
|
58
71
|
|
|
59
|
-
For local development, `pnpm run setup` seeds
|
|
72
|
+
For local development, `pnpm run setup` seeds each generated app's default dev
|
|
60
73
|
users and access grants. For additional local grants, copy the example fixture
|
|
61
74
|
files in `access/`, fill in customer-global user/group IDs from `auth/`, then
|
|
62
75
|
run:
|
|
@@ -83,4 +96,29 @@ pnpm mosaic add webapp my-app
|
|
|
83
96
|
pnpm mosaic add library my-lib
|
|
84
97
|
```
|
|
85
98
|
|
|
86
|
-
The compatibility metadata
|
|
99
|
+
The customer slug and compatibility metadata live in `.mosaic-workspace.json`.
|
|
100
|
+
|
|
101
|
+
## Registering the customer OS blueprint
|
|
102
|
+
|
|
103
|
+
To register this customer monorepo's OS blueprint in `Percepta-Core/infra`,
|
|
104
|
+
run:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
pnpm mosaic infra register-os-blueprint
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The command reads the customer slug from `.mosaic-workspace.json`, opens or
|
|
111
|
+
updates an infra PR that writes
|
|
112
|
+
`ryvn/definitions/<customer>/blueprints/<customer>-os.blueprint.yaml`, and does
|
|
113
|
+
not create environment installations. It authenticates with `GITHUB_TOKEN`,
|
|
114
|
+
`GH_TOKEN`, or the GitHub CLI's `gh auth token`.
|
|
115
|
+
|
|
116
|
+
After adding a webapp, register its app database in the customer OS blueprint:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pnpm mosaic infra register-app my-app
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
This opens or updates an infra PR that adds `my-app: {}` to the customer OS
|
|
123
|
+
blueprint's `app_databases` default. Merge the OS blueprint PR before
|
|
124
|
+
registering apps.
|
|
@@ -22,6 +22,9 @@ lands.
|
|
|
22
22
|
|
|
23
23
|
## Database
|
|
24
24
|
|
|
25
|
-
By default this package uses
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
By default this package uses a shared `auth` database with local PostgreSQL
|
|
26
|
+
defaults. Remote deployments should inject `AUTH_DATABASE_URL` from the
|
|
27
|
+
monorepo auth database Secret.
|
|
28
|
+
|
|
29
|
+
Do not use app `DATABASE_URL` for this package. That belongs to each webapp's
|
|
30
|
+
own database.
|
|
@@ -11,20 +11,18 @@
|
|
|
11
11
|
"./schema": "./src/drizzle/schema/index.ts"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
-
"
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
15
|
"db:generate": "drizzle-kit generate",
|
|
16
|
-
"db:migrate": "drizzle-kit migrate"
|
|
17
|
-
"db:setup": "tsx ./scripts/setup-database.ts",
|
|
18
|
-
"db:setup-and-migrate": "pnpm db:setup && pnpm db:migrate"
|
|
16
|
+
"db:migrate": "drizzle-kit migrate"
|
|
19
17
|
},
|
|
20
18
|
"dependencies": {
|
|
21
|
-
"@percepta/auth": "0.1.
|
|
19
|
+
"@percepta/auth": "^0.1.4",
|
|
22
20
|
"drizzle-orm": "^0.45.2"
|
|
23
21
|
},
|
|
24
22
|
"devDependencies": {
|
|
23
|
+
"@percepta/build": "^1.0.0",
|
|
25
24
|
"@types/node": "^24.1.0",
|
|
26
25
|
"drizzle-kit": "^0.31.4",
|
|
27
|
-
"tsx": "^4.20.3"
|
|
28
|
-
"typescript": "^5.8.3"
|
|
26
|
+
"tsx": "^4.20.3"
|
|
29
27
|
}
|
|
30
28
|
}
|
|
@@ -5,7 +5,6 @@ import { sessions } from "./drizzle/schema/auth/sessions";
|
|
|
5
5
|
import { verifications } from "./drizzle/schema/auth/verifications";
|
|
6
6
|
import { users } from "./drizzle/schema/users";
|
|
7
7
|
|
|
8
|
-
// eslint-disable-next-line n/no-process-env -- detecting Next.js build phase
|
|
9
8
|
const isBuildPhase = process.env.NEXT_PHASE === "phase-production-build";
|
|
10
9
|
|
|
11
10
|
function requiredEnv(name: string): string {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
export type { AuthDatabaseConfig } from "@percepta/auth";
|
|
8
8
|
|
|
9
9
|
export function getAuthDatabaseConfig(): AuthDatabaseConfig {
|
|
10
|
-
return readAuthDatabaseConfig({ defaultDatabaseName: "
|
|
10
|
+
return readAuthDatabaseConfig({ defaultDatabaseName: "auth" });
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function getAuthDatabaseConnectionString(): string {
|
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"declaration": false,
|
|
5
|
-
"declarationMap": false,
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"moduleResolution": "Bundler",
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"types": ["node"]
|
|
10
|
-
},
|
|
11
|
-
"include": ["drizzle.config.ts", "src/**/*.ts"]
|
|
2
|
+
"extends": "@percepta/build/tsconfig/library"
|
|
12
3
|
}
|
|
@@ -22,11 +22,11 @@ services:
|
|
|
22
22
|
environment:
|
|
23
23
|
POSTGRES_USER: postgres
|
|
24
24
|
POSTGRES_PASSWORD: postgres
|
|
25
|
-
POSTGRES_DB:
|
|
25
|
+
POSTGRES_DB: postgres
|
|
26
26
|
volumes:
|
|
27
27
|
- postgres_data:/var/lib/postgresql/data
|
|
28
28
|
healthcheck:
|
|
29
|
-
test: ["CMD-SHELL", "pg_isready -U postgres -d
|
|
29
|
+
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
|
|
30
30
|
interval: 5s
|
|
31
31
|
timeout: 5s
|
|
32
32
|
retries: 5
|
|
@@ -3,16 +3,21 @@
|
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "__APP_TITLE__",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"preinstall": "npx only-allow pnpm",
|
|
8
9
|
"mosaic": "pnpm dlx __CREATE_PACKAGE__@__CREATE_VERSION__",
|
|
9
|
-
"setup": "pnpm
|
|
10
|
+
"setup": "pnpm run docker:up && pnpm run db:setup-local && pnpm run auth:db:migrate && pnpm run access:apply-local && pnpm -r --filter './packages/*' --if-present run db:migrate && pnpm -r --filter './packages/*' --if-present run db:seed",
|
|
11
|
+
"docker:up": "docker compose up -d --wait",
|
|
12
|
+
"docker:down": "docker compose down",
|
|
13
|
+
"db:setup-local": "node scripts/setup-local-databases.mjs",
|
|
10
14
|
"dev": "pnpm -r --parallel --if-present run dev",
|
|
11
|
-
"build": "
|
|
12
|
-
"clean": "
|
|
13
|
-
"
|
|
14
|
-
"lint
|
|
15
|
-
"
|
|
15
|
+
"build": "turbo run build",
|
|
16
|
+
"clean": "turbo run clean",
|
|
17
|
+
"typecheck": "turbo run typecheck",
|
|
18
|
+
"lint": "oxlint",
|
|
19
|
+
"format": "oxfmt",
|
|
20
|
+
"test": "turbo run test",
|
|
16
21
|
"access:merge": "percepta-access-control merge --apps-dir \"$PWD/packages\" --out-dir access",
|
|
17
22
|
"access:validate": "percepta-access-control validate --apps-dir \"$PWD/packages\"",
|
|
18
23
|
"access:apply": "pnpm run access:merge && percepta-access-control apply --schema access/merged.zed --applications access/applications.generated.json",
|
|
@@ -22,17 +27,23 @@
|
|
|
22
27
|
"access:bootstrap-customer-admin": "percepta-access-control bootstrap-customer-admin",
|
|
23
28
|
"access:apply-bootstrap-grants": "percepta-access-control apply-bootstrap-grants --fixture access/bootstrap-grants.yaml",
|
|
24
29
|
"access:reconcile": "percepta-access-control reconcile --input access/reconcile.yaml",
|
|
25
|
-
"auth:db:
|
|
30
|
+
"auth:db:migrate": "pnpm --dir auth run db:migrate"
|
|
26
31
|
},
|
|
27
32
|
"engines": {
|
|
28
33
|
"node": ">=20",
|
|
29
|
-
"pnpm": ">=
|
|
34
|
+
"pnpm": ">=10"
|
|
30
35
|
},
|
|
36
|
+
"packageManager": "pnpm@10.6.4",
|
|
31
37
|
"devDependencies": {
|
|
32
|
-
"@percepta/access-control": "0.
|
|
38
|
+
"@percepta/access-control": "^1.0.0",
|
|
39
|
+
"@percepta/build": "^1.0.0",
|
|
33
40
|
"@types/node": "^24.1.0",
|
|
34
|
-
"
|
|
41
|
+
"oxfmt": "^0.47.0",
|
|
42
|
+
"oxlint": "^1.61.0",
|
|
43
|
+
"oxlint-tsgolint": "^0.22.0",
|
|
35
44
|
"rimraf": "^5.0.5",
|
|
36
|
-
"
|
|
45
|
+
"tsdown": "^0.21.10",
|
|
46
|
+
"turbo": "^2.9.6",
|
|
47
|
+
"typescript": "^6.0.3"
|
|
37
48
|
}
|
|
38
49
|
}
|