Browse Source

chore: Update readme with correct build instructions

Michael Bromley 6 years ago
parent
commit
12fed34d2a
3 changed files with 25 additions and 13 deletions
  1. 1 2
      .travis.yml
  2. 22 7
      README.md
  3. 2 4
      package.json

+ 1 - 2
.travis.yml

@@ -12,8 +12,7 @@ cache: yarn
 
 install:
   - yarn install
-  - yarn bootstrap
-  - cd admin-ui && yarn install && cd ..
+  - yarn bootstrap && cd ..
 
 script:
   - yarn lerna run build

+ 22 - 7
README.md

@@ -38,21 +38,36 @@ The root directory has a `package.json` which contains build-related dependencie
 
 This runs the Lerna "bootstrap" command, which installs dependencies for all packages.
 
-### 2. Set up the server
+### 3. Build all packages
+
+`yarn build`
+
+Packages must be built (i.e. TypeScript compiled, admin ui app built, certain assets copied etc.) before being used.
+
+Note that this can take a few minutes.
+
+### 4. Set up the server
 
 The server requires an SQL database to be available. I am currently using [bitnami-docker-phpmyadmin](https://github.com/bitnami/bitnami-docker-phpmyadmin) Docker image,
 which is MariaDB including phpMyAdmin. However, the simplest option is to use SQLite.
 
 Vendure uses [TypeORM](http://typeorm.io), so it compatible will any database which works with TypeORM.
 
-1. Configure the [dev config](./packages/dev-server/dev-config.ts)
-2. Create the database using your DB admin tool of choice (e.g. phpMyAdmin if you are using the docker image suggested above). Name it according to the config ("vendure-dev").
-3. Populate mock data with `yarn dev-server:populate`
-4. `yarn dev-server` to start the server
+1. Configure the [dev config](./packages/dev-server/dev-config.ts), making sure the connection settings in the `getDbConfig()` function are correct for the database type you will be using.
+2. Create the database using your DB admin tool of choice (e.g. phpMyAdmin if you are using the docker image suggested above). Name it according to the `getDbConfig()` settings. If you are using SQLite, you can skip this step.
+3. Populate mock data with `yarn dev-server:populate --db=<mysql|postgres|sqlite>`. If you do not specify the `db` argument, it will default to "mysql".
+
+### 5. Run the dev server
+
+```
+yarn dev-server:start --db=<mysql|postgres|sqlite>
+```
+
+ If you do not specify the `db` argument, it will default to "mysql".
 
-### 3. Set up the admin ui
+### 6. Launch the admin ui
 
-1. `cd admin-ui && yarn`
+1. `cd admin-ui`
 2. `yarn start`
 3. Go to http://localhost:4200 and log in with "superadmin", "superadmin"
 

+ 2 - 4
package.json

@@ -4,7 +4,7 @@
   "private": true,
   "scripts": {
     "core:watch": "concurrently -n tsc,gulp,common \"cd packages/core && yarn tsc:watch\" \"cd packages/core && yarn gulp:watch\" \"cd packages/common && yarn watch\"",
-    "bootstrap": "lerna bootstrap",
+    "bootstrap": "lerna bootstrap && cd admin-ui && yarn",
     "docs:watch": "concurrently -n docgen,hugo,webpack -c green,blue,cyan \"yarn generate-graphql-docs && yarn generate-typescript-docs -w\" \"cd docs && hugo server\" \"cd docs && yarn webpack -w\"",
     "docs:build": "yarn generate-graphql-docs && yarn generate-typescript-docs && cd docs && yarn webpack --prod && node build.js && hugo",
     "docs:deploy": "cd docs && yarn && cd .. && yarn docs:build",
@@ -17,9 +17,7 @@
     "precommit": "lint-staged",
     "postcommit": "git update-index --again",
     "prepush": "yarn test:all && cd admin-ui && yarn build --prod",
-    "dev-server:mysql": "cd packages/dev-server && yarn start --db=mysql",
-    "dev-server:postgres": "cd packages/dev-server && yarn start --db=postgres",
-    "dev-server:sqlite": "cd packages/dev-server && yarn start --db=sqlite",
+    "dev-server:start": "cd packages/dev-server && yarn start",
     "dev-server:populate": "cd packages/dev-server && yarn populate",
     "test:all": "cd admin-ui && yarn test --watch=false --browsers=ChromeHeadlessCI --progress=false && cd ../ && yarn test:common && yarn test:core && yarn test:email-plugin && yarn test:e2e",
     "test:common": "jest --config packages/common/jest.config.js",