Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
moelleer committed Oct 21, 2021
0 parents commit 64b5512
Show file tree
Hide file tree
Showing 7 changed files with 488 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
50 changes: 50 additions & 0 deletions commands/create.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const prompt = require("prompt");
const chalk = require("chalk");
const conf = new (require("conf"))();
const { exec } = require("child_process");
const createRepos = require("../tasks/github");
const {
installAppDependencies,
installApiDependencies,
} = require("../tasks/dependencies");

async function create() {
console.log(chalk.greenBright.bold("⚡️ Creating new Lisa project ⚡️"));
console.log();

prompt.start();
prompt.message = "";
prompt.delimiter = chalk.greenBright(" >");

let projectNamePrompt = {
properties: {
projectName: {
type: "string",
description: "Enter the name of your new project",
message: "Please use only lowercase and hyphens only.",
required: true,
pattern: /^[a-z-]+$/,
},
},
};

let { projectName } = await prompt.get(projectNamePrompt);

conf.set("projectName", projectName);

console.log();
console.log(chalk.greenBright(`✅ Project name set to ${projectName}`));

await createRepos();

console.log();
console.log(chalk.cyanBright("🪚 Install dependencies."));

let appPromise = installAppDependencies();
let apiPromise = installApiDependencies();

await Promise.all([appPromise, apiPromise]);
console.log(chalk.greenBright("✅ All dependencies installed."));
}

module.exports = create;
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /usr/bin/env node

const { program } = require("commander");
const create = require("./commands/create");

program.command("create").description("Create a Lisa project").action(create);

program.parse();
333 changes: 333 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 64b5512

Please sign in to comment.