Skip to content

Commit

Permalink
added nextjs support
Browse files Browse the repository at this point in the history
  • Loading branch information
MP281X committed Sep 4, 2024
1 parent c6327b3 commit 15141f5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
18 changes: 18 additions & 0 deletions cli/lib/configProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ const svelteTsConfig = `
{ "extends": ["./.svelte-kit/tsconfig.json", "@mp281x/shared-config/tsconfig"] }
`.trimStart()

const nextTsConfig = `
{
"extends": ["@mp281x/shared-config/tsconfig"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"compilerOptions": { "plugins": [{ "name": "next" }], "paths": { "@/*": ["./*"] } }
}
`.trimStart()

const nextJSConfig = `
/** @type {import('next').NextConfig} */
export default {
eslint: { ignoreDuringBuilds: true },
typescript: { ignoreBuildErrors: true }
}
`.trimStart()

const biome = `
{ "extends": ["@mp281x/shared-config/biome"] }
`.trimStart()
Expand Down Expand Up @@ -44,5 +60,7 @@ export const configProject = () => {
fs.writeFileSync('biome.jsonc', biome)
fs.writeFileSync('.gitignore', gitignore)

if (hasPackage('next')) fs.writeFileSync('tsconfig.json', nextTsConfig)
if (hasPackage('next')) fs.writeFileSync('next.config.mjs', nextJSConfig)
if (hasPackage('svelte')) fs.writeFileSync('tsconfig.json', svelteTsConfig)
}
8 changes: 7 additions & 1 deletion cli/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ invalidLogs.push(
'- Experiments',
'✓ Starting...',
'· reactCompiler',
'[BABEL] Note: The code generator'
'Skipping linting',
'Collecting page data',
'Collecting build traces',
'Finalizing page optimization',
'Skipping validation of types',
'[BABEL] Note: The code generator',
'Creating an optimized production build'
)

// tsx/pnpm/biome/...
Expand Down

0 comments on commit 15141f5

Please sign in to comment.