Skip to content

Commit a6cd126

Browse files
authored
Merge pull request #1 from jsrepl/nextjs
Migrate from Nuxt.js to Next.js
2 parents 46ce4fe + 38a65b4 commit a6cd126

File tree

247 files changed

+11233
-12352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+11233
-12352
lines changed

.prettierrc

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
"trailingComma": "es5",
55
"printWidth": 100,
66

7-
"importOrder": ["^node:", "<THIRD_PARTY_MODULES>", "^[./]"],
7+
"importOrder": [
8+
"^node:",
9+
"^react",
10+
"^next",
11+
"<THIRD_PARTY_MODULES>",
12+
"^\\~icons/",
13+
"^\\@/",
14+
"^\\.\\./",
15+
"^\\./"
16+
],
817
"importOrderSortSpecifiers": true,
918

1019
"plugins": ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"],

package.json

-5
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,5 @@
3838
"packageManager": "[email protected]",
3939
"engines": {
4040
"node": ">=18"
41-
},
42-
"pnpm": {
43-
"patchedDependencies": {
44-
45-
}
4641
}
4742
}

packages/jsrepl/.env.example

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
SUPABASE_URL=
2-
SUPABASE_KEY=
3-
SUPABASE_SERVICE_KEY=
4-
JSREPL_PREVIEW_URL=http://localhost:5199
5-
JSREPL_CUSTOM_APP_VERSION=
1+
NEXT_PUBLIC_PREVIEW_URL=http://localhost:5199
2+
NEXT_PUBLIC_APP_VERSION=

packages/jsrepl/.env.test

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
SUPABASE_URL=http://127.0.0.1:54321
2-
SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
3-
SUPABASE_SERVICE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU
4-
JSREPL_PREVIEW_URL=http://localhost:5199
5-
JSREPL_CUSTOM_APP_VERSION=9.9.9
1+
NEXT_PUBLIC_PREVIEW_URL=http://localhost:5199
2+
NEXT_PUBLIC_APP_VERSION=9.9.9

packages/jsrepl/.eslintrc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": ["next/core-web-vitals", "next/typescript", "plugin:storybook/recommended"],
3+
"ignorePatterns": ["public/e.js"],
4+
"rules": {
5+
"@next/next/no-img-element": "off"
6+
}
7+
}

packages/jsrepl/.gitignore

+46-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1-
public/e.js
2-
test-results/
3-
playwright-report/
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+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
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+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts
37+
38+
# playwright
39+
/test-results/
40+
/playwright-report/
41+
/blob-report/
42+
/playwright/.cache/
43+
44+
*storybook.log
45+
46+
public/e.js

packages/jsrepl/.lintstagedrc.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
import path from 'path'
12
import baseConfig from '../../.lintstagedrc.js'
23

4+
// https://nextjs.org/docs/app/building-your-application/configuring/eslint#lint-staged
5+
const buildEslintCommand = (filenames) =>
6+
`next lint --fix --file ${filenames.map((f) => path.relative(process.cwd(), f)).join(' --file ')}`
7+
38
export default {
49
...baseConfig,
5-
'**/*': 'eslint --fix',
10+
'*.{js,jsx,ts,tsx}': [buildEslintCommand],
611
}

packages/jsrepl/.storybook/main.ts

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { StorybookConfig } from '@storybook/nextjs'
2+
import { dirname, join } from 'path'
3+
4+
/**
5+
* This function is used to resolve the absolute path of a package.
6+
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
7+
*/
8+
function getAbsolutePath(value: string): any {
9+
return dirname(require.resolve(join(value, 'package.json')))
10+
}
11+
const config: StorybookConfig = {
12+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
13+
addons: [
14+
getAbsolutePath('@storybook/addon-links'),
15+
getAbsolutePath('@storybook/addon-essentials'),
16+
getAbsolutePath('@chromatic-com/storybook'),
17+
getAbsolutePath('@storybook/addon-interactions'),
18+
getAbsolutePath('@storybook/addon-themes'),
19+
],
20+
framework: {
21+
name: getAbsolutePath('@storybook/nextjs'),
22+
options: {},
23+
},
24+
}
25+
export default config
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import React from 'react'
2+
import { withThemeByDataAttribute } from '@storybook/addon-themes'
3+
import type { Preview, ReactRenderer } from '@storybook/react'
4+
import '../src/app/globals.css'
5+
import { Themes } from '../src/lib/themes'
6+
7+
const preview: Preview = {
8+
parameters: {
9+
controls: {
10+
matchers: {
11+
color: /(background|color)$/i,
12+
date: /Date$/i,
13+
},
14+
},
15+
},
16+
17+
decorators: [
18+
withThemeByDataAttribute<ReactRenderer>({
19+
themes: Themes.reduce(
20+
(acc, theme) => {
21+
acc[theme.id] = theme.id
22+
return acc
23+
},
24+
{} as Record<string, string>
25+
),
26+
defaultTheme: Themes[0].id,
27+
attributeName: 'data-theme',
28+
}),
29+
],
30+
}
31+
32+
export default preview

packages/jsrepl/README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
This is a [Next.js](https://nextjs.org) project bootstrapped with
2+
[`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
3+
4+
## Getting Started
5+
6+
First, run the development server:
7+
8+
```bash
9+
npm run dev
10+
# or
11+
yarn dev
12+
# or
13+
pnpm dev
14+
# or
15+
bun dev
16+
```
17+
18+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
19+
20+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the
21+
file.
22+
23+
This project uses
24+
[`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to
25+
automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
26+
27+
## Learn More
28+
29+
To learn more about Next.js, take a look at the following resources:
30+
31+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
32+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
33+
34+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback
35+
and contributions are welcome!
36+
37+
## Deploy on Vercel
38+
39+
The easiest way to deploy your Next.js app is to use the
40+
[Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme)
41+
from the creators of Next.js.
42+
43+
Check out our
44+
[Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying)
45+
for more details.

packages/jsrepl/app.vue

-16
This file was deleted.

packages/jsrepl/assets/css/tailwind.css

-146
This file was deleted.

0 commit comments

Comments
 (0)