tsi-org commited on
Commit
19e25f3
·
1 Parent(s): 3166c5c

Upload 89 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .eslintrc.js +84 -0
  2. .gitattributes +12 -0
  3. .gitignore +42 -0
  4. .npmrc +1 -0
  5. .prettierignore +38 -0
  6. .prettierrc.js +7 -0
  7. CHANGELOG.md +413 -0
  8. Dockerfile +0 -0
  9. commitlint.config.js +24 -0
  10. jest.config.js +29 -0
  11. jest.setup.js +5 -0
  12. next-env.d.ts +5 -0
  13. next-sitemap.config.js +13 -0
  14. next.config.js +37 -0
  15. output/2vu3w73bafxv3j2dpabiks75ma.mp4 +3 -0
  16. output/67vmmetb45zwfpagliukad62d4.mp4 +3 -0
  17. output/7uxth2lbmc2sffiawasrvwaqxy.mp4 +3 -0
  18. output/baecsv3b46swc7hxmhffqvaqeu.mp4 +0 -0
  19. output/eb5izbdbhi6b3rh36y2ldizkwm.mp4 +3 -0
  20. output/hs3uvcdb2brbeopvt72qsp7xqe.mp4 +0 -0
  21. output/i7wn3stbtlgkiitiyfnt46ydxe.mp4 +0 -0
  22. output/krxnyllb2ajzbaezgbtq7z7b7m.mp4 +3 -0
  23. output/l7fjlg3b4rt5tuxi6ahyxnogda.mp4 +3 -0
  24. output/ni6x7rdbh26kl6wazpzjjo3i6m.mp4 +0 -0
  25. output/ofscqflb7qeu6rt4n6tnvrxlui.mp4 +3 -0
  26. output/pbijtydbiooathoar3uthfw5di.mp4 +3 -0
  27. output/rge2iydbusmp3vuw4ksxodbsne.mp4 +3 -0
  28. output/sd2doj3bhnygjfauqgwghclgde.mp4 +3 -0
  29. output/soienm3bsot6j7y5cpwux35ghi.mp4 +0 -0
  30. output/synnpodbokv7bq7e7jqlfuhrke.mp4 +0 -0
  31. output/tlvrfotbvqiamajj6dnpxp6wo4.mp4 +3 -0
  32. output/xiyem2tbelkajqp6mocoss3o3m.mp4 +0 -0
  33. output/zcarbk3bdi6ci4dwgchyvvswry.mp4 +3 -0
  34. package-lock.json +0 -0
  35. package.json +68 -0
  36. postcss.config.js +6 -0
  37. public/favicon.ico +0 -0
  38. public/favicon/android-chrome-192x192.png +0 -0
  39. public/favicon/android-chrome-512x512.png +0 -0
  40. public/favicon/apple-touch-icon.png +0 -0
  41. public/favicon/browserconfig.xml +9 -0
  42. public/favicon/favicon-16x16.png +0 -0
  43. public/favicon/favicon-32x32.png +0 -0
  44. public/favicon/favicon.ico +0 -0
  45. public/favicon/large-og.jpg +0 -0
  46. public/favicon/mstile-150x150.png +0 -0
  47. public/favicon/safari-pinned-tab.svg +25 -0
  48. public/favicon/site.webmanifest +19 -0
  49. public/fonts/inter-var-latin.woff2 +0 -0
  50. public/images/large-og.png +0 -0
.eslintrc.js ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ es2021: true,
5
+ node: true,
6
+ },
7
+ plugins: ['@typescript-eslint', 'simple-import-sort', 'unused-imports'],
8
+ extends: [
9
+ 'eslint:recommended',
10
+ 'next',
11
+ 'next/core-web-vitals',
12
+ 'plugin:@typescript-eslint/recommended',
13
+ 'prettier',
14
+ ],
15
+ rules: {
16
+ 'no-unused-vars': 'off',
17
+ 'no-console': 'warn',
18
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
19
+ 'react/no-unescaped-entities': 'off',
20
+
21
+ 'react/display-name': 'off',
22
+ 'react/jsx-curly-brace-presence': [
23
+ 'warn',
24
+ { props: 'never', children: 'never' },
25
+ ],
26
+
27
+ //#region //*=========== Unused Import ===========
28
+ '@typescript-eslint/no-unused-vars': 'off',
29
+ 'unused-imports/no-unused-imports': 'warn',
30
+ 'unused-imports/no-unused-vars': [
31
+ 'warn',
32
+ {
33
+ vars: 'all',
34
+ varsIgnorePattern: '^_',
35
+ args: 'after-used',
36
+ argsIgnorePattern: '^_',
37
+ },
38
+ ],
39
+ //#endregion //*======== Unused Import ===========
40
+
41
+ //#region //*=========== Import Sort ===========
42
+ 'simple-import-sort/exports': 'warn',
43
+ 'simple-import-sort/imports': [
44
+ 'warn',
45
+ {
46
+ groups: [
47
+ // ext library & side effect imports
48
+ ['^@?\\w', '^\\u0000'],
49
+ // {s}css files
50
+ ['^.+\\.s?css$'],
51
+ // Lib and hooks
52
+ ['^@/lib', '^@/hooks'],
53
+ // static data
54
+ ['^@/data'],
55
+ // components
56
+ ['^@/components', '^@/container'],
57
+ // zustand store
58
+ ['^@/store'],
59
+ // Other imports
60
+ ['^@/'],
61
+ // relative paths up until 3 level
62
+ [
63
+ '^\\./?$',
64
+ '^\\.(?!/?$)',
65
+ '^\\.\\./?$',
66
+ '^\\.\\.(?!/?$)',
67
+ '^\\.\\./\\.\\./?$',
68
+ '^\\.\\./\\.\\.(?!/?$)',
69
+ '^\\.\\./\\.\\./\\.\\./?$',
70
+ '^\\.\\./\\.\\./\\.\\.(?!/?$)',
71
+ ],
72
+ ['^@/types'],
73
+ // other that didnt fit in
74
+ ['^'],
75
+ ],
76
+ },
77
+ ],
78
+ //#endregion //*======== Import Sort ===========
79
+ },
80
+ globals: {
81
+ React: true,
82
+ JSX: true,
83
+ },
84
+ };
.gitattributes CHANGED
@@ -33,3 +33,15 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ output/2vu3w73bafxv3j2dpabiks75ma.mp4 filter=lfs diff=lfs merge=lfs -text
37
+ output/67vmmetb45zwfpagliukad62d4.mp4 filter=lfs diff=lfs merge=lfs -text
38
+ output/7uxth2lbmc2sffiawasrvwaqxy.mp4 filter=lfs diff=lfs merge=lfs -text
39
+ output/eb5izbdbhi6b3rh36y2ldizkwm.mp4 filter=lfs diff=lfs merge=lfs -text
40
+ output/krxnyllb2ajzbaezgbtq7z7b7m.mp4 filter=lfs diff=lfs merge=lfs -text
41
+ output/l7fjlg3b4rt5tuxi6ahyxnogda.mp4 filter=lfs diff=lfs merge=lfs -text
42
+ output/ofscqflb7qeu6rt4n6tnvrxlui.mp4 filter=lfs diff=lfs merge=lfs -text
43
+ output/pbijtydbiooathoar3uthfw5di.mp4 filter=lfs diff=lfs merge=lfs -text
44
+ output/rge2iydbusmp3vuw4ksxodbsne.mp4 filter=lfs diff=lfs merge=lfs -text
45
+ output/sd2doj3bhnygjfauqgwghclgde.mp4 filter=lfs diff=lfs merge=lfs -text
46
+ output/tlvrfotbvqiamajj6dnpxp6wo4.mp4 filter=lfs diff=lfs merge=lfs -text
47
+ output/zcarbk3bdi6ci4dwgchyvvswry.mp4 filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ /node_modules
5
+ /.pnp
6
+ .pnp.js
7
+
8
+ # testing
9
+ /coverage
10
+
11
+ # next.js
12
+ /.next/
13
+ /out/
14
+
15
+ # production
16
+ /build
17
+
18
+ # misc
19
+ .DS_Store
20
+ *.pem
21
+
22
+ # debug
23
+ npm-debug.log*
24
+ yarn-debug.log*
25
+ yarn-error.log*
26
+ .pnpm-debug.log*
27
+
28
+ # local env files
29
+ .env
30
+ .env*.local
31
+
32
+ # vercel
33
+ .vercel
34
+
35
+ # typescript
36
+ *.tsbuildinfo
37
+ next-env.d.ts
38
+
39
+ # next-sitemap
40
+ robots.txt
41
+ sitemap.xml
42
+ sitemap-*.xml
.npmrc ADDED
@@ -0,0 +1 @@
 
 
1
+ v18.14.0
.prettierignore ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ /node_modules
5
+ /.pnp
6
+ .pnp.js
7
+
8
+ # testing
9
+ /coverage
10
+
11
+ # next.js
12
+ .next
13
+ /.next/
14
+ /out/
15
+
16
+ # production
17
+ /build
18
+
19
+ # misc
20
+ .DS_Store
21
+ *.pem
22
+
23
+ # debug
24
+ npm-debug.log*
25
+ yarn-debug.log*
26
+ yarn-error.log*
27
+
28
+ # local env files
29
+ .env.local
30
+ .env.development.local
31
+ .env.test.local
32
+ .env.production.local
33
+
34
+ # vercel
35
+ .vercel
36
+
37
+ # changelog
38
+ CHANGELOG.md
.prettierrc.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ module.exports = {
2
+ arrowParens: 'always',
3
+ singleQuote: true,
4
+ jsxSingleQuote: true,
5
+ tabWidth: 2,
6
+ semi: true,
7
+ };
CHANGELOG.md ADDED
@@ -0,0 +1,413 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- //!STARTERCONF Remove this file, this is used as the starter changelog -->
2
+
3
+ # ts-nextjs-tailwind-starter changelog
4
+
5
+ This changelog is manually generated and not accurate with the package.json, only to show the changes since the last release.
6
+
7
+ ## 0.5.4 - 2022-07-22
8
+
9
+ ### New Features
10
+
11
+ - #### Release Please
12
+
13
+ Standard Version is now deprecated, and ts-nextjs-tailwind-starter is now using release please. Activate them on `.github/workflows/release-please`
14
+
15
+ ### Improvements & Bug Fixes
16
+
17
+ - #### More Efficient Lint Actions
18
+
19
+ Lint workflow is now cached and will cancel previous run if there are 2 concurrent runs.
20
+
21
+ ## 0.5.3 - 2022-02-27
22
+
23
+ ### New Features
24
+
25
+ - #### Shimmer for NextImage and Skeleton
26
+
27
+ Addition of shimmer & blur placeholder for NextImage, and new Skeleton Component with shimmer effect.
28
+
29
+ https://user-images.githubusercontent.com/55318172/155867729-8c3176ad-ede4-4443-b42b-780517615e5a.mp4
30
+
31
+
32
+ - #### Support for SVGR
33
+
34
+ You can directly import SVG like
35
+
36
+ ```tsx
37
+ import Vercel from '~/svg/Vercel.svg';
38
+
39
+ <Vercel className='text-5xl' />
40
+ ```
41
+
42
+ - #### Public Folder Path Mapping
43
+
44
+ Easily access public folder with `~/` prefix.
45
+
46
+ - #### Tailwind CSS Prettier Sorter
47
+
48
+ ts-nextjs-tailwind-starter now use first-party plugin `prettier-plugin-tailwindcss`
49
+
50
+ ### Improvements & Bug Fixes
51
+
52
+ - #### Layout Declared Twice
53
+
54
+ Fix issue where adding elements to Layout ends up rendering them twice
55
+
56
+ - #### ESLint Curly Brace Rule
57
+
58
+ New autofixable rule
59
+
60
+ ```tsx
61
+ props={'hi'}
62
+
63
+ will become
64
+
65
+ props='hi'
66
+ ```
67
+
68
+ ## 0.5.2 - 2021-12-30
69
+
70
+ ### New Features
71
+
72
+ - #### New Component: PrimaryLink
73
+
74
+ Add a link component with accent color on top of UnstyledLink.
75
+
76
+ ### Improvements & Bug Fixes
77
+
78
+ - #### Unused Import ESlint Autofix
79
+
80
+ Unused import will automatically be removed by the ESlint autofix.
81
+
82
+ - #### Renamed CustomLink to UnderlineLink
83
+
84
+ This is to compensate the new PrimaryLink component
85
+
86
+ - #### Primary Button & ButtonLink Shade
87
+
88
+ The shade of the button is now using the `500` instead of `400`.
89
+
90
+
91
+ ## 0.5.1 - 2021-12-26
92
+
93
+ ### New Features
94
+
95
+ - #### New Snippets Wrap: clsx and fragment `<></>`
96
+
97
+ You can select text then wrap it with clsx or React.Fragment shorthand.
98
+
99
+ https://user-images.githubusercontent.com/55318172/147401848-3db5dba0-ef71-4f25-9f47-c7908beba69e.mp4
100
+
101
+
102
+ ## 0.5.0 - 2021-12-21
103
+
104
+ ### New Features
105
+
106
+ - #### Expansion Pack
107
+ You can easily add expansion such as React Hook Form + Components, Storybook, and more just using a single command line.
108
+
109
+ https://user-images.githubusercontent.com/55318172/146631994-e1cac137-1664-4cfe-950b-a96decc1eaa6.mp4
110
+
111
+ Check out the [expansion pack repository](https://github.com/theodorusclarence/expansion-pack) for the commands
112
+
113
+ ### Improvements & Bug Fixes
114
+
115
+ - #### Can't Use Layout Fill on NextImage
116
+
117
+ Using layout fill will make the width and height optional
118
+
119
+ - #### Vertically center Button & ButtonLink
120
+
121
+ Adds `items-center` to make the button vertically centered
122
+
123
+
124
+ ## 0.4.1 - 2021-12-12
125
+
126
+ ### New Features
127
+
128
+ - #### Tailwind CSS v3
129
+
130
+ The color palette configuration is also updated accordingly.
131
+
132
+ ## 0.4.0 - 2021-12-02
133
+
134
+ ### New Features
135
+
136
+ - #### Button & ButtonLink Variants
137
+
138
+ - New Variant: **Outline** and **Ghost**, you can also add `isDarkBg` prop if you are using these variants with dark background.
139
+ - Animated Underline style on **Primary**, **Dark**, **Light** is removed
140
+ - Added `ring-primary-500` on `focus-visible`
141
+
142
+ ![Button Variants](https://user-images.githubusercontent.com/55318172/144385213-632b3e1f-9a0e-4184-82e0-7905ee3318b4.gif)
143
+
144
+ - #### ArrowLink
145
+
146
+
147
+ Adds an animated arrow, this component is Polymorphic, the default element is `CustomLink`, you can extend it with `as` prop.
148
+
149
+ ```tsx
150
+ <ArrowLink
151
+ as={ButtonLink}
152
+ variant='light'
153
+ href='/'
154
+ >
155
+ Register now
156
+ </ArrowLink>
157
+ ```
158
+
159
+ ![Arrow Link Feature](https://user-images.githubusercontent.com/55318172/144385991-f3521d52-e0a8-49c5-8e87-409231fdd5b6.gif)
160
+
161
+ - #### Change default theme to white
162
+
163
+ | ![Home Page](https://user-images.githubusercontent.com/55318172/144386763-00e6c3fd-ee2e-4c9e-87f8-18b036bdc2e1.png) | ![404](https://user-images.githubusercontent.com/55318172/144386764-0e4b4fb0-35a8-4725-a795-f998b06543a1.png) |
164
+ | - | - |
165
+
166
+ ### Improvements & Bug Fixes
167
+
168
+ - #### Split Next.js Link Props Type
169
+
170
+ Now, to add props to Next.js `<Link>` component, you can use `nextLinkProps`.
171
+
172
+ ```tsx
173
+ <UnstyledLink
174
+ href='/'
175
+ nextLinkProps={{
176
+ shallow: true,
177
+ }}
178
+ >
179
+ Link
180
+ </UnstyledLink>
181
+ ```
182
+
183
+ The rest of `<a>` props can be directly added as a prop.
184
+
185
+ - #### Add Motion Safe to Animations
186
+
187
+ All components animation respect user preference about motion.
188
+
189
+ ## 0.3.0 - 2021-12-01
190
+
191
+ ### New Features
192
+
193
+ - #### Create Branch & Auto Resolve Issue Actions
194
+
195
+ | ![Create Branch Actions](https://user-images.githubusercontent.com/55318172/144379834-8c3e4d4f-d584-4253-9ad8-b9f1d468ed01.gif) <br> Auto Create Branch | ![Auto Resolve](https://user-images.githubusercontent.com/55318172/144382044-0132e755-9cd5-4805-a756-4086f67b3282.gif) <br> Auto Resolve |
196
+ | :--: | :--: |
197
+
198
+ You have to install the app for your organization/account/repository from the [GitHub Marketplace](https://github.com/marketplace/create-issue-branch) for this to work.
199
+
200
+ The branch will be created on **assign** with format `i${number}-${issue_title_lowercase}`.
201
+
202
+ - #### Custom Tailwind CSS Class Sorter
203
+
204
+ Classes are sorted using [prettier-plugin-sort-class-names](https://github.com/PutziSan/prettier-plugin-sort-class-names) with custom class order on [this file](https://github.com/theodorusclarence/ts-nextjs-tailwind-starter/blob/main/prettier-plugin-sort-class-names-order) and custom variant order on [prettierrc](https://github.com/theodorusclarence/ts-nextjs-tailwind-starter/blob/main/.prettierrc.js)
205
+
206
+ With this plugin, we can now safely check the order of the classes using the preconfigured lint action.
207
+
208
+ ## 0.2.0 - 2021-11-10
209
+
210
+ ### New Features
211
+
212
+ - #### Jest
213
+
214
+ Jest is configured and will be run every push on Github Actions
215
+
216
+ - #### Lint Github Action
217
+
218
+ 1. **ESLint** - will fail if there are any warning and error.
219
+ 2. **Type Check** - will fail on `tsc` error.
220
+ 3. **Prettier Check** - will fail if there are any formatting error.
221
+ 4. **Test** - will fail if there are any test failure.
222
+
223
+ ## 0.1.0
224
+
225
+ ### New Features
226
+
227
+ - #### Installed Packages
228
+
229
+ 1. [clsx](https://bundlephobia.com/package/clsx@latest), utility for constructing `className` strings conditionally.
230
+ 2. [react-icons](https://bundlephobia.com/package/react-icons@latest), svg react icons of popular icon packs.
231
+
232
+ - #### UnstyledLink Component
233
+
234
+ Used as a component for Next.js Link. Will render out Next/Link if the href started with `/` or `#`, else will render an `a` tag with `target='_blank'`. Also add a cursor style for outside links
235
+
236
+ - #### CustomLink Component
237
+
238
+ ![customlink](https://user-images.githubusercontent.com/55318172/129183546-4e8c2059-0493-4459-a1e9-755fbd32fe39.gif)
239
+
240
+
241
+ - #### Absolute Import
242
+
243
+ You can import without using relative path
244
+
245
+ ```tsx
246
+ import Nav from '../../../components/Nav';
247
+
248
+ simplified to
249
+
250
+ import Nav from '@/components/Nav';
251
+ ```
252
+
253
+ - #### Seo Component
254
+
255
+ Configure the default in `src/components/Seo.tsx`. If you want to use the default, just add `<Seo />` on top of your page.
256
+
257
+ You can also customize it per page by overriding the title, description as props
258
+
259
+ ```tsx
260
+ <Seo title='Next.js Tailwind Starter' description='your description' />
261
+ ```
262
+
263
+ or if you want to still keep the title like `%s | Next.js Tailwind Starter`, you can use `templateTitle` props.
264
+
265
+ - #### Custom 404 Page
266
+
267
+ ![404](https://user-images.githubusercontent.com/55318172/129184274-d90631f2-6688-4ed2-bef2-a4d018a4863c.gif)
268
+
269
+ - #### Workspace Snippets
270
+
271
+ Snippets such as React import, useState, useEffect, React Component. [View more](/.vscode/typescriptreact.code-snippets)
272
+
273
+ - #### Husky, Prettier, Lint, and Commitlint Configured
274
+
275
+ 3 Husky hooks including:
276
+
277
+ 1. pre-commit, running `next lint` and format the code using prettier
278
+ 2. commit-msg, running commitlint to ensure the use of [Conventional Commit](https://theodorusclarence.com/library/conventional-commit-readme) for commit messages
279
+ 3. post-merge, running `yarn` every `git pull` or after merge to ensure all new packages are installed and ready to go
280
+
281
+ - #### Default Favicon Declaration
282
+
283
+ Use [Favicon Generator](https://www.favicon-generator.org/) and then overwrite the files in `/public/favicon`
284
+
285
+ - #### Default Tailwind CSS Base Styles
286
+
287
+ There are default styles for responsive heading sizes, and `.layout` to support a max-width for larger screen size. Find more about it on [my blog post](https://theodorusclarence.com/blog/tailwindcss-best-practice#1-using-layout-class-or-container)
288
+
289
+ - #### Open Graph Generator
290
+
291
+ | ![image](https://user-images.githubusercontent.com/55318172/137617070-806a0509-84bd-4cae-a900-2ab17e418d8d.png) | ![image](https://user-images.githubusercontent.com/55318172/137617090-c24f684a-bfe5-41b6-8ba9-fa99bae5cadf.png) |
292
+ | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
293
+
294
+ Open Graph is generated using [og.thcl.dev](https://og.thcl.dev), but please fork and self-host if your website is going to have a lot of traffic.
295
+
296
+ Check out the [repository](https://github.com/theodorusclarence/og) to see the API parameters.
297
+
298
+ - #### Preloaded & Self Hosted Inter Fonts
299
+
300
+ Inter fonts is a variable fonts that is self hosted and preloaded.
301
+
302
+ ## Snippets
303
+
304
+ This starter is equipped with workspace-snippets, it is encouraged to use it, especially the `np` and `rc`
305
+
306
+ ### Next.js Page
307
+
308
+ File inside `src/pages` will be the webpage route, there are 2 things that need to be added in Next.js page:
309
+
310
+ 1. Seo component
311
+ 2. Layout class to give constraint to viewport width. [Read more about layout class](https://theodorusclarence.com/blog/tailwindcss-best-practice#1-using-layout-class-or-container).
312
+
313
+ Snippets: `np`
314
+
315
+ ```tsx
316
+ import * as React from 'react';
317
+ import Seo from '@/components/Seo';
318
+ export default function TestPage() {
319
+ return (
320
+ <>
321
+ <Seo templateTitle='Test' />
322
+ <main>
323
+ <section className=''>
324
+ <div className='layout'></div>
325
+ </section>
326
+ </main>
327
+ </>
328
+ );
329
+ }
330
+ ```
331
+
332
+ ### React Components
333
+
334
+ To make a new component, It is encouraged to use `export default function`. Because when we need to rename it, we only need to do it once.
335
+
336
+ Snippets: `rc`
337
+
338
+ ```tsx
339
+ import * as React from 'react';
340
+ export default function Component() {
341
+ return <div></div>;
342
+ }
343
+ ```
344
+
345
+ #### Import React
346
+
347
+ Snippets: `ir`
348
+
349
+ ```tsx
350
+ import * as React from 'react';
351
+ ```
352
+
353
+ #### Import Next Image
354
+
355
+ Snippets: `imimg`
356
+
357
+ ```tsx
358
+ import Image from 'next/image';
359
+ ```
360
+
361
+ #### Import Next Link
362
+
363
+ Snippets: `iml`
364
+
365
+ ```tsx
366
+ import Link from 'next/link';
367
+ ```
368
+
369
+ #### useState Hook
370
+
371
+ Snippets: `us`
372
+
373
+ ```tsx
374
+ const [state, setState] = React.useState(initialState);
375
+ ```
376
+
377
+ #### useEffect Hook
378
+
379
+ Snippets: `uf`
380
+
381
+ ```tsx
382
+ React.useEffect(() => {}, []);
383
+ ```
384
+
385
+ #### useReducer Hook
386
+
387
+ Snippets: `ur`
388
+
389
+ ```tsx
390
+ const [state, dispatch] = React.useReducer(someReducer, {});
391
+ ```
392
+
393
+ #### useRef Hook
394
+
395
+ Snippets: `urf`
396
+
397
+ ```tsx
398
+ const someRef = React.useRef();
399
+ ```
400
+
401
+ #### Region Comment
402
+
403
+ It is really useful when we need to group code. It is also collapsible in VSCode
404
+
405
+ Snippets: `reg`
406
+
407
+ ```tsx
408
+ //#region //*============== FORM SUBMIT
409
+ //#endregion //*============== FORM SUBMIT
410
+ ```
411
+
412
+ You should also use [Better Comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments) extension.
413
+
Dockerfile ADDED
File without changes
commitlint.config.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ module.exports = {
2
+ extends: ['@commitlint/config-conventional'],
3
+ rules: {
4
+ // TODO Add Scope Enum Here
5
+ // 'scope-enum': [2, 'always', ['yourscope', 'yourscope']],
6
+ 'type-enum': [
7
+ 2,
8
+ 'always',
9
+ [
10
+ 'feat',
11
+ 'fix',
12
+ 'docs',
13
+ 'chore',
14
+ 'style',
15
+ 'refactor',
16
+ 'ci',
17
+ 'test',
18
+ 'perf',
19
+ 'revert',
20
+ 'vercel',
21
+ ],
22
+ ],
23
+ },
24
+ };
jest.config.js ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
2
+ const nextJest = require('next/jest');
3
+
4
+ const createJestConfig = nextJest({
5
+ // Provide the path to your Next.js app to load next.config.js and .env files in your test environment
6
+ dir: './',
7
+ });
8
+
9
+ // Add any custom config to be passed to Jest
10
+ const customJestConfig = {
11
+ // Add more setup options before each test is run
12
+ setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
13
+
14
+ // if using TypeScript with a baseUrl set to the root directory then you need the below for alias' to work
15
+ moduleDirectories: ['node_modules', '<rootDir>/'],
16
+
17
+ testEnvironment: 'jest-environment-jsdom',
18
+
19
+ /**
20
+ * Absolute imports and Module Path Aliases
21
+ */
22
+ moduleNameMapper: {
23
+ '^@/(.*)$': '<rootDir>/src/$1',
24
+ '^~/(.*)$': '<rootDir>/public/$1',
25
+ },
26
+ };
27
+
28
+ // createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
29
+ module.exports = createJestConfig(customJestConfig);
jest.setup.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ import '@testing-library/jest-dom/extend-expect';
2
+
3
+ // Allow router mocks.
4
+ // eslint-disable-next-line no-undef
5
+ jest.mock('next/router', () => require('next-router-mock'));
next-env.d.ts ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ /// <reference types="next" />
2
+ /// <reference types="next/image-types/global" />
3
+
4
+ // NOTE: This file should not be edited
5
+ // see https://nextjs.org/docs/basic-features/typescript for more information.
next-sitemap.config.js ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * @type {import('next-sitemap').IConfig}
3
+ * @see https://github.com/iamvishnusankar/next-sitemap#readme
4
+ */
5
+ module.exports = {
6
+ // !STARTERCONF Change the siteUrl
7
+ /** Without additional '/' on the end, e.g. https://theodorusclarence.com */
8
+ siteUrl: 'https://tsnext-tw.thcl.dev',
9
+ generateRobotsTxt: true,
10
+ robotsTxtOptions: {
11
+ policies: [{ userAgent: '*', allow: '/' }],
12
+ },
13
+ };
next.config.js ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {
3
+ eslint: {
4
+ dirs: ['src'],
5
+ },
6
+
7
+ reactStrictMode: true,
8
+ swcMinify: true,
9
+
10
+ // Uncoment to add domain whitelist
11
+ // images: {
12
+ // domains: [
13
+ // 'res.cloudinary.com',
14
+ // ],
15
+ // },
16
+
17
+ // SVGR
18
+ webpack(config) {
19
+ config.module.rules.push({
20
+ test: /\.svg$/i,
21
+ issuer: /\.[jt]sx?$/,
22
+ use: [
23
+ {
24
+ loader: '@svgr/webpack',
25
+ options: {
26
+ typescript: true,
27
+ icon: true,
28
+ },
29
+ },
30
+ ],
31
+ });
32
+
33
+ return config;
34
+ },
35
+ };
36
+
37
+ module.exports = nextConfig;
output/2vu3w73bafxv3j2dpabiks75ma.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6551dd67bfafc5e898d24e39c496fb4b0403987b20aa80999522bcace7ee8be8
3
+ size 2112542
output/67vmmetb45zwfpagliukad62d4.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:48a52a3c466ac7a6c3b1717e56d62d9f9b66f9197401e78c171b2e15c1466381
3
+ size 1344304
output/7uxth2lbmc2sffiawasrvwaqxy.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9f7ec068295de6bb9ff7a203a140169f929e613cc2e3c2467546c5f0833de746
3
+ size 2280058
output/baecsv3b46swc7hxmhffqvaqeu.mp4 ADDED
Binary file (513 kB). View file
 
output/eb5izbdbhi6b3rh36y2ldizkwm.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a42ec0ad313b5ab50c7016de66ba6c8365a99ac7dda846f68d5f530dbbac9597
3
+ size 1703796
output/hs3uvcdb2brbeopvt72qsp7xqe.mp4 ADDED
Binary file (685 kB). View file
 
output/i7wn3stbtlgkiitiyfnt46ydxe.mp4 ADDED
Binary file (750 kB). View file
 
output/krxnyllb2ajzbaezgbtq7z7b7m.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e98fa7b6d69bfab9dc83b21ccdd93dc7fd251b2660076817e9499fe2aaab775b
3
+ size 2662759
output/l7fjlg3b4rt5tuxi6ahyxnogda.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a8f5441f7ac18e997dbba3e1fd34be727de5abe36377830fa4b360029c008cd
3
+ size 1659829
output/ni6x7rdbh26kl6wazpzjjo3i6m.mp4 ADDED
Binary file (577 kB). View file
 
output/ofscqflb7qeu6rt4n6tnvrxlui.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:62abde2ec645c8e1955ab025139a5cba78336ab241eb60e29a91fb88cf2b7904
3
+ size 1708857
output/pbijtydbiooathoar3uthfw5di.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1448b961451f1b2ba1e7a1e9f5fda49485d474f14a3f908e7774797890cdfe2f
3
+ size 1682765
output/rge2iydbusmp3vuw4ksxodbsne.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7888df1a384bccf136622d54d9ede87cbd9fb9de3bc385cbdef680a05bf821f4
3
+ size 1702028
output/sd2doj3bhnygjfauqgwghclgde.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1483b73bc30fead631f75f3940cf3bcf4666686a2fa36204ec58804280bb346c
3
+ size 1253364
output/soienm3bsot6j7y5cpwux35ghi.mp4 ADDED
Binary file (735 kB). View file
 
output/synnpodbokv7bq7e7jqlfuhrke.mp4 ADDED
Binary file (728 kB). View file
 
output/tlvrfotbvqiamajj6dnpxp6wo4.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dffd2d080c552ef7d33d3fd03655829054e272630723e605b5a09693f74971c6
3
+ size 1950174
output/xiyem2tbelkajqp6mocoss3o3m.mp4 ADDED
Binary file (688 kB). View file
 
output/zcarbk3bdi6ci4dwgchyvvswry.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:702e2cad6392e54dae60794430ad21cf82dae635c1706aed5188842821161bcb
3
+ size 3668962
package-lock.json ADDED
The diff for this file is too large to render. See raw diff
 
package.json ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "ts-nextjs-tailwind-starter",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev",
7
+ "build": "next build",
8
+ "start": "next start",
9
+ "lint": "next lint",
10
+ "lint:fix": "eslint src --fix && yarn format",
11
+ "lint:strict": "eslint --max-warnings=0 src",
12
+ "typecheck": "tsc --noEmit --incremental false",
13
+ "test:watch": "jest --watch",
14
+ "test": "jest",
15
+ "format": "prettier -w .",
16
+ "format:check": "prettier -c .",
17
+ "postbuild": "next-sitemap --config next-sitemap.config.js",
18
+ "prepare": "husky install"
19
+ },
20
+ "dependencies": {
21
+ "axios": "^1.5.1",
22
+ "clsx": "^1.2.1",
23
+ "formidable": "^3.5.1",
24
+ "lucide-react": "^0.260.0",
25
+ "next": "^13.4.10",
26
+ "react": "^18.2.0",
27
+ "react-dom": "^18.2.0",
28
+ "react-icons": "^4.10.1",
29
+ "replicate": "^0.20.1",
30
+ "tailwind-merge": "^1.13.2"
31
+ },
32
+ "devDependencies": {
33
+ "@commitlint/cli": "^16.3.0",
34
+ "@commitlint/config-conventional": "^16.2.4",
35
+ "@svgr/webpack": "^6.5.1",
36
+ "@tailwindcss/forms": "^0.5.4",
37
+ "@testing-library/jest-dom": "^5.16.5",
38
+ "@testing-library/react": "^13.4.0",
39
+ "@types/react": "^18.2.15",
40
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
41
+ "@typescript-eslint/parser": "^5.62.0",
42
+ "autoprefixer": "^10.4.14",
43
+ "eslint": "^8.45.0",
44
+ "eslint-config-next": "^13.4.10",
45
+ "eslint-config-prettier": "^8.8.0",
46
+ "eslint-plugin-simple-import-sort": "^7.0.0",
47
+ "eslint-plugin-unused-imports": "^2.0.0",
48
+ "husky": "^7.0.4",
49
+ "jest": "^27.5.1",
50
+ "lint-staged": "^12.5.0",
51
+ "next-router-mock": "^0.7.5",
52
+ "next-sitemap": "^2.5.28",
53
+ "postcss": "^8.4.26",
54
+ "prettier": "^2.8.8",
55
+ "prettier-plugin-tailwindcss": "^0.1.13",
56
+ "tailwindcss": "^3.3.3",
57
+ "typescript": "^4.9.5"
58
+ },
59
+ "lint-staged": {
60
+ "**/*.{js,jsx,ts,tsx}": [
61
+ "eslint --max-warnings=0",
62
+ "prettier -w"
63
+ ],
64
+ "**/*.{json,css,scss,md,webmanifest}": [
65
+ "prettier -w"
66
+ ]
67
+ }
68
+ }
postcss.config.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ module.exports = {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ };
public/favicon.ico ADDED
public/favicon/android-chrome-192x192.png ADDED
public/favicon/android-chrome-512x512.png ADDED
public/favicon/apple-touch-icon.png ADDED
public/favicon/browserconfig.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <browserconfig>
3
+ <msapplication>
4
+ <tile>
5
+ <square150x150logo src="/favicon/mstile-150x150.png"/>
6
+ <TileColor>#2b5797</TileColor>
7
+ </tile>
8
+ </msapplication>
9
+ </browserconfig>
public/favicon/favicon-16x16.png ADDED
public/favicon/favicon-32x32.png ADDED
public/favicon/favicon.ico ADDED
public/favicon/large-og.jpg ADDED
public/favicon/mstile-150x150.png ADDED
public/favicon/safari-pinned-tab.svg ADDED
public/favicon/site.webmanifest ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "",
3
+ "short_name": "",
4
+ "icons": [
5
+ {
6
+ "src": "/favicon/android-chrome-192x192.png",
7
+ "sizes": "192x192",
8
+ "type": "image/png"
9
+ },
10
+ {
11
+ "src": "/favicon/android-chrome-512x512.png",
12
+ "sizes": "512x512",
13
+ "type": "image/png"
14
+ }
15
+ ],
16
+ "theme_color": "#ffffff",
17
+ "background_color": "#ffffff",
18
+ "display": "standalone"
19
+ }
public/fonts/inter-var-latin.woff2 ADDED
Binary file (36.5 kB). View file
 
public/images/large-og.png ADDED