aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-23 06:18:56 -0500
committerGitHub <noreply@github.com>2024-02-23 11:18:56 +0000
commit8078e0ec7279916e56bdc8bab88ee7f1e1594425 (patch)
treea817e8aa6d8a8f3647e341c45a3cca5eebe44811 /docs
parent62ac615450ef8b96fa9dd90b8b4e7fe486cc77a6 (diff)
Package scripts update (#714)
* Update license-report commands * Rename build-libs * Update test-lint-js * Rename test-lint-json * Update test-lint-css * Rename test-lint-html * Update test-ts * Update test-code * Update test-build * Rename * Test JSON types * Distinguish JS tests from JSON tests * Add bench test * Test markdown * Add fast test option * Rename test:code * Describe scripts * Add test-build action * Add test:static-analysis * Update CI * Fix path * Fix missing type definition
Diffstat (limited to 'docs')
-rw-r--r--docs/development/npm-scripts.md86
1 files changed, 86 insertions, 0 deletions
diff --git a/docs/development/npm-scripts.md b/docs/development/npm-scripts.md
new file mode 100644
index 00000000..522be174
--- /dev/null
+++ b/docs/development/npm-scripts.md
@@ -0,0 +1,86 @@
+# npm Scripts
+
+This file documents the scripts available in the [package.json](../../package.json) file.
+Scripts can be executed by running `npm run <name>`.
+
+- `bench`
+ Runs performance benchmarks.
+
+- `build`
+ Builds packages for all of the primary build targets and outputs them to the builds folder in the root project directory.
+
+- `build:libs`
+ Rebuilds all of the third-party dependencies that the extension uses.
+
+- `test`
+ Runs all of the tests.
+
+- `test:fast`
+ Runs most of the tests that are used more frequently in the typical development process.
+
+- `test:static-analysis`
+ Runs all of the static analysis tests.
+
+- `test:js`
+ Runs [eslint](https://eslint.org/) on all of the JavaScript and TypeScript files in the project.
+
+- `test:json`
+ Runs all JSON tests.
+
+- `test:json:format`
+ Runs eslint on all of the JSON files in the project.
+
+- `test:json:types`
+ Performs type checking on all of the JSON files in the project.
+ Running this script often takes a long time since it has to validate a lot of files with complex types.
+
+- `test:css`
+ Runs [stylelint](https://stylelint.io/) on all of the CSS files in the project.
+
+- `test:html`
+ Runs [html-validate](https://html-validate.org/) on all of the HTML files in the project.
+
+- `test:md`
+ Runs [prettier](https://prettier.io/) on all of the Markdown files in the project.
+
+- `test:md:write`
+ Uses prettier to fix all issues it encounters with files.
+
+- `test:ts`
+ Runs [TypeScript](https://www.typescriptlang.org/) validation on all of the JavaScript and TypeScript files in the project.
+
+- `test:ts:main`
+ Runs [TypeScript](https://www.typescriptlang.org/) validation on the files in the [ext](../../ext/) folder.
+
+- `test:ts:dev`
+ Runs [TypeScript](https://www.typescriptlang.org/) validation on the files in the [dev](../../dev/) folder.
+
+- `test:ts:test`
+ Runs [TypeScript](https://www.typescriptlang.org/) validation on the files in the [test](../../test/) folder.
+
+- `test:ts:bench`
+ Runs [TypeScript](https://www.typescriptlang.org/) validation on the files in the [benches](../../benches/) folder.
+
+- `test:unit`
+ Runs all of the unit tests in the project using [vitest](https://vitest.dev/).
+
+- `test:unit:write`
+ Overwrites the expected test output data for some of the larger tests.
+ This usually only needs to be run when something modifies the format of dictionary entries or Anki data.
+
+- `test:unit:options`
+ Runs unit tests related to the extension's options and their upgrade process.
+
+- `test:build`
+ Performs a dry run of the build process without generating any files.
+
+- `license-report:html`
+ Generates a file containing license information about the third-party dependencies the extension uses.
+ The resulting file is located at ext/legal-npm.html.
+
+- `license-report:markdown`
+ Generates a Markdown table containing license information about the third-party dependencies the extension uses.
+ This table is located in the [README.md](../../README.md#third-party-libraries) file
+
+- `prepare`
+ Sets up [husky](https://typicode.github.io/husky/) for some git pre-commit tasks.