create-factor-app
Advanced tools
Comparing version 1.1.20 to 1.1.22
@@ -8,2 +8,3 @@ #!/usr/bin/env node | ||
const figures = require("figures") | ||
const axios = require("axios") | ||
const { name: packageName, version } = require("./package.json") | ||
@@ -13,2 +14,5 @@ // In a custom directory or current directory | ||
// Notify install | ||
axios.get(`https://factor.dev?_action=track-install&method=cfa`) | ||
consola.log(`${figures.pointer} Starting ${packageName}@${version}`) | ||
@@ -15,0 +19,0 @@ consola.log() |
{ | ||
"name": "create-factor-app", | ||
"version": "1.1.20", | ||
"version": "1.1.22", | ||
"description": "Create a Factor App in seconds.", | ||
@@ -19,2 +19,3 @@ "bin": "cli.js", | ||
"dependencies": { | ||
"axios": "^0.19.1", | ||
"chalk": "^3.0.0", | ||
@@ -33,3 +34,3 @@ "consola": "^2.6.0", | ||
"license": "GPL-2.0", | ||
"gitHead": "8c878567d13c8a0b04247c6b38012a882b99eae2" | ||
"gitHead": "9f0b300d972823377385f40610b49daf1a8f1cac" | ||
} |
@@ -16,3 +16,3 @@ /* eslint-disable no-console */ | ||
name: "name", | ||
message: "Project Title", | ||
message: "What's the name of your app?", | ||
default: "{outFolder}" | ||
@@ -22,3 +22,3 @@ }, | ||
name: "description", | ||
message: "Project description", | ||
message: "Basic description?", | ||
default: `My ${superb.random()} Factor project`, | ||
@@ -30,3 +30,3 @@ when: answers => !config.isUnitTest(answers) | ||
type: "string", | ||
message: "Your Name", | ||
message: "Your full name?", | ||
default: "{gitUser.name}", | ||
@@ -38,3 +38,3 @@ when: answers => !config.isUnitTest(answers) | ||
type: "string", | ||
message: "Your Email", | ||
message: "...and email?", | ||
default: "{gitUser.email}", | ||
@@ -47,4 +47,8 @@ when: answers => !config.isUnitTest(answers) | ||
message: | ||
"Do you have a MongoDB connection string ready? (needed for dashboard, posts, auth. you can can add this later...)", | ||
choices: ["yes", "no"], | ||
"Ok let's setup your database: do you have a MongoDB connection URL ready?", | ||
choices: [ | ||
{ name: "Yes, I'm ready to go", value: "yes" }, | ||
{ name: "Use the demo database (resets every 30 minutes)", value: "demo" }, | ||
{ name: "I'll do this later", value: "no" } | ||
], | ||
when: answers => !config.isUnitTest(answers) | ||
@@ -56,3 +60,3 @@ }, | ||
type: "string", | ||
message: "Your MongoDB Connection String (mongodb://...)", | ||
message: "DB Setup: Your MongoDB Connection URL (mongodb://...)", | ||
default: "", | ||
@@ -62,5 +66,5 @@ validate: val => { | ||
? true | ||
: "Doesn't seem to be a valid connection string..." | ||
: "Doesn't seem to be a valid database URL..." | ||
}, | ||
when: answers => answers.addDb != "no" && !config.isUnitTest(answers) | ||
when: answers => answers.addDb == "yes" && !config.isUnitTest(answers) | ||
} | ||
@@ -76,2 +80,3 @@ ], | ||
templateData() { | ||
const data = {} | ||
const answers = this.answers | ||
@@ -81,4 +86,4 @@ if (answers.name.includes("UNIT-TEST")) { | ||
} | ||
const urlName = config.slugify(answers.name || "no-name") | ||
const randomString = Math.random() | ||
data.urlName = config.slugify(answers.name || "no-name") | ||
data.randomString = Math.random() | ||
.toString(36) | ||
@@ -88,3 +93,8 @@ .replace(/[^a-z]+/g, "") | ||
return { urlName, randomString } | ||
if (answers.addDb == "demo") { | ||
data.db = | ||
"mongodb+srv://demo:demo@cluster0-yxsfy.mongodb.net/demo?retryWrites=true&w=majority" | ||
} | ||
return data | ||
}, | ||
@@ -149,8 +159,10 @@ slugify(text) { | ||
console.log() | ||
console.log(this.chalk.bold(` ${figures.tick} Start your local server:\n`)) | ||
console.log( | ||
this.chalk.bold(` ${figures.tick} Great work. Now start your local server:\n`) | ||
) | ||
cd() | ||
console.log(`\tyarn factor dev\n`) | ||
console.log() | ||
console.log(` ${figures.arrowRight} Factor Docs: https://factor.dev/`) | ||
console.log(` ${figures.arrowRight} Setup CLI: yarn factor setup`) | ||
console.log(` ${figures.arrowRight} Factor docs: https://factor.dev/`) | ||
console.log(` ${figures.arrowRight} Setup command: yarn factor setup`) | ||
console.log() | ||
@@ -157,0 +169,0 @@ } |
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
106929
216
9
+ Addedaxios@^0.19.1
+ Addedaxios@0.19.2(transitive)
+ Addedfollow-redirects@1.5.10(transitive)