sitevision-cli 1.0.0-beta.9 → 1.0.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/CHANGELOG.md +143 -0
- package/LICENSE +21 -0
- package/dist/cli.js +194 -70
- package/dist/commands/TaskScreen.js +32 -0
- package/dist/commands/build.js +6 -185
- package/dist/commands/deploy.js +95 -212
- package/dist/commands/dev.js +87 -416
- package/dist/commands/info.js +1 -1
- package/dist/commands/setup-signing.js +50 -33
- package/dist/commands/sign.js +9 -86
- package/dist/commands/use-finish.js +17 -0
- package/dist/commands/watch.js +5 -31
- package/dist/components/AnimatedLogo.js +8 -2
- package/dist/components/AuthLoginScreen.js +33 -15
- package/dist/components/PasswordInput.js +2 -1
- package/dist/scaffold/inquirer-stub.js +119 -0
- package/dist/scaffold/register.js +15 -0
- package/dist/shell/AddonPicker.js +54 -0
- package/dist/shell/Changelog.js +50 -0
- package/dist/shell/CommandPalette.js +63 -0
- package/dist/shell/ConfigForm.js +703 -0
- package/dist/shell/Frame.js +138 -0
- package/dist/shell/Help.js +96 -0
- package/dist/shell/Popover.js +15 -0
- package/dist/shell/Settings.js +149 -0
- package/dist/shell/Shell.js +953 -0
- package/dist/shell/Tabs.js +96 -0
- package/dist/shell/actions.js +493 -0
- package/dist/utils/config.js +62 -2
- package/dist/utils/create-app.js +231 -0
- package/dist/utils/debug.js +32 -0
- package/dist/utils/environments.js +74 -0
- package/dist/utils/i18n.js +369 -0
- package/dist/utils/jsonc.js +2 -1
- package/dist/utils/keychain.js +54 -6
- package/dist/utils/oauth2-auth.js +146 -43
- package/dist/utils/password-prompt.js +37 -3
- package/dist/utils/process-runner.js +77 -38
- package/dist/utils/project-detection.js +457 -112
- package/dist/utils/session-cookie-auth.js +10 -6
- package/dist/utils/sitevision-api.js +134 -25
- package/dist/utils/sitevision-scripts-runner.js +50 -22
- package/dist/utils/tasks.js +510 -0
- package/dist/utils/version-check.js +3 -3
- package/dist/utils/webpack-runner.js +9 -5
- package/dist/utils/workspace.js +105 -0
- package/dist/utils/zip.js +18 -19
- package/package.json +29 -5
- package/readme.md +117 -141
- package/dist/app.d.ts +0 -6
- package/dist/app.js +0 -307
- package/dist/cli.d.ts +0 -2
- package/dist/commands/build.d.ts +0 -12
- package/dist/commands/deploy.d.ts +0 -16
- package/dist/commands/dev.d.ts +0 -16
- package/dist/commands/index.d.ts +0 -4
- package/dist/commands/info.d.ts +0 -2
- package/dist/commands/setup-signing.d.ts +0 -2
- package/dist/commands/sign.d.ts +0 -14
- package/dist/commands/types.d.ts +0 -18
- package/dist/commands/watch.d.ts +0 -2
- package/dist/components/AnimatedLogo.d.ts +0 -10
- package/dist/components/AuthLoginScreen.d.ts +0 -21
- package/dist/components/DevPropertiesForm.d.ts +0 -10
- package/dist/components/DevPropertiesForm.js +0 -210
- package/dist/components/InfoScreen.d.ts +0 -7
- package/dist/components/InfoScreen.js +0 -14
- package/dist/components/KeychainPasswordChoice.d.ts +0 -8
- package/dist/components/KeychainPasswordChoice.js +0 -30
- package/dist/components/MainMenu.d.ts +0 -7
- package/dist/components/MainMenu.js +0 -83
- package/dist/components/PasswordInput.d.ts +0 -10
- package/dist/components/ProcessOutput.d.ts +0 -6
- package/dist/components/ProcessOutput.js +0 -30
- package/dist/components/SetupFlow.d.ts +0 -8
- package/dist/components/SetupFlow.js +0 -233
- package/dist/components/SigningPropertiesForm.d.ts +0 -7
- package/dist/components/SigningPropertiesForm.js +0 -38
- package/dist/components/StatusIndicator.d.ts +0 -8
- package/dist/components/TextInput.d.ts +0 -10
- package/dist/components/TextInput.js +0 -29
- package/dist/components/WelcomeScreen.d.ts +0 -14
- package/dist/types/index.d.ts +0 -284
- package/dist/utils/branding.d.ts +0 -28
- package/dist/utils/config.d.ts +0 -17
- package/dist/utils/jsonc.d.ts +0 -19
- package/dist/utils/keychain.d.ts +0 -15
- package/dist/utils/oauth2-auth.d.ts +0 -27
- package/dist/utils/password-prompt.d.ts +0 -14
- package/dist/utils/process-runner.d.ts +0 -22
- package/dist/utils/project-detection.d.ts +0 -151
- package/dist/utils/session-cookie-auth.d.ts +0 -34
- package/dist/utils/signing-password.d.ts +0 -12
- package/dist/utils/signing-step.d.ts +0 -15
- package/dist/utils/signing-step.js +0 -16
- package/dist/utils/sitevision-api.d.ts +0 -112
- package/dist/utils/sitevision-scripts-runner.d.ts +0 -83
- package/dist/utils/version-check.d.ts +0 -9
- package/dist/utils/webpack-runner.d.ts +0 -76
- package/dist/utils/zip.d.ts +0 -71
package/dist/utils/zip.js
CHANGED
|
@@ -114,7 +114,7 @@ async function buildZipBuffer(entries) {
|
|
|
114
114
|
const localHeader = Buffer.alloc(30);
|
|
115
115
|
localHeader.writeUInt32LE(0x04034b50, 0);
|
|
116
116
|
localHeader.writeUInt16LE(20, 4); // version needed to extract
|
|
117
|
-
localHeader.writeUInt16LE(
|
|
117
|
+
localHeader.writeUInt16LE(0x08_00, 6); // general purpose flag: UTF-8 names
|
|
118
118
|
localHeader.writeUInt16LE(method, 8);
|
|
119
119
|
localHeader.writeUInt16LE(dosTime, 10);
|
|
120
120
|
localHeader.writeUInt16LE(dosDate, 12);
|
|
@@ -130,7 +130,7 @@ async function buildZipBuffer(entries) {
|
|
|
130
130
|
centralHeader.writeUInt32LE(0x02014b50, 0);
|
|
131
131
|
centralHeader.writeUInt16LE(20, 4); // version made by
|
|
132
132
|
centralHeader.writeUInt16LE(20, 6); // version needed
|
|
133
|
-
centralHeader.writeUInt16LE(
|
|
133
|
+
centralHeader.writeUInt16LE(0x08_00, 8); // general purpose flag: UTF-8 names
|
|
134
134
|
centralHeader.writeUInt16LE(method, 10);
|
|
135
135
|
centralHeader.writeUInt16LE(dosTime, 12);
|
|
136
136
|
centralHeader.writeUInt16LE(dosDate, 14);
|
|
@@ -228,6 +228,9 @@ export async function createBuildZip(projectRoot, appId) {
|
|
|
228
228
|
if (!fs.existsSync(buildDir)) {
|
|
229
229
|
throw new Error(`Build directory not found: ${buildDir}. Run build first.`);
|
|
230
230
|
}
|
|
231
|
+
if (!fs.existsSync(path.join(buildDir, 'manifest.json'))) {
|
|
232
|
+
throw new Error(`${buildDir} has no manifest.json, so the zip would not be an app. manifest.json belongs in static/ (or src/ for an app that is not bundled).`);
|
|
233
|
+
}
|
|
231
234
|
return createZip(buildDir, zipPath);
|
|
232
235
|
}
|
|
233
236
|
// =============================================================================
|
|
@@ -268,15 +271,17 @@ export function copyChunksToResources(buildDir) {
|
|
|
268
271
|
export function copyStaticToBuild(projectRoot) {
|
|
269
272
|
const staticDir = path.join(projectRoot, 'static');
|
|
270
273
|
const buildDir = path.join(projectRoot, 'build');
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
//
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
fs.mkdirSync(buildDir, { recursive: true });
|
|
275
|
+
if (fs.existsSync(staticDir))
|
|
276
|
+
copyDirRecursive(staticDir, buildDir);
|
|
277
|
+
// Every build ends here. A manifest kept at the project root is detected,
|
|
278
|
+
// so it ships when neither src/ nor static/ brought one.
|
|
279
|
+
const manifestIn = (dir) => path.join(projectRoot, dir, 'manifest.json');
|
|
280
|
+
if (fs.existsSync(manifestIn('.')) &&
|
|
281
|
+
!fs.existsSync(manifestIn('src')) &&
|
|
282
|
+
!fs.existsSync(manifestIn('static'))) {
|
|
283
|
+
fs.copyFileSync(manifestIn('.'), path.join(buildDir, 'manifest.json'));
|
|
277
284
|
}
|
|
278
|
-
// Copy static directory contents to build
|
|
279
|
-
copyDirRecursive(staticDir, buildDir);
|
|
280
285
|
}
|
|
281
286
|
/**
|
|
282
287
|
* Copy source files to build directory (for non-bundled apps)
|
|
@@ -286,15 +291,9 @@ export function copyStaticToBuild(projectRoot) {
|
|
|
286
291
|
export function copySrcToBuild(projectRoot) {
|
|
287
292
|
const srcDir = path.join(projectRoot, 'src');
|
|
288
293
|
const buildDir = path.join(projectRoot, 'build');
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
// Ensure build directory exists
|
|
293
|
-
if (!fs.existsSync(buildDir)) {
|
|
294
|
-
fs.mkdirSync(buildDir, { recursive: true });
|
|
295
|
-
}
|
|
296
|
-
// Copy src directory contents to build
|
|
297
|
-
copyDirRecursive(srcDir, buildDir);
|
|
294
|
+
fs.mkdirSync(buildDir, { recursive: true });
|
|
295
|
+
if (fs.existsSync(srcDir))
|
|
296
|
+
copyDirRecursive(srcDir, buildDir);
|
|
298
297
|
}
|
|
299
298
|
/**
|
|
300
299
|
* Recursively copy a directory
|
package/package.json
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sitevision-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Build, sign and deploy Sitevision apps from the terminal",
|
|
4
5
|
"license": "MIT",
|
|
6
|
+
"author": "Rasmus Söderström",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/xrasod/SitevisionCli.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/xrasod/SitevisionCli#readme",
|
|
12
|
+
"bugs": "https://github.com/xrasod/SitevisionCli/issues",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"sitevision",
|
|
15
|
+
"cli",
|
|
16
|
+
"webapp",
|
|
17
|
+
"restapp",
|
|
18
|
+
"deploy"
|
|
19
|
+
],
|
|
5
20
|
"bin": {
|
|
6
21
|
"svc": "dist/cli.js"
|
|
7
22
|
},
|
|
@@ -10,20 +25,23 @@
|
|
|
10
25
|
"node": ">=22"
|
|
11
26
|
},
|
|
12
27
|
"scripts": {
|
|
13
|
-
"build": "tsc",
|
|
14
|
-
"dev": "tsc --watch",
|
|
28
|
+
"build": "node -e \"fs.rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && node -e \"fs.chmodSync('dist/cli.js',0o755)\"",
|
|
29
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
15
30
|
"test": "prettier --check . && xo && ava",
|
|
31
|
+
"prepublishOnly": "npm test && npm run build",
|
|
16
32
|
"release": "./scripts/publish.sh",
|
|
17
33
|
"release:beta": "./scripts/publish-beta.sh"
|
|
18
34
|
},
|
|
19
35
|
"files": [
|
|
20
|
-
"dist"
|
|
36
|
+
"dist",
|
|
37
|
+
"CHANGELOG.md"
|
|
21
38
|
],
|
|
22
39
|
"dependencies": {
|
|
23
40
|
"@napi-rs/keyring": "^1.3.0",
|
|
24
41
|
"ink": "^7.1.0",
|
|
25
42
|
"ink-spinner": "^5.0.0",
|
|
26
43
|
"meow": "^14.1.0",
|
|
44
|
+
"open": "^11.0.3",
|
|
27
45
|
"puppeteer-core": "^25.10.0",
|
|
28
46
|
"react": "^19.2.7"
|
|
29
47
|
},
|
|
@@ -44,13 +62,19 @@
|
|
|
44
62
|
"xo": "^3.0.2"
|
|
45
63
|
},
|
|
46
64
|
"ava": {
|
|
65
|
+
"workerThreads": false,
|
|
47
66
|
"extensions": [
|
|
48
67
|
"ts",
|
|
49
68
|
"tsx"
|
|
50
69
|
],
|
|
51
70
|
"nodeArguments": [
|
|
52
71
|
"--import=tsx"
|
|
53
|
-
]
|
|
72
|
+
],
|
|
73
|
+
"environmentVariables": {
|
|
74
|
+
"FORCE_COLOR": "0",
|
|
75
|
+
"SVC_NO_KEYCHAIN": "memory",
|
|
76
|
+
"XDG_CONFIG_HOME": "test/.xdg"
|
|
77
|
+
}
|
|
54
78
|
},
|
|
55
79
|
"prettier": "@vdemedes/prettier-config"
|
|
56
80
|
}
|
package/readme.md
CHANGED
|
@@ -1,181 +1,157 @@
|
|
|
1
1
|
# Sitevision CLI
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- **
|
|
13
|
-
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
|
|
3
|
+
[](https://github.com/xrasod/SitevisionCli/actions/workflows/test.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/sitevision-cli)
|
|
5
|
+
|
|
6
|
+
`svc` builds, signs and deploys Sitevision apps (WebApp, Widget, RESTApp,
|
|
7
|
+
MCPServer) from a full-screen terminal shell or as plain commands.
|
|
8
|
+
|
|
9
|
+
- **One shell for one app or a whole repo.** Run it inside an app, or at the
|
|
10
|
+
root of a repo with many apps and switch between them. Dev and watch keep
|
|
11
|
+
running in the background.
|
|
12
|
+
- **Three ways to authenticate deploys:** username and password, OAuth2 (PKCE,
|
|
13
|
+
works with SSO), or a captured browser session for SAML-only sites.
|
|
14
|
+
- **No secrets on disk.** Passwords, tokens and cookies live in the OS keychain.
|
|
15
|
+
- **Environments.** dev, test and prod in one config; production deploys use
|
|
16
|
+
the signed zip, confirm and activate.
|
|
17
|
+
- **Shared config in git.** Site and auth settings for the whole team live in
|
|
18
|
+
`package.json`, once at the repo root; your username stays in a local
|
|
19
|
+
`.dev_properties.json`. Compatible with plain sitevision-scripts.
|
|
20
|
+
- **Builds the way Sitevision does.** Bundled apps without their own webpack
|
|
21
|
+
config are built by `@sitevision/sitevision-scripts`.
|
|
22
|
+
- English and Swedish UI.
|
|
23
|
+
|
|
24
|
+
📖 **[User guide](docs/user-guide.md)** · **[Användarguide (svenska)](docs/anvandarguide.md)**
|
|
17
25
|
|
|
18
26
|
## Install
|
|
19
27
|
|
|
28
|
+
Requires Node.js 22+.
|
|
29
|
+
|
|
20
30
|
```bash
|
|
21
31
|
npm install --global sitevision-cli
|
|
22
32
|
```
|
|
23
33
|
|
|
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:
|
|
34
|
+
## Quick start
|
|
31
35
|
|
|
32
36
|
```bash
|
|
37
|
+
cd my-repo # or cd into a single app
|
|
33
38
|
svc
|
|
34
39
|
```
|
|
35
40
|
|
|
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
|
-
svc
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
# Build the application for production
|
|
74
|
-
svc build
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
#### Signing
|
|
41
|
+
1. Pick an app in the navigator and press `Enter`. (In a new repo the shell
|
|
42
|
+
opens on **Workspace settings** first.)
|
|
43
|
+
2. Press `2` for the **Config** tab and fill in domain, site name, addon name,
|
|
44
|
+
username and auth method. Each field saves on `Enter`.
|
|
45
|
+
3. Press `i` to install dependencies if needed, then `d` to start dev: build on
|
|
46
|
+
every change and deploy. Output is in the **Log** tab (`4`).
|
|
47
|
+
|
|
48
|
+
For production: switch environment with `v`, press `b` to build, `s` to sign
|
|
49
|
+
and `p` to deploy and activate.
|
|
50
|
+
|
|
51
|
+
## The shell
|
|
52
|
+
|
|
53
|
+
| Key | Action |
|
|
54
|
+
| --------------- | --------------------------------------------------- |
|
|
55
|
+
| `d` / `w` | Dev (build + deploy on change) / Watch (build only) |
|
|
56
|
+
| `b` / `s` | Build / Sign |
|
|
57
|
+
| `p` / `P` | Deploy / force deploy to the active environment |
|
|
58
|
+
| `a` | Versions: list and activate uploaded versions |
|
|
59
|
+
| `v` | Switch environment |
|
|
60
|
+
| `e` / `y` / `i` | Config tab / sync `package.json` / `npm install` |
|
|
61
|
+
| `l` | Log in again |
|
|
62
|
+
| `K` | Stop running tasks |
|
|
63
|
+
| `1`–`4` | Overview · Config · Versions · Log |
|
|
64
|
+
| `/` | Command palette |
|
|
65
|
+
| `?` | Help: every key in one place |
|
|
66
|
+
| `,` | Settings (language, update check, hints) |
|
|
67
|
+
| `Tab` / `Esc` | Switch pane / back |
|
|
68
|
+
| `q` | Quit |
|
|
69
|
+
|
|
70
|
+
In the navigator, typing filters the app list; action keys work once `Enter` or
|
|
71
|
+
`Tab` has moved focus to the content pane. The bottom bar always shows the keys
|
|
72
|
+
that apply. `svc --minimal` gives a compact layout for small panes.
|
|
73
|
+
`svc --debug` writes a log of everything svc does, for bug reports.
|
|
74
|
+
|
|
75
|
+
## Commands
|
|
78
76
|
|
|
79
77
|
```bash
|
|
80
|
-
#
|
|
81
|
-
svc
|
|
78
|
+
svc # interactive shell
|
|
79
|
+
svc build [--no-zip] # build to dist/<id>.zip
|
|
80
|
+
svc sign # sign to dist/<id>-signed.zip
|
|
81
|
+
svc deploy [--force] # deploy the zip
|
|
82
|
+
svc deploy --production [--activate] # deploy the signed zip
|
|
83
|
+
svc dev [--signed] # build + deploy on change
|
|
84
|
+
svc watch [--signed] # build on change, no deploy
|
|
85
|
+
svc info # project information
|
|
86
|
+
svc setup-signing [--global] # save the signing username and certificate
|
|
82
87
|
```
|
|
83
88
|
|
|
84
|
-
|
|
89
|
+
Short flags: `-f` force, `-p` production, `-a` activate, `-s` signed. An unknown
|
|
90
|
+
flag is an error.
|
|
85
91
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
-
```
|
|
92
|
+
Direct commands use the base environment, run without a terminal, and exit
|
|
93
|
+
non-zero when a step fails, so `svc build && svc sign && svc deploy -p -a` is
|
|
94
|
+
safe in CI. `SITEVISION_DEPLOY_PASSWORD` and `SITEVISION_SIGNING_PASSWORD`
|
|
95
|
+
supply the passwords; `SITEVISION_ACCESS_TOKEN` and `SITEVISION_SESSION_COOKIE`
|
|
96
|
+
pass an OAuth2 token or session cookie for one run.
|
|
110
97
|
|
|
111
98
|
## Configuration
|
|
112
99
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
100
|
+
`.dev_properties.json` is your local config and the main source; keep it out of
|
|
101
|
+
git. Shared values are committed in `package.json` and act as defaults
|
|
102
|
+
underneath it:
|
|
116
103
|
|
|
117
104
|
```json
|
|
118
105
|
{
|
|
119
|
-
"
|
|
120
|
-
"siteName": "
|
|
121
|
-
"addonName": "
|
|
122
|
-
"
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
106
|
+
"developmentDomain": "acme-use.sitevision-cloud.se",
|
|
107
|
+
"siteName": "Intranet",
|
|
108
|
+
"addonName": "my-addon",
|
|
109
|
+
"svc": {
|
|
110
|
+
"authMethod": "oauth2",
|
|
111
|
+
"environments": {"prod": {"domain": "acme.sitevision-cloud.se"}}
|
|
112
|
+
}
|
|
126
113
|
}
|
|
127
114
|
```
|
|
128
115
|
|
|
129
|
-
|
|
116
|
+
`username`, `signingUsername` and `certificateName` are user-specific and only
|
|
117
|
+
live in `.dev_properties.json`. `y` copies shared values from
|
|
118
|
+
`.dev_properties.json` into `package.json`. In a workspace, shared values go in
|
|
119
|
+
the root `package.json` and each app's `package.json` only needs `addonName`.
|
|
130
120
|
|
|
131
|
-
|
|
132
|
-
from `package.json`, which duplicates three fields of
|
|
133
|
-
`.dev_properties.json`. When they disagree — or when a fresh setup has just
|
|
134
|
-
written `.dev_properties.json` — `svc` shows the differences and offers to
|
|
135
|
-
update `package.json` from `.dev_properties.json`. Nothing is written without
|
|
136
|
-
confirmation, and `.dev_properties.json` is always the source of truth for
|
|
137
|
-
the copy. Existing indentation and unrelated fields are left alone.
|
|
121
|
+
## Authentication in short
|
|
138
122
|
|
|
139
|
-
|
|
140
|
-
in the project root:
|
|
123
|
+
There are two separate credentials:
|
|
141
124
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
125
|
+
- **Deploy**: your account on the site. `authMethod` is `basic` (password),
|
|
126
|
+
`oauth2` (browser login against the site's OAuth2 provider, refreshed
|
|
127
|
+
silently afterwards) or `cookie` (log in with SSO in a Chrome window, the
|
|
128
|
+
session is captured).
|
|
129
|
+
- **Signing**: your developer.sitevision.se account, always username and
|
|
130
|
+
password.
|
|
147
131
|
|
|
148
|
-
|
|
149
|
-
`
|
|
150
|
-
|
|
132
|
+
Everything secret goes in the OS keychain under `sitevision-cli`. For CI, set
|
|
133
|
+
`SITEVISION_DEPLOY_PASSWORD`, `SITEVISION_SIGNING_PASSWORD`,
|
|
134
|
+
`SITEVISION_ACCESS_TOKEN` or `SITEVISION_SESSION_COOKIE`.
|
|
151
135
|
|
|
152
|
-
|
|
136
|
+
OAuth2 needs a client registered on the site with the redirect URI
|
|
137
|
+
`http://127.0.0.1:8137/callback`. The [user guide](docs/user-guide.md#5-authentication)
|
|
138
|
+
covers the setup, the pitfalls, and which method works with which command.
|
|
153
139
|
|
|
154
|
-
|
|
155
|
-
Credential Manager, Linux libsecret) under the `sitevision-cli` service —
|
|
156
|
-
never in `.dev_properties.json`. Run `svc` and complete the setup form (or
|
|
157
|
-
enter the password when prompted at deploy/sign time and toggle "save to
|
|
158
|
-
keychain") to populate it.
|
|
140
|
+
## Development
|
|
159
141
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
For CI / headless use, set `SITEVISION_DEPLOY_PASSWORD` and/or
|
|
167
|
-
`SITEVISION_SIGNING_PASSWORD` — these take precedence over the keychain and
|
|
168
|
-
are never written anywhere.
|
|
169
|
-
|
|
170
|
-
### Signing Credentials
|
|
171
|
-
|
|
172
|
-
Signing credentials are used to sign apps via developer.sitevision.se:
|
|
142
|
+
```bash
|
|
143
|
+
npm install
|
|
144
|
+
npm run build # tsc → dist/
|
|
145
|
+
npm test # prettier, xo, ava
|
|
146
|
+
```
|
|
173
147
|
|
|
174
|
-
|
|
175
|
-
|
|
148
|
+
To run your local build as `svc`, link it once with `npm link`, then keep
|
|
149
|
+
`npm run dev` running in the repo: every save recompiles `dist/`, so `svc` in
|
|
150
|
+
any Sitevision app reflects your changes. `npm unlink -g sitevision-cli` and
|
|
151
|
+
`npm install -g sitevision-cli` restore the published version.
|
|
176
152
|
|
|
177
|
-
|
|
178
|
-
|
|
153
|
+
Contributing: see [CONTRIBUTING.md](CONTRIBUTING.md). Releasing: see
|
|
154
|
+
[RELEASING.md](RELEASING.md).
|
|
179
155
|
|
|
180
156
|
## License
|
|
181
157
|
|