create-rykira-app 1.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.
Files changed (143) hide show
  1. package/README.md +50 -0
  2. package/bin/cli.js +149 -0
  3. package/deployment.md +168 -0
  4. package/how-to-deploy-package.md +132 -0
  5. package/package.json +23 -0
  6. package/starter-usage.md +132 -0
  7. package/template/.dockerignore +11 -0
  8. package/template/.env.example +20 -0
  9. package/template/.eslintrc.js +13 -0
  10. package/template/.github/workflows/ci.yml +60 -0
  11. package/template/.prettierignore +7 -0
  12. package/template/.prettierrc +11 -0
  13. package/template/README.md +21 -0
  14. package/template/apps/admin/app/favicon.ico +0 -0
  15. package/template/apps/admin/app/layout.tsx +30 -0
  16. package/template/apps/admin/app/page.tsx +19 -0
  17. package/template/apps/admin/components/.gitkeep +0 -0
  18. package/template/apps/admin/components/theme-provider.tsx +71 -0
  19. package/template/apps/admin/components.json +23 -0
  20. package/template/apps/admin/eslint.config.js +4 -0
  21. package/template/apps/admin/hooks/.gitkeep +0 -0
  22. package/template/apps/admin/lib/.gitkeep +0 -0
  23. package/template/apps/admin/next-env.d.ts +6 -0
  24. package/template/apps/admin/next.config.mjs +6 -0
  25. package/template/apps/admin/nixpacks.toml +8 -0
  26. package/template/apps/admin/package.json +32 -0
  27. package/template/apps/admin/postcss.config.mjs +1 -0
  28. package/template/apps/admin/tsconfig.json +23 -0
  29. package/template/apps/api/nixpacks.toml +8 -0
  30. package/template/apps/api/package.json +32 -0
  31. package/template/apps/api/src/index.ts +11 -0
  32. package/template/apps/api/src/server.ts +21 -0
  33. package/template/apps/api/tsconfig.json +18 -0
  34. package/template/apps/web/app/favicon.ico +0 -0
  35. package/template/apps/web/app/layout.tsx +30 -0
  36. package/template/apps/web/app/page.tsx +19 -0
  37. package/template/apps/web/components/.gitkeep +0 -0
  38. package/template/apps/web/components/theme-provider.tsx +71 -0
  39. package/template/apps/web/components.json +23 -0
  40. package/template/apps/web/eslint.config.js +4 -0
  41. package/template/apps/web/hooks/.gitkeep +0 -0
  42. package/template/apps/web/lib/.gitkeep +0 -0
  43. package/template/apps/web/next-env.d.ts +6 -0
  44. package/template/apps/web/next.config.mjs +6 -0
  45. package/template/apps/web/nixpacks.toml +8 -0
  46. package/template/apps/web/package.json +32 -0
  47. package/template/apps/web/postcss.config.mjs +1 -0
  48. package/template/apps/web/tsconfig.json +23 -0
  49. package/template/infrastructure/docker/Dockerfile.admin +36 -0
  50. package/template/infrastructure/docker/Dockerfile.api +36 -0
  51. package/template/infrastructure/docker/Dockerfile.web +48 -0
  52. package/template/infrastructure/docker/compose.dev.yml +50 -0
  53. package/template/infrastructure/docker/compose.prod.yml +119 -0
  54. package/template/infrastructure/scripts/deploy.sh +3 -0
  55. package/template/infrastructure/scripts/dev.sh +5 -0
  56. package/template/infrastructure/scripts/init-traefik.sh +10 -0
  57. package/template/infrastructure/scripts/setup-server.sh +25 -0
  58. package/template/infrastructure/scripts/update.sh +7 -0
  59. package/template/infrastructure/traefik/acme.json +0 -0
  60. package/template/infrastructure/traefik/dynamic.yml +23 -0
  61. package/template/infrastructure/traefik/traefik.yml +26 -0
  62. package/template/package.json +25 -0
  63. package/template/packages/eslint-config/README.md +3 -0
  64. package/template/packages/eslint-config/base.js +32 -0
  65. package/template/packages/eslint-config/next.js +51 -0
  66. package/template/packages/eslint-config/package.json +26 -0
  67. package/template/packages/eslint-config/react-internal.js +41 -0
  68. package/template/packages/typescript-config/README.md +3 -0
  69. package/template/packages/typescript-config/base.json +20 -0
  70. package/template/packages/typescript-config/nextjs.json +13 -0
  71. package/template/packages/typescript-config/package.json +9 -0
  72. package/template/packages/typescript-config/react-library.json +8 -0
  73. package/template/packages/ui/components.json +23 -0
  74. package/template/packages/ui/eslint.config.js +4 -0
  75. package/template/packages/ui/package.json +52 -0
  76. package/template/packages/ui/postcss.config.mjs +6 -0
  77. package/template/packages/ui/src/components/.gitkeep +0 -0
  78. package/template/packages/ui/src/components/accordion.tsx +74 -0
  79. package/template/packages/ui/src/components/alert-dialog.tsx +187 -0
  80. package/template/packages/ui/src/components/alert.tsx +76 -0
  81. package/template/packages/ui/src/components/aspect-ratio.tsx +22 -0
  82. package/template/packages/ui/src/components/avatar.tsx +109 -0
  83. package/template/packages/ui/src/components/badge.tsx +52 -0
  84. package/template/packages/ui/src/components/breadcrumb.tsx +125 -0
  85. package/template/packages/ui/src/components/button-group.tsx +87 -0
  86. package/template/packages/ui/src/components/button.tsx +60 -0
  87. package/template/packages/ui/src/components/calendar.tsx +221 -0
  88. package/template/packages/ui/src/components/card.tsx +103 -0
  89. package/template/packages/ui/src/components/carousel.tsx +242 -0
  90. package/template/packages/ui/src/components/chart.tsx +356 -0
  91. package/template/packages/ui/src/components/checkbox.tsx +29 -0
  92. package/template/packages/ui/src/components/collapsible.tsx +21 -0
  93. package/template/packages/ui/src/components/combobox.tsx +297 -0
  94. package/template/packages/ui/src/components/command.tsx +196 -0
  95. package/template/packages/ui/src/components/context-menu.tsx +271 -0
  96. package/template/packages/ui/src/components/dialog.tsx +157 -0
  97. package/template/packages/ui/src/components/direction.tsx +6 -0
  98. package/template/packages/ui/src/components/drawer.tsx +131 -0
  99. package/template/packages/ui/src/components/dropdown-menu.tsx +268 -0
  100. package/template/packages/ui/src/components/empty.tsx +101 -0
  101. package/template/packages/ui/src/components/field.tsx +238 -0
  102. package/template/packages/ui/src/components/hover-card.tsx +51 -0
  103. package/template/packages/ui/src/components/input-group.tsx +158 -0
  104. package/template/packages/ui/src/components/input-otp.tsx +87 -0
  105. package/template/packages/ui/src/components/input.tsx +20 -0
  106. package/template/packages/ui/src/components/item.tsx +201 -0
  107. package/template/packages/ui/src/components/kbd.tsx +26 -0
  108. package/template/packages/ui/src/components/label.tsx +20 -0
  109. package/template/packages/ui/src/components/menubar.tsx +280 -0
  110. package/template/packages/ui/src/components/native-select.tsx +52 -0
  111. package/template/packages/ui/src/components/navigation-menu.tsx +168 -0
  112. package/template/packages/ui/src/components/pagination.tsx +130 -0
  113. package/template/packages/ui/src/components/popover.tsx +90 -0
  114. package/template/packages/ui/src/components/progress.tsx +83 -0
  115. package/template/packages/ui/src/components/radio-group.tsx +38 -0
  116. package/template/packages/ui/src/components/resizable.tsx +50 -0
  117. package/template/packages/ui/src/components/scroll-area.tsx +55 -0
  118. package/template/packages/ui/src/components/select.tsx +201 -0
  119. package/template/packages/ui/src/components/separator.tsx +25 -0
  120. package/template/packages/ui/src/components/sheet.tsx +135 -0
  121. package/template/packages/ui/src/components/sidebar.tsx +723 -0
  122. package/template/packages/ui/src/components/skeleton.tsx +13 -0
  123. package/template/packages/ui/src/components/slider.tsx +59 -0
  124. package/template/packages/ui/src/components/sonner.tsx +49 -0
  125. package/template/packages/ui/src/components/spinner.tsx +10 -0
  126. package/template/packages/ui/src/components/switch.tsx +32 -0
  127. package/template/packages/ui/src/components/table.tsx +116 -0
  128. package/template/packages/ui/src/components/tabs.tsx +82 -0
  129. package/template/packages/ui/src/components/textarea.tsx +18 -0
  130. package/template/packages/ui/src/components/toggle-group.tsx +89 -0
  131. package/template/packages/ui/src/components/toggle.tsx +44 -0
  132. package/template/packages/ui/src/components/tooltip.tsx +66 -0
  133. package/template/packages/ui/src/hooks/.gitkeep +0 -0
  134. package/template/packages/ui/src/hooks/use-mobile.ts +19 -0
  135. package/template/packages/ui/src/lib/.gitkeep +0 -0
  136. package/template/packages/ui/src/lib/utils.ts +6 -0
  137. package/template/packages/ui/src/styles/globals.css +128 -0
  138. package/template/packages/ui/tsconfig.json +11 -0
  139. package/template/packages/ui/tsconfig.lint.json +8 -0
  140. package/template/pnpm-lock.yaml +9103 -0
  141. package/template/pnpm-workspace.yaml +3 -0
  142. package/template/tsconfig.json +4 -0
  143. package/template/turbo.json +24 -0
@@ -0,0 +1 @@
1
+ export { default } from "@workspace/ui/postcss.config";
@@ -0,0 +1,23 @@
1
+ {
2
+ "extends": "@workspace/typescript-config/nextjs.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "paths": {
6
+ "@/*": ["./*"],
7
+ "@workspace/ui/*": ["../../packages/ui/src/*"]
8
+ },
9
+ "plugins": [
10
+ {
11
+ "name": "next"
12
+ }
13
+ ]
14
+ },
15
+ "include": [
16
+ "next-env.d.ts",
17
+ "next.config.ts",
18
+ "**/*.ts",
19
+ "**/*.tsx",
20
+ ".next/types/**/*.ts"
21
+ ],
22
+ "exclude": ["node_modules"]
23
+ }
@@ -0,0 +1,36 @@
1
+ FROM node:20-alpine AS base
2
+
3
+ WORKDIR /app
4
+ RUN corepack enable
5
+
6
+ FROM base AS pruner
7
+
8
+ COPY . .
9
+
10
+ RUN pnpm dlx turbo prune admin --docker
11
+
12
+
13
+ FROM base AS installer
14
+
15
+ WORKDIR /app
16
+
17
+ COPY --from=pruner /app/out/json/ .
18
+
19
+ RUN pnpm install --frozen-lockfile
20
+
21
+ COPY --from=pruner /app/out/full/ .
22
+
23
+ RUN pnpm turbo build --filter=admin
24
+
25
+
26
+ FROM node:20-alpine AS runner
27
+
28
+ WORKDIR /app
29
+
30
+ ENV NODE_ENV=production
31
+
32
+ COPY --from=installer /app .
33
+
34
+ EXPOSE 3001
35
+
36
+ CMD ["pnpm", "start:admin"]
@@ -0,0 +1,36 @@
1
+ FROM node:20-alpine AS base
2
+
3
+ WORKDIR /app
4
+ RUN corepack enable
5
+
6
+ FROM base AS pruner
7
+
8
+ COPY . .
9
+
10
+ RUN pnpm dlx turbo prune api --docker
11
+
12
+
13
+ FROM base AS installer
14
+
15
+ WORKDIR /app
16
+
17
+ COPY --from=pruner /app/out/json/ .
18
+
19
+ RUN pnpm install --frozen-lockfile
20
+
21
+ COPY --from=pruner /app/out/full/ .
22
+
23
+ RUN pnpm turbo build --filter=api
24
+
25
+
26
+ FROM node:20-alpine AS runner
27
+
28
+ WORKDIR /app
29
+
30
+ ENV NODE_ENV=production
31
+
32
+ COPY --from=installer /app .
33
+
34
+ EXPOSE 4000
35
+
36
+ CMD ["node", "apps/api/dist/index.js"]
@@ -0,0 +1,48 @@
1
+ FROM node:20-alpine AS base
2
+
3
+ WORKDIR /app
4
+ RUN corepack enable
5
+
6
+ # -----------------------------
7
+ # 1️⃣ PRUNE MONOREPO
8
+ # -----------------------------
9
+
10
+ FROM base AS pruner
11
+
12
+ COPY . .
13
+
14
+ RUN pnpm dlx turbo prune web --docker
15
+
16
+
17
+ # -----------------------------
18
+ # 2️⃣ INSTALL + BUILD
19
+ # -----------------------------
20
+
21
+ FROM base AS installer
22
+
23
+ WORKDIR /app
24
+
25
+ COPY --from=pruner /app/out/json/ .
26
+
27
+ RUN pnpm install --frozen-lockfile
28
+
29
+ COPY --from=pruner /app/out/full/ .
30
+
31
+ RUN pnpm turbo build --filter=web
32
+
33
+
34
+ # -----------------------------
35
+ # 3️⃣ RUN APPLICATION
36
+ # -----------------------------
37
+
38
+ FROM node:20-alpine AS runner
39
+
40
+ WORKDIR /app
41
+
42
+ ENV NODE_ENV=production
43
+
44
+ COPY --from=installer /app .
45
+
46
+ EXPOSE 3000
47
+
48
+ CMD ["pnpm", "start:web"]
@@ -0,0 +1,50 @@
1
+ version: "3.9"
2
+
3
+ services:
4
+
5
+ api:
6
+ build:
7
+ context: ../..
8
+ dockerfile: infrastructure/docker/Dockerfile.api
9
+ container_name: {{projectName}}-api-dev
10
+ env_file:
11
+ - ../../.env
12
+ ports:
13
+ - "4000:4000"
14
+ depends_on:
15
+ - postgres
16
+ - redis
17
+
18
+ web:
19
+ build:
20
+ context: ../..
21
+ dockerfile: infrastructure/docker/Dockerfile.web
22
+ env_file:
23
+ - ../../.env
24
+ ports:
25
+ - "3000:3000"
26
+
27
+ admin:
28
+ build:
29
+ context: ../..
30
+ dockerfile: infrastructure/docker/Dockerfile.admin
31
+ container_name: {{projectName}}-admin-dev
32
+ env_file:
33
+ - ../../.env
34
+ ports:
35
+ - "3001:3001"
36
+
37
+ postgres:
38
+ image: postgres:16
39
+ environment:
40
+ POSTGRES_DB: ${POSTGRES_DB}
41
+ POSTGRES_USER: ${POSTGRES_USER}
42
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
43
+ ports:
44
+ - "5432:5432"
45
+
46
+ redis:
47
+ image: redis:7
48
+ container_name: {{projectName}}-redis-dev
49
+ ports:
50
+ - "6379:6379"
@@ -0,0 +1,119 @@
1
+ version: "3.9"
2
+
3
+ services:
4
+
5
+ traefik:
6
+ image: traefik:v3.0
7
+ command:
8
+ - "--providers.docker=true"
9
+ - "--entrypoints.web.address=:80"
10
+ - "--entrypoints.websecure.address=:443"
11
+ ports:
12
+ - "80:80"
13
+ - "443:443"
14
+ volumes:
15
+ - /var/run/docker.sock:/var/run/docker.sock
16
+ - ../traefik/traefik.yml:/etc/traefik/traefik.yml
17
+ - ../traefik/dynamic.yml:/etc/traefik/dynamic.yml
18
+ - ../traefik/acme.json:/etc/traefik/acme.json
19
+ restart: always
20
+
21
+
22
+ web:
23
+ build:
24
+ context: ../..
25
+ dockerfile: infrastructure/docker/Dockerfile.web
26
+ container_name: {{projectName}}-web
27
+ env_file:
28
+ - ../../.env
29
+ labels:
30
+ - "traefik.enable=true"
31
+ - "traefik.http.routers.web.rule=Host(`app.${DOMAIN}`)"
32
+ - "traefik.http.routers.web.entrypoints=websecure"
33
+ - "traefik.http.routers.web.tls.certresolver=letsencrypt"
34
+ - "traefik.http.services.web.loadbalancer.server.port=3000"
35
+ - "traefik.http.routers.web.middlewares=secureHeaders@file,rateLimit@file"
36
+ restart: always
37
+
38
+ admin:
39
+ api:
40
+ build:
41
+ context: ../..
42
+ dockerfile: infrastructure/docker/Dockerfile.api
43
+ container_name: {{projectName}}-api
44
+ env_file:
45
+ - ../../.env
46
+ labels:
47
+ - "traefik.enable=true"
48
+ - "traefik.http.routers.admin.rule=Host(`admin.domain.com`)"
49
+ - "traefik.http.routers.admin.entrypoints=websecure"
50
+ - "traefik.http.routers.admin.tls.certresolver=letsencrypt"
51
+ - "traefik.http.services.admin.loadbalancer.server.port=3001"
52
+ - "traefik.http.routers.admin.middlewares=secureHeaders@file,rateLimit@file"
53
+ restart: always
54
+
55
+ api:
56
+ build:
57
+ context: ../..
58
+ dockerfile: infrastructure/docker/Dockerfile.api
59
+ labels:
60
+ - "traefik.enable=true"
61
+ - "traefik.http.routers.api.rule=Host(`api.${DOMAIN}`)"
62
+ - "traefik.http.routers.api.entrypoints=websecure"
63
+ - "traefik.http.routers.api.tls.certresolver=letsencrypt"
64
+ - "traefik.http.services.api.loadbalancer.server.port=4000"
65
+ - "traefik.http.routers.api.middlewares=secureHeaders@file,rateLimit@file"
66
+ healthcheck:
67
+ test: ["executable", "arg"]
68
+ interval: 1m30s
69
+ timeout: 30s
70
+ retries: 5
71
+ start_period: 30s
72
+ depends_on:
73
+ postgres:
74
+ condition: service_healthy
75
+ redis:
76
+ condition: service_healthy
77
+ restart: always
78
+
79
+ postgres:
80
+ image: postgres:16
81
+ container_name: {{projectName}}-postgres
82
+ environment:
83
+ POSTGRES_USER: ${POSTGRES_USER}
84
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
85
+ POSTGRES_DB: ${POSTGRES_DB}
86
+ volumes:
87
+ - postgres_data:/var/lib/postgresql/data
88
+ healthcheck:
89
+ test: ["executable", "arg"]
90
+ interval: 1m30s
91
+ timeout: 30s
92
+ retries: 5
93
+ start_period: 30s
94
+ restart: always
95
+
96
+ redis:
97
+ image: redis:7
98
+ container_name: {{projectName}}-redis
99
+ healthcheck:
100
+ test: ["executable", "arg"]
101
+ interval: 1m30s
102
+ timeout: 30s
103
+ retries: 5
104
+ start_period: 30s
105
+ restart: always
106
+
107
+ portainer:
108
+ image: portainer/portainer-ce
109
+ ports:
110
+ - "9000:9000"
111
+ volumes:
112
+ - /var/run/docker.sock:/var/run/docker.sock
113
+ - portainer_data:/data
114
+ restart: always
115
+
116
+ volumes:
117
+
118
+ postgres_data:
119
+ portainer_data:
@@ -0,0 +1,3 @@
1
+ docker compose \
2
+ -f infrastructure/docker/compose.prod.yml \
3
+ up -d --build
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ docker compose \
4
+ -f infrastructure/docker/compose.dev.yml \
5
+ up --build
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+
3
+ # init-traefik.sh - Initialize Traefik ACME file
4
+ # Usage: ./init-traefik.sh
5
+
6
+ echo "Initializing Traefik ACME file..."
7
+ touch infrastructure/traefik/acme.json
8
+ chmod 600 infrastructure/traefik/acme.json
9
+
10
+ echo "Traefik initialized successfully."
@@ -0,0 +1,25 @@
1
+ #!/bin/bash
2
+
3
+ # setup-server.sh - Initial server setup script
4
+ # Usage: ./setup-server.sh
5
+
6
+ # Update system
7
+ echo "Updating system..."
8
+ sudo apt update && sudo apt upgrade -y
9
+
10
+ # Install Docker
11
+ echo "Installing Docker..."
12
+ curl -fsSL https://get.docker.com -o get-docker.sh
13
+ sudo sh get-docker.sh
14
+
15
+ # Install UFW
16
+ echo "Configuring Firewall..."
17
+ sudo apt install ufw -y
18
+ sudo ufw default deny incoming
19
+ sudo ufw default allow outgoing
20
+ sudo ufw allow 22/tcp
21
+ sudo ufw allow 80/tcp
22
+ sudo ufw allow 443/tcp
23
+ echo "y" | sudo ufw enable
24
+
25
+ echo "Server setup complete! Please log out and log back in."
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+
3
+ git pull
4
+
5
+ docker compose \
6
+ -f infrastructure/docker/compose.prod.yml \
7
+ up -d --build
File without changes
@@ -0,0 +1,23 @@
1
+ http:
2
+
3
+ middlewares:
4
+
5
+ secureHeaders:
6
+ headers:
7
+
8
+ sslRedirect: true
9
+ stsSeconds: 63072000
10
+ stsIncludeSubdomains: true
11
+ stsPreload: true
12
+
13
+ contentTypeNosniff: true
14
+ browserXssFilter: true
15
+
16
+ frameDeny: true
17
+
18
+ rateLimit:
19
+ rateLimit:
20
+ average: 100
21
+ burst: 50
22
+
23
+ routers: {}
@@ -0,0 +1,26 @@
1
+ api:
2
+ dashboard: true
3
+
4
+ entryPoints:
5
+
6
+ web:
7
+ address: ":80"
8
+
9
+ websecure:
10
+ address: ":443"
11
+
12
+ providers:
13
+
14
+ docker:
15
+ exposedByDefault: false
16
+
17
+ file:
18
+ filename: /etc/traefik/dynamic.yml
19
+
20
+ certificatesResolvers:
21
+
22
+ letsencrypt:
23
+ acme:
24
+ storage: /etc/traefik/acme.json
25
+ httpChallenge:
26
+ entryPoint: web
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "scripts": {
6
+ "build": "turbo build",
7
+ "dev": "turbo dev",
8
+ "start": "turbo start",
9
+ "lint": "turbo lint",
10
+ "format": "turbo format",
11
+ "typecheck": "turbo typecheck"
12
+ },
13
+ "devDependencies": {
14
+ "@workspace/eslint-config": "workspace:*",
15
+ "@workspace/typescript-config": "workspace:*",
16
+ "prettier": "^3.8.1",
17
+ "prettier-plugin-tailwindcss": "^0.7.2",
18
+ "turbo": "^2.8.8",
19
+ "typescript": "5.9.3"
20
+ },
21
+ "packageManager": "pnpm@9.0.6",
22
+ "engines": {
23
+ "node": ">=20"
24
+ }
25
+ }
@@ -0,0 +1,3 @@
1
+ # `@workspace/eslint-config`
2
+
3
+ Shared eslint configuration for the workspace.
@@ -0,0 +1,32 @@
1
+ import js from "@eslint/js"
2
+ import eslintConfigPrettier from "eslint-config-prettier"
3
+ import onlyWarn from "eslint-plugin-only-warn"
4
+ import turboPlugin from "eslint-plugin-turbo"
5
+ import tseslint from "typescript-eslint"
6
+
7
+ /**
8
+ * A shared ESLint configuration for the repository.
9
+ *
10
+ * @type {import("eslint").Linter.Config}
11
+ * */
12
+ export const config = [
13
+ js.configs.recommended,
14
+ eslintConfigPrettier,
15
+ ...tseslint.configs.recommended,
16
+ {
17
+ plugins: {
18
+ turbo: turboPlugin,
19
+ },
20
+ rules: {
21
+ "turbo/no-undeclared-env-vars": "warn",
22
+ },
23
+ },
24
+ {
25
+ plugins: {
26
+ onlyWarn,
27
+ },
28
+ },
29
+ {
30
+ ignores: ["dist/**", ".next/**", "**/.turbo/**", "**/coverage/**"],
31
+ },
32
+ ]
@@ -0,0 +1,51 @@
1
+ import js from "@eslint/js"
2
+ import pluginNext from "@next/eslint-plugin-next"
3
+ import eslintConfigPrettier from "eslint-config-prettier"
4
+ import pluginReact from "eslint-plugin-react"
5
+ import pluginReactHooks from "eslint-plugin-react-hooks"
6
+ import globals from "globals"
7
+ import tseslint from "typescript-eslint"
8
+
9
+ import { config as baseConfig } from "./base.js"
10
+
11
+ /**
12
+ * A custom ESLint configuration for libraries that use Next.js.
13
+ *
14
+ * @type {import("eslint").Linter.Config}
15
+ * */
16
+ export const nextJsConfig = [
17
+ ...baseConfig,
18
+ js.configs.recommended,
19
+ eslintConfigPrettier,
20
+ ...tseslint.configs.recommended,
21
+ {
22
+ ...pluginReact.configs.flat.recommended,
23
+ languageOptions: {
24
+ ...pluginReact.configs.flat.recommended.languageOptions,
25
+ globals: {
26
+ ...globals.serviceworker,
27
+ },
28
+ },
29
+ },
30
+ {
31
+ plugins: {
32
+ "@next/next": pluginNext,
33
+ },
34
+ rules: {
35
+ ...pluginNext.configs.recommended.rules,
36
+ ...pluginNext.configs["core-web-vitals"].rules,
37
+ },
38
+ },
39
+ {
40
+ plugins: {
41
+ "react-hooks": pluginReactHooks,
42
+ },
43
+ settings: { react: { version: "detect" } },
44
+ rules: {
45
+ ...pluginReactHooks.configs.recommended.rules,
46
+ // React scope no longer necessary with new JSX transform.
47
+ "react/react-in-jsx-scope": "off",
48
+ "react/prop-types": "off",
49
+ },
50
+ },
51
+ ]
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@workspace/eslint-config",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "private": true,
6
+ "exports": {
7
+ "./base": "./base.js",
8
+ "./next-js": "./next.js",
9
+ "./react-internal": "./react-internal.js"
10
+ },
11
+ "devDependencies": {
12
+ "@eslint/js": "^9.39.2",
13
+ "@next/eslint-plugin-next": "^16.1.6",
14
+ "@typescript-eslint/eslint-plugin": "^8.54.0",
15
+ "@typescript-eslint/parser": "^8.54.0",
16
+ "eslint": "^9.39.2",
17
+ "eslint-config-prettier": "^10.1.8",
18
+ "eslint-plugin-only-warn": "^1.1.0",
19
+ "eslint-plugin-react": "^7.37.5",
20
+ "eslint-plugin-react-hooks": "^7.0.1",
21
+ "eslint-plugin-turbo": "^2.8.1",
22
+ "globals": "^17.2.0",
23
+ "typescript": "^5.9.3",
24
+ "typescript-eslint": "^8.54.0"
25
+ }
26
+ }
@@ -0,0 +1,41 @@
1
+ import js from "@eslint/js"
2
+ import eslintConfigPrettier from "eslint-config-prettier"
3
+ import pluginReact from "eslint-plugin-react"
4
+ import pluginReactHooks from "eslint-plugin-react-hooks"
5
+ import globals from "globals"
6
+ import tseslint from "typescript-eslint"
7
+
8
+ import { config as baseConfig } from "./base.js"
9
+
10
+ /**
11
+ * A custom ESLint configuration for libraries that use React.
12
+ *
13
+ * @type {import("eslint").Linter.Config} */
14
+ export const config = [
15
+ ...baseConfig,
16
+ js.configs.recommended,
17
+ eslintConfigPrettier,
18
+ ...tseslint.configs.recommended,
19
+ pluginReact.configs.flat.recommended,
20
+ {
21
+ languageOptions: {
22
+ ...pluginReact.configs.flat.recommended.languageOptions,
23
+ globals: {
24
+ ...globals.serviceworker,
25
+ ...globals.browser,
26
+ },
27
+ },
28
+ },
29
+ {
30
+ plugins: {
31
+ "react-hooks": pluginReactHooks,
32
+ },
33
+ settings: { react: { version: "detect" } },
34
+ rules: {
35
+ ...pluginReactHooks.configs.recommended.rules,
36
+ // React scope no longer necessary with new JSX transform.
37
+ "react/react-in-jsx-scope": "off",
38
+ "react/prop-types": "off",
39
+ },
40
+ },
41
+ ]
@@ -0,0 +1,3 @@
1
+ # `@workspace/typescript-config`
2
+
3
+ Shared typescript configuration for the workspace.
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Default",
4
+ "compilerOptions": {
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "esModuleInterop": true,
8
+ "incremental": false,
9
+ "isolatedModules": true,
10
+ "lib": ["es2022", "DOM", "DOM.Iterable"],
11
+ "module": "NodeNext",
12
+ "moduleDetection": "force",
13
+ "moduleResolution": "NodeNext",
14
+ "noUncheckedIndexedAccess": true,
15
+ "resolveJsonModule": true,
16
+ "skipLibCheck": true,
17
+ "strict": true,
18
+ "target": "ES2022"
19
+ }
20
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "Next.js",
4
+ "extends": "./base.json",
5
+ "compilerOptions": {
6
+ "plugins": [{ "name": "next" }],
7
+ "module": "ESNext",
8
+ "moduleResolution": "Bundler",
9
+ "allowJs": true,
10
+ "jsx": "preserve",
11
+ "noEmit": true
12
+ }
13
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@workspace/typescript-config",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "license": "PROPRIETARY",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ }
9
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "display": "React Library",
4
+ "extends": "./base.json",
5
+ "compilerOptions": {
6
+ "jsx": "react-jsx",
7
+ }
8
+ }