docusaurus-init
Advanced tools
Comparing version 1.0.2 to 1.9.0
@@ -10,5 +10,5 @@ #!/usr/bin/env node | ||
const shell = require("shelljs"); | ||
const chalk = require("chalk"); | ||
const fs = require("fs"); | ||
const shell = require('shelljs'); | ||
const chalk = require('chalk'); | ||
const fs = require('fs'); | ||
@@ -18,10 +18,10 @@ const CWD = process.cwd(); | ||
let useYarn = false; | ||
if (shell.which("yarn")) { | ||
if (shell.which('yarn')) { | ||
useYarn = true; | ||
} | ||
if (fs.existsSync(CWD + "/website")) { | ||
console.error(chalk.yellow("Website folder already exists.\n")); | ||
if (fs.existsSync(`${CWD}/website`)) { | ||
console.error(chalk.yellow('Website folder already exists.\n')); | ||
console.log( | ||
"In order for Docusaurus to get set up as your static site generator, you will need to remove any existing 'website' folder from your root directory. If you are migrating from another static site generator, you may want to move your old website folder to a different location." | ||
"In order for Docusaurus to get set up as your static site generator, you will need to remove any existing 'website' folder from your root directory. If you are migrating from another static site generator, you may want to move your old website folder to a different location.", | ||
); | ||
@@ -33,30 +33,30 @@ process.exit(1); | ||
shell.mkdir("website"); | ||
shell.mkdir('website'); | ||
console.log(chalk.green("Website folder created!\n")); | ||
console.log(chalk.green('Website folder created!\n')); | ||
shell.cd("website"); | ||
shell.cd('website'); | ||
console.log( | ||
chalk.yellow("Installing latest version of Docusaurus in website.\n") | ||
chalk.yellow('Installing latest version of Docusaurus in website.\n'), | ||
); | ||
const packageContent = { scripts: { examples: "docusaurus-examples" } }; | ||
const packageContent = {scripts: {examples: 'docusaurus-examples'}}; | ||
fs.writeFileSync( | ||
CWD + "/website/package.json", | ||
JSON.stringify(packageContent, null, 2) + "\n" | ||
`${CWD}/website/package.json`, | ||
`${JSON.stringify(packageContent, null, 2)}\n`, | ||
); | ||
if (useYarn) { | ||
shell.exec("yarn add docusaurus --dev"); | ||
shell.exec('yarn add docusaurus --dev'); | ||
} else { | ||
shell.exec("npm install docusaurus --save-dev"); | ||
shell.exec('npm install docusaurus --save-dev'); | ||
} | ||
console.log(chalk.green("Docusaurus installed in website folder!\n")); | ||
console.log(chalk.green('Docusaurus installed in website folder!\n')); | ||
if (useYarn) { | ||
shell.exec("yarn run examples"); | ||
shell.exec('yarn run examples'); | ||
} else { | ||
shell.exec("npm run examples"); | ||
shell.exec('npm run examples'); | ||
} |
{ | ||
"name": "docusaurus-init", | ||
"description": "Initialization script for Docusaurus", | ||
"version": "1.0.2", | ||
"version": "1.9.0", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "preferGlobal": true, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2664