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

Commit

Permalink
Welcome back Yarn, Close #1633
Browse files Browse the repository at this point in the history
  • Loading branch information
steida committed Feb 1, 2019
1 parent 269a0c5 commit 89474c1
Show file tree
Hide file tree
Showing 7 changed files with 9,585 additions and 12,382 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ jobs:
working_directory: ~/repo
steps:
- checkout
- run: npm install
- run: npm run env dev
- run: npm test
- run: yarn
- run: yarn env dev
- run: yarn test
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,34 @@

- [nodejs.org](http://nodejs.org/)
- [docker-compose](https://www.docker.com/products/docker-engine)
- [yarnpkg.com](https://yarnpkg.com/en/)

## Setup project

- `git clone https://github.com/este/este`
- `cd este`
- `npm install`
- `npm run docker:up`
- `npm run prisma:deploy`
- `npm run env dev`
- `yarn`
- `yarn docker:up`
- `yarn prisma:deploy`
- `yarn env dev`

## Tasks

- `npm run dev` start development
- `npm run prisma:deploy` after `prisma/datamodel.graphql` change
- `npm run gen:api` after `api/schema.graphql` change
- `npm run prisma delete` get rid of the whole service
- `npm run env dev` copy `.env.dev` to `.env`
- `npm run env prod` copy `.env.prod` to `.env`
- `npm test` before commit
- `npm run deploy` deploy to https://name-xxxxxxxxx.now.sh
- `npm run deploy && now alias` deploy to aliased custom domain
- `yarn dev` start development
- `yarn prisma:deploy` after `prisma/datamodel.graphql` change
- `yarn gen:api` after `api/schema.graphql` change
- `yarn prisma delete` get rid of the whole service
- `yarn env dev` copy `.env.dev` to `.env`
- `yarn env prod` copy `.env.prod` to `.env`
- `yarn test` before commit
- `yarn deploy` deploy to <https://name-xxxxxxxxx.now.sh>
- `yarn deploy && now alias` deploy to aliased custom domain

## Tips

- `npm run dev`, then open [localhost:5000/playground](http://localhost:5000/playground) and set HTTP HEADERS to `{ "Authorization": "Bearer token" }`. Token is browser cookie for api and `npm run prisma token` for db.
- After `prisma/docker-compose.yml` change, run `npm run docker:up`
- To deploy local Prisma to demo server, set up Prisma with demo database, and put its endpoint to .env.prod (copy paste of .env.dev), then `npm run env prod`, then `npm run prisma:deploy`.
- `yarn dev`, then open [localhost:5000/playground](http://localhost:5000/playground) and set HTTP HEADERS to `{ "Authorization": "Bearer token" }`. Token is browser cookie for api and `yarn prisma token` for db.
- After `prisma/docker-compose.yml` change, run `yarn docker:up`
- To deploy local Prisma to demo server, set up Prisma with demo database, and put its endpoint to .env.prod (copy paste of .env.dev), then `yarn env prod`, then `yarn prisma:deploy`.

## Links

Expand Down
2 changes: 1 addition & 1 deletion api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Context, User } from './types';
const { PRISMA_ENDPOINT, PRISMA_SECRET, API_SECRET } = process.env;

if (!PRISMA_ENDPOINT || !PRISMA_SECRET || !API_SECRET)
throw Error(`Did you run 'npm run env dev'?`);
throw Error(`Did you run 'yarn env dev'?`);

const db = new Prisma({ endpoint: PRISMA_ENDPOINT, secret: PRISMA_SECRET });

Expand Down

0 comments on commit 89474c1

Please sign in to comment.