diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ee2f7094..e690111c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ These issues may need more input before becoming dev-ready and will be labelled Once you have have found an issue you feel comfortable working on, leave a comment in that issue that you'd like to tackle it. We'll label the issue as being in progress to make sure others don't work on it as well. -If this is your first time contributing to open-source or you need a refresher, see this [great guide](https://github.com/firstcontributions/first-contributions#first-contributions] that goes through the steps of contributing to an open-source project. +If this is your first time contributing to open-source or you need a refresher, see this [contributing guide](https://github.com/firstcontributions/first-contributions#first-contributions) that goes through the steps of contributing to an open-source project. ## 3. Create a Pull Request (PR) diff --git a/README.md b/README.md index 93bc95f3..4890fbf5 100644 --- a/README.md +++ b/README.md @@ -54,13 +54,20 @@ To run the same command in _all_ workspaces, use `yarn workspaces`. For instance yarn workspaces run test ``` -Typing out the full workspace name can get tedious. You can place aliases in your `.bashrc` or `.profile` to save time: +Typing out the full workspace name can get tedious. We've added some convenient scripts to run commands on a specific package: + +- `yarn common`: runs the command in the common package +- `yarn server`: runs the command in the server package +- `yarn types`: runs the command in the types package +- `yarn web`: runs the command in the web package + +For example, to run tests only for the web package, you can run: ```console -alias @uw="yarn workspace @upswyng/web " +yarn web test ``` -Now you only need `@uw start` to start the web dev server. +The above is the equivalent of `yarn workspace @upswyng/web test`. ### Running tests diff --git a/package.json b/package.json index 6ec3af76..38b6526b 100644 --- a/package.json +++ b/package.json @@ -80,19 +80,23 @@ "name": "upswyng", "private": true, "scripts": { - "build:local-packages": "yarn workspace @upswyng/types build && yarn workspace @upswyng/common build", - "build:server": "yarn build:local-packages && yarn workspace @upswyng/server build", - "build:web": "yarn build:local-packages && yarn workspace @upswyng/web build", + "build:local-packages": "yarn types build && yarn common build", + "build:server": "yarn build:local-packages && yarn server build", + "build:web": "yarn build:local-packages && yarn web build", "build:local-db": "docker-compose up --build -d && npm run restore:db", "restore:db": "mongorestore --port 27018 --username upswyng-dev-user --password upswyng123 -d upswyng-dev ./packages/server/localdb/mongodump", "clean": "node clean.js", + "common": "yarn workspace @upswyng/common", "reset": "node clean.js --reset && docker compose down -v", "heroku-postbuild": "yarn build:web && yarn build:server", "lint": "tsc --noEmit && eslint \"packages/**/src/**/*.{js,jsx,ts,tsx}\" --fix", "lint:ci": "tsc --noEmit && eslint \"packages/**/src/**/*.{js,jsx,ts,tsx}\" --quiet", - "test": "concurrently -n common,server -c yellow,blue \"yarn workspace @upswyng/common test:unit\" \"yarn workspace @upswyng/server test\" && yarn workspace @upswyng/web test", - "test:ci": "concurrently -n common,server -c yellow,blue \"yarn workspace @upswyng/common test:unit\" \"yarn workspace @upswyng/server test\" --kill-others-on-fail && yarn workspace @upswyng/web test", - "start:local": "./start_local.sh" + "test": "concurrently -n common,server -c yellow,blue \"yarn common test:unit\" \"yarn server test\" && yarn web test", + "test:ci": "concurrently -n common,server -c yellow,blue \"yarn common test:unit\" \"yarn server test\" --kill-others-on-fail && yarn web test", + "start:local": "./start_local.sh", + "server": "yarn workspace @upswyng/server", + "types": "yarn workspace @upswyng/types", + "web": "yarn workspace @upswyng/web" }, "version": "0.1.0", "workspaces": [