Skip to content

Commit

Permalink
Merge branch 'main' into 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
heyAyushh authored Jul 14, 2021
2 parents 0f249cd + 6b0f931 commit d47c3b0
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actionsrelease

name: Node.js CI
name: build

on:
push:
Expand All @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [12.x,14.x,16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -27,10 +27,6 @@ jobs:
- run: npm install
- run: npm run build

- name: build changes
- name: Fail if build changes exist
id: changes
uses: UnicornGlobal/[email protected]

- name: Git Commit/Push Changes
if: steps.changes.outputs.changed == 1
uses: actions-x/commit@v2
run: exit $(git status --porcelain | grep "dist\|src" | wc -l)
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
# n.ts
npx n.ts: generate bare minimum node typescript setup asap
# nd.ts 🚀
[![build](https://github.com/heyAyushh/nd.ts/actions/workflows/main.build.yml/badge.svg?branch=main)](https://github.com/heyAyushh/nd.ts/actions/workflows/main.build.yml) ![npm](https://img.shields.io/npm/v/nd.ts) ![npm](https://img.shields.io/npm/dm/nd.ts) ![NPM](https://img.shields.io/npm/l/nd.ts)

generate bare minimum node typescript setup asap

```
npx nd.ts
```

This CLI setups the [node.ts starter](https://github.com/heyAyushh/node.ts) with simple command.

- tell the project name 📂
- Choose your own package manager 📦
- VOILA, boilerplate for nodejs project ready asap 🚀
5 changes: 5 additions & 0 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

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

2 changes: 1 addition & 1 deletion package-lock.json

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

13 changes: 9 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import chalk from "chalk";
import rimraf from "rimraf";
import inquirer from "inquirer";
import ora from "ora";
import fs from "fs";

const execp = promisify(exec);
const rimrafp = promisify(rimraf);
Expand All @@ -21,6 +22,10 @@ console.log(ascii());

const spinner = ora();

const copyFile = async (src: string, dest: string) => {
await fs.promises.copyFile(src, dest)
}

inquirer
.prompt([
{
Expand Down Expand Up @@ -70,14 +75,14 @@ inquirer
await Promise.all([
rimrafp(`${folder_name}/.git`),
execp(
`${folder_name === "." ? "" : `cd ${folder_name} &&`} ${
package_manager === "pnpm"
? "pnpm i"
: package_manager === "yarn"
`${folder_name === "." ? "" : `cd ${folder_name} &&`} ${package_manager === "pnpm"
? "pnpm i"
: package_manager === "yarn"
? "yarn"
: "npm i"
}`
),
copyFile(`${folder_name}/.env.default`, `${folder_name}/.env`),
]);

spinner.succeed(chalk.blueBright("Happy hacking ✨"));
Expand Down

0 comments on commit d47c3b0

Please sign in to comment.