Skip to content

Commit

Permalink
create-wakuwork
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Mar 20, 2023
1 parent 37a3bcf commit 01cb0a6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ Minimalistic React Framework

## How to start a new project

Use one of examples as a template:
```bash
npm create wakuwork
```

```bash
yarn create wakuwork
```

```bash
curl -L https://github.com/dai-shi/wakuwork/archive/v0.7.0.tar.gz | tar -x --strip-components=2 wakuwork-0.7.0/examples/01_counter
pnpm create wakuwork
```

## Work in progress
Expand Down
12 changes: 12 additions & 0 deletions contrib/create-wakuwork/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const fs = require('fs');
const { exec } = require('child_process');

const dirName = 'wanakwork-example';

if (fs.existsSync(dirName)) {
throw new Error('Directory already exists');
}

fs.mkdirSync(dirName);

exec(`curl -L https://github.com/dai-shi/wakuwork/archive/v0.7.1.tar.gz | tar -x --directory ${dirName} --strip-components=3 wakuwork-0.7.1/examples/01_counter`)
5 changes: 5 additions & 0 deletions contrib/create-wakuwork/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "create-wakuwork",
"version": "0.2.0",
"bin": "./cli.js"
}

0 comments on commit 01cb0a6

Please sign in to comment.