mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 05:23:40 +00:00
CLI: Generate .gitignore file by default
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'create-next-docs-app': patch
|
||||
---
|
||||
|
||||
Generate .gitignore file by default
|
||||
@@ -1,37 +0,0 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
.contentlayer
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# local env files
|
||||
.env*.local
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
@@ -1,37 +0,0 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
.contentlayer
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# local env files
|
||||
.env*.local
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
@@ -69,6 +69,9 @@ async function main() {
|
||||
info.message('Updating README.md')
|
||||
generateReadme(path.join(dest, 'README.md'), name)
|
||||
|
||||
info.message('Adding .gitignore')
|
||||
generateGitIgnore(path.join(dest, '.gitignore'))
|
||||
|
||||
info.stop('Project Generated')
|
||||
|
||||
outro(color.bgGreen(color.bold('Done')))
|
||||
@@ -134,6 +137,34 @@ function generateReadme(path: string, projectName: string) {
|
||||
fs.writeFileSync(path, content)
|
||||
}
|
||||
|
||||
function generateGitIgnore(path: string) {
|
||||
const ignores = [
|
||||
// deps
|
||||
'/node_modules',
|
||||
'/.pnp',
|
||||
'.pnp.js',
|
||||
// outputs
|
||||
'.contentlayer',
|
||||
'/coverage',
|
||||
'/.next/',
|
||||
'/out/',
|
||||
'/build',
|
||||
'.DS_Store',
|
||||
'*.pem',
|
||||
// debug logs
|
||||
'npm-debug.log*',
|
||||
'yarn-debug.log*',
|
||||
'yarn-error.log*',
|
||||
|
||||
'.env*.local',
|
||||
'.vercel',
|
||||
'*.tsbuildinfo',
|
||||
'next-env.d.ts'
|
||||
]
|
||||
|
||||
fs.writeFileSync(path, ignores.join('\n'))
|
||||
}
|
||||
|
||||
function copy(
|
||||
from: string,
|
||||
to: string,
|
||||
|
||||
Reference in New Issue
Block a user