useblocks-cli 1.1.44-alpha.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 +85 -0
- package/bin/createPlugin.js +7 -0
- package/dist/index.js +4674 -0
- package/package.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# 🧰 CLI
|
|
2
|
+
|
|
3
|
+
`useblocks-cli` is the public project generator for external plugins and demo stands. It supports an interactive wizard and full non-interactive CLI usage.
|
|
4
|
+
|
|
5
|
+
## Command-line flags
|
|
6
|
+
|
|
7
|
+
The list below covers the main options available to end users through `--help`.
|
|
8
|
+
|
|
9
|
+
### `--dev` / `--dev-packages`
|
|
10
|
+
|
|
11
|
+
**The flag you will use most often in day-to-day development:** it selects **dev** dist-tags for internal `@emailmaker-internal/*` packages in generated templates instead of `latest`. Use it when you need fresh prerelease builds from the ecosystem.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx useblocks-cli my-plugin --kind plugin --preset advanced --bundler vite --target npm-package --dev --output-dir ./my-plugin
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Short form: `--dev` (same as `--dev-packages`).
|
|
18
|
+
|
|
19
|
+
### Other options
|
|
20
|
+
|
|
21
|
+
| Flag | Purpose |
|
|
22
|
+
|------|---------|
|
|
23
|
+
| `--interactive` | Run the interactive wizard. |
|
|
24
|
+
| `--package-name` | Explicit npm package name for the generated plugin. |
|
|
25
|
+
| `--kind` | Mode: `plugin` or `demo-stand`. |
|
|
26
|
+
| `--stand-mode` | Stand scenario: `oauth`, `closed-loop`, `react-adapter`, `advanced`. |
|
|
27
|
+
| `--advanced-profile` | For `--stand-mode advanced`: `subpath`, `shadow-dom`, or `umd`. |
|
|
28
|
+
| `--preset` | Plugin template: `minimal` or `advanced`. |
|
|
29
|
+
| `--bundler` | `vite` or `webpack` for the template. |
|
|
30
|
+
| `--target` | Plugin delivery: `npm-package`, `browser`, or `advanced`. |
|
|
31
|
+
| `--advanced-target` | Extra target for `advanced` mode (webpack-only); see CLI help. |
|
|
32
|
+
| `--output-dir` | Directory where the project is generated. |
|
|
33
|
+
| `--output-base` | Base directory; the project folder is created inside it. |
|
|
34
|
+
| `--force` | Allow writing into an existing directory. |
|
|
35
|
+
|
|
36
|
+
For the authoritative list, run:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx useblocks-cli --help
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## What the CLI does
|
|
43
|
+
|
|
44
|
+
- interactive wizard and scripted runs;
|
|
45
|
+
- plugin and demo-stand scaffolding;
|
|
46
|
+
- **vite** and **webpack** templates;
|
|
47
|
+
- delivery targets: npm package, browser bundle, and **advanced** integration modes.
|
|
48
|
+
|
|
49
|
+
## Main modes
|
|
50
|
+
|
|
51
|
+
### `plugin`
|
|
52
|
+
|
|
53
|
+
External plugin: app side, sandbox, local debug host, baseline build scripts.
|
|
54
|
+
|
|
55
|
+
### `demo-stand`
|
|
56
|
+
|
|
57
|
+
Standalone integration stands with OAuth, closed-loop, react-adapter, and advanced profiles.
|
|
58
|
+
|
|
59
|
+
## Plugin presets
|
|
60
|
+
|
|
61
|
+
- **`minimal`** — scaffold without a React example.
|
|
62
|
+
- **`advanced`** — React UI, `ComponentRegistry`, sample panels, and APIs.
|
|
63
|
+
|
|
64
|
+
## Examples
|
|
65
|
+
|
|
66
|
+
With **dev** packages:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npx useblocks-cli my-plugin --kind plugin --preset advanced --bundler vite --target npm-package --dev --output-dir ./my-plugin
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Stable registry versions (no `--dev`):
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx useblocks-cli my-plugin --kind plugin --preset advanced --bundler vite --target npm-package --output-dir ./my-plugin
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
After a global install the command may be named `useblocks-cli`.
|
|
79
|
+
|
|
80
|
+
## When to use the CLI
|
|
81
|
+
|
|
82
|
+
- bootstrap a new external plugin quickly;
|
|
83
|
+
- avoid hand-writing **vite** / **webpack** configs;
|
|
84
|
+
- get a consistent app, sandbox, and local-debug layout.
|
|
85
|
+
|