Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,18 @@ HOSTNAME=<devsantara.com | kit.devsantara.com | "your.domain">
CLOUDFLARE_API_TOKEN=<***>
# Your Cloudflare email
CLOUDFLARE_EMAIL=<***>

# Observability - Posthog
# See https://app.posthog.com/project/settings
VITE_PUBLIC_POSTHOG_HOST=<posthog host url>
VITE_PUBLIC_POSTHOG_KEY=<***>
VITE_PUBLIC_POSTHOG_DEBUG=<enable debug mode (default: false)>
VITE_PUBLIC_POSTHOG_ENABLED=<enable posthog (default: false)>

# Observability - Posthog sourcemap upload (CI only)
# See https://app.posthog.com/settings/project#variables
POSTHOG_CLI_HOST=<posthog cli host url>
POSTHOG_CLI_ENV_ID=<***>
# Personal API key with error tracking write and organization read scopes
# See https://app.posthog.com/settings/user-api-keys#variables
POSTHOG_CLI_TOKEN=<***>
48 changes: 48 additions & 0 deletions .github/workflows/cleanup-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow destroys the preview environment/deployment when a PR is closed.
# It prevents preview resources from leaking/stale after close.

name: Cleanup Preview
on:
pull_request:
branches:
- main
types:
- closed
concurrency:
group: cleanup-preview-${{ github.ref }}
cancel-in-progress: false
env:
NODE_VERSION: '24.11.1'
PNPM_VERSION: '10.23.0'
STAGE: ${{ format('preview-{0}', github.event.number) }}
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Destroy Preview Environment
run: pnpm alchemy destroy --stage ${{ env.STAGE }}
env:
# Alchemy
HOSTNAME: ${{ vars.HOSTNAME }}
ALCHEMY_SECRET: ${{ secrets.ALCHEMY_SECRET }}
ALCHEMY_STATE_TOKEN: ${{ secrets.ALCHEMY_STATE_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
PULL_REQUEST: ${{ github.event.number }}
63 changes: 63 additions & 0 deletions .github/workflows/deployment-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Deploys a per-PR preview environment for this repository.
# Triggered when a PR targeting main (commonly from release/* or hotfix/*) is opened, reopened, or updated (synchronize).
# Deploys to the "preview" environment with stage name "preview-<PR_NUMBER>" .

name: Deployment (Preview)
on:
pull_request:
branches:
- main
types:
- opened
- reopened
- synchronize
concurrency:
group: deployment-preview-${{ github.ref }}
cancel-in-progress: false
env:
NODE_VERSION: '24.11.1'
PNPM_VERSION: '10.23.0'
STAGE: ${{ format('preview-{0}', github.event.number) }}
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: preview
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build and deploy
run: pnpm alchemy deploy --stage ${{ env.STAGE }}
env:
# Alchemy
HOSTNAME: ${{ vars.HOSTNAME }}
ALCHEMY_SECRET: ${{ secrets.ALCHEMY_SECRET }}
ALCHEMY_STATE_TOKEN: ${{ secrets.ALCHEMY_STATE_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
PULL_REQUEST: ${{ github.event.number }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Build
VITE_PUBLIC_POSTHOG_HOST: ${{ vars.VITE_PUBLIC_POSTHOG_HOST }}
VITE_PUBLIC_POSTHOG_KEY: ${{ secrets.VITE_PUBLIC_POSTHOG_KEY }}
VITE_PUBLIC_POSTHOG_DEBUG: ${{ vars.VITE_PUBLIC_POSTHOG_DEBUG }}
VITE_PUBLIC_POSTHOG_ENABLED: ${{ vars.VITE_PUBLIC_POSTHOG_ENABLED }}
# Sourcemap inject and upload
POSTHOG_CLI_HOST: ${{ vars.POSTHOG_CLI_HOST }}
POSTHOG_CLI_ENV_ID: ${{ secrets.POSTHOG_CLI_ENV_ID }}
POSTHOG_CLI_TOKEN: ${{ secrets.POSTHOG_CLI_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/deployment-production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Deploys the main branch to the production environment on every push to main.
# Deploys to the GitHub environment "production" with stage name "production".

name: Deployment (Production)
on:
push:
branches:
- main
concurrency:
group: deployment-production-${{ github.ref }}
cancel-in-progress: false
env:
NODE_VERSION: '24.11.1'
PNPM_VERSION: '10.23.0'
STAGE: 'production'
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: production
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build and deploy
run: pnpm alchemy deploy --stage ${{ env.STAGE }}
env:
# Alchemy
HOSTNAME: ${{ vars.HOSTNAME }}
ALCHEMY_SECRET: ${{ secrets.ALCHEMY_SECRET }}
ALCHEMY_STATE_TOKEN: ${{ secrets.ALCHEMY_STATE_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
# Build
VITE_PUBLIC_POSTHOG_HOST: ${{ vars.VITE_PUBLIC_POSTHOG_HOST }}
VITE_PUBLIC_POSTHOG_KEY: ${{ secrets.VITE_PUBLIC_POSTHOG_KEY }}
VITE_PUBLIC_POSTHOG_DEBUG: ${{ vars.VITE_PUBLIC_POSTHOG_DEBUG }}
VITE_PUBLIC_POSTHOG_ENABLED: ${{ vars.VITE_PUBLIC_POSTHOG_ENABLED }}
# Sourcemap inject and upload
POSTHOG_CLI_HOST: ${{ vars.POSTHOG_CLI_HOST }}
POSTHOG_CLI_ENV_ID: ${{ secrets.POSTHOG_CLI_ENV_ID }}
POSTHOG_CLI_TOKEN: ${{ secrets.POSTHOG_CLI_TOKEN }}
88 changes: 0 additions & 88 deletions .github/workflows/deployment.yml

This file was deleted.

29 changes: 27 additions & 2 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,32 @@
"bracketSameLine": false,
"singleAttributePerLine": false,
"arrowParens": "always",
"ignorePatterns": ["pnpm-lock.yaml", "routeTree.gen.ts", "public/"],
"ignorePatterns": [
"pnpm-lock.yaml",
"routeTree.gen.ts",
"public/",
"src/lib/i18n/"
],
"experimentalSortPackageJson": true,
"experimentalSortImports": { "order": "asc" }
"experimentalSortImports": {
"order": "asc",
"internalPattern": ["~/"],
"groups": [
["side-effect"],
["side-effect-style"],
["builtin"],
["external", "external-type"],
["internal", "internal-type"],
["parent", "parent-type"],
["sibling", "sibling-type"],
["index", "index-type"]
]
},
"experimentalTailwindcss": {
"stylesheet": "./src/ui/styles/app.css",
"attributes": ["class", "className", "classNames"],
"functions": ["clsx", "twMerge", "cn", "cva"],
"preserveDuplicates": false,
"preserveWhitespace": false
}
}
9 changes: 7 additions & 2 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"ignorePatterns": ["pnpm-lock.yaml", "routeTree.gen.ts", "public/"],
"ignorePatterns": [
"pnpm-lock.yaml",
"routeTree.gen.ts",
"public/",
"src/lib/i18n/"
],
"env": {
"browser": true,
"node": true
Expand Down Expand Up @@ -63,7 +68,7 @@
"react/rules-of-hooks": "error",

// Style
"capitalized-comments": "warn",
"capitalized-comments": "off",
"default-case-last": "error",
"default-param-last": "error",
"func-names": ["error", "as-needed", { "generators": "as-needed" }],
Expand Down
4 changes: 2 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import '../src/ui/styles/app.css';

import addonDocs from '@storybook/addon-docs';
import { definePreview } from '@storybook/react-vite';

import '../src/ui/styles/app.css';

export default definePreview({
addons: [addonDocs()],
tags: ['autodocs'],
Expand Down
6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"recommendations": ["oxc.oxc-vscode", "bradlc.vscode-tailwindcss"]
"recommendations": [
"oxc.oxc-vscode",
"bradlc.vscode-tailwindcss",
"inlang.vs-code-extension"
]
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

// Extension - Oxc
"oxc.enable": true,
"oxc.fmt.configPath": ".oxfmtrc.json",

// Extension - Tailwind CSS
"tailwindCSS.classAttributes": ["class", "className", "classNames"],
Expand Down
5 changes: 5 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://inlang.com/schema/inlang-message-format",
"app_name": "Devsantara Kit",
"app_description": "The blueprint for your next big idea"
}
5 changes: 5 additions & 0 deletions messages/id.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://inlang.com/schema/inlang-message-format",
"app_name": "Devsantara Kit",
"app_description": "Rancangan dasar untuk ide besar kamu berikutnya"
}
5 changes: 5 additions & 0 deletions messages/zh-CN.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://inlang.com/schema/inlang-message-format",
"app_name": "Devsantara 工具包",
"app_description": "您下一个伟大构想的基石计划"
}
Loading