sitevision-cli 1.0.0-beta.2 → 1.0.0-beta.21
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/dist/app.d.ts +1 -1
- package/dist/app.js +59 -8
- package/dist/cli.js +96 -39
- package/dist/commands/build.js +1 -1
- package/dist/commands/deploy.d.ts +2 -2
- package/dist/commands/deploy.js +135 -25
- package/dist/commands/dev.d.ts +8 -10
- package/dist/commands/dev.js +77 -366
- package/dist/commands/info.js +2 -2
- package/dist/commands/watch.js +5 -23
- package/dist/components/AnimatedLogo.js +8 -2
- package/dist/components/AuthLoginScreen.d.ts +21 -0
- package/dist/components/AuthLoginScreen.js +90 -0
- package/dist/components/DevPropertiesForm.d.ts +2 -1
- package/dist/components/DevPropertiesForm.js +198 -33
- package/dist/components/InfoScreen.js +2 -2
- package/dist/components/MainMenu.js +7 -2
- package/dist/components/PasswordInput.js +2 -1
- package/dist/components/SetupFlow.d.ts +2 -1
- package/dist/components/SetupFlow.js +100 -11
- package/dist/shell/AddonPicker.d.ts +14 -0
- package/dist/shell/AddonPicker.js +54 -0
- package/dist/shell/CommandPalette.d.ts +8 -0
- package/dist/shell/CommandPalette.js +63 -0
- package/dist/shell/ConfigForm.d.ts +36 -0
- package/dist/shell/ConfigForm.js +558 -0
- package/dist/shell/Frame.d.ts +59 -0
- package/dist/shell/Frame.js +134 -0
- package/dist/shell/Settings.d.ts +6 -0
- package/dist/shell/Settings.js +96 -0
- package/dist/shell/Shell.d.ts +9 -0
- package/dist/shell/Shell.js +586 -0
- package/dist/shell/Tabs.d.ts +36 -0
- package/dist/shell/Tabs.js +90 -0
- package/dist/shell/actions.d.ts +45 -0
- package/dist/shell/actions.js +0 -0
- package/dist/types/index.d.ts +44 -5
- package/dist/utils/config.d.ts +10 -0
- package/dist/utils/config.js +14 -0
- package/dist/utils/environments.d.ts +20 -0
- package/dist/utils/environments.js +74 -0
- package/dist/utils/i18n.d.ts +12 -0
- package/dist/utils/i18n.js +279 -0
- package/dist/utils/jsonc.d.ts +19 -0
- package/dist/utils/jsonc.js +74 -0
- package/dist/utils/keychain.d.ts +9 -0
- package/dist/utils/keychain.js +54 -0
- package/dist/utils/oauth2-auth.d.ts +64 -0
- package/dist/utils/oauth2-auth.js +242 -0
- package/dist/utils/password-prompt.d.ts +5 -0
- package/dist/utils/password-prompt.js +28 -0
- package/dist/utils/project-detection.d.ts +105 -6
- package/dist/utils/project-detection.js +411 -54
- package/dist/utils/session-cookie-auth.d.ts +35 -0
- package/dist/utils/session-cookie-auth.js +99 -0
- package/dist/utils/sitevision-api.d.ts +64 -5
- package/dist/utils/sitevision-api.js +195 -33
- package/dist/utils/tasks.d.ts +48 -0
- package/dist/utils/tasks.js +371 -0
- package/dist/utils/workspace.d.ts +17 -0
- package/dist/utils/workspace.js +67 -0
- package/package.json +3 -1
- package/readme.md +102 -121
package/readme.md
CHANGED
|
@@ -1,158 +1,139 @@
|
|
|
1
1
|
# Sitevision CLI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- **
|
|
13
|
-
|
|
14
|
-
- **
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
`svc` builds, signs and deploys Sitevision apps (WebApp, Widget, RESTApp,
|
|
4
|
+
MCPServer) from a full-screen terminal shell or as plain commands.
|
|
5
|
+
|
|
6
|
+
- **One shell for one app or a whole repo.** Run it inside an app, or at the
|
|
7
|
+
root of a repo with many apps and switch between them. Dev and watch keep
|
|
8
|
+
running in the background.
|
|
9
|
+
- **Three ways to authenticate deploys:** username and password, OAuth2 (PKCE,
|
|
10
|
+
works with SSO), or a captured browser session for SAML-only sites.
|
|
11
|
+
- **No secrets on disk.** Passwords, tokens and cookies live in the OS keychain.
|
|
12
|
+
- **Environments.** dev, test and prod in one config; production deploys use
|
|
13
|
+
the signed zip, confirm and activate.
|
|
14
|
+
- **Shared config in git.** Site and auth settings for the whole team live in
|
|
15
|
+
`package.json`, once at the repo root; your username stays in a local
|
|
16
|
+
`.dev_properties.json`. Compatible with plain sitevision-scripts.
|
|
17
|
+
- **Builds the way Sitevision does.** Bundled apps without their own webpack
|
|
18
|
+
config are built by `@sitevision/sitevision-scripts`.
|
|
19
|
+
- English and Swedish UI.
|
|
20
|
+
|
|
21
|
+
📖 **[User guide](docs/user-guide.md)** · **[Användarguide (svenska)](docs/anvandarguide.md)**
|
|
17
22
|
|
|
18
23
|
## Install
|
|
19
24
|
|
|
25
|
+
Requires Node.js 22+.
|
|
26
|
+
|
|
20
27
|
```bash
|
|
21
28
|
npm install --global sitevision-cli
|
|
22
29
|
```
|
|
23
30
|
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
The CLI must be run inside a Sitevision project directory (containing a `manifest.json`).
|
|
27
|
-
|
|
28
|
-
### Interactive Mode
|
|
29
|
-
|
|
30
|
-
Simply run `svc` to launch the interactive menu:
|
|
31
|
+
## Quick start
|
|
31
32
|
|
|
32
33
|
```bash
|
|
34
|
+
cd my-repo # or cd into a single app
|
|
33
35
|
svc
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
3.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
#### Building
|
|
38
|
+
1. Pick an app in the navigator and press `Enter`. (In a new repo the shell
|
|
39
|
+
opens on **Workspace settings** first.)
|
|
40
|
+
2. Press `2` for the **Config** tab and fill in domain, site name, addon name,
|
|
41
|
+
username and auth method. Each field saves on `Enter`.
|
|
42
|
+
3. Press `i` to install dependencies if needed, then `d` to start dev: build on
|
|
43
|
+
every change and deploy. Output is in the **Log** tab (`4`).
|
|
44
|
+
|
|
45
|
+
For production: switch environment with `E`, press `b` to build, `s` to sign
|
|
46
|
+
and `p` to deploy and activate.
|
|
47
|
+
|
|
48
|
+
## The shell
|
|
49
|
+
|
|
50
|
+
| Key | Action |
|
|
51
|
+
| --------------- | --------------------------------------------------- |
|
|
52
|
+
| `d` / `w` | Dev (build + deploy on change) / Watch (build only) |
|
|
53
|
+
| `b` / `s` | Build / Sign |
|
|
54
|
+
| `p` / `P` | Deploy / force deploy to the active environment |
|
|
55
|
+
| `a` | Versions: list and activate uploaded versions |
|
|
56
|
+
| `E` | Switch environment |
|
|
57
|
+
| `e` / `y` / `i` | Config tab / sync `package.json` / `npm install` |
|
|
58
|
+
| `l` | Log in again |
|
|
59
|
+
| `K` | Stop running tasks |
|
|
60
|
+
| `1`–`4` | Overview · Config · Versions · Log |
|
|
61
|
+
| `/` | Command palette |
|
|
62
|
+
| `,` | Settings (language, intro animation) |
|
|
63
|
+
| `Tab` / `Esc` | Switch pane / back |
|
|
64
|
+
| `q` | Quit |
|
|
65
|
+
|
|
66
|
+
In the navigator, typing filters the app list; action keys work once `Enter` or
|
|
67
|
+
`Tab` has moved focus to the content pane. The bottom bar always shows the keys
|
|
68
|
+
that apply. `svc --minimal` gives a compact layout for small panes.
|
|
69
|
+
|
|
70
|
+
## Commands
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
#
|
|
74
|
-
svc build
|
|
73
|
+
svc # interactive shell
|
|
74
|
+
svc build # build to dist/<id>.zip
|
|
75
|
+
svc sign # sign to dist/<id>-signed.zip
|
|
76
|
+
svc deploy [--force] # deploy the zip
|
|
77
|
+
svc deploy --production [--activate] # deploy the signed zip
|
|
78
|
+
svc dev [--signed] # build + deploy on change
|
|
79
|
+
svc watch [--signed] # build on change, no deploy
|
|
80
|
+
svc info # project information
|
|
75
81
|
```
|
|
76
82
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
# Sign the app for production deployment
|
|
81
|
-
svc sign
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
#### Deployment
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
# Deploy to development server
|
|
88
|
-
svc deploy
|
|
89
|
-
|
|
90
|
-
# Force deploy (overwrite existing)
|
|
91
|
-
svc deploy --force
|
|
92
|
-
|
|
93
|
-
# Deploy to production (requires signed app)
|
|
94
|
-
svc deploy --production
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
#### Setup
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# Configure signing credentials
|
|
101
|
-
svc setup-signing
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
#### Project Info
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
# Show project information and configuration
|
|
108
|
-
svc info
|
|
109
|
-
```
|
|
83
|
+
Direct commands use the base environment. `--token` and `--cookie` pass an
|
|
84
|
+
OAuth2 token or session cookie for one run.
|
|
110
85
|
|
|
111
86
|
## Configuration
|
|
112
87
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
88
|
+
`.dev_properties.json` is your local config and the main source; keep it out of
|
|
89
|
+
git. Shared values are committed in `package.json` and act as defaults
|
|
90
|
+
underneath it:
|
|
116
91
|
|
|
117
92
|
```json
|
|
118
93
|
{
|
|
119
|
-
"
|
|
120
|
-
"siteName": "
|
|
121
|
-
"addonName": "
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
94
|
+
"developmentDomain": "acme-use.sitevision-cloud.se",
|
|
95
|
+
"siteName": "Intranet",
|
|
96
|
+
"addonName": "my-addon",
|
|
97
|
+
"svc": {
|
|
98
|
+
"authMethod": "oauth2",
|
|
99
|
+
"environments": {"prod": {"domain": "acme.sitevision-cloud.se"}}
|
|
100
|
+
}
|
|
126
101
|
}
|
|
127
102
|
```
|
|
128
103
|
|
|
129
|
-
|
|
104
|
+
`username`, `signingUsername` and `certificateName` are user-specific and only
|
|
105
|
+
live in `.dev_properties.json`. `y` copies shared values from
|
|
106
|
+
`.dev_properties.json` into `package.json`. In a workspace, shared values go in
|
|
107
|
+
the root `package.json` and each app's `package.json` only needs `addonName`.
|
|
108
|
+
|
|
109
|
+
## Authentication in short
|
|
130
110
|
|
|
131
|
-
|
|
132
|
-
Credential Manager, Linux libsecret) under the `sitevision-cli` service —
|
|
133
|
-
never in `.dev_properties.json`. Run `svc` and complete the setup form (or
|
|
134
|
-
enter the password when prompted at deploy/sign time and toggle "save to
|
|
135
|
-
keychain") to populate it.
|
|
111
|
+
There are two separate credentials:
|
|
136
112
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
113
|
+
- **Deploy**: your account on the site. `authMethod` is `basic` (password),
|
|
114
|
+
`oauth2` (browser login against the site's OAuth2 provider, refreshed
|
|
115
|
+
silently afterwards) or `cookie` (log in with SSO in a Chrome window, the
|
|
116
|
+
session is captured).
|
|
117
|
+
- **Signing**: your developer.sitevision.se account, always username and
|
|
118
|
+
password.
|
|
142
119
|
|
|
143
|
-
|
|
144
|
-
`SITEVISION_SIGNING_PASSWORD
|
|
145
|
-
|
|
120
|
+
Everything secret goes in the OS keychain under `sitevision-cli`. For CI, set
|
|
121
|
+
`SITEVISION_DEPLOY_PASSWORD`, `SITEVISION_SIGNING_PASSWORD`,
|
|
122
|
+
`SITEVISION_ACCESS_TOKEN` or `SITEVISION_SESSION_COOKIE`.
|
|
146
123
|
|
|
147
|
-
|
|
124
|
+
OAuth2 needs a client registered on the site with the redirect URI
|
|
125
|
+
`http://127.0.0.1:8137/callback`. The [user guide](docs/user-guide.md#5-authentication)
|
|
126
|
+
covers the setup, the pitfalls, and which method works with which command.
|
|
148
127
|
|
|
149
|
-
|
|
128
|
+
## Development
|
|
150
129
|
|
|
151
|
-
|
|
152
|
-
|
|
130
|
+
```bash
|
|
131
|
+
npm install
|
|
132
|
+
npm run build # tsc → dist/
|
|
133
|
+
npm test # prettier, xo, ava
|
|
134
|
+
```
|
|
153
135
|
|
|
154
|
-
|
|
155
|
-
the OS keychain for future runs.
|
|
136
|
+
Releasing: see [RELEASING.md](RELEASING.md).
|
|
156
137
|
|
|
157
138
|
## License
|
|
158
139
|
|