@browser-compat/cli 0.1.1 → 0.1.2
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 +59 -9
- package/dist/index.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,16 +1,66 @@
|
|
|
1
1
|
# @browser-compat/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command line interface for the Browser Compat toolkit.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Browser Compat helps applications generate browser compatibility manifests from
|
|
6
|
+
their own `browserslist` targets, check those manifests in CI, and use the
|
|
7
|
+
result at runtime through small framework adapters.
|
|
8
|
+
|
|
9
|
+
## What This Package Does
|
|
10
|
+
|
|
11
|
+
`@browser-compat/cli` installs the `browser-compat` command. Use it to:
|
|
12
|
+
|
|
13
|
+
- generate a compatibility manifest
|
|
14
|
+
- generate capability and CSS reports
|
|
15
|
+
- generate scoped low-power CSS
|
|
16
|
+
- check whether a committed manifest still matches current `browserslist`
|
|
17
|
+
targets
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
7
20
|
|
|
8
21
|
```bash
|
|
9
|
-
|
|
10
|
-
browser-compat check --project . --manifest generated/browser-compat.manifest.json --strict-browserslist
|
|
11
|
-
browser-compat report --project . --out generated/browser-compat.capabilities.json --format json
|
|
22
|
+
npm install -D @browser-compat/cli
|
|
12
23
|
```
|
|
13
24
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
browser-compat generate \
|
|
29
|
+
--project . \
|
|
30
|
+
--out generated/browser-compat.manifest.json \
|
|
31
|
+
--capabilities generated/browser-compat.capabilities.json \
|
|
32
|
+
--css-report generated/browser-compat.css-report.json \
|
|
33
|
+
--css-out src/styles/browser-compat.generated.css \
|
|
34
|
+
--css-mode generate \
|
|
35
|
+
--strict-browserslist
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Check the manifest in CI:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
browser-compat check \
|
|
42
|
+
--project . \
|
|
43
|
+
--manifest generated/browser-compat.manifest.json \
|
|
44
|
+
--strict-browserslist
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You can also run without installing first:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx @browser-compat/cli generate --project . --out generated/browser-compat.manifest.json --strict-browserslist
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Commands
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
browser-compat prepare --project <dir> --out <file> [--strict-browserslist] [--targets "..."] [--with-capabilities]
|
|
57
|
+
browser-compat check --project <dir> --manifest <file> [--strict-browserslist]
|
|
58
|
+
browser-compat report --project <dir> [--out <file>] [--css-report <file>] [--strict-browserslist] [--format json]
|
|
59
|
+
browser-compat generate --project <dir> --out <manifest-file> [--capabilities <file>] [--css-report <file>] [--css-out <file>] [--css-mode report|generate] [--strict-browserslist]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The CLI uses the consuming project's explicit `browserslist` configuration by
|
|
63
|
+
default. It does not include built-in project-specific browser versions, memory
|
|
64
|
+
thresholds, or business routes.
|
|
65
|
+
|
|
66
|
+
Full documentation: https://github.com/relaxcloud-cn/browser-compat-package
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { mapCapabilities, toManifestCapabilities } from "@browser-compat/capabil
|
|
|
5
5
|
import { compareManifestWithCurrentTargets, createCompatManifest, validateCompatManifest, } from "@browser-compat/core";
|
|
6
6
|
import { scanCompatCss } from "@browser-compat/postcss";
|
|
7
7
|
import { BrowserslistConfigError, resolveBrowserslistConfig } from "./projectConfig.js";
|
|
8
|
-
const CLI_PACKAGE_VERSION = "0.1.
|
|
8
|
+
const CLI_PACKAGE_VERSION = "0.1.2";
|
|
9
9
|
async function main(argv) {
|
|
10
10
|
const args = parseArgs(argv);
|
|
11
11
|
if (args.help || !args.command) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@browser-compat/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI for generating and checking browser-compat manifests and reports.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@browser-compat/capabilities": "0.1.
|
|
31
|
-
"@browser-compat/core": "0.1.
|
|
32
|
-
"@browser-compat/postcss": "0.1.
|
|
30
|
+
"@browser-compat/capabilities": "0.1.2",
|
|
31
|
+
"@browser-compat/core": "0.1.2",
|
|
32
|
+
"@browser-compat/postcss": "0.1.2",
|
|
33
33
|
"browserslist": "^4.24.4"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|