Skip to content

Commit

Permalink
chore: Rename development scripts from "start" to "dev"
Browse files Browse the repository at this point in the history
This is more descriptive and more inline with most developers'
expectations.
  • Loading branch information
michaelbromley committed Oct 16, 2024
1 parent 2a8c17e commit 54f6c7c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ you need to run the `postgres_16` container and then run `DB=postgres npm run po

```
cd packages/dev-server
[DB=mysql|postgres|sqlite] npm run start
[DB=mysql|postgres|sqlite] npm run dev
```

### Testing admin ui changes locally

If you are making changes to the admin ui, you need to start the admin ui independent from the dev-server:

1. `cd packages/admin-ui`
2. `npm run start`
2. `npm run dev`
3. Go to http://localhost:4200 and log in with "superadmin", "superadmin"

This will auto restart when you make changes to the admin ui. You don't need this step when you just use the admin ui just
Expand Down Expand Up @@ -137,7 +137,7 @@ npm run watch:core-common
```shell
# Terminal 2
cd packages/dev-server
DB=sqlite npm run start
DB=sqlite npm run dev
```

3. The dev-server will now have your local changes from the changed package.
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"docs:build": "npm run docs:generate-typescript-docs && npm run docs:generate-graphql-docs",
"codegen": "tsc -p scripts/codegen/plugins && ts-node scripts/codegen/generate-graphql-types.ts",
"version": "npm run check-imports && npm run check-angular-versions && npm run build && npm run check-core-type-defs && npm run generate-changelog && git add CHANGELOG* && git add */version.ts",
"dev-server:start": "cd packages/dev-server && npm run start",
"test": "lerna run test --stream --no-bail",
"e2e": "lerna run e2e --stream --no-bail",
"build": "lerna run build",
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ This report data is also saved to the [i18n-coverage.json](./i18n-coverage.json)

To add support for a new language, create a new empty json file (`{}`) in the `i18n-messages` directory named `<languageCode>.json`, where `languageCode` is one of the supported codes as given in the [LanguageCode enum type](../core/src/api/schema/common/language-code.graphql), then run `npm run extract-translations`

To verify localization changes add `<languageCode>.json` to `./src/lib/static/vendure-ui-config.json` in the array `availableLanguages`. This will make the localization available in Admin UI development mode using `npm run start`
To verify localization changes add `<languageCode>.json` to `./src/lib/static/vendure-ui-config.json` in the array `availableLanguages`. This will make the localization available in Admin UI development mode using `npm run dev`

2 changes: 1 addition & 1 deletion packages/admin-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "GPL-3.0-or-later",
"scripts": {
"ng": "ng",
"start": "node scripts/set-version.js && ng serve",
"dev": "node scripts/set-version.js && ng serve",
"build:app": "ng build vendure-admin --configuration production",
"build": "node scripts/copy-package-json.js && node scripts/set-version.js && node scripts/build-public-api.js && ng build vendure-admin-lib --configuration production && node scripts/compile-styles.js",
"watch": "ng build --watch=true",
Expand Down
19 changes: 11 additions & 8 deletions packages/dev-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ This package is not published to npm. It is used in development of the Vendure s

### Running

To run the server, run the `start` script. The database configuration can be specified by the `DB=<type>` environment variable:
Ensure you have a database running. From the root directory, run:

```bash
DB=mysql npm run start
DB=postgres npm run start
DB=sqlite npm run start
docker-compose up -d mariadb
```

To run the server, run the `dev` script. The database configuration can be specified by the `DB=<type>` environment variable:

```bash
cd packages/dev-server

[DB=mysql|postgres|sqlite] npm run dev
```

The default if no db is specified is mysql.
Expand All @@ -21,7 +27,7 @@ Test data can be populated by running the `populate` script. This uses the same
Specify the database as above to populate that database:

```bash
DB=sqlite npm run populate
[DB=mysql|postgres|sqlite] npm run populate
```

## Testing custom ui extension compilation
Expand All @@ -35,9 +41,6 @@ the [temporary admin ui `tsconfig.json`](./custom-admin-ui/tsconfig.json) file:
}
```




## Load testing

This package also contains scripts for load testing the Vendure server. The load testing infrastructure and scripts are located in the [`./load-testing`](./load-testing) directory.
Expand Down
6 changes: 3 additions & 3 deletions packages/dev-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"private": true,
"scripts": {
"populate": "node -r ts-node/register -r dotenv/config populate-dev-server.ts",
"run:server": "node -r ts-node/register -r dotenv/config index.ts",
"run:worker": "node -r ts-node/register -r dotenv/config index-worker.ts",
"start": "concurrently npm:run*",
"dev:server": "node -r ts-node/register -r dotenv/config index.ts",
"dev:worker": "node -r ts-node/register -r dotenv/config index-worker.ts",
"dev": "concurrently npm:dev*",
"load-test:1k": "node -r ts-node/register load-testing/run-load-test.ts 1000",
"load-test:10k": "node -r ts-node/register load-testing/run-load-test.ts 10000",
"load-test:100k": "node -r ts-node/register load-testing/run-load-test.ts 100000"
Expand Down

0 comments on commit 54f6c7c

Please sign in to comment.