@percepta/create 3.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 +93 -0
- package/dist/chunk-GEVZERMP.js +108 -0
- package/dist/chunk-R4FWPE4A.js +49 -0
- package/dist/chunk-WMJT7CB5.js +57 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +974 -0
- package/dist/init-Z4VGBHAK.js +96 -0
- package/dist/status-MITGDLTT.js +76 -0
- package/dist/sync-J4SFZHDX.js +136 -0
- package/dist/upstream-AQI7P4EU.js +144 -0
- package/package.json +58 -0
- package/template-versions.json +4 -0
- package/templates/library/README.md +30 -0
- package/templates/library/eslint.config.js +10 -0
- package/templates/library/gitignore.template +18 -0
- package/templates/library/package.json.template +29 -0
- package/templates/library/src/index.ts +9 -0
- package/templates/library/tsconfig.json +19 -0
- package/templates/monorepo/README.md +41 -0
- package/templates/monorepo/eslint.config.js +10 -0
- package/templates/monorepo/gitignore.template +31 -0
- package/templates/monorepo/npmrc.template +4 -0
- package/templates/monorepo/package.json.template +25 -0
- package/templates/monorepo/packages/.gitkeep +0 -0
- package/templates/monorepo/pnpm-workspace.yaml +2 -0
- package/templates/monorepo/tsconfig.json +16 -0
- package/templates/webapp/.claude/commands/sync.md +19 -0
- package/templates/webapp/.claude/commands/upstream.md +17 -0
- package/templates/webapp/.dockerignore +59 -0
- package/templates/webapp/.gitattributes +1 -0
- package/templates/webapp/.github/workflows/__APP_NAME__-ryvn-release.yaml +114 -0
- package/templates/webapp/.github/workflows/__APP_NAME__-terraform.yml +28 -0
- package/templates/webapp/.github/workflows/ci.yml +149 -0
- package/templates/webapp/.node-version +2 -0
- package/templates/webapp/.prettierrc.mjs +5 -0
- package/templates/webapp/AGENTS.md +240 -0
- package/templates/webapp/Dockerfile +64 -0
- package/templates/webapp/README.md +200 -0
- package/templates/webapp/agent-skills/database.md +140 -0
- package/templates/webapp/agent-skills/deploy.md +94 -0
- package/templates/webapp/agent-skills/inngest.md +147 -0
- package/templates/webapp/agent-skills/langfuse.md +117 -0
- package/templates/webapp/agent-skills/oneshot.md +216 -0
- package/templates/webapp/agent-skills/ryvn.md +25 -0
- package/templates/webapp/deploy/README.md +39 -0
- package/templates/webapp/deploy/ryvn/__APP_NAME__.service.yaml +11 -0
- package/templates/webapp/deploy/ryvn/environments/percepta-test/installations/__APP_NAME__.env.percepta-test.serviceinstallation.yaml +121 -0
- package/templates/webapp/docker-compose.yml +19 -0
- package/templates/webapp/drizzle.config.ts +30 -0
- package/templates/webapp/env.example.template +44 -0
- package/templates/webapp/eslint.config.mjs +52 -0
- package/templates/webapp/gitignore.template +53 -0
- package/templates/webapp/next.config.ts +8 -0
- package/templates/webapp/npmrc.template +4 -0
- package/templates/webapp/package.json.template +122 -0
- package/templates/webapp/postcss.config.mjs +5 -0
- package/templates/webapp/scripts/create-user.ts +47 -0
- package/templates/webapp/scripts/migrate.ts +18 -0
- package/templates/webapp/scripts/seed.ts +62 -0
- package/templates/webapp/scripts/setup-database.ts +57 -0
- package/templates/webapp/scripts/setup-readonly-user.ts +193 -0
- package/templates/webapp/scripts/start.sh +52 -0
- package/templates/webapp/src/app/(app)/layout.tsx +21 -0
- package/templates/webapp/src/app/(app)/page.tsx +30 -0
- package/templates/webapp/src/app/(auth)/auth/signin/CredentialsSignInForm.tsx +103 -0
- package/templates/webapp/src/app/(auth)/auth/signin/page.tsx +30 -0
- package/templates/webapp/src/app/(auth)/layout.tsx +15 -0
- package/templates/webapp/src/app/api/auth/[...all]/route.ts +4 -0
- package/templates/webapp/src/app/api/healthz/route.ts +10 -0
- package/templates/webapp/src/app/api/inngest/route.ts +31 -0
- package/templates/webapp/src/app/api/readyz/route.ts +31 -0
- package/templates/webapp/src/app/api/trpc/[trpc]/route.ts +21 -0
- package/templates/webapp/src/app/favicon.ico +0 -0
- package/templates/webapp/src/app/global-error.tsx +27 -0
- package/templates/webapp/src/app/layout.tsx +18 -0
- package/templates/webapp/src/components/FaroProvider.tsx +37 -0
- package/templates/webapp/src/components/Header.tsx +70 -0
- package/templates/webapp/src/components/Providers.tsx +45 -0
- package/templates/webapp/src/components/form/FormItem.tsx +82 -0
- package/templates/webapp/src/config/clientEnvConfig.ts +11 -0
- package/templates/webapp/src/config/getEnvConfig.ts +62 -0
- package/templates/webapp/src/config/isDev.ts +7 -0
- package/templates/webapp/src/drizzle/db.ts +28 -0
- package/templates/webapp/src/drizzle/migrations/0000_eager_grandmaster.sql +57 -0
- package/templates/webapp/src/drizzle/migrations/meta/0000_snapshot.json +376 -0
- package/templates/webapp/src/drizzle/migrations/meta/_journal.json +13 -0
- package/templates/webapp/src/drizzle/schema/auth/accounts.ts +33 -0
- package/templates/webapp/src/drizzle/schema/auth/sessions.ts +25 -0
- package/templates/webapp/src/drizzle/schema/auth/users.ts +38 -0
- package/templates/webapp/src/drizzle/schema/auth/verifications.ts +19 -0
- package/templates/webapp/src/drizzle/schema/index.ts +4 -0
- package/templates/webapp/src/drizzle/schema/utils/jsonbFromZod.ts +25 -0
- package/templates/webapp/src/instrumentation.ts +35 -0
- package/templates/webapp/src/lib/auth/index.ts +85 -0
- package/templates/webapp/src/lib/auth-client.ts +6 -0
- package/templates/webapp/src/lib/trpc.ts +15 -0
- package/templates/webapp/src/server/api/root.ts +5 -0
- package/templates/webapp/src/server/trpc.ts +61 -0
- package/templates/webapp/src/services/AuthContextService.ts +63 -0
- package/templates/webapp/src/services/DatabaseService.ts +54 -0
- package/templates/webapp/src/services/inngest/InngestFunctionCollection.ts +5 -0
- package/templates/webapp/src/services/inngest/InngestService.ts +71 -0
- package/templates/webapp/src/services/inngest/events/AppEvents.ts +34 -0
- package/templates/webapp/src/services/inngest/events/payloads/ExampleEventPayload.ts +14 -0
- package/templates/webapp/src/services/langfuse/LangfuseService.ts +80 -0
- package/templates/webapp/src/services/logger/AppLogger.ts +61 -0
- package/templates/webapp/src/services/logger/withRequestContext.ts +27 -0
- package/templates/webapp/src/services/observability/initFaro.ts +22 -0
- package/templates/webapp/src/startup-checks.ts +32 -0
- package/templates/webapp/src/styles/globals.css +27 -0
- package/templates/webapp/src/utils/__tests__/cn.test.ts +20 -0
- package/templates/webapp/src/utils/cn.ts +6 -0
- package/templates/webapp/src/utils/syncInngestApp.ts +62 -0
- package/templates/webapp/terraform/README.md +147 -0
- package/templates/webapp/terraform/deploy.sh +97 -0
- package/templates/webapp/terraform/main.tf +101 -0
- package/templates/webapp/terraform/modules/cloudtrail/main.tf +27 -0
- package/templates/webapp/terraform/modules/cloudtrail/outputs.tf +10 -0
- package/templates/webapp/terraform/modules/cloudtrail/variables.tf +15 -0
- package/templates/webapp/terraform/modules/networking/main.tf +118 -0
- package/templates/webapp/terraform/modules/networking/outputs.tf +38 -0
- package/templates/webapp/terraform/modules/networking/variables.tf +24 -0
- package/templates/webapp/terraform/modules/rds/main.tf +227 -0
- package/templates/webapp/terraform/modules/rds/outputs.tf +73 -0
- package/templates/webapp/terraform/modules/rds/variables.tf +61 -0
- package/templates/webapp/terraform/modules/s3-logging/main.tf +148 -0
- package/templates/webapp/terraform/modules/s3-logging/outputs.tf +10 -0
- package/templates/webapp/terraform/modules/s3-logging/variables.tf +16 -0
- package/templates/webapp/terraform/modules/secrets/main.tf +39 -0
- package/templates/webapp/terraform/modules/secrets/outputs.tf +9 -0
- package/templates/webapp/terraform/modules/secrets/variables.tf +51 -0
- package/templates/webapp/terraform/outputs.tf +102 -0
- package/templates/webapp/terraform/providers.tf +32 -0
- package/templates/webapp/terraform/terraform.tfvars.example +65 -0
- package/templates/webapp/terraform/variables.tf +129 -0
- package/templates/webapp/tsconfig.json +14 -0
- package/templates/webapp/vitest.config.ts +9 -0
- package/templates/webapp/vitest.setup.ts +5 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
.pnpm-store/
|
|
4
|
+
|
|
5
|
+
# Build outputs
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
.turbo/
|
|
9
|
+
|
|
10
|
+
# IDE
|
|
11
|
+
.idea/
|
|
12
|
+
.vscode/
|
|
13
|
+
*.swp
|
|
14
|
+
*.swo
|
|
15
|
+
|
|
16
|
+
# OS
|
|
17
|
+
.DS_Store
|
|
18
|
+
Thumbs.db
|
|
19
|
+
|
|
20
|
+
# Env files
|
|
21
|
+
.env
|
|
22
|
+
.env.local
|
|
23
|
+
.env.*.local
|
|
24
|
+
|
|
25
|
+
# Logs
|
|
26
|
+
*.log
|
|
27
|
+
npm-debug.log*
|
|
28
|
+
pnpm-debug.log*
|
|
29
|
+
|
|
30
|
+
# Test coverage
|
|
31
|
+
coverage/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "__APP_NAME__",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "__APP_TITLE__",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"preinstall": "npx only-allow pnpm",
|
|
8
|
+
"dev": "pnpm -r --parallel run dev",
|
|
9
|
+
"build": "pnpm -r run build",
|
|
10
|
+
"clean": "pnpm -r run clean",
|
|
11
|
+
"lint": "pnpm -r --parallel --no-bail run lint",
|
|
12
|
+
"lint:fix": "pnpm -r --no-bail run lint:fix",
|
|
13
|
+
"test": "pnpm -r run test"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=20",
|
|
17
|
+
"pnpm": ">=9"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^24.1.0",
|
|
21
|
+
"eslint": "^9.18.0",
|
|
22
|
+
"rimraf": "^5.0.5",
|
|
23
|
+
"typescript": "^5.8.3"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
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
|
+
"resolveJsonModule": true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Sync downstream template changes into this app.
|
|
2
|
+
|
|
3
|
+
## Steps
|
|
4
|
+
|
|
5
|
+
1. Read `.mosaic-template.json` in the current package directory to get the template type, current version, and placeholder mappings.
|
|
6
|
+
2. Determine the mosaic repo path: use `$ARGUMENTS` if provided, otherwise check the `MOSAIC_TEMPLATE_PATH` environment variable. If neither is available, ask the user for the path to their local mosaic repo checkout.
|
|
7
|
+
3. Run: `npx @percepta/create sync --mosaic-template-path <path>`
|
|
8
|
+
4. If the command reports "Already up to date" or "No template file changes", inform the user and stop.
|
|
9
|
+
5. Read the generated `.mosaic-sync-context.md` file.
|
|
10
|
+
6. Apply the template changes described in the context file to this app:
|
|
11
|
+
- Replace placeholder tokens (e.g. `__APP_NAME__`) with actual values from the mapping table
|
|
12
|
+
- Check `mosaic-template-notes.md` for intentional divergences — preserve them
|
|
13
|
+
- For files not modified locally, apply changes directly
|
|
14
|
+
- For files modified locally, merge intelligently, preserving local customizations
|
|
15
|
+
7. Run `pnpm install && pnpm build && pnpm lint` to verify the changes.
|
|
16
|
+
8. Update `.mosaic-template.json`: set `templateVersion` to the new version and update `templateCommit`.
|
|
17
|
+
9. If you made decisions about merge conflicts, add notes to `mosaic-template-notes.md`.
|
|
18
|
+
10. Delete `.mosaic-sync-context.md`.
|
|
19
|
+
11. Summarize what changed and ask the user to review before committing.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Propose app improvements upstream to the mosaic template.
|
|
2
|
+
|
|
3
|
+
## Steps
|
|
4
|
+
|
|
5
|
+
1. Read `.mosaic-template.json` in the current package directory to get the template type, current version, and placeholder mappings.
|
|
6
|
+
2. Determine which files to propose upstream: use `$ARGUMENTS` if provided (space-separated file paths), otherwise ask the user which files contain improvements they want to contribute back to the template.
|
|
7
|
+
3. Determine the mosaic repo path: check the `MOSAIC_TEMPLATE_PATH` environment variable. If not set, ask the user for the path to their local mosaic repo checkout.
|
|
8
|
+
4. Run: `npx @percepta/create upstream --mosaic-template-path <path> --files <file1> <file2> ...`
|
|
9
|
+
5. Read the generated `.mosaic-upstream-context.md` file.
|
|
10
|
+
6. For each file listed in the context:
|
|
11
|
+
- Compare the app version against the template version
|
|
12
|
+
- Determine which changes are generalizable (useful for all apps) vs app-specific
|
|
13
|
+
- For generalizable changes, apply them to the template files in the mosaic repo at the path specified in the context
|
|
14
|
+
- When applying, replace app-specific values with placeholder tokens using the mapping table (replace longest values first to avoid partial matches)
|
|
15
|
+
7. Bump the version in `packages/create-mosaic-module/template-versions.json` in the mosaic repo.
|
|
16
|
+
8. Delete `.mosaic-upstream-context.md`.
|
|
17
|
+
9. Summarize what was changed in the template and ask the user to review the changes in the mosaic repo before committing.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# testing
|
|
9
|
+
/coverage
|
|
10
|
+
|
|
11
|
+
# next.js
|
|
12
|
+
/.next/
|
|
13
|
+
/out/
|
|
14
|
+
|
|
15
|
+
# production
|
|
16
|
+
/build
|
|
17
|
+
|
|
18
|
+
# misc
|
|
19
|
+
.DS_Store
|
|
20
|
+
*.pem
|
|
21
|
+
|
|
22
|
+
# debug
|
|
23
|
+
npm-debug.log*
|
|
24
|
+
yarn-debug.log*
|
|
25
|
+
yarn-error.log*
|
|
26
|
+
|
|
27
|
+
# local env files
|
|
28
|
+
.env*.local
|
|
29
|
+
.env
|
|
30
|
+
|
|
31
|
+
# vercel
|
|
32
|
+
.vercel
|
|
33
|
+
|
|
34
|
+
# typescript
|
|
35
|
+
*.tsbuildinfo
|
|
36
|
+
next-env.d.ts
|
|
37
|
+
|
|
38
|
+
# IDE
|
|
39
|
+
.vscode
|
|
40
|
+
.idea
|
|
41
|
+
|
|
42
|
+
# OS
|
|
43
|
+
.DS_Store
|
|
44
|
+
Thumbs.db
|
|
45
|
+
|
|
46
|
+
# Git
|
|
47
|
+
.git
|
|
48
|
+
.gitignore
|
|
49
|
+
|
|
50
|
+
# Docker
|
|
51
|
+
Dockerfile
|
|
52
|
+
.dockerignore
|
|
53
|
+
|
|
54
|
+
# Documentation
|
|
55
|
+
README.md
|
|
56
|
+
CHANGELOG.md
|
|
57
|
+
|
|
58
|
+
# CI/CD
|
|
59
|
+
.github
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
src/drizzle/migrations/meta/*_snapshot.json linguist-generated=true
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
name: Build & Release __APP_NAME__
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- "main"
|
|
7
|
+
paths:
|
|
8
|
+
- "packages/__APP_NAME__/src/**"
|
|
9
|
+
- "packages/__APP_NAME__/scripts/**"
|
|
10
|
+
- "packages/__APP_NAME__/Dockerfile"
|
|
11
|
+
- "packages/__APP_NAME__/package.json"
|
|
12
|
+
- "pnpm-lock.yaml"
|
|
13
|
+
- ".github/workflows/__APP_NAME__-ryvn-release.yaml"
|
|
14
|
+
pull_request:
|
|
15
|
+
branches:
|
|
16
|
+
- "main"
|
|
17
|
+
paths:
|
|
18
|
+
- "packages/__APP_NAME__/src/**"
|
|
19
|
+
- "packages/__APP_NAME__/scripts/**"
|
|
20
|
+
- "packages/__APP_NAME__/Dockerfile"
|
|
21
|
+
- "packages/__APP_NAME__/package.json"
|
|
22
|
+
- "pnpm-lock.yaml"
|
|
23
|
+
workflow_dispatch:
|
|
24
|
+
|
|
25
|
+
env:
|
|
26
|
+
SERVICE_NAME: __APP_NAME__
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
build-and-release:
|
|
30
|
+
name: Build and Release
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
permissions:
|
|
33
|
+
contents: write
|
|
34
|
+
id-token: write
|
|
35
|
+
|
|
36
|
+
steps:
|
|
37
|
+
- name: Checkout code
|
|
38
|
+
uses: actions/checkout@v4
|
|
39
|
+
with:
|
|
40
|
+
fetch-depth: 0
|
|
41
|
+
|
|
42
|
+
- name: Install Ryvn CLI
|
|
43
|
+
uses: ryvn-technologies/install-ryvn-cli@v1.0.0
|
|
44
|
+
|
|
45
|
+
- name: Generate Release Tag
|
|
46
|
+
id: generate-tag
|
|
47
|
+
env:
|
|
48
|
+
RYVN_CLIENT_ID: ${{ secrets.RYVN_CLIENT_ID }}
|
|
49
|
+
RYVN_CLIENT_SECRET: ${{ secrets.RYVN_CLIENT_SECRET }}
|
|
50
|
+
run: |
|
|
51
|
+
tag_info=$(ryvn generate-release-tag "$SERVICE_NAME" --prefix="${SERVICE_NAME}@" -o json --default-bump-minor)
|
|
52
|
+
|
|
53
|
+
version=$(echo "$tag_info" | jq -r '.version')
|
|
54
|
+
new_tag=$(echo "$tag_info" | jq -r '.tag')
|
|
55
|
+
channel=$(echo "$tag_info" | jq -r '.channel')
|
|
56
|
+
isPreview=$(echo "$tag_info" | jq -r '.isPreview')
|
|
57
|
+
|
|
58
|
+
echo "version=$version" >> $GITHUB_OUTPUT
|
|
59
|
+
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT
|
|
60
|
+
echo "channel=$channel" >> $GITHUB_OUTPUT
|
|
61
|
+
echo "isPreview=$isPreview" >> $GITHUB_OUTPUT
|
|
62
|
+
|
|
63
|
+
- name: Build and Push
|
|
64
|
+
uses: ryvn-technologies/ryvn-build-action@v1.2.0
|
|
65
|
+
with:
|
|
66
|
+
service_name: ${{ env.SERVICE_NAME }}
|
|
67
|
+
version: ${{ steps.generate-tag.outputs.version }}
|
|
68
|
+
build_only: ${{ !(github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || steps.generate-tag.outputs.isPreview == 'true') }}
|
|
69
|
+
ryvn_client_id: ${{ secrets.RYVN_CLIENT_ID }}
|
|
70
|
+
ryvn_client_secret: ${{ secrets.RYVN_CLIENT_SECRET }}
|
|
71
|
+
|
|
72
|
+
- name: Create Ryvn Release
|
|
73
|
+
if: |
|
|
74
|
+
!contains(github.event.head_commit.message, '[skip-release]') &&
|
|
75
|
+
!contains(github.event.pull_request.title, '[skip-release]') &&
|
|
76
|
+
(steps.generate-tag.outputs.isPreview == 'true' || github.ref == format('refs/heads/{0}', github.event.repository.default_branch))
|
|
77
|
+
env:
|
|
78
|
+
RYVN_CLIENT_ID: ${{ secrets.RYVN_CLIENT_ID }}
|
|
79
|
+
RYVN_CLIENT_SECRET: ${{ secrets.RYVN_CLIENT_SECRET }}
|
|
80
|
+
run: |
|
|
81
|
+
version="${{ steps.generate-tag.outputs.new_tag }}"
|
|
82
|
+
version="${version#"${SERVICE_NAME}@"}"
|
|
83
|
+
version="${version#@}"
|
|
84
|
+
channel="${{ steps.generate-tag.outputs.channel }}"
|
|
85
|
+
|
|
86
|
+
if [ -n "$channel" ] && [ "$channel" != "null" ]; then
|
|
87
|
+
ryvn create release "$SERVICE_NAME" "$version" --channel "$channel"
|
|
88
|
+
else
|
|
89
|
+
ryvn create release "$SERVICE_NAME" "$version"
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
- name: Create GitHub Tag
|
|
93
|
+
if: |
|
|
94
|
+
github.ref == format('refs/heads/{0}', github.event.repository.default_branch) &&
|
|
95
|
+
!contains(github.event.head_commit.message, '[skip-release]') &&
|
|
96
|
+
!contains(github.event.pull_request.title, '[skip-release]')
|
|
97
|
+
run: |
|
|
98
|
+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
99
|
+
git config --global user.name "github-actions[bot]"
|
|
100
|
+
git tag "${{ steps.generate-tag.outputs.new_tag }}"
|
|
101
|
+
git push origin "${{ steps.generate-tag.outputs.new_tag }}"
|
|
102
|
+
|
|
103
|
+
- name: Create GitHub Release
|
|
104
|
+
if: |
|
|
105
|
+
github.ref == format('refs/heads/{0}', github.event.repository.default_branch) &&
|
|
106
|
+
!contains(github.event.head_commit.message, '[skip-release]') &&
|
|
107
|
+
!contains(github.event.pull_request.title, '[skip-release]')
|
|
108
|
+
uses: softprops/action-gh-release@v1
|
|
109
|
+
with:
|
|
110
|
+
tag_name: ${{ steps.generate-tag.outputs.new_tag }}
|
|
111
|
+
name: ${{ steps.generate-tag.outputs.new_tag }}
|
|
112
|
+
generate_release_notes: true
|
|
113
|
+
draft: false
|
|
114
|
+
prerelease: false
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
name: Terraform Validate (__APP_NAME__)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
paths:
|
|
6
|
+
- "packages/__APP_NAME__/terraform/**"
|
|
7
|
+
- ".github/workflows/__APP_NAME__-terraform.yml"
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
terraform-validate:
|
|
11
|
+
name: Validate Terraform
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout repository
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Setup Terraform
|
|
19
|
+
uses: hashicorp/setup-terraform@v3
|
|
20
|
+
|
|
21
|
+
- name: Terraform Init
|
|
22
|
+
run: terraform -chdir=packages/__APP_NAME__/terraform init -backend=false
|
|
23
|
+
|
|
24
|
+
- name: Terraform Format Check
|
|
25
|
+
run: terraform fmt -check -recursive packages/__APP_NAME__/terraform/
|
|
26
|
+
|
|
27
|
+
- name: Terraform Validate
|
|
28
|
+
run: terraform -chdir=packages/__APP_NAME__/terraform validate
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
name: Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push: {}
|
|
5
|
+
|
|
6
|
+
env:
|
|
7
|
+
PNPM_VERSION: 10.x
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
setup:
|
|
11
|
+
name: Setup
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout repository
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Setup PNPM
|
|
19
|
+
uses: pnpm/action-setup@v4
|
|
20
|
+
with:
|
|
21
|
+
version: ${{ env.PNPM_VERSION }}
|
|
22
|
+
|
|
23
|
+
- name: Setup Node.js
|
|
24
|
+
uses: actions/setup-node@v4
|
|
25
|
+
with:
|
|
26
|
+
node-version-file: ".node-version"
|
|
27
|
+
cache: pnpm
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: pnpm install --frozen-lockfile
|
|
31
|
+
|
|
32
|
+
- name: Check packages are deduplicated
|
|
33
|
+
run: pnpm dedupe --check
|
|
34
|
+
|
|
35
|
+
build:
|
|
36
|
+
name: Build
|
|
37
|
+
needs: setup
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
|
|
40
|
+
steps:
|
|
41
|
+
- name: Checkout repository
|
|
42
|
+
uses: actions/checkout@v4
|
|
43
|
+
|
|
44
|
+
- name: Setup PNPM
|
|
45
|
+
uses: pnpm/action-setup@v4
|
|
46
|
+
with:
|
|
47
|
+
version: ${{ env.PNPM_VERSION }}
|
|
48
|
+
|
|
49
|
+
- name: Setup Node.js
|
|
50
|
+
uses: actions/setup-node@v4
|
|
51
|
+
with:
|
|
52
|
+
node-version-file: ".node-version"
|
|
53
|
+
cache: pnpm
|
|
54
|
+
|
|
55
|
+
- name: Install dependencies
|
|
56
|
+
run: pnpm install --frozen-lockfile
|
|
57
|
+
|
|
58
|
+
- name: Build project
|
|
59
|
+
run: pnpm build
|
|
60
|
+
|
|
61
|
+
lint:
|
|
62
|
+
name: Lint
|
|
63
|
+
needs: setup
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
|
|
66
|
+
steps:
|
|
67
|
+
- name: Checkout repository
|
|
68
|
+
uses: actions/checkout@v4
|
|
69
|
+
|
|
70
|
+
- name: Setup PNPM
|
|
71
|
+
uses: pnpm/action-setup@v4
|
|
72
|
+
with:
|
|
73
|
+
version: ${{ env.PNPM_VERSION }}
|
|
74
|
+
|
|
75
|
+
- name: Setup Node.js
|
|
76
|
+
uses: actions/setup-node@v4
|
|
77
|
+
with:
|
|
78
|
+
node-version-file: ".node-version"
|
|
79
|
+
cache: pnpm
|
|
80
|
+
|
|
81
|
+
- name: Install dependencies
|
|
82
|
+
run: pnpm install --frozen-lockfile
|
|
83
|
+
|
|
84
|
+
- name: Run lint checks
|
|
85
|
+
run: pnpm lint
|
|
86
|
+
|
|
87
|
+
check-migrations:
|
|
88
|
+
name: Check for Migrations
|
|
89
|
+
needs: setup
|
|
90
|
+
runs-on: ubuntu-latest
|
|
91
|
+
|
|
92
|
+
steps:
|
|
93
|
+
- name: Checkout repository
|
|
94
|
+
uses: actions/checkout@v4
|
|
95
|
+
|
|
96
|
+
- name: Setup PNPM
|
|
97
|
+
uses: pnpm/action-setup@v4
|
|
98
|
+
with:
|
|
99
|
+
version: ${{ env.PNPM_VERSION }}
|
|
100
|
+
|
|
101
|
+
- name: Setup Node.js
|
|
102
|
+
uses: actions/setup-node@v4
|
|
103
|
+
with:
|
|
104
|
+
node-version-file: ".node-version"
|
|
105
|
+
cache: pnpm
|
|
106
|
+
|
|
107
|
+
- name: Install dependencies
|
|
108
|
+
run: pnpm install --frozen-lockfile
|
|
109
|
+
|
|
110
|
+
- name: Generate migration check
|
|
111
|
+
run: pnpm db:generate
|
|
112
|
+
|
|
113
|
+
- name: Check for journal changes
|
|
114
|
+
run: git diff --exit-code src/drizzle/migrations/meta/_journal.json
|
|
115
|
+
|
|
116
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
117
|
+
# Docker Build Validation
|
|
118
|
+
# ──────────────────────────────────────────────────────────────────────────────
|
|
119
|
+
|
|
120
|
+
changes:
|
|
121
|
+
name: Detect Changes
|
|
122
|
+
runs-on: ubuntu-latest
|
|
123
|
+
outputs:
|
|
124
|
+
root: ${{ steps.filter.outputs.root }}
|
|
125
|
+
steps:
|
|
126
|
+
- uses: actions/checkout@v4
|
|
127
|
+
- uses: dorny/paths-filter@v3
|
|
128
|
+
id: filter
|
|
129
|
+
with:
|
|
130
|
+
filters: |
|
|
131
|
+
root:
|
|
132
|
+
- 'src/**'
|
|
133
|
+
- 'scripts/**'
|
|
134
|
+
- 'Dockerfile'
|
|
135
|
+
- 'package.json'
|
|
136
|
+
- 'pnpm-lock.yaml'
|
|
137
|
+
- 'tsconfig.json'
|
|
138
|
+
|
|
139
|
+
docker-build-root:
|
|
140
|
+
name: Docker Build (root)
|
|
141
|
+
needs: changes
|
|
142
|
+
if: needs.changes.outputs.root == 'true'
|
|
143
|
+
runs-on: ubuntu-latest
|
|
144
|
+
steps:
|
|
145
|
+
- uses: actions/checkout@v4
|
|
146
|
+
- name: Build Docker image
|
|
147
|
+
run: docker build --build-arg NPM_TOKEN=${{ secrets.NPM_TOKEN }} -t __APP_NAME__:ci .
|
|
148
|
+
- name: Verify server.js is valid
|
|
149
|
+
run: docker run --rm __APP_NAME__:ci node --check server.js
|