feat: npm init docusaurus, yarn create docusaurus (#5635)

* initial create-docusaurus impl

* cleanup

* @docusaurus/init renamed to create-docusaurus

* 0.0.6

* update lockfile

* fix lint

* remove npm2yarn for "npm init" because npm2yarn doesn't convert it and yarn result fails to execute

* prettier

* add correct version

* prettier

* prettier

* prettier

* prettier

* fix annoying --config .prettierrc issue
This commit is contained in:
Sébastien Lorber 2021-10-07 16:06:42 +02:00 committed by GitHub
parent e1b4da04fe
commit f6ec757aa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
102 changed files with 80 additions and 93 deletions

View file

@ -27,7 +27,7 @@ function generateTemplateExample(template) {
// /!\ we use the published init script on purpose,
// because using the local init script is too early and could generate upcoming/unavailable config options
// remember CodeSandbox templates will use the published version, not the repo version
`npx @docusaurus/init@latest init examples/${template} ${command}`,
`npm init docusaurus@latest examples/${template} ${command}`,
// `node ./packages/docusaurus-init/bin/index.js init examples/${template} ${template}`,
{
stdio: 'inherit',
@ -175,9 +175,9 @@ function run() {
console.log('## Generate example folders...');
console.log('');
const excludes = ['README.md', 'shared'];
const templates = readdirSync('./packages/docusaurus-init/templates').filter(
(name) => !excludes.includes(name),
);
const templates = readdirSync(
'./packages/create-docusaurus/templates',
).filter((name) => !excludes.includes(name));
console.log(`Will generate examples for templates: ${templates}`);
templates.forEach(generateTemplateExample);
console.log('Commiting changes');