Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
update package.json (npm scripts); update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mallendeo committed May 28, 2019
1 parent 1831346 commit 704b8c2
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 7 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# jobs-common

Common helpers, configs, and constants used across the Jobs project

## Install
Expand All @@ -9,6 +10,10 @@ yarn add @chile-sh/jobs-common

## Env variables

`PG_HOST`, `PG_USER`, and `PG_PASS` are required to run migrations.

Other env variables should be inherited from outside.

```conf
NODE_ENV=development
RMQ_HOST=rabbitmq
Expand Down Expand Up @@ -40,6 +45,40 @@ aws_access_key_id=...
aws_secret_access_key=...
```

## Database

Use knex with:

```bash
yarn knex
```

e.g:
```bash
yarn knex seed:make getonbrd -x ts # use TypeScript
```

### Migrations

```bash
yarn db:migrate && yarn db:seed

yarn db:rollback
```

## Development

```bash
yarn global add yalc

yarn build && yalc publish
```

Then, on the external project:
```bash
yalc link @chile-sh/jobs-common
```

# License

GNU General Public License v3.0
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,29 @@
"build"
],
"scripts": {
"ts-node": "node -r tsconfig-paths/register -r ts-node/register",
"ts-node": "node -r dotenv/config -r ts-node/register",
"build": "rm -rvf build && tsc",
"test": "yarn lint",
"test:watch": "jest --watch",
"lint": "eslint 'src/**/*.@(ts|js|tsx|jsx)'",
"lint:fix": "yarn lint --fix",
"version": "yarn build && git add build"
"version": "yarn build && git add build",
"knex": "yarn ts-node node_modules/.bin/knex --cwd src --knexfile knexfile.ts",
"db:migrate": "yarn knex migrate:latest",
"db:rollback": "yarn knex migrate:rollback",
"db:seed": "yarn knex seed:run"
},
"devDependencies": {
"@chile-sh/eslint-config-ts": "^2.2.2",
"@types/got": "^9.4.4",
"@types/ioredis": "^4.0.10",
"@types/jest": "^24.0.12",
"@types/lodash": "^4.14.123",
"@types/node": "^12.0.0",
"@types/node": "^12.0.2",
"@types/winston": "^2.4.4",
"@typescript-eslint/eslint-plugin": "^1.7.0",
"@typescript-eslint/parser": "^1.7.0",
"dotenv": "^8.0.0",
"eslint": "^5.16.0",
"eslint-config-prettier": "^4.2.0",
"eslint-plugin-prettier": "^3.0.1",
Expand Down
13 changes: 9 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.30.tgz#f6c38b7ecbbf698b0bbd138315a0f0f18954f85f"
integrity sha512-OftRLCgAzJP7vmKn9by/GVjnf4hloz/pXNOwPo0vKGAfXI7GqWXJi9N2kRar4cP5s1dGwuwcagWqO6iHBTq1Mg==

"@types/node@*", "@types/node@^12.0.0":
"@types/node@*", "@types/node@^12.0.2":
version "12.0.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.2.tgz#3452a24edf9fea138b48fad4a0a028a683da1e40"
integrity sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==
Expand Down Expand Up @@ -1153,9 +1153,9 @@ copy-descriptor@^0.1.0:
integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=

core-js@^2.6.5:
version "2.6.7"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.7.tgz#c2b19af9b50ec49c356ee087d6155632a889e968"
integrity sha512-ydmsQxDVH7lDpYoirXft8S83ddKKfdsrsmWhtyj7xafXVLbLhKOyfD7kAi2ueFfeP7m9rNavjW59O3hLLzzC5A==
version "2.6.8"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.8.tgz#dc3a1e633a04267944e0cb850d3880f340248139"
integrity sha512-RWlREFU74TEkdXzyl1bka66O3kYp8jeTXrvJZDzVVMH8AiHUSOFpL1yfhQJ+wHocAm1m+4971W1PPzfLuCv1vg==

[email protected], core-util-is@~1.0.0:
version "1.0.2"
Expand Down Expand Up @@ -1346,6 +1346,11 @@ domexception@^1.0.1:
dependencies:
webidl-conversions "^4.0.2"

dotenv@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.0.0.tgz#ed310c165b4e8a97bb745b0a9d99c31bda566440"
integrity sha512-30xVGqjLjiUOArT4+M5q9sYdvuR4riM6yK9wMcas9Vbp6zZa+ocC9dp6QoftuhTPhFAiLK/0C5Ni2nou/Bk8lg==

duplexer3@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
Expand Down

0 comments on commit 704b8c2

Please sign in to comment.