nexu-app 2.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 +149 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1192 -0
- package/package.json +43 -0
- package/templates/default/.changeset/config.json +11 -0
- package/templates/default/.eslintignore +16 -0
- package/templates/default/.eslintrc.js +67 -0
- package/templates/default/.github/actions/build/action.yml +35 -0
- package/templates/default/.github/actions/quality/action.yml +53 -0
- package/templates/default/.github/dependabot.yml +51 -0
- package/templates/default/.github/workflows/deploy-dev.yml +83 -0
- package/templates/default/.github/workflows/deploy-prod.yml +83 -0
- package/templates/default/.github/workflows/deploy-rec.yml +83 -0
- package/templates/default/.husky/commit-msg +1 -0
- package/templates/default/.husky/pre-commit +1 -0
- package/templates/default/.nexu-version +1 -0
- package/templates/default/.prettierignore +7 -0
- package/templates/default/.prettierrc +19 -0
- package/templates/default/.vscode/extensions.json +14 -0
- package/templates/default/.vscode/settings.json +36 -0
- package/templates/default/apps/gitkeep +0 -0
- package/templates/default/commitlint.config.js +26 -0
- package/templates/default/docker/docker-compose.dev.yml +49 -0
- package/templates/default/docker/docker-compose.prod.yml +64 -0
- package/templates/default/docker/docker-compose.yml +6 -0
- package/templates/default/docs/architecture.md +452 -0
- package/templates/default/docs/cli.md +330 -0
- package/templates/default/docs/contributing.md +462 -0
- package/templates/default/docs/scripts.md +460 -0
- package/templates/default/gitignore +44 -0
- package/templates/default/lintstagedrc.cjs +4 -0
- package/templates/default/package.json +51 -0
- package/templates/default/packages/auth/package.json +61 -0
- package/templates/default/packages/auth/src/components/ProtectedRoute.tsx +75 -0
- package/templates/default/packages/auth/src/components/SignInForm.tsx +153 -0
- package/templates/default/packages/auth/src/components/SignUpForm.tsx +179 -0
- package/templates/default/packages/auth/src/components/SocialButtons.tsx +147 -0
- package/templates/default/packages/auth/src/components/index.ts +4 -0
- package/templates/default/packages/auth/src/hooks/index.ts +4 -0
- package/templates/default/packages/auth/src/hooks/useAuth.ts +51 -0
- package/templates/default/packages/auth/src/hooks/useRequireAuth.ts +54 -0
- package/templates/default/packages/auth/src/hooks/useSession.ts +48 -0
- package/templates/default/packages/auth/src/hooks/useUser.ts +48 -0
- package/templates/default/packages/auth/src/index.ts +45 -0
- package/templates/default/packages/auth/src/next/index.ts +18 -0
- package/templates/default/packages/auth/src/next/middleware.ts +183 -0
- package/templates/default/packages/auth/src/next/server.ts +219 -0
- package/templates/default/packages/auth/src/providers/AuthContext.tsx +435 -0
- package/templates/default/packages/auth/src/providers/index.ts +1 -0
- package/templates/default/packages/auth/src/types/index.ts +284 -0
- package/templates/default/packages/auth/src/utils/api.ts +228 -0
- package/templates/default/packages/auth/src/utils/index.ts +3 -0
- package/templates/default/packages/auth/src/utils/oauth.ts +230 -0
- package/templates/default/packages/auth/src/utils/token.ts +204 -0
- package/templates/default/packages/auth/tsconfig.json +14 -0
- package/templates/default/packages/auth/tsup.config.ts +18 -0
- package/templates/default/packages/cache/package.json +26 -0
- package/templates/default/packages/cache/src/index.ts +137 -0
- package/templates/default/packages/cache/tsconfig.json +9 -0
- package/templates/default/packages/cache/tsup.config.ts +9 -0
- package/templates/default/packages/config/eslint/index.js +20 -0
- package/templates/default/packages/config/package.json +9 -0
- package/templates/default/packages/config/typescript/base.json +26 -0
- package/templates/default/packages/constants/package.json +26 -0
- package/templates/default/packages/constants/src/index.ts +121 -0
- package/templates/default/packages/constants/tsconfig.json +9 -0
- package/templates/default/packages/constants/tsup.config.ts +9 -0
- package/templates/default/packages/logger/package.json +27 -0
- package/templates/default/packages/logger/src/index.ts +197 -0
- package/templates/default/packages/logger/tsconfig.json +11 -0
- package/templates/default/packages/logger/tsup.config.ts +9 -0
- package/templates/default/packages/result/package.json +26 -0
- package/templates/default/packages/result/src/index.ts +142 -0
- package/templates/default/packages/result/tsconfig.json +9 -0
- package/templates/default/packages/result/tsup.config.ts +9 -0
- package/templates/default/packages/types/package.json +26 -0
- package/templates/default/packages/types/src/index.ts +78 -0
- package/templates/default/packages/types/tsconfig.json +9 -0
- package/templates/default/packages/types/tsup.config.ts +10 -0
- package/templates/default/packages/ui/package.json +38 -0
- package/templates/default/packages/ui/src/components/Button.tsx +58 -0
- package/templates/default/packages/ui/src/components/Card.tsx +85 -0
- package/templates/default/packages/ui/src/components/Input.tsx +45 -0
- package/templates/default/packages/ui/src/index.ts +15 -0
- package/templates/default/packages/ui/tsconfig.json +11 -0
- package/templates/default/packages/ui/tsup.config.ts +11 -0
- package/templates/default/packages/utils/package.json +30 -0
- package/templates/default/packages/utils/src/index.test.ts +130 -0
- package/templates/default/packages/utils/src/index.ts +154 -0
- package/templates/default/packages/utils/tsconfig.json +10 -0
- package/templates/default/packages/utils/tsup.config.ts +10 -0
- package/templates/default/pnpm-workspace.yaml +3 -0
- package/templates/default/scripts/audit.mjs +700 -0
- package/templates/default/scripts/deploy.mjs +40 -0
- package/templates/default/scripts/generate-app.mjs +808 -0
- package/templates/default/scripts/lib/package-manager.mjs +186 -0
- package/templates/default/scripts/setup.mjs +102 -0
- package/templates/default/services/.env.example +16 -0
- package/templates/default/services/docker-compose.yml +207 -0
- package/templates/default/services/grafana/provisioning/dashboards/dashboards.yml +11 -0
- package/templates/default/services/grafana/provisioning/datasources/datasources.yml +9 -0
- package/templates/default/services/postgres/init/gitkeep +2 -0
- package/templates/default/services/prometheus/prometheus.yml +13 -0
- package/templates/default/tsconfig.json +27 -0
- package/templates/default/turbo.json +40 -0
- package/templates/default/vitest.config.ts +15 -0
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nexu-app",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "CLI to create and update Nexu monorepo projects",
|
|
5
|
+
"author": "Nexu Team",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"nexu-app": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"templates"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup",
|
|
20
|
+
"dev": "tsup --watch",
|
|
21
|
+
"lint": "eslint src/",
|
|
22
|
+
"lint:fix": "eslint src/ --fix",
|
|
23
|
+
"typecheck": "tsc --noEmit"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"chalk": "^5.3.0",
|
|
27
|
+
"commander": "^12.0.0",
|
|
28
|
+
"diff": "^8.0.3",
|
|
29
|
+
"fs-extra": "^11.2.0",
|
|
30
|
+
"inquirer": "^9.2.0",
|
|
31
|
+
"ora": "^8.0.0",
|
|
32
|
+
"semver": "^7.6.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/diff": "^8.0.0",
|
|
36
|
+
"@types/fs-extra": "^11.0.0",
|
|
37
|
+
"@types/inquirer": "^9.0.0",
|
|
38
|
+
"@types/node": "^20.0.0",
|
|
39
|
+
"@types/semver": "^7.5.0",
|
|
40
|
+
"tsup": "^8.0.0",
|
|
41
|
+
"typescript": "^5.4.0"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
|
|
3
|
+
"changelog": "@changesets/cli/changelog",
|
|
4
|
+
"commit": false,
|
|
5
|
+
"fixed": [],
|
|
6
|
+
"linked": [],
|
|
7
|
+
"access": "restricted",
|
|
8
|
+
"baseBranch": "main",
|
|
9
|
+
"updateInternalDependencies": "patch",
|
|
10
|
+
"ignore": []
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Config files (not part of TypeScript project)
|
|
2
|
+
.eslintrc.js
|
|
3
|
+
commitlint.config.js
|
|
4
|
+
*.config.js
|
|
5
|
+
*.config.mjs
|
|
6
|
+
*.config.ts
|
|
7
|
+
packages/config/**
|
|
8
|
+
|
|
9
|
+
# Scripts (JavaScript, not TypeScript)
|
|
10
|
+
scripts/**
|
|
11
|
+
|
|
12
|
+
# Build outputs
|
|
13
|
+
node_modules
|
|
14
|
+
dist
|
|
15
|
+
.next
|
|
16
|
+
coverage
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
browser: true,
|
|
5
|
+
es2024: true,
|
|
6
|
+
node: true,
|
|
7
|
+
},
|
|
8
|
+
extends: [
|
|
9
|
+
'eslint:recommended',
|
|
10
|
+
'plugin:@typescript-eslint/recommended',
|
|
11
|
+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
12
|
+
'prettier',
|
|
13
|
+
],
|
|
14
|
+
parser: '@typescript-eslint/parser',
|
|
15
|
+
parserOptions: {
|
|
16
|
+
ecmaVersion: 'latest',
|
|
17
|
+
sourceType: 'module',
|
|
18
|
+
project: ['./tsconfig.json', './apps/*/tsconfig.json', './packages/*/tsconfig.json'],
|
|
19
|
+
},
|
|
20
|
+
plugins: ['@typescript-eslint', 'import', 'unused-imports'],
|
|
21
|
+
rules: {
|
|
22
|
+
// TypeScript
|
|
23
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
24
|
+
'unused-imports/no-unused-imports': 'error',
|
|
25
|
+
'unused-imports/no-unused-vars': [
|
|
26
|
+
'warn',
|
|
27
|
+
{
|
|
28
|
+
vars: 'all',
|
|
29
|
+
varsIgnorePattern: '^_',
|
|
30
|
+
args: 'after-used',
|
|
31
|
+
argsIgnorePattern: '^_',
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
35
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
36
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
37
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
38
|
+
'@typescript-eslint/await-thenable': 'error',
|
|
39
|
+
|
|
40
|
+
// Import
|
|
41
|
+
'import/order': [
|
|
42
|
+
'error',
|
|
43
|
+
{
|
|
44
|
+
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
45
|
+
'newlines-between': 'always',
|
|
46
|
+
alphabetize: { order: 'asc', caseInsensitive: true },
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
'import/no-duplicates': 'error',
|
|
50
|
+
|
|
51
|
+
// General
|
|
52
|
+
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
53
|
+
'prefer-const': 'error',
|
|
54
|
+
'no-var': 'error',
|
|
55
|
+
},
|
|
56
|
+
ignorePatterns: [
|
|
57
|
+
'node_modules',
|
|
58
|
+
'dist',
|
|
59
|
+
'.next',
|
|
60
|
+
'coverage',
|
|
61
|
+
'*.config.js',
|
|
62
|
+
'*.config.mjs',
|
|
63
|
+
'.eslintrc.js',
|
|
64
|
+
'.lintstagedrc.cjs',
|
|
65
|
+
'commitlint.config.js',
|
|
66
|
+
],
|
|
67
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: 'Build'
|
|
2
|
+
description: 'Build all packages and apps'
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
turbo-token:
|
|
6
|
+
description: 'Turbo remote cache token'
|
|
7
|
+
required: false
|
|
8
|
+
turbo-team:
|
|
9
|
+
description: 'Turbo team name'
|
|
10
|
+
required: false
|
|
11
|
+
|
|
12
|
+
runs:
|
|
13
|
+
using: 'composite'
|
|
14
|
+
steps:
|
|
15
|
+
- name: Setup pnpm
|
|
16
|
+
uses: pnpm/action-setup@v3
|
|
17
|
+
with:
|
|
18
|
+
version: 9
|
|
19
|
+
|
|
20
|
+
- name: Setup Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: 20
|
|
24
|
+
cache: 'pnpm'
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
shell: bash
|
|
28
|
+
run: pnpm install --frozen-lockfile
|
|
29
|
+
|
|
30
|
+
- name: Build
|
|
31
|
+
shell: bash
|
|
32
|
+
run: pnpm build
|
|
33
|
+
env:
|
|
34
|
+
TURBO_TOKEN: ${{ inputs.turbo-token }}
|
|
35
|
+
TURBO_TEAM: ${{ inputs.turbo-team }}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
name: 'Quality Check'
|
|
2
|
+
description: 'Run lint, format, typecheck, and tests'
|
|
3
|
+
|
|
4
|
+
inputs:
|
|
5
|
+
turbo-token:
|
|
6
|
+
description: 'Turbo remote cache token'
|
|
7
|
+
required: false
|
|
8
|
+
turbo-team:
|
|
9
|
+
description: 'Turbo team name'
|
|
10
|
+
required: false
|
|
11
|
+
|
|
12
|
+
runs:
|
|
13
|
+
using: 'composite'
|
|
14
|
+
steps:
|
|
15
|
+
- name: Setup pnpm
|
|
16
|
+
uses: pnpm/action-setup@v3
|
|
17
|
+
with:
|
|
18
|
+
version: 9
|
|
19
|
+
|
|
20
|
+
- name: Setup Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: 20
|
|
24
|
+
cache: 'pnpm'
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
shell: bash
|
|
28
|
+
run: pnpm install --frozen-lockfile
|
|
29
|
+
|
|
30
|
+
- name: Lint
|
|
31
|
+
shell: bash
|
|
32
|
+
run: pnpm lint
|
|
33
|
+
env:
|
|
34
|
+
TURBO_TOKEN: ${{ inputs.turbo-token }}
|
|
35
|
+
TURBO_TEAM: ${{ inputs.turbo-team }}
|
|
36
|
+
|
|
37
|
+
- name: Format Check
|
|
38
|
+
shell: bash
|
|
39
|
+
run: pnpm format:check
|
|
40
|
+
|
|
41
|
+
- name: Type Check
|
|
42
|
+
shell: bash
|
|
43
|
+
run: pnpm typecheck
|
|
44
|
+
env:
|
|
45
|
+
TURBO_TOKEN: ${{ inputs.turbo-token }}
|
|
46
|
+
TURBO_TEAM: ${{ inputs.turbo-team }}
|
|
47
|
+
|
|
48
|
+
- name: Test
|
|
49
|
+
shell: bash
|
|
50
|
+
run: pnpm test
|
|
51
|
+
env:
|
|
52
|
+
TURBO_TOKEN: ${{ inputs.turbo-token }}
|
|
53
|
+
TURBO_TEAM: ${{ inputs.turbo-team }}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: 'npm'
|
|
4
|
+
directory: '/'
|
|
5
|
+
schedule:
|
|
6
|
+
interval: 'weekly'
|
|
7
|
+
day: 'monday'
|
|
8
|
+
open-pull-requests-limit: 10
|
|
9
|
+
groups:
|
|
10
|
+
typescript:
|
|
11
|
+
patterns:
|
|
12
|
+
- 'typescript'
|
|
13
|
+
- '@typescript-eslint/*'
|
|
14
|
+
update-types:
|
|
15
|
+
- 'minor'
|
|
16
|
+
- 'patch'
|
|
17
|
+
eslint:
|
|
18
|
+
patterns:
|
|
19
|
+
- 'eslint*'
|
|
20
|
+
update-types:
|
|
21
|
+
- 'minor'
|
|
22
|
+
- 'patch'
|
|
23
|
+
testing:
|
|
24
|
+
patterns:
|
|
25
|
+
- 'vitest'
|
|
26
|
+
- '@vitest/*'
|
|
27
|
+
update-types:
|
|
28
|
+
- 'minor'
|
|
29
|
+
- 'patch'
|
|
30
|
+
build:
|
|
31
|
+
patterns:
|
|
32
|
+
- 'turbo'
|
|
33
|
+
- 'tsup'
|
|
34
|
+
update-types:
|
|
35
|
+
- 'minor'
|
|
36
|
+
- 'patch'
|
|
37
|
+
commit-message:
|
|
38
|
+
prefix: 'chore(deps)'
|
|
39
|
+
labels:
|
|
40
|
+
- 'dependencies'
|
|
41
|
+
|
|
42
|
+
- package-ecosystem: 'github-actions'
|
|
43
|
+
directory: '/'
|
|
44
|
+
schedule:
|
|
45
|
+
interval: 'weekly'
|
|
46
|
+
day: 'monday'
|
|
47
|
+
commit-message:
|
|
48
|
+
prefix: 'ci(deps)'
|
|
49
|
+
labels:
|
|
50
|
+
- 'dependencies'
|
|
51
|
+
- 'ci'
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: Deploy Dev
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- dev
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
REGISTRY: ghcr.io
|
|
10
|
+
IMAGE_NAME: ${{ github.repository }}
|
|
11
|
+
ENVIRONMENT: development
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
quality:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout
|
|
18
|
+
uses: actions/checkout@v6
|
|
19
|
+
|
|
20
|
+
- name: Quality Check
|
|
21
|
+
uses: ./.github/actions/quality
|
|
22
|
+
with:
|
|
23
|
+
turbo-token: ${{ secrets.TURBO_TOKEN }}
|
|
24
|
+
turbo-team: ${{ vars.TURBO_TEAM }}
|
|
25
|
+
|
|
26
|
+
build-and-deploy:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
needs: quality
|
|
29
|
+
environment: development
|
|
30
|
+
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout
|
|
33
|
+
uses: actions/checkout@v6
|
|
34
|
+
|
|
35
|
+
- name: Build
|
|
36
|
+
uses: ./.github/actions/build
|
|
37
|
+
with:
|
|
38
|
+
turbo-token: ${{ secrets.TURBO_TOKEN }}
|
|
39
|
+
turbo-team: ${{ vars.TURBO_TEAM }}
|
|
40
|
+
|
|
41
|
+
- name: Set up Docker Buildx
|
|
42
|
+
uses: docker/setup-buildx-action@v3
|
|
43
|
+
|
|
44
|
+
- name: Login to Container Registry
|
|
45
|
+
uses: docker/login-action@v3
|
|
46
|
+
with:
|
|
47
|
+
registry: ${{ env.REGISTRY }}
|
|
48
|
+
username: ${{ github.actor }}
|
|
49
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
50
|
+
|
|
51
|
+
- name: Get app list
|
|
52
|
+
id: apps
|
|
53
|
+
run: |
|
|
54
|
+
if [ -d "apps" ] && [ "$(ls -A apps 2>/dev/null)" ]; then
|
|
55
|
+
APPS=$(ls -d apps/*/ 2>/dev/null | xargs -n1 basename | tr '\n' ' ')
|
|
56
|
+
echo "list=$APPS" >> $GITHUB_OUTPUT
|
|
57
|
+
echo "exists=true" >> $GITHUB_OUTPUT
|
|
58
|
+
else
|
|
59
|
+
echo "exists=false" >> $GITHUB_OUTPUT
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
- name: Build and push images
|
|
63
|
+
if: steps.apps.outputs.exists == 'true'
|
|
64
|
+
run: |
|
|
65
|
+
for APP in ${{ steps.apps.outputs.list }}; do
|
|
66
|
+
if [ -f "apps/$APP/docker/Dockerfile" ]; then
|
|
67
|
+
echo "Building $APP..."
|
|
68
|
+
docker build \
|
|
69
|
+
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }} \
|
|
70
|
+
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }} \
|
|
71
|
+
-f apps/$APP/docker/Dockerfile \
|
|
72
|
+
.
|
|
73
|
+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }}
|
|
74
|
+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }}
|
|
75
|
+
fi
|
|
76
|
+
done
|
|
77
|
+
|
|
78
|
+
- name: Deploy summary
|
|
79
|
+
run: |
|
|
80
|
+
echo "## Deployment Summary" >> $GITHUB_STEP_SUMMARY
|
|
81
|
+
echo "- **Environment:** ${{ env.ENVIRONMENT }}" >> $GITHUB_STEP_SUMMARY
|
|
82
|
+
echo "- **Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
|
|
83
|
+
echo "- **Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: Deploy Prod
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
REGISTRY: ghcr.io
|
|
10
|
+
IMAGE_NAME: ${{ github.repository }}
|
|
11
|
+
ENVIRONMENT: production
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
quality:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout
|
|
18
|
+
uses: actions/checkout@v6
|
|
19
|
+
|
|
20
|
+
- name: Quality Check
|
|
21
|
+
uses: ./.github/actions/quality
|
|
22
|
+
with:
|
|
23
|
+
turbo-token: ${{ secrets.TURBO_TOKEN }}
|
|
24
|
+
turbo-team: ${{ vars.TURBO_TEAM }}
|
|
25
|
+
|
|
26
|
+
build-and-deploy:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
needs: quality
|
|
29
|
+
environment: production
|
|
30
|
+
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout
|
|
33
|
+
uses: actions/checkout@v6
|
|
34
|
+
|
|
35
|
+
- name: Build
|
|
36
|
+
uses: ./.github/actions/build
|
|
37
|
+
with:
|
|
38
|
+
turbo-token: ${{ secrets.TURBO_TOKEN }}
|
|
39
|
+
turbo-team: ${{ vars.TURBO_TEAM }}
|
|
40
|
+
|
|
41
|
+
- name: Set up Docker Buildx
|
|
42
|
+
uses: docker/setup-buildx-action@v3
|
|
43
|
+
|
|
44
|
+
- name: Login to Container Registry
|
|
45
|
+
uses: docker/login-action@v3
|
|
46
|
+
with:
|
|
47
|
+
registry: ${{ env.REGISTRY }}
|
|
48
|
+
username: ${{ github.actor }}
|
|
49
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
50
|
+
|
|
51
|
+
- name: Get app list
|
|
52
|
+
id: apps
|
|
53
|
+
run: |
|
|
54
|
+
if [ -d "apps" ] && [ "$(ls -A apps 2>/dev/null)" ]; then
|
|
55
|
+
APPS=$(ls -d apps/*/ 2>/dev/null | xargs -n1 basename | tr '\n' ' ')
|
|
56
|
+
echo "list=$APPS" >> $GITHUB_OUTPUT
|
|
57
|
+
echo "exists=true" >> $GITHUB_OUTPUT
|
|
58
|
+
else
|
|
59
|
+
echo "exists=false" >> $GITHUB_OUTPUT
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
- name: Build and push images
|
|
63
|
+
if: steps.apps.outputs.exists == 'true'
|
|
64
|
+
run: |
|
|
65
|
+
for APP in ${{ steps.apps.outputs.list }}; do
|
|
66
|
+
if [ -f "apps/$APP/docker/Dockerfile" ]; then
|
|
67
|
+
echo "Building $APP..."
|
|
68
|
+
docker build \
|
|
69
|
+
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }} \
|
|
70
|
+
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }} \
|
|
71
|
+
-f apps/$APP/docker/Dockerfile \
|
|
72
|
+
.
|
|
73
|
+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }}
|
|
74
|
+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }}
|
|
75
|
+
fi
|
|
76
|
+
done
|
|
77
|
+
|
|
78
|
+
- name: Deploy summary
|
|
79
|
+
run: |
|
|
80
|
+
echo "## Deployment Summary" >> $GITHUB_STEP_SUMMARY
|
|
81
|
+
echo "- **Environment:** ${{ env.ENVIRONMENT }}" >> $GITHUB_STEP_SUMMARY
|
|
82
|
+
echo "- **Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
|
|
83
|
+
echo "- **Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
name: Deploy Rec
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- rec
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
REGISTRY: ghcr.io
|
|
10
|
+
IMAGE_NAME: ${{ github.repository }}
|
|
11
|
+
ENVIRONMENT: recette
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
quality:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout
|
|
18
|
+
uses: actions/checkout@v6
|
|
19
|
+
|
|
20
|
+
- name: Quality Check
|
|
21
|
+
uses: ./.github/actions/quality
|
|
22
|
+
with:
|
|
23
|
+
turbo-token: ${{ secrets.TURBO_TOKEN }}
|
|
24
|
+
turbo-team: ${{ vars.TURBO_TEAM }}
|
|
25
|
+
|
|
26
|
+
build-and-deploy:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
needs: quality
|
|
29
|
+
environment: recette
|
|
30
|
+
|
|
31
|
+
steps:
|
|
32
|
+
- name: Checkout
|
|
33
|
+
uses: actions/checkout@v6
|
|
34
|
+
|
|
35
|
+
- name: Build
|
|
36
|
+
uses: ./.github/actions/build
|
|
37
|
+
with:
|
|
38
|
+
turbo-token: ${{ secrets.TURBO_TOKEN }}
|
|
39
|
+
turbo-team: ${{ vars.TURBO_TEAM }}
|
|
40
|
+
|
|
41
|
+
- name: Set up Docker Buildx
|
|
42
|
+
uses: docker/setup-buildx-action@v3
|
|
43
|
+
|
|
44
|
+
- name: Login to Container Registry
|
|
45
|
+
uses: docker/login-action@v3
|
|
46
|
+
with:
|
|
47
|
+
registry: ${{ env.REGISTRY }}
|
|
48
|
+
username: ${{ github.actor }}
|
|
49
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
50
|
+
|
|
51
|
+
- name: Get app list
|
|
52
|
+
id: apps
|
|
53
|
+
run: |
|
|
54
|
+
if [ -d "apps" ] && [ "$(ls -A apps 2>/dev/null)" ]; then
|
|
55
|
+
APPS=$(ls -d apps/*/ 2>/dev/null | xargs -n1 basename | tr '\n' ' ')
|
|
56
|
+
echo "list=$APPS" >> $GITHUB_OUTPUT
|
|
57
|
+
echo "exists=true" >> $GITHUB_OUTPUT
|
|
58
|
+
else
|
|
59
|
+
echo "exists=false" >> $GITHUB_OUTPUT
|
|
60
|
+
fi
|
|
61
|
+
|
|
62
|
+
- name: Build and push images
|
|
63
|
+
if: steps.apps.outputs.exists == 'true'
|
|
64
|
+
run: |
|
|
65
|
+
for APP in ${{ steps.apps.outputs.list }}; do
|
|
66
|
+
if [ -f "apps/$APP/docker/Dockerfile" ]; then
|
|
67
|
+
echo "Building $APP..."
|
|
68
|
+
docker build \
|
|
69
|
+
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }} \
|
|
70
|
+
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }} \
|
|
71
|
+
-f apps/$APP/docker/Dockerfile \
|
|
72
|
+
.
|
|
73
|
+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ env.ENVIRONMENT }}
|
|
74
|
+
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/$APP:${{ github.sha }}
|
|
75
|
+
fi
|
|
76
|
+
done
|
|
77
|
+
|
|
78
|
+
- name: Deploy summary
|
|
79
|
+
run: |
|
|
80
|
+
echo "## Deployment Summary" >> $GITHUB_STEP_SUMMARY
|
|
81
|
+
echo "- **Environment:** ${{ env.ENVIRONMENT }}" >> $GITHUB_STEP_SUMMARY
|
|
82
|
+
echo "- **Branch:** ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
|
|
83
|
+
echo "- **Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pnpm commitlint --edit $1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pnpm lint-staged
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.1.4
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"semi": true,
|
|
3
|
+
"singleQuote": true,
|
|
4
|
+
"tabWidth": 2,
|
|
5
|
+
"trailingComma": "es5",
|
|
6
|
+
"printWidth": 100,
|
|
7
|
+
"bracketSpacing": true,
|
|
8
|
+
"arrowParens": "avoid",
|
|
9
|
+
"endOfLine": "lf",
|
|
10
|
+
"plugins": ["prettier-plugin-tailwindcss"],
|
|
11
|
+
"overrides": [
|
|
12
|
+
{
|
|
13
|
+
"files": "*.json",
|
|
14
|
+
"options": {
|
|
15
|
+
"tabWidth": 2
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"recommendations": [
|
|
3
|
+
"dbaeumer.vscode-eslint",
|
|
4
|
+
"esbenp.prettier-vscode",
|
|
5
|
+
"bradlc.vscode-tailwindcss",
|
|
6
|
+
"ms-vscode.vscode-typescript-next",
|
|
7
|
+
"ms-azuretools.vscode-docker",
|
|
8
|
+
"GitHub.copilot",
|
|
9
|
+
"eamodio.gitlens",
|
|
10
|
+
"usernamehw.errorlens",
|
|
11
|
+
"christian-kohler.path-intellisense",
|
|
12
|
+
"formulahendry.auto-rename-tag"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.formatOnSave": true,
|
|
3
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
4
|
+
"editor.codeActionsOnSave": {
|
|
5
|
+
"source.fixAll.eslint": "explicit",
|
|
6
|
+
"source.organizeImports": "explicit"
|
|
7
|
+
},
|
|
8
|
+
"eslint.workingDirectories": [{ "pattern": "apps/*" }, { "pattern": "packages/*" }],
|
|
9
|
+
"typescript.tsdk": "node_modules/typescript/lib",
|
|
10
|
+
"typescript.enablePromptUseWorkspaceTsdk": true,
|
|
11
|
+
"files.associations": {
|
|
12
|
+
"*.css": "tailwindcss"
|
|
13
|
+
},
|
|
14
|
+
"tailwindCSS.experimental.classRegex": [
|
|
15
|
+
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
|
|
16
|
+
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
|
|
17
|
+
],
|
|
18
|
+
"[typescript]": {
|
|
19
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
20
|
+
},
|
|
21
|
+
"[typescriptreact]": {
|
|
22
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
23
|
+
},
|
|
24
|
+
"[javascript]": {
|
|
25
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
26
|
+
},
|
|
27
|
+
"[javascriptreact]": {
|
|
28
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
29
|
+
},
|
|
30
|
+
"[json]": {
|
|
31
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
32
|
+
},
|
|
33
|
+
"[markdown]": {
|
|
34
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: ['@commitlint/config-conventional'],
|
|
3
|
+
rules: {
|
|
4
|
+
'type-enum': [
|
|
5
|
+
2,
|
|
6
|
+
'always',
|
|
7
|
+
[
|
|
8
|
+
'feat', // Nouvelle fonctionnalité
|
|
9
|
+
'fix', // Correction de bug
|
|
10
|
+
'docs', // Documentation
|
|
11
|
+
'style', // Formatage (pas de changement de code)
|
|
12
|
+
'refactor', // Refactorisation
|
|
13
|
+
'perf', // Amélioration de performance
|
|
14
|
+
'test', // Ajout de tests
|
|
15
|
+
'build', // Changements de build
|
|
16
|
+
'ci', // Changements CI
|
|
17
|
+
'chore', // Maintenance
|
|
18
|
+
'revert', // Annulation
|
|
19
|
+
'build', // Changements de build
|
|
20
|
+
],
|
|
21
|
+
],
|
|
22
|
+
'subject-case': [0], // Désactivé - accepte toutes les casses
|
|
23
|
+
'subject-max-length': [2, 'always', 100],
|
|
24
|
+
'body-max-line-length': [0, 'always', Infinity],
|
|
25
|
+
},
|
|
26
|
+
};
|