diff --git a/.eslintrc b/.eslintrc index 10c5c1f9..72e43bee 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,3 +1,6 @@ { - "extends": "@corex" + "extends": "@corex", + "rules": { + "react/react-in-jsx-scope": "off" + } } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 591f8645..b95ed60e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: platform: [ubuntu-latest, macos-latest, windows-latest] - node: ['17', '16', '14.18'] + node: ['16', '17', '18', '19'] runs-on: ${{ matrix.platform }} steps: - name: Github Checkout diff --git a/examples/app-dir/.vscode/settings.json b/examples/app-dir/.vscode/settings.json new file mode 100644 index 00000000..ce508cdd --- /dev/null +++ b/examples/app-dir/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "typescript.tsdk": "./node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true +} diff --git a/examples/app-dir/app/[dynamic]/page.tsx b/examples/app-dir/app/[dynamic]/page.tsx new file mode 100644 index 00000000..6d48cd5f --- /dev/null +++ b/examples/app-dir/app/[dynamic]/page.tsx @@ -0,0 +1,20 @@ +const DynamicPage: React.FC = ({ params }) => { + return ( +
+

DynamicPage Component

+
{JSON.stringify(params, null, 2)}
+
+ ) +} + +export default DynamicPage + +/** + * @see https://beta.nextjs.org/docs/api-reference/generate-static-params + * @returns + */ +export async function generateStaticParams() { + return [...Array(10000)].map((_, index) => ({ + dynamic: `page-${index}`, + })) +} diff --git a/examples/app-dir/app/layout.tsx b/examples/app-dir/app/layout.tsx new file mode 100644 index 00000000..46f4ea6d --- /dev/null +++ b/examples/app-dir/app/layout.tsx @@ -0,0 +1,14 @@ +import React from 'react' + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + + {children} + + ) +} diff --git a/examples/app-dir/app/page.tsx b/examples/app-dir/app/page.tsx new file mode 100644 index 00000000..9908ef9e --- /dev/null +++ b/examples/app-dir/app/page.tsx @@ -0,0 +1,11 @@ +import React from 'react' + +const HomePage: React.FC = () => { + return ( +
+

HomePage Component

+
+ ) +} + +export default HomePage diff --git a/examples/app-dir/next-env.d.ts b/examples/app-dir/next-env.d.ts new file mode 100644 index 00000000..4f11a03d --- /dev/null +++ b/examples/app-dir/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/examples/app-dir/next-sitemap.config.js b/examples/app-dir/next-sitemap.config.js new file mode 100644 index 00000000..c4dffed4 --- /dev/null +++ b/examples/app-dir/next-sitemap.config.js @@ -0,0 +1,16 @@ +/** @type {import('next-sitemap').IConfig} */ +const config = { + siteUrl: process.env.SITE_URL || 'https://example.com', + generateRobotsTxt: true, + sitemapSize: 1000, + // optional + robotsTxtOptions: { + additionalSitemaps: [ + 'https://example.com/my-custom-sitemap-1.xml', + 'https://example.com/my-custom-sitemap-2.xml', + 'https://example.com/my-custom-sitemap-3.xml', + ], + }, +} + +export default config diff --git a/examples/app-dir/next.config.js b/examples/app-dir/next.config.js new file mode 100644 index 00000000..1b30ee54 --- /dev/null +++ b/examples/app-dir/next.config.js @@ -0,0 +1,8 @@ +/**@type {import('next').NextConfig} */ +const config = { + experimental: { + appDir: true, + }, +} + +export default config diff --git a/examples/app-dir/package.json b/examples/app-dir/package.json new file mode 100644 index 00000000..5a7e2734 --- /dev/null +++ b/examples/app-dir/package.json @@ -0,0 +1,23 @@ +{ + "name": "with-next-app-dir", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "private": true, + "type": "module", + "scripts": { + "dev": "next", + "build": "next build", + "postbuild": "next-sitemap" + }, + "dependencies": { + "@types/react-dom": "^18.0.6", + "next": "^13.0.2", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@types/react": "^18.0.17", + "next-sitemap": "*" + } +} diff --git a/examples/app-dir/tsconfig.json b/examples/app-dir/tsconfig.json new file mode 100644 index 00000000..67524906 --- /dev/null +++ b/examples/app-dir/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": false, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "incremental": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "plugins": [ + { + "name": "next" + } + ] + }, + "include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +}