next-ts-cli 1.0.3
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/LICENSE +21 -0
- package/README.md +194 -0
- package/dist/index.js +94 -0
- package/package.json +97 -0
- package/template/base/.cusror/mpc.json +8 -0
- package/template/base/.husky/commit-msg +1 -0
- package/template/base/.husky/pre-commit +1 -0
- package/template/base/LICENSE +21 -0
- package/template/base/README.md +0 -0
- package/template/base/app/apple-icon.png +0 -0
- package/template/base/app/favicon.ico +0 -0
- package/template/base/app/globals.css +9 -0
- package/template/base/app/layout.tsx +61 -0
- package/template/base/app/loading.tsx +7 -0
- package/template/base/app/manifest.ts +33 -0
- package/template/base/app/opengraph-image.png +0 -0
- package/template/base/app/page.tsx +7 -0
- package/template/base/app/robots.ts +28 -0
- package/template/base/app/sitemap.ts +17 -0
- package/template/base/app/twitter-image.png +0 -0
- package/template/base/biome.jsonc +272 -0
- package/template/base/commitlint.config.ts +25 -0
- package/template/base/hooks/use-hydration.tsx +16 -0
- package/template/base/jest.config.js +18 -0
- package/template/base/jest.setup.js +2 -0
- package/template/base/lib/fonts.ts +14 -0
- package/template/base/lib/indexing.ts +14 -0
- package/template/base/lib/microdata.ts +51 -0
- package/template/base/lib/utils.ts +6 -0
- package/template/base/next.config.ts +7 -0
- package/template/base/package-lock.json +9296 -0
- package/template/base/package.json +59 -0
- package/template/base/postcss.config.js +5 -0
- package/template/base/providers/MicrodataScript.tsx +18 -0
- package/template/base/public/.gitkeep +3 -0
- package/template/base/test/index.test.tsx +9 -0
- package/template/base/tsconfig.json +38 -0
- package/template/extras/better-auth/api/auth/[...all]/route.ts +7 -0
- package/template/extras/better-auth/base-auth.ts +12 -0
- package/template/extras/better-auth/with-drizzle-auth.ts +31 -0
- package/template/extras/clerk/layout.tsx +89 -0
- package/template/extras/clerk/proxy.ts +21 -0
- package/template/extras/docker/.dockerignore +60 -0
- package/template/extras/docker/Dockerfile +51 -0
- package/template/extras/docker/docker-compose.prod.yml +34 -0
- package/template/extras/drizzle/db/index.ts +9 -0
- package/template/extras/drizzle/db/schema.ts +7 -0
- package/template/extras/drizzle/drizzle.config.ts +15 -0
- package/template/extras/neon/index.ts +10 -0
- package/template/extras/shadcnui/components.json +21 -0
- package/template/extras/shadcnui/globals.css +71 -0
- package/template/extras/stripe/checkout_session/route.ts +60 -0
- package/template/extras/stripe/stripe.ts +17 -0
- package/template/extras/stripe/webhook/stripe/route.ts +89 -0
- package/template/extras/supabase/client.ts +8 -0
- package/template/extras/supabase/getAuth.ts +50 -0
- package/template/extras/supabase/proxy.ts +70 -0
- package/template/extras/supabase/server.ts +34 -0
- package/template/extras/supabase/storage.ts +90 -0
- package/template/extras/vercel-ai/route.ts +12 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { MetadataRoute } from "next";
|
|
2
|
+
|
|
3
|
+
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
|
4
|
+
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL;
|
|
5
|
+
const currentDate = new Date();
|
|
6
|
+
|
|
7
|
+
const staticRoutes: MetadataRoute.Sitemap = [
|
|
8
|
+
{
|
|
9
|
+
url: `${baseUrl}`,
|
|
10
|
+
lastModified: currentDate,
|
|
11
|
+
changeFrequency: "never" as const,
|
|
12
|
+
priority: 1,
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
return [...staticRoutes];
|
|
17
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true,
|
|
7
|
+
"defaultBranch": "main"
|
|
8
|
+
},
|
|
9
|
+
"files": {
|
|
10
|
+
"ignoreUnknown": false
|
|
11
|
+
},
|
|
12
|
+
"formatter": {
|
|
13
|
+
"enabled": true,
|
|
14
|
+
"indentStyle": "tab",
|
|
15
|
+
"indentWidth": 2,
|
|
16
|
+
"lineEnding": "lf",
|
|
17
|
+
"lineWidth": 100
|
|
18
|
+
},
|
|
19
|
+
"linter": {
|
|
20
|
+
"enabled": true,
|
|
21
|
+
"domains": {
|
|
22
|
+
"next": "recommended"
|
|
23
|
+
},
|
|
24
|
+
"rules": {
|
|
25
|
+
"recommended": true,
|
|
26
|
+
"a11y": {
|
|
27
|
+
"recommended": true,
|
|
28
|
+
"noAccessKey": "error",
|
|
29
|
+
"noAriaUnsupportedElements": "error",
|
|
30
|
+
"noAutofocus": "warn",
|
|
31
|
+
"noDistractingElements": "error",
|
|
32
|
+
"noHeaderScope": "error",
|
|
33
|
+
"noInteractiveElementToNoninteractiveRole": "error",
|
|
34
|
+
"noNoninteractiveElementToInteractiveRole": "error",
|
|
35
|
+
"noNoninteractiveTabindex": "error",
|
|
36
|
+
"noPositiveTabindex": "error",
|
|
37
|
+
"noRedundantAlt": "error",
|
|
38
|
+
"noRedundantRoles": "error",
|
|
39
|
+
"useFocusableInteractive": "error",
|
|
40
|
+
"useKeyWithClickEvents": "error",
|
|
41
|
+
"useKeyWithMouseEvents": "error",
|
|
42
|
+
"useValidAnchor": "error",
|
|
43
|
+
"useValidAriaProps": "error",
|
|
44
|
+
"useValidAriaValues": "error",
|
|
45
|
+
"useValidLang": "warn"
|
|
46
|
+
},
|
|
47
|
+
"complexity": {
|
|
48
|
+
"recommended": true,
|
|
49
|
+
"noBannedTypes": "error",
|
|
50
|
+
"noExtraBooleanCast": "error",
|
|
51
|
+
"noAdjacentSpacesInRegex": "error",
|
|
52
|
+
"noStaticOnlyClass": "error",
|
|
53
|
+
"noUselessCatch": "error",
|
|
54
|
+
"noUselessConstructor": "error",
|
|
55
|
+
"noUselessEmptyExport": "error",
|
|
56
|
+
"noUselessFragments": "error",
|
|
57
|
+
"noUselessLabel": "error",
|
|
58
|
+
"noUselessLoneBlockStatements": "error",
|
|
59
|
+
"noUselessRename": "error",
|
|
60
|
+
"noUselessSwitchCase": "error",
|
|
61
|
+
"noUselessTypeConstraint": "error",
|
|
62
|
+
"noExcessiveCognitiveComplexity": "warn",
|
|
63
|
+
"noExcessiveNestedTestSuites": "warn"
|
|
64
|
+
},
|
|
65
|
+
"correctness": {
|
|
66
|
+
"recommended": true,
|
|
67
|
+
"noConstAssign": "error",
|
|
68
|
+
"noConstantCondition": "error",
|
|
69
|
+
"noConstructorReturn": "error",
|
|
70
|
+
"noEmptyCharacterClassInRegex": "error",
|
|
71
|
+
"noEmptyPattern": "error",
|
|
72
|
+
"noGlobalObjectCalls": "error",
|
|
73
|
+
"noInnerDeclarations": "error",
|
|
74
|
+
"noInvalidConstructorSuper": "error",
|
|
75
|
+
"noInvalidBuiltinInstantiation": "error",
|
|
76
|
+
"noNonoctalDecimalEscape": "error",
|
|
77
|
+
"noPrecisionLoss": "error",
|
|
78
|
+
"noSelfAssign": "error",
|
|
79
|
+
"noSetterReturn": "error",
|
|
80
|
+
"noSwitchDeclarations": "error",
|
|
81
|
+
"noUndeclaredVariables": "error",
|
|
82
|
+
"noUnreachable": "error",
|
|
83
|
+
"noUnreachableSuper": "error",
|
|
84
|
+
"noUnsafeFinally": "error",
|
|
85
|
+
"noUnsafeOptionalChaining": "error",
|
|
86
|
+
"noUnusedLabels": "error",
|
|
87
|
+
"noUnusedPrivateClassMembers": "error",
|
|
88
|
+
"noUnusedVariables": "error",
|
|
89
|
+
"noUnusedImports": "error",
|
|
90
|
+
"noUnusedFunctionParameters": "warn",
|
|
91
|
+
"useExhaustiveDependencies": "warn",
|
|
92
|
+
"useHookAtTopLevel": "error",
|
|
93
|
+
"useIsNan": "error",
|
|
94
|
+
"useJsxKeyInIterable": "error",
|
|
95
|
+
"useValidForDirection": "error",
|
|
96
|
+
"useYield": "error",
|
|
97
|
+
"noNestedComponentDefinitions": "off"
|
|
98
|
+
},
|
|
99
|
+
"performance": {
|
|
100
|
+
"recommended": true,
|
|
101
|
+
"noAccumulatingSpread": "warn",
|
|
102
|
+
"noDelete": "error"
|
|
103
|
+
},
|
|
104
|
+
"security": {
|
|
105
|
+
"recommended": true,
|
|
106
|
+
"noDangerouslySetInnerHtmlWithChildren": "error",
|
|
107
|
+
"noBlankTarget": "error",
|
|
108
|
+
"noGlobalEval": "error"
|
|
109
|
+
},
|
|
110
|
+
"style": {
|
|
111
|
+
"noImplicitBoolean": "off",
|
|
112
|
+
"noInferrableTypes": "error",
|
|
113
|
+
"noNamespace": "error",
|
|
114
|
+
"noNegationElse": "off",
|
|
115
|
+
"noParameterAssign": "error",
|
|
116
|
+
"noRestrictedGlobals": "error",
|
|
117
|
+
"noShoutyConstants": "warn",
|
|
118
|
+
"noUnusedTemplateLiteral": "error",
|
|
119
|
+
"useAsConstAssertion": "error",
|
|
120
|
+
"useBlockStatements": "error",
|
|
121
|
+
"useCollapsedElseIf": "warn",
|
|
122
|
+
"useConst": "error",
|
|
123
|
+
"useDefaultParameterLast": "error",
|
|
124
|
+
"useExponentiationOperator": "error",
|
|
125
|
+
"useFragmentSyntax": "error",
|
|
126
|
+
"useImportType": "warn",
|
|
127
|
+
"useNamingConvention": {
|
|
128
|
+
"level": "warn",
|
|
129
|
+
"options": {
|
|
130
|
+
"strictCase": false,
|
|
131
|
+
"conventions": [
|
|
132
|
+
{
|
|
133
|
+
"selector": {
|
|
134
|
+
"kind": "variable"
|
|
135
|
+
},
|
|
136
|
+
"formats": ["camelCase"]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"selector": {
|
|
140
|
+
"kind": "typeLike"
|
|
141
|
+
},
|
|
142
|
+
"formats": ["PascalCase"]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"selector": {
|
|
146
|
+
"kind": "function"
|
|
147
|
+
},
|
|
148
|
+
"formats": ["camelCase", "PascalCase", "CONSTANT_CASE"]
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"selector": {
|
|
152
|
+
"kind": "objectLiteralMember"
|
|
153
|
+
},
|
|
154
|
+
"formats": ["camelCase", "snake_case", "PascalCase"]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"selector": {
|
|
158
|
+
"kind": "typeMember"
|
|
159
|
+
},
|
|
160
|
+
"formats": ["camelCase", "snake_case", "PascalCase"]
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"useConsistentArrayType": {
|
|
166
|
+
"level": "warn",
|
|
167
|
+
"options": {
|
|
168
|
+
"syntax": "shorthand"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"suspicious": {
|
|
173
|
+
"noConsole": "warn"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"javascript": {
|
|
178
|
+
"formatter": {
|
|
179
|
+
"quoteStyle": "double",
|
|
180
|
+
"jsxQuoteStyle": "double",
|
|
181
|
+
"quoteProperties": "asNeeded",
|
|
182
|
+
"trailingCommas": "es5",
|
|
183
|
+
"semicolons": "always",
|
|
184
|
+
"arrowParentheses": "always",
|
|
185
|
+
"bracketSpacing": true
|
|
186
|
+
},
|
|
187
|
+
"globals": ["React", "JSX"]
|
|
188
|
+
},
|
|
189
|
+
"json": {
|
|
190
|
+
"formatter": {
|
|
191
|
+
"enabled": true,
|
|
192
|
+
"indentStyle": "tab",
|
|
193
|
+
"indentWidth": 2,
|
|
194
|
+
"lineWidth": 100,
|
|
195
|
+
"trailingCommas": "none"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
"css": {
|
|
199
|
+
"formatter": {
|
|
200
|
+
"enabled": true,
|
|
201
|
+
"indentStyle": "tab",
|
|
202
|
+
"indentWidth": 2,
|
|
203
|
+
"lineWidth": 100,
|
|
204
|
+
"quoteStyle": "double"
|
|
205
|
+
},
|
|
206
|
+
"parser": {
|
|
207
|
+
"tailwindDirectives": true
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"overrides": [
|
|
211
|
+
{
|
|
212
|
+
"includes": [
|
|
213
|
+
"**/*.config.{js,ts,mjs,cjs}",
|
|
214
|
+
"**/next.config.{js,ts}",
|
|
215
|
+
"**/middleware.{ts,tsx,js}",
|
|
216
|
+
"**/route.{ts,tsx,js}",
|
|
217
|
+
"**/layout.{ts,tsx,js}",
|
|
218
|
+
"**/page.{ts,tsx,js}",
|
|
219
|
+
"**/loading.{ts,tsx,js}",
|
|
220
|
+
"**/error.{ts,tsx,js}",
|
|
221
|
+
"**/not-found.{ts,tsx,js}",
|
|
222
|
+
"**/template.{ts,tsx,js}",
|
|
223
|
+
"**/default.{ts,tsx,js}"
|
|
224
|
+
],
|
|
225
|
+
"linter": {
|
|
226
|
+
"rules": {
|
|
227
|
+
"style": {
|
|
228
|
+
"noDefaultExport": "off"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"includes": ["**/app/**/*.{ts,tsx,js}"],
|
|
235
|
+
"linter": {
|
|
236
|
+
"rules": {
|
|
237
|
+
"correctness": {
|
|
238
|
+
"useExhaustiveDependencies": "off"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"includes": [
|
|
245
|
+
"**/*.test.{ts,tsx,js}",
|
|
246
|
+
"**/*.spec.{ts,tsx,js}",
|
|
247
|
+
"**/__tests__/**",
|
|
248
|
+
"**/__mocks__/**"
|
|
249
|
+
],
|
|
250
|
+
"javascript": {
|
|
251
|
+
"globals": [
|
|
252
|
+
"describe",
|
|
253
|
+
"it",
|
|
254
|
+
"test",
|
|
255
|
+
"expect",
|
|
256
|
+
"beforeEach",
|
|
257
|
+
"afterEach",
|
|
258
|
+
"beforeAll",
|
|
259
|
+
"afterAll",
|
|
260
|
+
"jest"
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
"linter": {
|
|
264
|
+
"rules": {
|
|
265
|
+
"suspicious": {
|
|
266
|
+
"noConsole": "off"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { UserConfig } from "@commitlint/types";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
extends: ["@commitlint/config-conventional"],
|
|
5
|
+
rules: {
|
|
6
|
+
"type-enum": [
|
|
7
|
+
2,
|
|
8
|
+
"always",
|
|
9
|
+
[
|
|
10
|
+
"feat",
|
|
11
|
+
"fix",
|
|
12
|
+
"test",
|
|
13
|
+
"ref",
|
|
14
|
+
"refactor",
|
|
15
|
+
"revert",
|
|
16
|
+
"security",
|
|
17
|
+
"build",
|
|
18
|
+
"ci",
|
|
19
|
+
"docs",
|
|
20
|
+
"perf",
|
|
21
|
+
],
|
|
22
|
+
],
|
|
23
|
+
"header-max-length": () => [0, "always", 50],
|
|
24
|
+
},
|
|
25
|
+
} satisfies UserConfig;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* To check if our component is mounted, so we can use client-side functions
|
|
6
|
+
* @returns {boolean} isMounted
|
|
7
|
+
*/
|
|
8
|
+
export const useHydration = (): boolean => {
|
|
9
|
+
const [isMounted, setIsMounded] = useState(false);
|
|
10
|
+
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
setIsMounded(true);
|
|
13
|
+
}, []);
|
|
14
|
+
|
|
15
|
+
return isMounted;
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const nextJest = require("next/jest");
|
|
2
|
+
|
|
3
|
+
const createJestConfig = nextJest({
|
|
4
|
+
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
|
|
5
|
+
dir: "./",
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// Add any custom config to be passed to Jest
|
|
9
|
+
const customJestConfig = {
|
|
10
|
+
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
|
|
11
|
+
testEnvironment: "jest-environment-jsdom",
|
|
12
|
+
moduleNameMapper: {
|
|
13
|
+
"^@/(.*)$": "<rootDir>/$1",
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
|
|
18
|
+
module.exports = createJestConfig(customJestConfig);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Barrio, DM_Sans } from "next/font/google";
|
|
2
|
+
|
|
3
|
+
const barrio = Barrio({
|
|
4
|
+
weight: "400",
|
|
5
|
+
subsets: ["latin"],
|
|
6
|
+
variable: "--font-barrio",
|
|
7
|
+
});
|
|
8
|
+
const dmSans = DM_Sans({
|
|
9
|
+
weight: ["400", "500", "700"],
|
|
10
|
+
subsets: ["latin"],
|
|
11
|
+
variable: "--font-dm-sans",
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { barrio, dmSans };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
WithContext,
|
|
3
|
+
Thing,
|
|
4
|
+
Person,
|
|
5
|
+
Organization,
|
|
6
|
+
Product,
|
|
7
|
+
WebSite,
|
|
8
|
+
Article,
|
|
9
|
+
LocalBusiness,
|
|
10
|
+
Book,
|
|
11
|
+
Event,
|
|
12
|
+
CreativeWork,
|
|
13
|
+
AboutPage,
|
|
14
|
+
ContactPage,
|
|
15
|
+
ProfilePage,
|
|
16
|
+
CheckoutPage,
|
|
17
|
+
SearchResultsPage,
|
|
18
|
+
WebPage,
|
|
19
|
+
} from "schema-dts";
|
|
20
|
+
|
|
21
|
+
export type SchemaTypeMap = {
|
|
22
|
+
Person: Person;
|
|
23
|
+
Organization: Organization;
|
|
24
|
+
Product: Product;
|
|
25
|
+
WebSite: WebSite;
|
|
26
|
+
Article: Article;
|
|
27
|
+
LocalBusiness: LocalBusiness;
|
|
28
|
+
Book: Book;
|
|
29
|
+
Event: Event;
|
|
30
|
+
CreativeWork: CreativeWork;
|
|
31
|
+
AboutPage: AboutPage;
|
|
32
|
+
ContactPage: ContactPage;
|
|
33
|
+
ProfilePage: ProfilePage;
|
|
34
|
+
CheckoutPage: CheckoutPage;
|
|
35
|
+
SearchResultsPage: SearchResultsPage;
|
|
36
|
+
WebPage: WebPage;
|
|
37
|
+
Thing: Thing;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type SchemaType = keyof SchemaTypeMap;
|
|
41
|
+
|
|
42
|
+
export const microdata = <T extends SchemaType>(
|
|
43
|
+
type: T,
|
|
44
|
+
data: Omit<SchemaTypeMap[T], "@type" | "@context">
|
|
45
|
+
): WithContext<SchemaTypeMap[T]> => {
|
|
46
|
+
return {
|
|
47
|
+
"@context": "https://schema.org",
|
|
48
|
+
"@type": type,
|
|
49
|
+
...data,
|
|
50
|
+
} as unknown as WithContext<SchemaTypeMap[T]>;
|
|
51
|
+
};
|