virmator 12.0.3 → 13.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +224 -129
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +21 -5
- package/dist/index.d.ts +1416 -1310
- package/dist/index.js +25 -63
- package/dist/tests/test-virmator.mock.d.ts +3 -0
- package/dist/tests/test-virmator.mock.js +5 -0
- package/package.json +25 -69
- package/src/cli.ts +29 -0
- package/src/index.ts +26 -0
- package/src/tests/test-virmator.mock.ts +13 -0
- package/base-configs/base-cspell.js +0 -272
- package/base-configs/base-mocharc.cjs +0 -20
- package/base-configs/base-nyc.js +0 -40
- package/base-configs/base-prettierrc.js +0 -32
- package/base-configs/base-web-test-runner.mjs +0 -137
- package/base-configs/test-files-glob.js +0 -13
- package/base-configs/tsconfig.base.json +0 -32
- package/configs/.gitattributes +0 -2
- package/configs/.github/workflows/build-for-gh-pages.yml +0 -24
- package/configs/.github/workflows/tagged-release.yml +0 -41
- package/configs/.github/workflows/tests.yml +0 -25
- package/configs/.nvmrc +0 -1
- package/configs/.prettierignore +0 -11
- package/configs/.prettierrc.js +0 -13
- package/configs/.vscode/settings.json +0 -50
- package/configs/LICENSE-CC0 +0 -121
- package/configs/LICENSE-MIT +0 -21
- package/configs/configs/dep-cruiser.config.ts +0 -22
- package/configs/configs/mocha.config.cjs +0 -8
- package/configs/configs/ncu.config.ts +0 -12
- package/configs/configs/nyc.config.js +0 -7
- package/configs/configs/typedoc.config.ts +0 -20
- package/configs/configs/vite.config.ts +0 -14
- package/configs/configs/web-test-runner.config.mjs +0 -21
- package/configs/cspell.config.cjs +0 -11
- package/configs/dep-cruiser.config.ts +0 -22
- package/configs/gitignore.txt +0 -13
- package/configs/ncu.config.ts +0 -13
- package/configs/npmignore.txt +0 -26
- package/configs/package.json +0 -23
- package/configs/src/index.html +0 -12
- package/configs/src/ui/elements/vir-app.element.ts +0 -10
- package/configs/tsconfig.json +0 -16
- package/configs/www-static/_redirects +0 -1
- package/configs/www-static/index.css +0 -7
- package/cspell.config.cjs +0 -13
- package/dist/api/command/command-configs.d.ts +0 -3
- package/dist/api/command/command-configs.js +0 -10
- package/dist/api/command/command-description.d.ts +0 -8
- package/dist/api/command/command-description.js +0 -2
- package/dist/api/command/command-executor.d.ts +0 -30
- package/dist/api/command/command-executor.js +0 -6
- package/dist/api/command/command-help.d.ts +0 -8
- package/dist/api/command/command-help.js +0 -2
- package/dist/api/command/command-logging.d.ts +0 -11
- package/dist/api/command/command-logging.js +0 -17
- package/dist/api/command/command-mapping.d.ts +0 -7
- package/dist/api/command/command-mapping.js +0 -9
- package/dist/api/command/command-messages.d.ts +0 -1
- package/dist/api/command/command-messages.js +0 -9
- package/dist/api/command/command-to-help-message.d.ts +0 -9
- package/dist/api/command/command-to-help-message.js +0 -175
- package/dist/api/command/define-command-inputs.d.ts +0 -22
- package/dist/api/command/define-command-inputs.js +0 -8
- package/dist/api/command/define-command.d.ts +0 -22
- package/dist/api/command/define-command.js +0 -41
- package/dist/api/config/config-file-definition.d.ts +0 -15
- package/dist/api/config/config-file-definition.js +0 -2
- package/dist/api/config/config-paths.d.ts +0 -7
- package/dist/api/config/config-paths.js +0 -7
- package/dist/api/config/copy-config.d.ts +0 -27
- package/dist/api/config/copy-config.js +0 -98
- package/dist/api/create-virmator.d.ts +0 -8
- package/dist/api/create-virmator.js +0 -67
- package/dist/api/run-command/check-npm-deps.d.ts +0 -8
- package/dist/api/run-command/check-npm-deps.js +0 -111
- package/dist/api/run-command/extract-arguments.d.ts +0 -6
- package/dist/api/run-command/extract-arguments.js +0 -36
- package/dist/api/run-command/run-command-executor.d.ts +0 -5
- package/dist/api/run-command/run-command-executor.js +0 -50
- package/dist/api/run-command/run-extended-virmator.d.ts +0 -10
- package/dist/api/run-command/run-extended-virmator.js +0 -53
- package/dist/api/run-command/run-shell-command.d.ts +0 -8
- package/dist/api/run-command/run-shell-command.js +0 -21
- package/dist/api/virmator-types.d.ts +0 -18
- package/dist/api/virmator-types.js +0 -2
- package/dist/augments/array.d.ts +0 -1
- package/dist/augments/array.js +0 -6
- package/dist/augments/console.d.ts +0 -9
- package/dist/augments/console.js +0 -43
- package/dist/augments/fs.d.ts +0 -11
- package/dist/augments/fs.js +0 -71
- package/dist/augments/git.d.ts +0 -1
- package/dist/augments/git.js +0 -12
- package/dist/augments/json.d.ts +0 -1
- package/dist/augments/json.js +0 -11
- package/dist/augments/npm.d.ts +0 -11
- package/dist/augments/npm.js +0 -52
- package/dist/augments/object.d.ts +0 -4
- package/dist/augments/object.js +0 -44
- package/dist/augments/path.d.ts +0 -1
- package/dist/augments/path.js +0 -12
- package/dist/augments/prettier.d.ts +0 -1
- package/dist/augments/prettier.js +0 -52
- package/dist/augments/regexp.d.ts +0 -1
- package/dist/augments/regexp.js +0 -6
- package/dist/augments/string.d.ts +0 -2
- package/dist/augments/string.js +0 -9
- package/dist/augments/type.d.ts +0 -1
- package/dist/augments/type.js +0 -2
- package/dist/augments/typescript-config-file.d.ts +0 -5
- package/dist/augments/typescript-config-file.js +0 -62
- package/dist/commands/compile.command.d.ts +0 -84
- package/dist/commands/compile.command.js +0 -58
- package/dist/commands/deps.command.d.ts +0 -144
- package/dist/commands/deps.command.js +0 -208
- package/dist/commands/docs.command.d.ts +0 -99
- package/dist/commands/docs.command.js +0 -192
- package/dist/commands/extra-configs/all-extra-configs.d.ts +0 -2
- package/dist/commands/extra-configs/all-extra-configs.js +0 -71
- package/dist/commands/extra-configs/combine-json-config.d.ts +0 -2
- package/dist/commands/extra-configs/combine-json-config.js +0 -21
- package/dist/commands/extra-configs/combine-text-config.d.ts +0 -2
- package/dist/commands/extra-configs/combine-text-config.js +0 -26
- package/dist/commands/extra-configs/create-default-package-json.d.ts +0 -1
- package/dist/commands/extra-configs/create-default-package-json.js +0 -86
- package/dist/commands/format.command.d.ts +0 -215
- package/dist/commands/format.command.js +0 -157
- package/dist/commands/frontend.command.d.ts +0 -149
- package/dist/commands/frontend.command.js +0 -140
- package/dist/commands/init.command.d.ts +0 -163
- package/dist/commands/init.command.js +0 -53
- package/dist/commands/publish.command.d.ts +0 -33
- package/dist/commands/publish.command.js +0 -193
- package/dist/commands/spellcheck.command.d.ts +0 -74
- package/dist/commands/spellcheck.command.js +0 -60
- package/dist/commands/test-web.command.d.ts +0 -189
- package/dist/commands/test-web.command.js +0 -125
- package/dist/commands/test.command.d.ts +0 -224
- package/dist/commands/test.command.js +0 -100
- package/dist/commands/update-configs.command.d.ts +0 -33
- package/dist/commands/update-configs.command.js +0 -35
- package/dist/compiled-base-configs/base-dep-cruiser.config.d.ts +0 -195
- package/dist/compiled-base-configs/base-dep-cruiser.config.js +0 -206
- package/dist/compiled-base-configs/base-ncu.d.ts +0 -6
- package/dist/compiled-base-configs/base-ncu.js +0 -16
- package/dist/compiled-base-configs/base-typedoc.d.ts +0 -3
- package/dist/compiled-base-configs/base-typedoc.js +0 -36
- package/dist/compiled-base-configs/base-vite.d.ts +0 -27
- package/dist/compiled-base-configs/base-vite.js +0 -74
- package/dist/compiled-base-configs/vite-always-reload-plugin.d.ts +0 -10
- package/dist/compiled-base-configs/vite-always-reload-plugin.js +0 -99
- package/dist/file-paths/package-paths.d.ts +0 -12
- package/dist/file-paths/package-paths.js +0 -46
- package/dist/scripts/save-help-message.d.ts +0 -1
- package/dist/scripts/save-help-message.js +0 -33
- package/mocha.config.cjs +0 -16
package/README.md
CHANGED
|
@@ -1,208 +1,303 @@
|
|
|
1
|
-
# virmator
|
|
1
|
+
# @virmator
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
# Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm -i D virmator
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
# Help
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npx virmator --help
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Below is full documentation for the cli, which is generated via the cli's `help` message:
|
|
18
|
-
|
|
19
|
-
<!-- usage below -->
|
|
3
|
+
A package for centralizing and automating mind-numbingly repetitive repo tasks and checks. New commands can easily be added through a plugin system.
|
|
20
4
|
|
|
21
5
|
# virmator usage
|
|
22
6
|
|
|
23
|
-
|
|
24
|
-
[npx] virmator [--flags] command subCommand
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
`npx` is needed when the command is run directly from the terminal (not scoped within an npm script) unless the package has been globally installed (which will work just fine but I wouldn't recommend, simply because I prefer explicit dependencies).
|
|
28
|
-
|
|
29
|
-
# Available commands
|
|
30
|
-
|
|
31
|
-
## compile
|
|
32
|
-
|
|
33
|
-
compile typescript files
|
|
34
|
-
Pass any extra tsc flags to this command.
|
|
35
|
-
|
|
36
|
-
### Examples
|
|
7
|
+
`[npx] virmator [--flags] command subCommand [...optional args]`
|
|
37
8
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
9
|
+
- `npx` is needed when the command is run directly from the terminal (not called from within an npm script) unless virmator has been globally installed (which I recommend against).
|
|
10
|
+
- `[--flags]` is any of the optional virmator flags. See Virmator Flags below.
|
|
11
|
+
- `command`, `subCommand`, and `[...optional args]` depend on the specific command you're running. See Available Commands below.
|
|
40
12
|
|
|
41
|
-
|
|
13
|
+
## Available commands
|
|
42
14
|
|
|
43
|
-
|
|
15
|
+
- **compile**
|
|
44
16
|
|
|
45
|
-
|
|
17
|
+
Type checks TypeScript files and compiles them into JS outputs using the TypeScript compiler. Any extra args are passed directly to tsc.
|
|
46
18
|
|
|
47
|
-
|
|
19
|
+
Automatically compiles a mono-repo's sub packages in the correct order if called from a mono-repo root.
|
|
48
20
|
|
|
49
|
-
|
|
21
|
+
- Examples
|
|
22
|
+
- `virmator compile`
|
|
23
|
+
- With tsc flags: `virmator compile --noEmit`
|
|
24
|
+
- Configs
|
|
25
|
+
- tsconfig.json
|
|
26
|
+
- tsconfig.json
|
|
27
|
+
- configs/tsconfig.base.json
|
|
28
|
+
- Deps
|
|
29
|
+
- [typescript](https://npmjs.com/package/typescript)
|
|
30
|
+
- [mono-vir](https://npmjs.com/package/mono-vir)
|
|
50
31
|
|
|
51
|
-
|
|
32
|
+
- **deps**
|
|
52
33
|
|
|
53
|
-
|
|
34
|
+
Various dependency commands. A sub-command must be provided.
|
|
54
35
|
|
|
55
|
-
|
|
36
|
+
- Examples
|
|
37
|
+
- check import dependencies: `virmator deps check`
|
|
38
|
+
- upgrade npm dependencies: `virmator deps upgrade`
|
|
39
|
+
- regenerate npm dependencies: `virmator deps regen`
|
|
40
|
+
- Sub Commands
|
|
56
41
|
|
|
57
|
-
|
|
42
|
+
- **check**
|
|
58
43
|
|
|
59
|
-
|
|
44
|
+
Checks that import dependencies pass your dependency cruiser config. The base configuration blocks typical import errors such as circular dependencies and importing test files.
|
|
60
45
|
|
|
61
|
-
|
|
46
|
+
- Examples
|
|
47
|
+
- `virmator deps check`
|
|
48
|
+
- Configs
|
|
49
|
+
- configs/dep-cruiser.config.cts
|
|
50
|
+
- Deps
|
|
51
|
+
- [dependency-cruiser](https://npmjs.com/package/dependency-cruiser)
|
|
52
|
+
- [esbuild](https://npmjs.com/package/esbuild)
|
|
62
53
|
|
|
63
|
-
-
|
|
64
|
-
- Check deps: `virmator deps check`
|
|
65
|
-
- Check deps for a specific file: `virmator deps check ./src/my-file.ts`
|
|
66
|
-
- Regen deps: `virmator deps regen`
|
|
54
|
+
- **upgrade**
|
|
67
55
|
|
|
68
|
-
|
|
56
|
+
Upgrades dependencies using npm-check-update. Does not automatically run 'npm i'. It is recommended to run 'virmator deps regen' instead.
|
|
69
57
|
|
|
70
|
-
|
|
58
|
+
- Examples
|
|
59
|
+
- `virmator deps upgrade`
|
|
60
|
+
- Configs
|
|
61
|
+
- configs/ncu.config.ts
|
|
62
|
+
- Deps
|
|
63
|
+
- [npm-check-updates](https://npmjs.com/package/npm-check-updates)
|
|
71
64
|
|
|
72
|
-
|
|
65
|
+
- **regen**
|
|
73
66
|
|
|
74
|
-
|
|
67
|
+
Force regeneration of all all dependencies by deleting all node_modules directories and package-lock.json and then running 'npm i'.
|
|
75
68
|
|
|
76
|
-
|
|
69
|
+
- Examples
|
|
70
|
+
- `virmator deps regen`
|
|
77
71
|
|
|
78
|
-
|
|
72
|
+
- **docs**
|
|
79
73
|
|
|
80
|
-
|
|
74
|
+
Generates documentation using the typedoc package and inserts code examples into README files using the markdown-code-example-inserter package.
|
|
81
75
|
|
|
82
|
-
|
|
76
|
+
- Examples
|
|
77
|
+
- `virmator docs`
|
|
78
|
+
- Configs
|
|
79
|
+
- configs/typedoc.config.ts
|
|
80
|
+
- Deps
|
|
81
|
+
- [markdown-code-example-inserter](https://npmjs.com/package/markdown-code-example-inserter)
|
|
82
|
+
- [typedoc](https://npmjs.com/package/typedoc)
|
|
83
|
+
- [esbuild](https://npmjs.com/package/esbuild)
|
|
84
|
+
- Sub Commands
|
|
83
85
|
|
|
84
|
-
|
|
86
|
+
- **check**
|
|
85
87
|
|
|
86
|
-
|
|
88
|
+
Checks that documentation is valid and passes all checks without generating documentation outputs.
|
|
87
89
|
|
|
88
|
-
|
|
90
|
+
- Examples
|
|
91
|
+
- `virmator docs check`
|
|
89
92
|
|
|
90
|
-
-
|
|
91
|
-
- checking if files are up-to-date: `virmator docs check`
|
|
92
|
-
- override files to check to a single file: `virmator docs only/this/one/file.md`
|
|
93
|
-
- override files to check to a group of files: `virmator docs "only/this/dir/*.md"`
|
|
93
|
+
- **format**
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
Formats with prettier.
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
- Examples
|
|
98
|
+
- `virmator format`
|
|
99
|
+
- Configs
|
|
100
|
+
- prettier.config.mjs
|
|
101
|
+
- .prettierignore
|
|
102
|
+
- Deps
|
|
103
|
+
- [prettier](https://npmjs.com/package/prettier)
|
|
104
|
+
- [prettier-plugin-jsdoc](https://npmjs.com/package/prettier-plugin-jsdoc)
|
|
105
|
+
- [prettier-plugin-multiline-arrays](https://npmjs.com/package/prettier-plugin-multiline-arrays)
|
|
106
|
+
- [prettier-plugin-organize-imports](https://npmjs.com/package/prettier-plugin-organize-imports)
|
|
107
|
+
- [prettier-plugin-packagejson](https://npmjs.com/package/prettier-plugin-packagejson)
|
|
108
|
+
- [prettier-plugin-sort-json](https://npmjs.com/package/prettier-plugin-sort-json)
|
|
109
|
+
- [prettier-plugin-toml](https://npmjs.com/package/prettier-plugin-toml)
|
|
110
|
+
- [prettier-plugin-interpolated-html-tags](https://npmjs.com/package/prettier-plugin-interpolated-html-tags)
|
|
111
|
+
- Sub Commands
|
|
98
112
|
|
|
99
|
-
|
|
113
|
+
- **check**
|
|
100
114
|
|
|
101
|
-
|
|
115
|
+
Checks that formatting is all valid.
|
|
102
116
|
|
|
103
|
-
|
|
117
|
+
- Examples
|
|
118
|
+
- `virmator format check`
|
|
119
|
+
|
|
120
|
+
- **frontend**
|
|
121
|
+
|
|
122
|
+
Runs a frontend dev server with Vite.
|
|
104
123
|
|
|
105
|
-
|
|
124
|
+
- Examples
|
|
125
|
+
- `virmator frontend`
|
|
126
|
+
- Configs
|
|
127
|
+
- configs/vite.config.ts
|
|
128
|
+
- Deps
|
|
129
|
+
- [typescript](https://npmjs.com/package/typescript)
|
|
130
|
+
- [vite](https://npmjs.com/package/vite)
|
|
131
|
+
- Sub Commands
|
|
106
132
|
|
|
107
|
-
|
|
133
|
+
- **build**
|
|
108
134
|
|
|
109
|
-
|
|
135
|
+
Builds a frontend for deployment using Vite (and Rollup).
|
|
110
136
|
|
|
111
|
-
|
|
137
|
+
- Examples
|
|
138
|
+
- `virmator frontend build`
|
|
112
139
|
|
|
113
|
-
-
|
|
114
|
-
- checks formatting only for .md files: `virmator format check --file-types md`
|
|
115
|
-
- checks formatting only for .md and .json files: `virmator format check --file-types md json`
|
|
116
|
-
- fixes formatting for files:
|
|
140
|
+
- **preview**
|
|
117
141
|
|
|
118
|
-
|
|
119
|
-
virmator format
|
|
120
|
-
virmator format
|
|
121
|
-
```
|
|
142
|
+
Builds a frontend and previews that build in a local dev server.
|
|
122
143
|
|
|
123
|
-
-
|
|
144
|
+
- Examples
|
|
145
|
+
- `virmator frontend preview`
|
|
124
146
|
|
|
125
|
-
|
|
126
|
-
virmator format --ignore-path .prettierignore
|
|
127
|
-
virmator format --ignore-path .prettierignore
|
|
128
|
-
virmator format --ignore-path .prettierignore --file-types md json
|
|
129
|
-
```
|
|
147
|
+
- **help**
|
|
130
148
|
|
|
131
|
-
|
|
149
|
+
Prints help messages for all supported plugins/commands.
|
|
132
150
|
|
|
133
|
-
|
|
151
|
+
- Examples
|
|
152
|
+
- `virmator help`
|
|
134
153
|
|
|
135
|
-
|
|
154
|
+
- **init**
|
|
136
155
|
|
|
137
|
-
|
|
156
|
+
Init all default configs. Needs env and package type args.
|
|
138
157
|
|
|
139
|
-
|
|
158
|
+
- Examples
|
|
159
|
+
- `virmator init web mono-repo`
|
|
160
|
+
- `virmator init node package`
|
|
161
|
+
- Configs
|
|
162
|
+
- .github/workflows/build-for-gh-pages.yml
|
|
163
|
+
- .github/workflows/tagged-release.yml
|
|
164
|
+
- .github/workflows/tests.yml
|
|
165
|
+
- .github/workflows/tests.yml
|
|
166
|
+
- src/ui/elements/vir-app.element.ts
|
|
167
|
+
- src/index.html
|
|
168
|
+
- www-static/index.css
|
|
169
|
+
- www-static/\_redirects
|
|
170
|
+
- .gitattributes
|
|
171
|
+
- .nvmrc
|
|
172
|
+
- .gitignore
|
|
173
|
+
- LICENSE-MIT
|
|
174
|
+
- LICENSE-CC0
|
|
175
|
+
- .npmignore
|
|
176
|
+
- package.json
|
|
177
|
+
- package.json
|
|
178
|
+
- package.json
|
|
179
|
+
- package.json
|
|
180
|
+
- package.json
|
|
140
181
|
|
|
141
|
-
|
|
182
|
+
- **lint**
|
|
142
183
|
|
|
143
|
-
|
|
184
|
+
Runs ESLint.
|
|
144
185
|
|
|
145
|
-
|
|
186
|
+
- Examples
|
|
187
|
+
- `virmator lint`
|
|
188
|
+
- Configs
|
|
189
|
+
- configs/tsconfig.eslint.json
|
|
190
|
+
- eslint.config.mjs
|
|
191
|
+
- Deps
|
|
192
|
+
- [eslint](https://npmjs.com/package/eslint)
|
|
193
|
+
- [@eslint/js](https://npmjs.com/package/@eslint/js)
|
|
194
|
+
- [@stylistic/eslint-plugin](https://npmjs.com/package/@stylistic/eslint-plugin)
|
|
195
|
+
- [@stylistic/eslint-plugin-ts](https://npmjs.com/package/@stylistic/eslint-plugin-ts)
|
|
196
|
+
- [@typescript-eslint/eslint-plugin](https://npmjs.com/package/@typescript-eslint/eslint-plugin)
|
|
197
|
+
- [eslint-config-prettier](https://npmjs.com/package/eslint-config-prettier)
|
|
198
|
+
- [eslint-plugin-jsdoc](https://npmjs.com/package/eslint-plugin-jsdoc)
|
|
199
|
+
- [eslint-plugin-mocha](https://npmjs.com/package/eslint-plugin-mocha)
|
|
200
|
+
- [eslint-plugin-playwright](https://npmjs.com/package/eslint-plugin-playwright)
|
|
201
|
+
- [eslint-plugin-prettier](https://npmjs.com/package/eslint-plugin-prettier)
|
|
202
|
+
- [eslint-plugin-sonarjs](https://npmjs.com/package/eslint-plugin-sonarjs)
|
|
203
|
+
- [typescript-eslint](https://npmjs.com/package/typescript-eslint)
|
|
204
|
+
- Sub Commands
|
|
146
205
|
|
|
147
|
-
|
|
206
|
+
- **fix**
|
|
148
207
|
|
|
149
|
-
|
|
208
|
+
Auto fix all fixable ESLint issues.
|
|
150
209
|
|
|
151
|
-
|
|
210
|
+
- Examples
|
|
211
|
+
- `virmator lint fix`
|
|
152
212
|
|
|
153
|
-
-
|
|
154
|
-
- run init and force all configs to be written: `virmator init force`
|
|
213
|
+
- **publish**
|
|
155
214
|
|
|
156
|
-
|
|
215
|
+
Publish a package or mono-repo to NPM with an optional test script and auto-incrementing package version.
|
|
157
216
|
|
|
158
|
-
|
|
217
|
+
- Examples
|
|
218
|
+
- With tests: `virmator publish npm test`
|
|
219
|
+
- Without tests: `virmator publish`
|
|
159
220
|
|
|
160
|
-
|
|
221
|
+
- **spellcheck**
|
|
161
222
|
|
|
162
|
-
|
|
223
|
+
Checks spelling for all files using the cspell package. All arguments are passed directly to cspell.
|
|
163
224
|
|
|
164
|
-
|
|
225
|
+
- Examples
|
|
226
|
+
- `virmator spellcheck`
|
|
227
|
+
- Check a specific file: `virmator spellcheck src/index.ts`
|
|
228
|
+
- Configs
|
|
229
|
+
- cspell.config.cjs
|
|
230
|
+
- Deps
|
|
231
|
+
- [cspell](https://npmjs.com/package/cspell)
|
|
165
232
|
|
|
166
|
-
-
|
|
167
|
-
- publish a package and run tests beforehand: `virmator publish npm test`
|
|
233
|
+
- **test**
|
|
168
234
|
|
|
169
|
-
|
|
235
|
+
Runs tests. An environment is required.
|
|
170
236
|
|
|
171
|
-
|
|
237
|
+
This cannot be run in a mono-repo root, it can only be run for mono-repo sub-packages or a top-level singular package.
|
|
172
238
|
|
|
173
|
-
|
|
239
|
+
- Examples
|
|
240
|
+
- Run tests in a browser: `virmator test web`
|
|
241
|
+
- Run tests in Node: `virmator test node`
|
|
242
|
+
- Sub Commands
|
|
174
243
|
|
|
175
|
-
|
|
244
|
+
- **web**
|
|
176
245
|
|
|
177
|
-
|
|
246
|
+
Runs web tests in a browser using web-test-runner.
|
|
178
247
|
|
|
179
|
-
|
|
248
|
+
- Examples
|
|
249
|
+
- `virmator test web`
|
|
250
|
+
- Configs
|
|
251
|
+
- configs/web-test-runner.config.mjs
|
|
252
|
+
- Deps
|
|
253
|
+
- [@open-wc/testing](https://npmjs.com/package/@open-wc/testing)
|
|
254
|
+
- [@types/mocha](https://npmjs.com/package/@types/mocha)
|
|
255
|
+
- [@web/dev-server-esbuild](https://npmjs.com/package/@web/dev-server-esbuild)
|
|
256
|
+
- [@web/test-runner-commands](https://npmjs.com/package/@web/test-runner-commands)
|
|
257
|
+
- [@web/test-runner-playwright](https://npmjs.com/package/@web/test-runner-playwright)
|
|
258
|
+
- [@web/test-runner-visual-regression](https://npmjs.com/package/@web/test-runner-visual-regression)
|
|
259
|
+
- [@web/test-runner](https://npmjs.com/package/@web/test-runner)
|
|
260
|
+
- [istanbul-smart-text-reporter](https://npmjs.com/package/istanbul-smart-text-reporter)
|
|
261
|
+
- Sub Commands
|
|
262
|
+
|
|
263
|
+
- **coverage**
|
|
264
|
+
|
|
265
|
+
Run tests and calculate code coverage.
|
|
180
266
|
|
|
181
|
-
|
|
267
|
+
- Examples
|
|
268
|
+
- `virmator test web coverage`
|
|
182
269
|
|
|
183
|
-
-
|
|
184
|
-
- Test a single file: `virmator test ./path/to/single/file.js`
|
|
185
|
-
- Test multiple files: `virmator test "./**/single-file.js"`
|
|
270
|
+
- **node**
|
|
186
271
|
|
|
187
|
-
|
|
272
|
+
Runs backend tests in Node.js using its built-in test runner.
|
|
188
273
|
|
|
189
|
-
|
|
274
|
+
- Examples
|
|
275
|
+
- `virmator test node`
|
|
276
|
+
- Sub Commands
|
|
190
277
|
|
|
191
|
-
|
|
278
|
+
- **coverage**
|
|
192
279
|
|
|
193
|
-
|
|
280
|
+
Run tests and calculate code coverage.
|
|
194
281
|
|
|
195
|
-
|
|
282
|
+
- Examples
|
|
283
|
+
- `virmator test node coverage`
|
|
284
|
+
- Configs
|
|
285
|
+
- configs/c8.config.json
|
|
286
|
+
- Deps
|
|
287
|
+
- [c8](https://npmjs.com/package/c8)
|
|
288
|
+
- [istanbul-smart-text-reporter](https://npmjs.com/package/istanbul-smart-text-reporter)
|
|
196
289
|
|
|
197
|
-
|
|
290
|
+
- **update**
|
|
198
291
|
|
|
199
|
-
|
|
200
|
-
- Test a specific file: `virmator test-web path/to/file.test.ts`
|
|
292
|
+
Run tests and update snapshots.
|
|
201
293
|
|
|
202
|
-
|
|
294
|
+
- Examples
|
|
295
|
+
- `virmator test node update`
|
|
203
296
|
|
|
204
|
-
|
|
297
|
+
## Virmator Flags
|
|
205
298
|
|
|
206
|
-
|
|
299
|
+
All virmator flags are optional and typically not needed.
|
|
207
300
|
|
|
208
|
-
|
|
301
|
+
- **--no-configs**: Prevents command config files from being copied.
|
|
302
|
+
- **--no-deps**: Prevents command npm deps from being installed.
|
|
303
|
+
- **--help**: Print the help message.
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env -S npx tsx
|
|
2
2
|
export {};
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
#!/usr/bin/env -S npx tsx
|
|
2
|
+
import { createPluginLogger, executeVirmatorCommand, hideNoTraceTraces, VirmatorNoTraceError, } from '@virmator/core';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { defaultVirmatorPlugins } from './index';
|
|
5
|
+
const log = createPluginLogger(process);
|
|
6
|
+
executeVirmatorCommand({
|
|
7
|
+
cliCommand: process.argv,
|
|
8
|
+
plugins: defaultVirmatorPlugins,
|
|
9
|
+
entryPointFilePath: fileURLToPath(import.meta.url),
|
|
10
|
+
log,
|
|
11
|
+
}).catch((error) => {
|
|
12
|
+
if (error instanceof VirmatorNoTraceError && hideNoTraceTraces) {
|
|
13
|
+
if (error.message) {
|
|
14
|
+
log.error(error.message);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
log.error(error);
|
|
19
|
+
}
|
|
20
|
+
process.exit(1);
|
|
21
|
+
});
|