Skip to content

Fix setup command #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Create a new database with the name you have in your `.env`-file.
Then setup your application environment.

```bash
npm start setup
npm run setup
```

> This installs all dependencies with yarn. After that it migrates the database and seeds some test data into it. So after that your development environment is ready to use.
Expand Down
18 changes: 7 additions & 11 deletions package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,16 @@ module.exports = {
description: 'Serves the current app and watches for changes to restart it'
},
/**
* Setup's the development environment and the database
* Setup's stuff
*/
setup: {
script: series(
'yarn install',
copy(
'.env.example',
'.env'
db: {
script: series(
'nps db.migrate',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To run typorm we have to create typorm.json first with nps config

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As db.migrate and db.seed already contain nps config we don't need this here.

'nps db.seed'
),
'nps config',
'nps db.migrate',
'nps db.seed'
),
description: 'Setup`s the development environment and the database'
description: 'Setup`s the database by migrating and seeding'
}
},
/**
* Creates the needed configuration files
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"scripts": {
"start": "nps",
"test": "npm start test",
"build": "npm start build"
"build": "npm start build",
"presetup": "yarn install",
"setup": "npm start setup.db"
},
"engines": {
"node": ">=8.0.0"
Expand Down