docusaurus-init
Advanced tools
Comparing version 1.0.2 to 2.0.0-alpha.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": "2.0.0-alpha.0", | ||
"license": "MIT", | ||
@@ -19,3 +19,4 @@ "preferGlobal": true, | ||
"shelljs": "^0.7.8" | ||
} | ||
}, | ||
"gitHead": "dd2cfc89b264f73ba7af24136c65ba11d84c0fde" | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
3809
4
2
1