@rs-x/cli 2.0.0-next.0
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/LICENSE +21 -0
- package/README.md +92 -0
- package/bin/rsx.cjs +3509 -0
- package/package.json +28 -0
- package/rs-x-vscode-extension-2.0.0-next.0.vsix +0 -0
- package/scripts/postinstall.cjs +90 -0
- package/scripts/prepare-vsix.cjs +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 robert-sanders-software-ontwikkeling
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# @rs-x/cli
|
|
2
|
+
|
|
3
|
+
Command line installer for RS-X developer tooling.
|
|
4
|
+
|
|
5
|
+
## Postinstall behavior
|
|
6
|
+
|
|
7
|
+
When `@rs-x/cli` is installed, it attempts to install the VS Code extension
|
|
8
|
+
automatically if the `code` CLI is available:
|
|
9
|
+
|
|
10
|
+
- from the bundled local `.vsix` included in the package.
|
|
11
|
+
|
|
12
|
+
Disable this behavior with:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
RSX_SKIP_VSCODE_EXTENSION_INSTALL=true
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## What gets installed
|
|
19
|
+
|
|
20
|
+
Installing `@rs-x/cli` gives you the `rsx` command.
|
|
21
|
+
|
|
22
|
+
Running `rsx init` installs:
|
|
23
|
+
|
|
24
|
+
- runtime packages: `@rs-x/core`, `@rs-x/state-manager`, `@rs-x/expression-parser`
|
|
25
|
+
- compiler/tooling packages: `@rs-x/compiler`, `@rs-x/typescript-plugin`
|
|
26
|
+
- framework-specific packages when required by setup/template (for example `@rs-x/angular`, `@rs-x/react`, or `@rs-x/vue`)
|
|
27
|
+
|
|
28
|
+
## VS Code extension features
|
|
29
|
+
|
|
30
|
+
The rs-x VS Code extension provides:
|
|
31
|
+
|
|
32
|
+
- RS-X expression IntelliSense
|
|
33
|
+
- RS-X expression diagnostics in TS/JS files
|
|
34
|
+
- integration through `@rs-x/typescript-plugin`
|
|
35
|
+
|
|
36
|
+
## If VSIX install fails
|
|
37
|
+
|
|
38
|
+
1. Make sure the VS Code CLI is available:
|
|
39
|
+
- `code --version`
|
|
40
|
+
2. Retry install:
|
|
41
|
+
- `npx rsx install vscode --force`
|
|
42
|
+
3. Install manually from a VSIX path if needed:
|
|
43
|
+
- `code --install-extension "/absolute/path/to/rs-x-vscode-extension-<version>.vsix"`
|
|
44
|
+
4. In CI/restricted shells, disable auto-install:
|
|
45
|
+
- `RSX_SKIP_VSCODE_EXTENSION_INSTALL=true`
|
|
46
|
+
|
|
47
|
+
## Commands
|
|
48
|
+
|
|
49
|
+
- `rsx doctor`
|
|
50
|
+
- `rsx add` (aliases: `rsx -a`, `rsx -add`)
|
|
51
|
+
- `rsx install vscode [--force] [--local] [--dry-run]`
|
|
52
|
+
- `rsx install compiler [--pm <pnpm|npm|yarn|bun>] [--dry-run]`
|
|
53
|
+
- `rsx setup [--pm <pnpm|npm|yarn|bun>] [--force] [--local] [--dry-run]`
|
|
54
|
+
- `rsx init [--pm <pnpm|npm|yarn|bun>] [--entry <path>] [--skip-install] [--skip-vscode] [--force] [--local] [--dry-run]`
|
|
55
|
+
- `rsx project [angular|vuejs|react|nextjs|nodejs] [--name <project-name>] [--template <...>] [--pm <pnpm|npm|yarn|bun>] [--skip-install] [--skip-vscode] [--dry-run]`
|
|
56
|
+
- `rsx build [--project <path-to-tsconfig>] [--out-dir <path>] [--dry-run]`
|
|
57
|
+
- `rsx typecheck [--project <path-to-tsconfig>] [--dry-run]`
|
|
58
|
+
|
|
59
|
+
`rsx init` does:
|
|
60
|
+
|
|
61
|
+
- install runtime packages: `@rs-x/core`, `@rs-x/state-manager`, `@rs-x/expression-parser`
|
|
62
|
+
- install compiler tooling: `@rs-x/compiler`, `@rs-x/typescript-plugin`
|
|
63
|
+
- detect project context (`angular`, `react`, `vuejs`, `generic`, `next`)
|
|
64
|
+
- create `rsx-bootstrap.ts` (or `.js`) with async module loading
|
|
65
|
+
- patch startup file to `await initRsx()` before app bootstrap:
|
|
66
|
+
- React: wraps `createRoot(...).render(...)`
|
|
67
|
+
- Angular: wraps `bootstrapApplication(...)` / `bootstrapModule(...)`
|
|
68
|
+
- Generic: wraps `main();`-style startup call
|
|
69
|
+
- Vue: wraps `createApp(...).mount(...)`
|
|
70
|
+
- Next.js: creates `RsxBootstrapGate` client component and wraps app children (`app/layout.*`) or `<Component />` (`pages/_app.*`)
|
|
71
|
+
- install VS Code extension (unless `--skip-vscode`)
|
|
72
|
+
|
|
73
|
+
`rsx setup` behavior:
|
|
74
|
+
|
|
75
|
+
- `rsx setup` auto-detects framework (`angular`, `react`, `vuejs`, `next`, fallback generic) and runs matching setup flow.
|
|
76
|
+
|
|
77
|
+
`rsx project` template extras:
|
|
78
|
+
|
|
79
|
+
- `angular`: installs `@rs-x/angular`
|
|
80
|
+
- `react` and `nextjs`: install `@rs-x/react`
|
|
81
|
+
- `vuejs`: installs `@rs-x/vue` and replaces `src/App.vue` with an RS-X expression example (`useRsxExpression('a + b', { model })`)
|
|
82
|
+
|
|
83
|
+
## Examples
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx @rs-x/cli init
|
|
87
|
+
npx @rs-x/cli init --entry src/main.ts --skip-vscode
|
|
88
|
+
npx @rs-x/cli setup
|
|
89
|
+
npx @rs-x/cli install vscode --force
|
|
90
|
+
npx @rs-x/cli install compiler --pm pnpm
|
|
91
|
+
npx @rs-x/cli typecheck --project tsconfig.json
|
|
92
|
+
```
|