@adlas/create-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.
- package/README.md +476 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +39 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/figma.d.ts +16 -0
- package/dist/commands/figma.d.ts.map +1 -0
- package/dist/commands/figma.js +172 -0
- package/dist/commands/figma.js.map +1 -0
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +5 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +8 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +1471 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/swagger.d.ts +16 -0
- package/dist/commands/swagger.d.ts.map +1 -0
- package/dist/commands/swagger.js +404 -0
- package/dist/commands/swagger.js.map +1 -0
- package/dist/commands/update.d.ts +15 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +93 -0
- package/dist/commands/update.js.map +1 -0
- package/package.json +63 -0
- package/templates/.vscode/extensions.json +9 -0
- package/templates/.vscode/launch.json +26 -0
- package/templates/.vscode/settings.json +67 -0
- package/templates/.vscode/tasks.json +21 -0
- package/templates/boilerplate/config/fonts.ts +10 -0
- package/templates/boilerplate/config/navigationUrls.ts +47 -0
- package/templates/boilerplate/config/site.ts +96 -0
- package/templates/boilerplate/libs/I18n.ts +15 -0
- package/templates/boilerplate/libs/I18nNavigation.ts +5 -0
- package/templates/boilerplate/libs/I18nRouting.ts +9 -0
- package/templates/boilerplate/libs/env.ts +21 -0
- package/templates/boilerplate/libs/react-query/ReactQueryProvider.tsx +21 -0
- package/templates/boilerplate/libs/react-query/index.ts +2 -0
- package/templates/boilerplate/libs/react-query/queryClient.ts +62 -0
- package/templates/boilerplate/libs/react-query/queryKeys.ts +5 -0
- package/templates/boilerplate/public/images/index.ts +1 -0
- package/templates/boilerplate/reset.d.ts +2 -0
- package/templates/boilerplate/styles/globals.css +308 -0
- package/templates/boilerplate/types/i18n.ts +10 -0
- package/templates/boilerplate/types/locale.ts +8 -0
- package/templates/boilerplate/utils/file/fileConfig.ts +123 -0
- package/templates/boilerplate/utils/file/fileValidation.ts +78 -0
- package/templates/boilerplate/utils/file/imageCompression.ts +182 -0
- package/templates/boilerplate/utils/file/index.ts +3 -0
- package/templates/boilerplate/utils/helpers.ts +55 -0
- package/templates/boilerplate/validations/auth.validation.ts +92 -0
- package/templates/boilerplate/validations/commonValidations.ts +258 -0
- package/templates/boilerplate/validations/zodErrorMap.ts +101 -0
- package/templates/configs/.env.example +8 -0
- package/templates/configs/.prettierignore +23 -0
- package/templates/configs/.prettierrc.cjs +26 -0
- package/templates/configs/.prettierrc.icons.cjs +11 -0
- package/templates/configs/Dockerfile +6 -0
- package/templates/configs/commitlint.config.ts +8 -0
- package/templates/configs/eslint.config.mjs +119 -0
- package/templates/configs/knip.config.ts +32 -0
- package/templates/configs/lefthook.yml +42 -0
- package/templates/configs/lint-staged.config.js +8 -0
- package/templates/configs/next.config.template.ts +77 -0
- package/templates/configs/next.config.ts +43 -0
- package/templates/configs/package.json +75 -0
- package/templates/configs/postcss.config.mjs +15 -0
- package/templates/configs/svgr.config.mjs +129 -0
- package/templates/configs/tsconfig.json +75 -0
- package/templates/docs/AI_QUICK_REFERENCE.md +379 -0
- package/templates/docs/ARCHITECTURE_PATTERNS.md +927 -0
- package/templates/docs/DOCUMENTATION_INDEX.md +411 -0
- package/templates/docs/FIGMA_TO_CODE_GUIDE.md +768 -0
- package/templates/docs/IMPLEMENTATION_GUIDE.md +892 -0
- package/templates/docs/PROJECT_OVERVIEW.md +302 -0
- package/templates/docs/REFACTOR_PROGRESS.md +1113 -0
- package/templates/docs/SHADCN_TO_HEROUI_MIGRATION.md +1375 -0
- package/templates/docs/UI_COMPONENTS_GUIDE.md +893 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { dirname } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
import antfu from '@antfu/eslint-config';
|
|
5
|
+
import jsxA11y from 'eslint-plugin-jsx-a11y';
|
|
6
|
+
import tailwind from 'eslint-plugin-tailwindcss';
|
|
7
|
+
|
|
8
|
+
export default antfu(
|
|
9
|
+
{
|
|
10
|
+
react: true,
|
|
11
|
+
nextjs: true,
|
|
12
|
+
typescript: true,
|
|
13
|
+
|
|
14
|
+
// Configuration preferences
|
|
15
|
+
lessOpinionated: true,
|
|
16
|
+
isInEditor: false,
|
|
17
|
+
|
|
18
|
+
// Code style
|
|
19
|
+
stylistic: {
|
|
20
|
+
semi: true,
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
// Format settings
|
|
24
|
+
formatters: {
|
|
25
|
+
css: true,
|
|
26
|
+
prettier: {
|
|
27
|
+
printWidth: 130,
|
|
28
|
+
singleQuote: true,
|
|
29
|
+
semi: true,
|
|
30
|
+
trailingComma: 'all',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
// Ignored paths
|
|
35
|
+
ignores: ['migrations/**/*', '**/*.md', '**/*.yml', '**/*.yaml'],
|
|
36
|
+
},
|
|
37
|
+
// --- Accessibility Rules ---
|
|
38
|
+
jsxA11y.flatConfigs.recommended,
|
|
39
|
+
// --- Tailwind CSS Rules ---
|
|
40
|
+
...tailwind.configs['flat/recommended'],
|
|
41
|
+
{
|
|
42
|
+
settings: {
|
|
43
|
+
tailwindcss: {
|
|
44
|
+
config: `${dirname(fileURLToPath(import.meta.url))}/src/styles/globals.css`,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
// --- Custom Rule Overrides ---
|
|
49
|
+
{
|
|
50
|
+
rules: {
|
|
51
|
+
'antfu/no-top-level-await': 'off', // Allow top-level await
|
|
52
|
+
'antfu/consistent-chaining': 'off', // Allow line breaks in method chains for readability
|
|
53
|
+
'style/brace-style': 'off', // Let Prettier handle brace style
|
|
54
|
+
'style/indent': 'off', // Let Prettier handle indentation
|
|
55
|
+
'style/jsx-curly-newline': 'off', // Let Prettier handle JSX curly brace newlines
|
|
56
|
+
'ts/consistent-type-definitions': ['error', 'type'], // Use `type` instead of `interface`
|
|
57
|
+
'react/prefer-destructuring-assignment': 'off', // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
|
|
58
|
+
'node/prefer-global/process': 'off', // Allow using `process.env`
|
|
59
|
+
'test/padding-around-all': 'error', // Add padding in test files
|
|
60
|
+
'test/prefer-lowercase-title': 'off', // Allow using uppercase titles in test titles
|
|
61
|
+
'react-hooks-extra/no-direct-set-state-in-use-effect': 'off', // Allow direct setState in useEffect
|
|
62
|
+
// Maximum line length
|
|
63
|
+
'style/max-len': [
|
|
64
|
+
'error',
|
|
65
|
+
{
|
|
66
|
+
code: 130, // Maximum characters per line
|
|
67
|
+
tabWidth: 2,
|
|
68
|
+
ignoreUrls: true,
|
|
69
|
+
ignoreStrings: true,
|
|
70
|
+
ignoreTemplateLiterals: true,
|
|
71
|
+
ignoreRegExpLiterals: true,
|
|
72
|
+
ignoreComments: true, // Ignore comment length
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
|
|
76
|
+
// Disable conflicting rules with Prettier
|
|
77
|
+
'style/quotes': 'off', // Let Prettier handle quote style
|
|
78
|
+
'style/quote-props': 'off', // Let Prettier handle property quoting
|
|
79
|
+
'style/multiline-ternary': 'off', // Let Prettier handle ternary formatting
|
|
80
|
+
'style/operator-linebreak': 'off', // Let Prettier handle operator linebreaks
|
|
81
|
+
'style/arrow-parens': 'off', // Let Prettier handle arrow function parens
|
|
82
|
+
'style/indent-binary-ops': 'off', // Let Prettier handle binary operator indentation
|
|
83
|
+
'style/jsx-one-expression-per-line': 'off', // Let Prettier handle JSX line breaks
|
|
84
|
+
'style/jsx-wrap-multilines': 'off', // Let Prettier handle JSX wrapping
|
|
85
|
+
'tailwindcss/classnames-order': 'error', // ESLint plugin handles Tailwind class ordering
|
|
86
|
+
|
|
87
|
+
// Import ordering and grouping
|
|
88
|
+
'perfectionist/sort-imports': [
|
|
89
|
+
'error',
|
|
90
|
+
{
|
|
91
|
+
type: 'natural',
|
|
92
|
+
order: 'asc',
|
|
93
|
+
groups: [
|
|
94
|
+
'side-effect-style',
|
|
95
|
+
'style',
|
|
96
|
+
'type',
|
|
97
|
+
'react',
|
|
98
|
+
'builtin',
|
|
99
|
+
'external',
|
|
100
|
+
'internal-type',
|
|
101
|
+
'internal',
|
|
102
|
+
['parent-type', 'sibling-type', 'index-type'],
|
|
103
|
+
['parent', 'sibling', 'index'],
|
|
104
|
+
'side-effect',
|
|
105
|
+
'object',
|
|
106
|
+
'unknown',
|
|
107
|
+
],
|
|
108
|
+
customGroups: {
|
|
109
|
+
value: {
|
|
110
|
+
react: ['^react$', '^react-dom$'],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
newlinesBetween: 'always',
|
|
114
|
+
internalPattern: ['^@/'],
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { KnipConfig } from 'knip';
|
|
2
|
+
|
|
3
|
+
const config: KnipConfig = {
|
|
4
|
+
// Files to exclude from Knip analysis
|
|
5
|
+
ignore: [
|
|
6
|
+
'src/libs/I18n.ts',
|
|
7
|
+
'src/types/I18n.ts',
|
|
8
|
+
'src/types/i18n.ts',
|
|
9
|
+
'src/utils/Helpers.ts',
|
|
10
|
+
'src/styles/hero.ts',
|
|
11
|
+
'src/components/icons/**',
|
|
12
|
+
'src/components/ui/**',
|
|
13
|
+
'lint-staged.config.js',
|
|
14
|
+
'src/libs/I18nNavigation.ts',
|
|
15
|
+
'svgr.config.mjs',
|
|
16
|
+
'.prettierrc.icons.cjs',
|
|
17
|
+
],
|
|
18
|
+
// Dependencies to ignore during analysis
|
|
19
|
+
ignoreDependencies: [
|
|
20
|
+
'@react-types/shared',
|
|
21
|
+
'conventional-changelog-conventionalcommits',
|
|
22
|
+
'@svgr/babel-plugin-remove-jsx-attribute',
|
|
23
|
+
'autoprefixer',
|
|
24
|
+
'dotenv-cli',
|
|
25
|
+
'tailwind-variants',
|
|
26
|
+
],
|
|
27
|
+
compilers: {
|
|
28
|
+
css: (text: string) => [...text.matchAll(/(?<=@)import[^;]+/g)].join('\n'),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default config;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Validate commit messages
|
|
2
|
+
commit-msg:
|
|
3
|
+
commands:
|
|
4
|
+
commitlint:
|
|
5
|
+
run: npx --no -- commitlint --edit {1}
|
|
6
|
+
|
|
7
|
+
# Validate content before committing
|
|
8
|
+
pre-commit:
|
|
9
|
+
commands:
|
|
10
|
+
# Format code with prettier
|
|
11
|
+
prettier:
|
|
12
|
+
glob: '*.{js,jsx,ts,tsx,json,css,scss,md,mdx,yml,yaml}'
|
|
13
|
+
run: pnpm prettier:format {staged_files}
|
|
14
|
+
stage_fixed: true
|
|
15
|
+
priority: 1
|
|
16
|
+
# Fix double spaces in className
|
|
17
|
+
lint-spaces:
|
|
18
|
+
glob: '*.{tsx,jsx}'
|
|
19
|
+
run: pnpm lint:spaces
|
|
20
|
+
stage_fixed: true
|
|
21
|
+
priority: 2
|
|
22
|
+
# Lint and fix code
|
|
23
|
+
lint:
|
|
24
|
+
glob: '*.{js,jsx,ts,tsx}'
|
|
25
|
+
run: eslint --fix {staged_files}
|
|
26
|
+
stage_fixed: true
|
|
27
|
+
priority: 3
|
|
28
|
+
# Type checking
|
|
29
|
+
check-types:
|
|
30
|
+
glob: '*.{ts,tsx}'
|
|
31
|
+
run: pnpm check:types
|
|
32
|
+
priority: 4
|
|
33
|
+
# Check dependencies
|
|
34
|
+
check-deps:
|
|
35
|
+
glob: '*'
|
|
36
|
+
run: pnpm check:deps
|
|
37
|
+
priority: 5
|
|
38
|
+
# Check i18n
|
|
39
|
+
check-i18n:
|
|
40
|
+
glob: '*.{ts,tsx,js,jsx}'
|
|
41
|
+
run: pnpm check:i18n
|
|
42
|
+
priority: 6
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
// Format code with prettier
|
|
3
|
+
'*.{js,jsx,ts,tsx,json,css,scss,md,mdx,yml,yaml}': ['prettier --write'],
|
|
4
|
+
// Lint and fix code (includes lint:spaces)
|
|
5
|
+
'*.{js,jsx,ts,tsx}': ['pnpm lint:fix'],
|
|
6
|
+
// Type checking
|
|
7
|
+
'**/*.ts?(x)': () => 'pnpm check:types',
|
|
8
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { NextConfig } from 'next';
|
|
2
|
+
{{#i18n}}
|
|
3
|
+
import createNextIntlPlugin from 'next-intl/plugin';
|
|
4
|
+
{{/i18n}}
|
|
5
|
+
{{#pwa}}
|
|
6
|
+
import withPWA from 'next-pwa';
|
|
7
|
+
{{/pwa}}
|
|
8
|
+
|
|
9
|
+
// Define the base Next.js configuration
|
|
10
|
+
const baseConfig: NextConfig = {
|
|
11
|
+
reactStrictMode: true,
|
|
12
|
+
poweredByHeader: false,
|
|
13
|
+
typescript: {
|
|
14
|
+
ignoreBuildErrors: false,
|
|
15
|
+
},
|
|
16
|
+
eslint: {
|
|
17
|
+
ignoreDuringBuilds: false,
|
|
18
|
+
},
|
|
19
|
+
images: {
|
|
20
|
+
// Optimized quality: 75 provides excellent visual quality at ~50% smaller file size
|
|
21
|
+
// Next.js automatically generates WebP/AVIF when browser supports it
|
|
22
|
+
qualities: [75, 85, 100],
|
|
23
|
+
formats: ['image/avif', 'image/webp'],
|
|
24
|
+
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
25
|
+
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384, 512, 1024],
|
|
26
|
+
// Cache images for 7 days (604800 seconds) for better performance
|
|
27
|
+
minimumCacheTTL: 604800,
|
|
28
|
+
remotePatterns: [
|
|
29
|
+
{
|
|
30
|
+
protocol: 'https',
|
|
31
|
+
hostname: '**',
|
|
32
|
+
pathname: '/**',
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
experimental: {
|
|
37
|
+
serverActions: {
|
|
38
|
+
bodySizeLimit: '10mb',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{{#ssr}}
|
|
42
|
+
output: 'standalone',
|
|
43
|
+
{{/ssr}}
|
|
44
|
+
{{^ssr}}
|
|
45
|
+
output: 'export',
|
|
46
|
+
{{/ssr}}
|
|
47
|
+
webpack(config) {
|
|
48
|
+
// SVGR configuration for importing SVGs as React components
|
|
49
|
+
config.module.rules.push({
|
|
50
|
+
test: /\.svg$/i,
|
|
51
|
+
issuer: /\.[jt]sx?$/,
|
|
52
|
+
use: ['@svgr/webpack'],
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return config;
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
{{#pwa}}
|
|
60
|
+
// Configure PWA
|
|
61
|
+
const pwaConfig = withPWA({
|
|
62
|
+
dest: 'public',
|
|
63
|
+
register: true,
|
|
64
|
+
skipWaiting: true,
|
|
65
|
+
disable: process.env.NODE_ENV === 'development',
|
|
66
|
+
})(baseConfig);
|
|
67
|
+
{{/pwa}}
|
|
68
|
+
|
|
69
|
+
{{#i18n}}
|
|
70
|
+
// Initialize the Next-Intl plugin
|
|
71
|
+
const configWithPlugins = createNextIntlPlugin('./src/libs/I18n.ts')({{#pwa}}pwaConfig{{/pwa}}{{^pwa}}baseConfig{{/pwa}});
|
|
72
|
+
{{/i18n}}
|
|
73
|
+
{{^i18n}}
|
|
74
|
+
const configWithPlugins = {{#pwa}}pwaConfig{{/pwa}}{{^pwa}}baseConfig{{/pwa}};
|
|
75
|
+
{{/i18n}}
|
|
76
|
+
|
|
77
|
+
export default configWithPlugins;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { NextConfig } from 'next';
|
|
2
|
+
|
|
3
|
+
import createNextIntlPlugin from 'next-intl/plugin';
|
|
4
|
+
|
|
5
|
+
// Define the base Next.js configuration
|
|
6
|
+
const baseConfig: NextConfig = {
|
|
7
|
+
reactStrictMode: true,
|
|
8
|
+
poweredByHeader: false,
|
|
9
|
+
typescript: {
|
|
10
|
+
ignoreBuildErrors: false,
|
|
11
|
+
},
|
|
12
|
+
eslint: {
|
|
13
|
+
ignoreDuringBuilds: false,
|
|
14
|
+
},
|
|
15
|
+
images: {
|
|
16
|
+
// Optimized quality: 75 provides excellent visual quality at ~50% smaller file size
|
|
17
|
+
// Next.js automatically generates WebP/AVIF when browser supports it
|
|
18
|
+
qualities: [75, 85, 100],
|
|
19
|
+
formats: ['image/avif', 'image/webp'],
|
|
20
|
+
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
21
|
+
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384, 512, 1024],
|
|
22
|
+
// Cache images for 7 days (604800 seconds) for better performance
|
|
23
|
+
minimumCacheTTL: 604800,
|
|
24
|
+
remotePatterns: [
|
|
25
|
+
{
|
|
26
|
+
protocol: 'https',
|
|
27
|
+
hostname: 'berndorf-dashboard.adlas.cloud',
|
|
28
|
+
pathname: '/**',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
experimental: {
|
|
33
|
+
serverActions: {
|
|
34
|
+
bodySizeLimit: '10mb',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
output: 'standalone',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Initialize the Next-Intl plugin
|
|
41
|
+
const configWithPlugins = createNextIntlPlugin('./src/libs/I18n.ts')(baseConfig);
|
|
42
|
+
|
|
43
|
+
export default configWithPlugins;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "adlas-app",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev --turbopack",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"lint:fix": "eslint . --fix",
|
|
11
|
+
"format": "prettier --write .",
|
|
12
|
+
"format:check": "prettier --check .",
|
|
13
|
+
"knip": "knip",
|
|
14
|
+
"prepare": "lefthook install",
|
|
15
|
+
"commit": "commit",
|
|
16
|
+
"check:i18n": "lingual-check --patterns 'src/**/*.{ts,tsx}' --locales 'locales/*.json' --unused --missing"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@heroui/react": "^2.7.8",
|
|
20
|
+
"@internationalized/date": "^3.8.0",
|
|
21
|
+
"@tanstack/react-query": "^5.66.0",
|
|
22
|
+
"axios": "^1.7.9",
|
|
23
|
+
"clsx": "^2.1.1",
|
|
24
|
+
"framer-motion": "^12.4.7",
|
|
25
|
+
"next": "^15.3.0",
|
|
26
|
+
"next-intl": "^4.1.0",
|
|
27
|
+
"next-themes": "^0.4.4",
|
|
28
|
+
"react": "^19.1.0",
|
|
29
|
+
"react-dom": "^19.1.0",
|
|
30
|
+
"sonner": "^2.0.3",
|
|
31
|
+
"tailwind-variants": "^1.0.0",
|
|
32
|
+
"usehooks-ts": "^3.1.1",
|
|
33
|
+
"zod": "^3.24.2",
|
|
34
|
+
"zustand": "^5.0.3"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@antfu/eslint-config": "^4.11.0",
|
|
38
|
+
"@commitlint/cli": "^19.8.0",
|
|
39
|
+
"@commitlint/config-conventional": "^19.8.0",
|
|
40
|
+
"@commitlint/prompt-cli": "^19.8.0",
|
|
41
|
+
"@commitlint/types": "^19.8.0",
|
|
42
|
+
"@eslint-react/eslint-plugin": "^1.42.1",
|
|
43
|
+
"@lingual/i18n-check": "^1.0.3",
|
|
44
|
+
"@next/eslint-plugin-next": "^15.3.0",
|
|
45
|
+
"@react-types/shared": "^3.27.0",
|
|
46
|
+
"@svgr/babel-plugin-remove-jsx-attribute": "^8.0.0",
|
|
47
|
+
"@svgr/cli": "^8.1.0",
|
|
48
|
+
"@tailwindcss/postcss": "^4.1.0",
|
|
49
|
+
"@tanstack/react-query-devtools": "^5.66.0",
|
|
50
|
+
"@total-typescript/ts-reset": "^0.6.1",
|
|
51
|
+
"@types/node": "^22.13.4",
|
|
52
|
+
"@types/react": "^19.0.10",
|
|
53
|
+
"@types/react-dom": "^19.0.4",
|
|
54
|
+
"autoprefixer": "^10.4.21",
|
|
55
|
+
"conventional-changelog-conventionalcommits": "^9.0.0",
|
|
56
|
+
"dotenv-cli": "^8.0.0",
|
|
57
|
+
"eslint": "^9.21.0",
|
|
58
|
+
"eslint-plugin-format": "^1.0.1",
|
|
59
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
60
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
61
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
62
|
+
"eslint-plugin-tailwindcss": "^3.18.0",
|
|
63
|
+
"immer": "^10.1.1",
|
|
64
|
+
"knip": "^5.46.0",
|
|
65
|
+
"lefthook": "^1.11.6",
|
|
66
|
+
"postcss": "^8.5.3",
|
|
67
|
+
"postcss-load-config": "^6.0.1",
|
|
68
|
+
"prettier": "^3.5.2",
|
|
69
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
70
|
+
"rimraf": "^6.0.1",
|
|
71
|
+
"tailwindcss": "^4.1.0",
|
|
72
|
+
"typescript": "^5.8.2"
|
|
73
|
+
},
|
|
74
|
+
"packageManager": "pnpm@10.6.1"
|
|
75
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostCSS Configuration
|
|
3
|
+
* @type {import('postcss-load-config').Config}
|
|
4
|
+
*
|
|
5
|
+
* This file configures the PostCSS processor which transforms CSS with JavaScript plugins.
|
|
6
|
+
* It's used in the build process to process CSS files before they're served to the browser.
|
|
7
|
+
*/
|
|
8
|
+
const config = {
|
|
9
|
+
plugins: {
|
|
10
|
+
// Add Tailwind CSS support
|
|
11
|
+
'@tailwindcss/postcss': {},
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default config;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
icon: true,
|
|
3
|
+
exportAsDefault: true,
|
|
4
|
+
typescript: true,
|
|
5
|
+
native: false,
|
|
6
|
+
prettier: false,
|
|
7
|
+
jsxRuntime: 'automatic',
|
|
8
|
+
indexTemplate: filePaths => {
|
|
9
|
+
const exportEntries = filePaths.map(filePath => {
|
|
10
|
+
// Handle case where filePath might be an object instead of a string
|
|
11
|
+
const path = typeof filePath === 'string' ? filePath : filePath.path || '';
|
|
12
|
+
|
|
13
|
+
// Extract the basename (filename without extension)
|
|
14
|
+
const parts = path.toString().split('/');
|
|
15
|
+
const filename = parts[parts.length - 1] || '';
|
|
16
|
+
const basename = filename.split('.')[0] || '';
|
|
17
|
+
|
|
18
|
+
// Check if the file is already named with "Icon" suffix (case insensitive)
|
|
19
|
+
const hasIconSuffix = /icon$/i.test(basename);
|
|
20
|
+
|
|
21
|
+
// For files already named with Icon (e.g., HeartIcon.svg), get just the base name (e.g., Heart)
|
|
22
|
+
const baseName = hasIconSuffix ? basename.replace(/icon$/i, '') : basename;
|
|
23
|
+
|
|
24
|
+
// Create the proper component name with Icon suffix
|
|
25
|
+
const componentName = `${baseName}Icon`;
|
|
26
|
+
|
|
27
|
+
return `export { default as ${componentName} } from './${basename}';`;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return exportEntries.join('\n');
|
|
31
|
+
},
|
|
32
|
+
// Set stroke to foreground color for render hero ui render correctly
|
|
33
|
+
svgProps: {
|
|
34
|
+
fill: 'none',
|
|
35
|
+
stroke: 'foreground',
|
|
36
|
+
width: '1em',
|
|
37
|
+
height: '1em',
|
|
38
|
+
},
|
|
39
|
+
svgoConfig: {
|
|
40
|
+
plugins: [
|
|
41
|
+
{
|
|
42
|
+
name: 'preset-default',
|
|
43
|
+
params: {
|
|
44
|
+
overrides: {
|
|
45
|
+
// Disable merging of paths
|
|
46
|
+
mergePaths: false,
|
|
47
|
+
// Keep individual path elements
|
|
48
|
+
convertShapeToPath: false,
|
|
49
|
+
// Preserve stroke attributes
|
|
50
|
+
removeUnknownsAndDefaults: {
|
|
51
|
+
keepAriaAttrs: true,
|
|
52
|
+
keepDataAttrs: true,
|
|
53
|
+
unknownAttrs: false,
|
|
54
|
+
},
|
|
55
|
+
// Don't remove viewBox
|
|
56
|
+
removeViewBox: false,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
// Disable prefixIds plugin separately
|
|
61
|
+
{
|
|
62
|
+
name: 'prefixIds',
|
|
63
|
+
active: false,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
jsx: {
|
|
68
|
+
runtime: 'automatic',
|
|
69
|
+
babelConfig: {
|
|
70
|
+
plugins: [
|
|
71
|
+
[
|
|
72
|
+
'@svgr/babel-plugin-remove-jsx-attribute',
|
|
73
|
+
{
|
|
74
|
+
elements: [
|
|
75
|
+
'svg',
|
|
76
|
+
'path',
|
|
77
|
+
'circle',
|
|
78
|
+
'line',
|
|
79
|
+
'ellipse',
|
|
80
|
+
'polyline',
|
|
81
|
+
'polygon',
|
|
82
|
+
'g',
|
|
83
|
+
'defs',
|
|
84
|
+
'clipPath',
|
|
85
|
+
'rect',
|
|
86
|
+
],
|
|
87
|
+
attributes: ['fill', 'stroke', 'stroke-width', 'strokeWidth', 'xmlns', 'xmlnsXlink'],
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
filenameCase: 'pascal',
|
|
94
|
+
prefix: false,
|
|
95
|
+
template: (variables, { tpl }) => {
|
|
96
|
+
// Extract the filename from componentName (remove Svg prefix)
|
|
97
|
+
const nameWithoutPrefix = variables.componentName.replace(/^Svg/, '');
|
|
98
|
+
|
|
99
|
+
// Normalize the name using the result after removing SVG prefix
|
|
100
|
+
const filename = nameWithoutPrefix.split('/').pop();
|
|
101
|
+
const fileBaseName = filename ? filename.split('.')[0] : nameWithoutPrefix;
|
|
102
|
+
|
|
103
|
+
// Check if the file is already named with "Icon" suffix (case insensitive)
|
|
104
|
+
const hasIconSuffix = /icon$/i.test(fileBaseName);
|
|
105
|
+
|
|
106
|
+
// For files already named with Icon (e.g., HeartIcon.svg), get just the base name (e.g., Heart)
|
|
107
|
+
// Otherwise use the original name
|
|
108
|
+
const baseName = hasIconSuffix ? fileBaseName.replace(/icon$/i, '') : fileBaseName;
|
|
109
|
+
|
|
110
|
+
// Create the proper component name with Icon suffix
|
|
111
|
+
const newComponentName = `${baseName}Icon`;
|
|
112
|
+
|
|
113
|
+
// Update the component name
|
|
114
|
+
variables.componentName = newComponentName;
|
|
115
|
+
|
|
116
|
+
// Return the template with proper formatting
|
|
117
|
+
return tpl`
|
|
118
|
+
${variables.imports};
|
|
119
|
+
|
|
120
|
+
${variables.interfaces};
|
|
121
|
+
|
|
122
|
+
const ${variables.componentName} = (${variables.props}) => (
|
|
123
|
+
${variables.jsx}
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
export default ${variables.componentName};
|
|
127
|
+
`;
|
|
128
|
+
},
|
|
129
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* eslint-disable jsonc/sort-keys */
|
|
2
|
+
{
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
// ======================================================================
|
|
5
|
+
// Language & Environment
|
|
6
|
+
// Defines JavaScript version and runtime environment
|
|
7
|
+
// ======================================================================
|
|
8
|
+
"target": "ES2017",
|
|
9
|
+
"module": "esnext",
|
|
10
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
// ======================================================================
|
|
14
|
+
// Type Safety - Foundation
|
|
15
|
+
// Core type checking settings for a robust codebase
|
|
16
|
+
// ======================================================================
|
|
17
|
+
"strict": true,
|
|
18
|
+
"alwaysStrict": true,
|
|
19
|
+
"strictNullChecks": true,
|
|
20
|
+
"noImplicitAny": true,
|
|
21
|
+
"noImplicitThis": true,
|
|
22
|
+
// ======================================================================
|
|
23
|
+
// Type Safety - Advanced
|
|
24
|
+
// Additional checks for higher code quality
|
|
25
|
+
// ======================================================================
|
|
26
|
+
"noUncheckedIndexedAccess": true,
|
|
27
|
+
"noImplicitReturns": true,
|
|
28
|
+
"noUnusedLocals": true,
|
|
29
|
+
"noUnusedParameters": true,
|
|
30
|
+
"noFallthroughCasesInSwitch": true,
|
|
31
|
+
"allowUnreachableCode": false,
|
|
32
|
+
"useUnknownInCatchVariables": true,
|
|
33
|
+
"noImplicitOverride": true,
|
|
34
|
+
// ======================================================================
|
|
35
|
+
// Interoperability
|
|
36
|
+
// Settings for working with different file types and modules
|
|
37
|
+
// ======================================================================
|
|
38
|
+
"allowJs": true,
|
|
39
|
+
"checkJs": false,
|
|
40
|
+
"esModuleInterop": true,
|
|
41
|
+
"resolveJsonModule": true,
|
|
42
|
+
// ======================================================================
|
|
43
|
+
// Build & Performance
|
|
44
|
+
// Settings that affect compilation output and build performance
|
|
45
|
+
// ======================================================================
|
|
46
|
+
"skipLibCheck": true,
|
|
47
|
+
"removeComments": true,
|
|
48
|
+
"preserveConstEnums": true,
|
|
49
|
+
"forceConsistentCasingInFileNames": true,
|
|
50
|
+
// ======================================================================
|
|
51
|
+
// Project Structure
|
|
52
|
+
// Configure import paths and module resolution
|
|
53
|
+
// ======================================================================
|
|
54
|
+
"baseUrl": ".",
|
|
55
|
+
"paths": {
|
|
56
|
+
"@/*": ["./src/*"],
|
|
57
|
+
"@/public/*": ["./public/*"]
|
|
58
|
+
},
|
|
59
|
+
// ======================================================================
|
|
60
|
+
// Next.js Project Configuration
|
|
61
|
+
// Controls settings specific to Next.js framework
|
|
62
|
+
// ======================================================================
|
|
63
|
+
"jsx": "preserve", // Preserve JSX for Next.js transformation
|
|
64
|
+
"incremental": true, // Enable faster incremental builds
|
|
65
|
+
"noEmit": true, // Skip emitting files (Next.js handles this)
|
|
66
|
+
"plugins": [
|
|
67
|
+
{
|
|
68
|
+
"name": "next"
|
|
69
|
+
}
|
|
70
|
+
] // Enable Next.js TypeScript plugin
|
|
71
|
+
},
|
|
72
|
+
// Files to include/exclude from the project
|
|
73
|
+
"exclude": ["node_modules"],
|
|
74
|
+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "**/*.mts"]
|
|
75
|
+
}
|