@finebi/finebi-cli 1.2.0 → 1.2.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 +0 -104
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,110 +10,6 @@ Array options take a JSON array as one argument, for example `--values '["上海
|
|
|
10
10
|
npm install -g @finebi/finebi-cli --registry=https://registry.npmjs.org/
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
For local development, prefer `npm link` from this `cli` directory:
|
|
14
|
-
|
|
15
|
-
```powershell
|
|
16
|
-
cd D:\project\ino-7.0\nuclear-all\plugin-bi-finecli\cli
|
|
17
|
-
npm link
|
|
18
|
-
finebi-cli --help
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
After `npm link`, edits under `src` are picked up by the global `finebi-cli` command without linking again. If `finebi-cli` was installed from a packed `.tgz`, rebuild and reinstall the package after code changes:
|
|
22
|
-
|
|
23
|
-
```powershell
|
|
24
|
-
cd D:\project\ino-7.0\nuclear-all\plugin-bi-finecli\cli
|
|
25
|
-
npm run pack:cli
|
|
26
|
-
npm install -g .\finebi-finebi-cli-1.0.0.tgz
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
On Windows, use `where finebi-cli` if the command does not appear to update. Multiple Node.js/npm installations can leave more than one global command shim on `PATH`.
|
|
30
|
-
|
|
31
|
-
## Publish an Update
|
|
32
|
-
|
|
33
|
-
Publish from this `cli` directory. A published npm version is immutable, so increment the version before every release. Make and commit the functional changes first, then run the following release checks and version update:
|
|
34
|
-
|
|
35
|
-
```powershell
|
|
36
|
-
cd D:\project\ino-7.0\nuclear-all\plugin-bi-finecli\cli
|
|
37
|
-
npm test
|
|
38
|
-
npm run verify:pack
|
|
39
|
-
npm version patch --no-git-tag-version
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Use `patch` for bug fixes, `minor` for backward-compatible features, and `major` for breaking changes. `npm version` updates both `package.json` and `package-lock.json`. Review and commit the release version with a Chinese Conventional Commit message, then log in with an npm account authorized to publish under `@finebi`. The package publishes publicly to the official npm registry:
|
|
43
|
-
|
|
44
|
-
```powershell
|
|
45
|
-
git add package.json package-lock.json
|
|
46
|
-
git commit -m "chore(cli): 发布 1.0.1"
|
|
47
|
-
npm login --registry=https://registry.npmjs.org/
|
|
48
|
-
npm publish --registry=https://registry.npmjs.org/ --access public
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
After a successful publish, verify the registry version and install it. Public package installation does not require npm authentication:
|
|
52
|
-
|
|
53
|
-
```powershell
|
|
54
|
-
npm view @finebi/finebi-cli version --registry=https://registry.npmjs.org/
|
|
55
|
-
npm install -g @finebi/finebi-cli@latest --registry=https://registry.npmjs.org/
|
|
56
|
-
finebi-cli version
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Testing
|
|
60
|
-
|
|
61
|
-
Run these commands from the repository root. On Windows PowerShell use `npm.cmd`; on Linux/macOS use `npm`:
|
|
62
|
-
|
|
63
|
-
```powershell
|
|
64
|
-
npm.cmd --prefix cli test
|
|
65
|
-
npm.cmd --prefix cli run test:integration:stub
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Linux/macOS:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
npm --prefix cli test
|
|
72
|
-
npm --prefix cli run test:integration:stub
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
For a real FineBI environment, use the corresponding integration script:
|
|
76
|
-
|
|
77
|
-
Windows PowerShell:
|
|
78
|
-
|
|
79
|
-
```powershell
|
|
80
|
-
npm.cmd --prefix cli run test:integration:readonly
|
|
81
|
-
npm.cmd --prefix cli run test:integration:mutating
|
|
82
|
-
npm.cmd --prefix cli run test:integration:real
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Linux/macOS:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
npm --prefix cli run test:integration:readonly
|
|
89
|
-
npm --prefix cli run test:integration:mutating
|
|
90
|
-
npm --prefix cli run test:integration:real
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### Real integration prerequisites
|
|
94
|
-
|
|
95
|
-
Before running a real FineBI test, configure all of the following:
|
|
96
|
-
|
|
97
|
-
- `cli/tests/fixtures/finebi-integration-environment.json`: set `ready` to `true`, and provide a reachable HTTP(S) `baseUrl`, the test `username`, a positive `revision`, and `passwordSource` pointing to `FINEBI_INTEGRATION_PASSWORD`. `reportDir` may be a relative default or an absolute path.
|
|
98
|
-
- `cli/tests/fixtures/capabilities/`: keep the per-resource snapshots valid and synchronized with the deployed plugin/environment. The commands and request schemas in real cases are checked against this Capability snapshot (aggregated by `fixtures/capabilities/load.js`).
|
|
99
|
-
- `cli/tests/real-cases/*.json`: enable at least one case with `enabled: true`. Readonly cases must use `mutation: false` commands; mutating cases must declare scoped cleanup for resources created by that case.
|
|
100
|
-
- FineBI: deploy the plugin version corresponding to the current source and verify that the configured account can log in and access the required resources. Run mutating cases only in a dedicated test environment.
|
|
101
|
-
- Credentials: inject the password through the environment variable before starting the test. `xxxx` below is only a placeholder and must be replaced locally or by CI Secret injection.
|
|
102
|
-
|
|
103
|
-
Windows PowerShell:
|
|
104
|
-
|
|
105
|
-
```powershell
|
|
106
|
-
$env:FINEBI_INTEGRATION_PASSWORD = 'xxxx'
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Linux/macOS:
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
export FINEBI_INTEGRATION_PASSWORD='xxxx'
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Do not commit the real value or place it in case JSON, CLI arguments, logs, or reports. If `--report-dir` is supplied, it must be an existing writable absolute directory; `--case` can narrow the run to one enabled case. See the complete [CLI testing guide](../docs/cli-testing/20260804-finebi-real-integration/cli-testing-guide.md) for platform-specific setup, real-case authoring with the `finebi-cli-case-authoring` skill, cleanup rules, and report troubleshooting.
|
|
116
|
-
|
|
117
13
|
## Usage
|
|
118
14
|
|
|
119
15
|
Built-in help is always available and does not require server config, login, or a capability refresh:
|