Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Make npm commands used for development uniform #775

Merged
merged 8 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions docs/development-workflows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Developer Workflows

This documentation provides the commands necessary for developing the extension and CLI packages.

## Extension Workflows

### Development Mode

To run the extension in development mode for continuous changes only for the extension package, use:
```bash
npm run webpack:dev:ext
```

If you are making continuous changes in the extension or any packages it depends on, use:
```bash
npm run dev:ext
```

### Build Extension

To build the extension after making changes, use:
```bash
npm run build:ext
```

## CLI Workflows

### Development Mode

To run the CLI in development mode for continuous changes only for the cli package, use:
```bash
npm run webpack:dev:cli
```

If you are making continuous changes in the CLI or any packages it relies on, use:
```bash
npm run dev:cli
```

### Build CLI

After making changes in the `cli`, `cli-dashboard`, or any CLI-related packages, use:
```bash
npm run build:cli
```

## Build Workflows

### TypeScript Packages

To build all TypeScript packages together, use:
```bash
npm run build:tsc-packages
```

### Individual Packages

To build individual packages, use the following syntax:
```bash
npm run build:[package-name]
```

### All Packages

To build all packages together, use:
```bash
npm run build:all
```

## Update the Cookie Database

Any changes to the cookie database need to be updated before a release. To update the cookie database, use:
```bash
npm run cookie-db:update
```
57 changes: 24 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,36 @@
"description": "Cookie Analysis Tool and CLI for analysis and understanding of cookie usage on web pages.",
"scripts": {
"build-storybook": "storybook build",
"build:all": "npm-run-all **:build ",
"tsc-packages:build": "npm run i18n:build && npm run common:build && npm run design-system:build && npm run library-detection:build && npm run analysis-utils:build",
"tsc-packages:dev": "run-p i18n:dev common:dev design-system:dev library-detection:dev analysis-utils:dev",
"build:all": "run-p build:cli build:ext",
"build:tsc-packages": "npm run build:i18n && npm run build:common && npm run build:design-system && npm run build:library-detection && npm run build:analysis-utils",
"dev:tsc-packages": "run-p dev:i18n dev:common dev:design-system dev:library-detection dev:analysis-utils",
"publish:all:local": "npm run build:all && npm run publish:local --workspaces",
"unpublish:all:local": "npm run unpublish:local --workspaces",
"publish:all:remote": "npm run build:all && npm run publish:remote --workspaces",
"unpublish:all:remote": "npm run unpublish:remote --workspaces",
"i18n:prebuild": "npm run build:remove -w @google-psat/i18n",
"i18n:build": "npm run i18n:prebuild && npm run build -w @google-psat/i18n",
"i18n:dev": "npm run dev -w @google-psat/i18n",
"common:prebuild": "npm run build:remove -w @google-psat/common",
"common:build": "npm run common:prebuild && npm run build -w @google-psat/common",
"common:dev": "npm run dev -w @google-psat/common",
"design-system:prebuild": "npm run build:remove -w @google-psat/design-system",
"design-system:build": "npm run design-system:prebuild && npm run build -w @google-psat/design-system",
"design-system:dev": "npm run dev -w @google-psat/design-system",
"library-detection:prebuild": "npm run build:remove -w @google-psat/library-detection",
"library-detection:build": "npm run library-detection:prebuild && npm run build -w @google-psat/library-detection",
"library-detection:dev": "npm run dev -w @google-psat/library-detection",
"analysis-utils:prebuild": "npm run build:remove -w @google-psat/analysis-utils",
"analysis-utils:dev": "npm run dev -w @google-psat/analysis-utils",
"analysis-utils:build": "npm run analysis-utils:prebuild && npm run build -w @google-psat/analysis-utils",
"cli:predev": "npm run dev -w @google-psat/cli",
"cli:dev": "run-p tsc-packages:dev cli:predev",
"cli:prebuild": "npm run build:remove -w @google-psat/cli",
"build:cli": "npm run tsc-packages:build && npm run cli:prebuild && cross-env NODE_ENV=production npm run build -w @google-psat/cli",
"build-cli": "npm run build:cli && npm run cli-dashboard:build",
"cli:start": "npm install && npm run cli:dev",
"build:i18n": "npm run build -w @google-psat/i18n",
"dev:i18n": "npm run dev -w @google-psat/i18n",
"build:common": "npm run build -w @google-psat/common",
"dev:common": "npm run dev -w @google-psat/common",
"build:design-system": "npm run build -w @google-psat/design-system",
"dev:design-system": "npm run dev -w @google-psat/design-system",
"build:library-detection": "npm run build -w @google-psat/library-detection",
"dev:library-detection": "npm run dev -w @google-psat/library-detection",
"build:analysis-utils": "npm run build -w @google-psat/analysis-utils",
"dev:analysis-utils": "npm run dev -w @google-psat/analysis-utils",
"webpack:dev:cli": "npm run dev -w @google-psat/cli",
"dev:cli": "run-p dev:tsc-packages webpack:dev:cli",
"build:cli": "npm run build:tsc-packages && cross-env NODE_ENV=production npm run build -w @google-psat/cli",
"build:cli:dashboard": "run-p build:cli build:cli-dashboard",
"cli": "node packages/cli/dist/main.js",
"report:dev": "npm run dev -w @google-psat/report",
"cli-dashboard:dev": "npm run dev -w @google-psat/cli-dashboard",
"cli-dashboard:prebuild": "npm run build:remove -w @google-psat/cli-dashboard",
"cli-dashboard:build": "npm run cli-dashboard:prebuild && cross-env NODE_ENV=production npm run build -w @google-psat/cli-dashboard",
"build:report": "npm run dev -w @google-psat/report",
"dev:report": "npm run dev -w @google-psat/report",
"dev:cli-dashboard": "npm run dev -w @google-psat/cli-dashboard",
"build:cli-dashboard": "cross-env NODE_ENV=production npm run build -w @google-psat/cli-dashboard",
"cookie-db:update": "node scripts/update-cookie-db.cjs",
"ext:predev":"npm run dev -w @google-psat/extension",
"ext:dev": "run-p tsc-packages:dev ext:predev",
"ext:prebuild": "npm run build:remove -w @google-psat/extension",
"build:ext": "npm run tsc-packages:build && npm run ext:prebuild && cross-env NODE_ENV=production npm run build -w @google-psat/extension",
"ext:start": "npm install && npm run ext:dev",
"webpack:dev:ext":"npm run dev -w @google-psat/extension",
"dev:ext": "run-p dev:tsc-packages webpack:dev:ext",
"build:ext": "npm run build:tsc-packages && cross-env NODE_ENV=production npm run build -w @google-psat/extension",
"lint": "npm-run-all --parallel lint:*",
"lint:js": "eslint .",
"lint:types": "tsc ",
Expand Down
2 changes: 1 addition & 1 deletion packages/analysis-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"scripts": {
"build": "tsc",
"dev": "tsc-watch",
"build:remove": "rimraf dist dist-types tsconfig.tsbuildinfo",
"prebuild": "rimraf dist dist-types tsconfig.tsbuildinfo",
"publish:local": "npm publish --registry=http://localhost:4873",
"publish:remote": "npm publish --access=public --registry=https://registry.npmjs.org",
"unpublish:local": "npm unpublish --registry=http://localhost:4873 --force",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts": {
"dev": "webpack serve --config ../../dashboard.webpack.config.cjs --open --port 8085",
"build": "webpack --config ../../dashboard.webpack.config.cjs",
"build:remove": "rimraf dist",
"prebuild": "rimraf dist dist-types tsconfig.tsbuildinfo",
"publish:local": "npm publish --registry=http://localhost:4873",
"publish:remote": "npm publish --access=public --registry=https://registry.npmjs.org",
"unpublish:local": "npm unpublish --registry=http://localhost:4873 --force",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"build": "webpack --config ../../cli.webpack.config.cjs ",
"dev": "webpack --config ../../cli.webpack.config.cjs --watch",
"build:remove": "rimraf dist dist-types tsconfig.tsbuildinfo",
"prebuild": "rimraf dist dist-types tsconfig.tsbuildinfo",
"publish:local": "npm publish --registry=http://localhost:4873",
"publish:remote": "npm publish --access=public --registry=https://registry.npmjs.org",
"unpublish:local": "npm unpublish --registry=http://localhost:4873 --force",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"build": "tsc",
"dev": "tsc-watch",
"build:remove": "rimraf dist dist-types tsconfig.tsbuildinfo",
"prebuild": "rimraf dist dist-types tsconfig.tsbuildinfo",
"publish:local": "npm publish --registry=http://localhost:4873",
"publish:remote": "npm publish --access=public --registry=https://registry.npmjs.org",
"unpublish:local": "npm unpublish --registry=http://localhost:4873 --force",
Expand Down
2 changes: 1 addition & 1 deletion packages/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"build": "tsc",
"dev": "tsc-watch",
"build:remove": "rimraf dist dist-types tsconfig.tsbuildinfo",
"prebuild": "rimraf dist dist-types tsconfig.tsbuildinfo",
"publish:local": "npm publish --registry=http://localhost:4873",
"publish:remote": "npm publish --access=public --registry=https://registry.npmjs.org",
"unpublish:local": "npm unpublish --registry=http://localhost:4873 --force",
Expand Down
4 changes: 2 additions & 2 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"license": "Apache-2.0",
"scripts": {
"dev": "webpack --config ../../extension.webpack.config.cjs --watch",
"build": "npm run build:remove && webpack --config ../../extension.webpack.config.cjs",
"build:remove": "rimraf ../../dist/extension",
"prebuild": "rimraf ../../dist/extension",
"build": "webpack --config ../../extension.webpack.config.cjs",
"publish:local": "",
"publish:remote": "",
"unpublish:local": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"build": "tsc --build",
"dev": "tsc-watch --build",
"build:remove": "rimraf dist dist-types tsconfig.tsbuildinfo",
"prebuild": "rimraf dist dist-types tsconfig.tsbuildinfo",
"publish:local": "npm publish --registry=http://localhost:4873",
"publish:remote": "npm publish --access=public --registry=https://registry.npmjs.org",
"unpublish:local": "npm unpublish --registry=http://localhost:4873 --force",
Expand Down
2 changes: 1 addition & 1 deletion packages/library-detection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"scripts": {
"build": "tsc",
"dev": "tsc-watch",
"build:remove": "rimraf dist dist-types tsconfig.tsbuildinfo",
"prebuild": "rimraf dist dist-types tsconfig.tsbuildinfo",
"publish:local": "npm publish --registry=http://localhost:4873",
"publish:remote": "npm publish --access=public --registry=https://registry.npmjs.org",
"unpublish:local": "npm unpublish --registry=http://localhost:4873 --force",
Expand Down
Loading