Skip to content

Commit 6539f3a

Browse files
author
pooya parsa
committed
feat: upgrade to sao@1 (fixes #64)
1 parent f96c496 commit 6539f3a

File tree

4 files changed

+49
-46
lines changed

4 files changed

+49
-46
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ to rapidly create efficient and feature-reach [PWA](https://developers.google.co
4545
Use the command below to create a new app using starter template:
4646

4747
```bash
48-
> npx sao nuxt-community/nuxt7 nuxt7-app
48+
> npx sao@1 nuxt-community/nuxt7 nuxt7-app
4949
```
5050

5151
## ▶️ Examples

sao.js

-38
This file was deleted.

saofile.js

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
prompts () {
3+
return [
4+
{
5+
name: 'name',
6+
message: 'Project name',
7+
default: this.outFolder
8+
},
9+
{
10+
name: 'description',
11+
message: 'Project description',
12+
default: ``
13+
}
14+
]
15+
},
16+
17+
templateData () {
18+
return {
19+
name: this.answers.name,
20+
description: this.answers.description
21+
}
22+
},
23+
24+
actions: [
25+
{
26+
type: 'add',
27+
files: '**'
28+
},
29+
{ type: 'move',
30+
patterns: {
31+
gitignore: '.gitignore'
32+
}
33+
}
34+
],
35+
36+
async completed () {
37+
this.gitInit()
38+
await this.npmInstall()
39+
this.showProjectTips()
40+
}
41+
}

template/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
> <%= description %>
44
5-
## Build Setup
5+
## Development
66

77
``` bash
88
# Install dependencies
9-
$ <%= _.pm %> install
9+
<% if (context.npmClient === 'yarn') { %>yarn add<% } else { %>npm i<% } %> <%= name %>
1010

11-
# Serve with hot reload at localhost:3000
12-
$ <%= _.pm %> run dev
11+
# Serve with hot-reload at localhost:3000
12+
<%= context.npmClient %> run dev
1313

1414
# Build for production and launch server
15-
$ <%= _.pm %> run build
16-
$ <%= _.pm %> start
15+
<%= context.npmClient %> run build
16+
<%= context.npmClient %> start
1717

1818
# Generate static project
19-
$ <%= _.pm %> run generate
19+
<%= context.npmClient %> run generate
2020
```
2121
2222
For detailed explanation on how things work, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js).

0 commit comments

Comments
 (0)