create-rediagram-project
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.2.2](https://github.com/kamiazya/rediagram/compare/create-rediagram-project@0.2.1...create-rediagram-project@0.2.2) (2021-08-24) | ||
**Note:** Version bump only for package create-rediagram-project | ||
## [0.2.1](https://github.com/kamiazya/rediagram/compare/create-rediagram-project@0.2.0...create-rediagram-project@0.2.1) (2021-01-10) | ||
@@ -8,0 +16,0 @@ |
@@ -27,31 +27,4 @@ 'use strict'; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
const pkg = JSON.parse(fs__default['default'].readFileSync(path__default['default'].resolve(__dirname, '../package.json'), 'utf-8')); | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
function __spreadArrays() { | ||
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) | ||
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) | ||
r[k] = a[j]; | ||
return r; | ||
} | ||
function __makeTemplateObject(cooked, raw) { | ||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } | ||
return cooked; | ||
} | ||
var pkg = JSON.parse(fs__default['default'].readFileSync(path__default['default'].resolve(__dirname, '../package.json'), 'utf-8')); | ||
function assertArgs(name, pm) { | ||
@@ -61,11 +34,14 @@ if (name !== path__default['default'].basename(name)) { | ||
} | ||
var _a = validate__default['default'](name), validForNewPackages = _a.validForNewPackages, warnings = _a.warnings, errors = _a.errors; | ||
const { validForNewPackages, warnings, errors } = validate__default['default'](name); | ||
if (!validForNewPackages) { | ||
throw new commander.CommanderError(1, assertArgs.key, "name must be a package name that can be created.\n" + __spreadArrays((errors !== null && errors !== void 0 ? errors : []).map(function (msg) { return " error: " + msg; }), (warnings !== null && warnings !== void 0 ? warnings : []).map(function (msg) { return " worning: " + msg; })).join('\n')); | ||
throw new commander.CommanderError(1, assertArgs.key, `name must be a package name that can be created.\n${[ | ||
...(errors !== null && errors !== void 0 ? errors : []).map((msg) => ` error: ${msg}`), | ||
...(warnings !== null && warnings !== void 0 ? warnings : []).map((msg) => ` worning: ${msg}`), | ||
].join('\n')}`); | ||
} | ||
if (fs__default$1['default'].pathExistsSync(path__default['default'].resolve(process.cwd(), name))) { | ||
throw new commander.CommanderError(1, assertArgs.key, "'" + name + "' directory already exists."); | ||
throw new commander.CommanderError(1, assertArgs.key, `'${name}' directory already exists.`); | ||
} | ||
if (!['npm', 'yarn'].includes(pm)) { | ||
throw new commander.CommanderError(1, assertArgs.key, "'" + pm + "' is not supportted. choose from yarn or npm"); | ||
throw new commander.CommanderError(1, assertArgs.key, `'${pm}' is not supportted. choose from yarn or npm`); | ||
} | ||
@@ -75,12 +51,12 @@ } | ||
var command = commander.createCommand(pkg.name) | ||
/* eslint-disable @typescript-eslint/no-unused-vars, func-names, no-console */ | ||
const command = commander.createCommand(pkg.name) | ||
.version(pkg.version) | ||
.arguments('<name>') | ||
.option('-p, --package-manager <pm>', 'select a package manager, yarn or npm.', 'yarn') | ||
.action(function (name, _a) { | ||
var packageManager = _a.packageManager; | ||
.action(function (name, { packageManager }) { | ||
assertArgs(name, packageManager); | ||
var cwd = process.cwd(); | ||
var src = path__default['default'].resolve(__dirname, '../templates/typescript'); | ||
var dist = path__default['default'].resolve(cwd, name); | ||
const cwd = process.cwd(); | ||
const src = path__default['default'].resolve(__dirname, '../templates/typescript'); | ||
const dist = path__default['default'].resolve(cwd, name); | ||
fs__default$1['default'].ensureDirSync(dist); | ||
@@ -90,3 +66,3 @@ ncp.ncp(src, dist, { | ||
dereference: true, | ||
transform: function (read, write) { | ||
transform(read, write) { | ||
read | ||
@@ -97,7 +73,12 @@ .pipe(replacestream__default['default']('{{name}}', name)) | ||
}, | ||
}, function () { | ||
console.log(chalk__default['default'](templateObject_1 || (templateObject_1 = __makeTemplateObject(["\uD83C\uDF08 Creating new rediagram project in {bold ", "}."], ["\uD83C\uDF08 Creating new rediagram project in {bold ", "}."])), name)); | ||
}, () => { | ||
console.log(chalk__default['default'] `🌈 Creating new rediagram project in {bold ${name}}.`); | ||
console.log(); | ||
if (which__default['default'].sync('dot', { nothrow: true }) === null) { | ||
console.log(dedent__default['default'](chalk__default['default'](templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n \uD83D\uDC47 Install the dependent software:\n\n - {bold Graphviz}\n - {white.underline https://graphviz.org/download/}\n "], ["\n \uD83D\uDC47 Install the dependent software:\n\n - {bold Graphviz}\n - {white.underline https://graphviz.org/download/}\n "]))))); | ||
console.log(dedent__default['default'](chalk__default['default'] ` | ||
👇 Install the dependent software: | ||
- {bold Graphviz} | ||
- {white.underline https://graphviz.org/download/} | ||
`)); | ||
console.log(); | ||
@@ -107,3 +88,3 @@ } | ||
console.log(); | ||
console.log(chalk__default['default'](templateObject_3 || (templateObject_3 = __makeTemplateObject(["Running {bold $} {cyan ", "} install"], ["Running {bold $} {cyan ", "} install"])), packageManager)); | ||
console.log(chalk__default['default'] `Running {bold $} {cyan ${packageManager}} install`); | ||
spawn__default['default'].sync(packageManager, ['install'], { | ||
@@ -114,9 +95,26 @@ cwd: dist, | ||
console.log(); | ||
console.log("\u2728 The installation is complete."); | ||
console.log(`✨ The installation is complete.`); | ||
console.log(); | ||
console.log(dedent__default['default'](chalk__default['default'](templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n \uD83D\uDC49 Get started with following commands:\n\n {gray # Move to the project directory with the following command.}\n {bold $} {cyan cd} ", "\n "], ["\n \uD83D\uDC49 Get started with following commands:\n\n {gray # Move to the project directory with the following command.}\n {bold $} {cyan cd} ", "\n "])), name))); | ||
console.log(dedent__default['default'](chalk__default['default'] ` | ||
👉 Get started with following commands: | ||
{gray # Move to the project directory with the following command.} | ||
{bold $} {cyan cd} ${name} | ||
`)); | ||
console.log(); | ||
console.log(dedent__default['default'](chalk__default['default'](templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n \uD83D\uDE80 {bold In the project directory, you can run:}\n\n {gray # Runs {bold src/*.rediagram.tsx} scripts and output the image with rediagram.}\n {bold $} {cyan ", "} start\n "], ["\n \uD83D\uDE80 {bold In the project directory, you can run:}\n\n {gray # Runs {bold src/*.rediagram.tsx} scripts and output the image with rediagram.}\n {bold $} {cyan ", "} start\n "])), packageManager))); | ||
console.log(dedent__default['default'](chalk__default['default'] ` | ||
🚀 {bold In the project directory, you can run:} | ||
{gray # Runs {bold src/*.rediagram.tsx} scripts and output the image with rediagram.} | ||
{bold $} {cyan ${packageManager}} start | ||
`)); | ||
console.log(); | ||
console.log(chalk__default['default'](templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n {yellow.bold Thanks for installing rediagram \uD83D\uDE4F}\n\n Please consider donating to help\n maintain rediagram packages!\n\n GitHub Sponsor: {white.underline https://github.com/sponsors/kamiazya/}\n ko-fi: {white.underline https://ko-fi.com/kamiazya}"], ["\n {yellow.bold Thanks for installing rediagram \uD83D\uDE4F}\n\n Please consider donating to help\n maintain rediagram packages!\n\n GitHub Sponsor: {white.underline https://github.com/sponsors/kamiazya/}\n ko-fi: {white.underline https://ko-fi.com/kamiazya}"])))); | ||
console.log(chalk__default['default'] ` | ||
{yellow.bold Thanks for installing rediagram 🙏} | ||
Please consider donating to help | ||
maintain rediagram packages! | ||
GitHub Sponsor: {white.underline https://github.com/sponsors/kamiazya/} | ||
ko-fi: {white.underline https://ko-fi.com/kamiazya}`); | ||
console.log(); | ||
@@ -126,3 +124,2 @@ }); | ||
.exitOverride(); | ||
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6; | ||
@@ -138,3 +135,3 @@ try { | ||
// eslint-disable-next-line no-console | ||
console.log(chalk__default['default'].red(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["{bold ", "}\n", "\n"], ["{bold ", "}\\n", "\\n"])), err.code, err.message)); | ||
console.log(chalk__default['default'].red `{bold ${err.code}}\n${err.message}\n`); | ||
command.outputHelp(); | ||
@@ -145,2 +142,1 @@ process.exit(err.exitCode); | ||
} | ||
var templateObject_1$1; |
{ | ||
"name": "create-rediagram-project", | ||
"license": "MIT", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": "kamiazya <yuki@kamiazya.tech>", | ||
@@ -45,3 +45,3 @@ "description": "Starter kit for rediagram.", | ||
"@types/ncp": "^2.0.4", | ||
"@types/node": "^14.11.8", | ||
"@types/node": "^16.4.5", | ||
"@types/replacestream": "^4.0.0", | ||
@@ -51,7 +51,7 @@ "@types/validate-npm-package-name": "^3.0.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.32.0", | ||
"rollup-plugin-typescript2": "^0.28.0", | ||
"rollup": "^2.55.0", | ||
"rollup-plugin-typescript2": "^0.30.0", | ||
"typescript": "^4.0.2" | ||
}, | ||
"gitHead": "6516951d69f6cd1c90982c29fbe40fec8ddeb78a" | ||
"gitHead": "88d1e2867a0d1b684f21442121b699dccccb9e8d" | ||
} |
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
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
20874
324