sitevision-cli 1.0.0-beta.32 → 1.0.0-beta.33

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.
Files changed (108) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/LICENSE +21 -0
  3. package/dist/cli.js +56 -35
  4. package/dist/commands/TaskScreen.js +32 -0
  5. package/dist/commands/build.js +6 -185
  6. package/dist/commands/deploy.js +85 -238
  7. package/dist/commands/dev.js +34 -37
  8. package/dist/commands/info.js +1 -1
  9. package/dist/commands/setup-signing.js +43 -28
  10. package/dist/commands/sign.js +9 -86
  11. package/dist/commands/use-finish.js +17 -0
  12. package/dist/commands/watch.js +0 -8
  13. package/dist/components/AuthLoginScreen.js +27 -12
  14. package/dist/shell/ConfigForm.js +90 -29
  15. package/dist/shell/Frame.js +4 -1
  16. package/dist/shell/Help.js +2 -1
  17. package/dist/shell/Settings.js +59 -6
  18. package/dist/shell/Shell.js +124 -41
  19. package/dist/shell/Tabs.js +8 -2
  20. package/dist/shell/actions.js +0 -0
  21. package/dist/utils/config.js +46 -3
  22. package/dist/utils/create-app.js +9 -2
  23. package/dist/utils/i18n.js +36 -13
  24. package/dist/utils/jsonc.js +2 -1
  25. package/dist/utils/keychain.js +44 -4
  26. package/dist/utils/oauth2-auth.js +35 -7
  27. package/dist/utils/password-prompt.js +23 -3
  28. package/dist/utils/process-runner.js +4 -2
  29. package/dist/utils/project-detection.js +84 -33
  30. package/dist/utils/session-cookie-auth.js +5 -4
  31. package/dist/utils/sitevision-api.js +21 -14
  32. package/dist/utils/sitevision-scripts-runner.js +32 -15
  33. package/dist/utils/tasks.js +130 -64
  34. package/dist/utils/version-check.js +3 -3
  35. package/dist/utils/webpack-runner.js +6 -5
  36. package/dist/utils/workspace.js +41 -3
  37. package/dist/utils/zip.js +18 -19
  38. package/package.json +24 -3
  39. package/readme.md +11 -4
  40. package/dist/app.d.ts +0 -6
  41. package/dist/app.js +0 -321
  42. package/dist/cli.d.ts +0 -2
  43. package/dist/commands/build.d.ts +0 -12
  44. package/dist/commands/deploy.d.ts +0 -17
  45. package/dist/commands/dev.d.ts +0 -14
  46. package/dist/commands/index.d.ts +0 -4
  47. package/dist/commands/info.d.ts +0 -2
  48. package/dist/commands/setup-signing.d.ts +0 -2
  49. package/dist/commands/sign.d.ts +0 -14
  50. package/dist/commands/types.d.ts +0 -18
  51. package/dist/commands/watch.d.ts +0 -2
  52. package/dist/components/AnimatedLogo.d.ts +0 -10
  53. package/dist/components/AuthLoginScreen.d.ts +0 -21
  54. package/dist/components/DevPropertiesForm.d.ts +0 -11
  55. package/dist/components/DevPropertiesForm.js +0 -246
  56. package/dist/components/InfoScreen.d.ts +0 -7
  57. package/dist/components/InfoScreen.js +0 -14
  58. package/dist/components/KeychainPasswordChoice.d.ts +0 -8
  59. package/dist/components/KeychainPasswordChoice.js +0 -30
  60. package/dist/components/MainMenu.d.ts +0 -7
  61. package/dist/components/MainMenu.js +0 -88
  62. package/dist/components/PasswordInput.d.ts +0 -10
  63. package/dist/components/ProcessOutput.d.ts +0 -6
  64. package/dist/components/ProcessOutput.js +0 -30
  65. package/dist/components/SetupFlow.d.ts +0 -8
  66. package/dist/components/SetupFlow.js +0 -233
  67. package/dist/components/SigningPropertiesForm.d.ts +0 -7
  68. package/dist/components/SigningPropertiesForm.js +0 -38
  69. package/dist/components/StatusIndicator.d.ts +0 -8
  70. package/dist/components/TextInput.d.ts +0 -10
  71. package/dist/components/TextInput.js +0 -29
  72. package/dist/components/WelcomeScreen.d.ts +0 -14
  73. package/dist/scaffold/inquirer-stub.d.ts +0 -6
  74. package/dist/scaffold/register.d.ts +0 -1
  75. package/dist/shell/AddonPicker.d.ts +0 -14
  76. package/dist/shell/Changelog.d.ts +0 -10
  77. package/dist/shell/CommandPalette.d.ts +0 -12
  78. package/dist/shell/ConfigForm.d.ts +0 -42
  79. package/dist/shell/Frame.d.ts +0 -59
  80. package/dist/shell/Help.d.ts +0 -9
  81. package/dist/shell/Popover.d.ts +0 -12
  82. package/dist/shell/Settings.d.ts +0 -6
  83. package/dist/shell/Shell.d.ts +0 -11
  84. package/dist/shell/Tabs.d.ts +0 -36
  85. package/dist/shell/actions.d.ts +0 -49
  86. package/dist/types/index.d.ts +0 -295
  87. package/dist/utils/branding.d.ts +0 -28
  88. package/dist/utils/config.d.ts +0 -27
  89. package/dist/utils/create-app.d.ts +0 -53
  90. package/dist/utils/environments.d.ts +0 -20
  91. package/dist/utils/i18n.d.ts +0 -12
  92. package/dist/utils/jsonc.d.ts +0 -19
  93. package/dist/utils/keychain.d.ts +0 -15
  94. package/dist/utils/oauth2-auth.d.ts +0 -64
  95. package/dist/utils/password-prompt.d.ts +0 -14
  96. package/dist/utils/process-runner.d.ts +0 -32
  97. package/dist/utils/project-detection.d.ts +0 -210
  98. package/dist/utils/session-cookie-auth.d.ts +0 -35
  99. package/dist/utils/signing-password.d.ts +0 -12
  100. package/dist/utils/signing-step.d.ts +0 -15
  101. package/dist/utils/signing-step.js +0 -16
  102. package/dist/utils/sitevision-api.d.ts +0 -155
  103. package/dist/utils/sitevision-scripts-runner.d.ts +0 -84
  104. package/dist/utils/tasks.d.ts +0 -61
  105. package/dist/utils/version-check.d.ts +0 -9
  106. package/dist/utils/webpack-runner.d.ts +0 -76
  107. package/dist/utils/workspace.d.ts +0 -17
  108. package/dist/utils/zip.d.ts +0 -71
package/package.json CHANGED
@@ -1,7 +1,22 @@
1
1
  {
2
2
  "name": "sitevision-cli",
3
- "version": "1.0.0-beta.32",
3
+ "version": "1.0.0-beta.33",
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,9 +25,10 @@
10
25
  "node": ">=22"
11
26
  },
12
27
  "scripts": {
13
- "build": "tsc",
28
+ "build": "node -e \"fs.rmSync('dist',{recursive:true,force:true})\" && tsc && node -e \"fs.chmodSync('dist/cli.js',0o755)\"",
14
29
  "dev": "tsc --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
  },
@@ -52,7 +68,12 @@
52
68
  ],
53
69
  "nodeArguments": [
54
70
  "--import=tsx"
55
- ]
71
+ ],
72
+ "environmentVariables": {
73
+ "FORCE_COLOR": "0",
74
+ "SVC_NO_KEYCHAIN": "memory",
75
+ "XDG_CONFIG_HOME": "test/.xdg"
76
+ }
56
77
  },
57
78
  "prettier": "@vdemedes/prettier-config"
58
79
  }
package/readme.md CHANGED
@@ -60,7 +60,7 @@ and `p` to deploy and activate.
60
60
  | `1`–`4` | Overview · Config · Versions · Log |
61
61
  | `/` | Command palette |
62
62
  | `?` | Help: every key in one place |
63
- | `,` | Settings (language, intro animation) |
63
+ | `,` | Settings (language, update check, hints) |
64
64
  | `Tab` / `Esc` | Switch pane / back |
65
65
  | `q` | Quit |
66
66
 
@@ -72,17 +72,24 @@ that apply. `svc --minimal` gives a compact layout for small panes.
72
72
 
73
73
  ```bash
74
74
  svc # interactive shell
75
- svc build # build to dist/<id>.zip
75
+ svc build [--no-zip] # build to dist/<id>.zip
76
76
  svc sign # sign to dist/<id>-signed.zip
77
77
  svc deploy [--force] # deploy the zip
78
78
  svc deploy --production [--activate] # deploy the signed zip
79
79
  svc dev [--signed] # build + deploy on change
80
80
  svc watch [--signed] # build on change, no deploy
81
81
  svc info # project information
82
+ svc setup-signing [--global] # save the signing username and certificate
82
83
  ```
83
84
 
84
- Direct commands use the base environment. `--token` and `--cookie` pass an
85
- OAuth2 token or session cookie for one run.
85
+ Short flags: `-f` force, `-p` production, `-a` activate, `-s` signed. An unknown
86
+ flag is an error.
87
+
88
+ Direct commands use the base environment, run without a terminal, and exit
89
+ non-zero when a step fails, so `svc build && svc sign && svc deploy -p -a` is
90
+ safe in CI. `SITEVISION_DEPLOY_PASSWORD` and `SITEVISION_SIGNING_PASSWORD`
91
+ supply the passwords; `SITEVISION_ACCESS_TOKEN` and `SITEVISION_SESSION_COOKIE`
92
+ pass an OAuth2 token or session cookie for one run.
86
93
 
87
94
  ## Configuration
88
95
 
package/dist/app.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { type ProjectInfo } from './utils/project-detection.js';
2
- type Props = {
3
- project: ProjectInfo;
4
- };
5
- export default function App({ project: initialProject }: Props): import("react").JSX.Element | null;
6
- export {};
package/dist/app.js DELETED
@@ -1,321 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useCallback, useMemo, useState } from 'react';
3
- import { detectProject } from './utils/project-detection.js';
4
- import { MainMenu } from './components/MainMenu.js';
5
- import { InfoScreen } from './components/InfoScreen.js';
6
- import { SetupFlow } from './components/SetupFlow.js';
7
- import { DevPropertiesForm } from './components/DevPropertiesForm.js';
8
- import { PasswordInput } from './components/PasswordInput.js';
9
- import { KeychainPasswordChoice } from './components/KeychainPasswordChoice.js';
10
- import { decideSigningStep } from './utils/signing-step.js';
11
- import { DevScreen } from './commands/dev.js';
12
- import { BuildScreen } from './commands/build.js';
13
- import { DeployScreen } from './commands/deploy.js';
14
- import { SignScreen } from './commands/sign.js';
15
- import { SigningPropertiesForm } from './components/SigningPropertiesForm.js';
16
- import { getSigningPassword, setDeployPassword as saveDeployPassword, setSigningPassword as saveSigningPassword, } from './utils/keychain.js';
17
- const NONBASIC_DEV_UNSUPPORTED = '\x1b[33mdev/watch support only basic auth. Use `svc deploy` for OAuth2/cookie.\x1b[0m';
18
- export default function App({ project: initialProject }) {
19
- // The project is loaded once at startup, but setup flows write new values to
20
- // disk and the OS keychain. Hold it in state so we can re-detect after setup
21
- // and pick up those changes (e.g. saved passwords) without restarting the CLI.
22
- const [project, setProject] = useState(initialProject);
23
- const reloadProject = useCallback(() => {
24
- try {
25
- const refreshed = detectProject(initialProject.root);
26
- if (refreshed)
27
- setProject(refreshed);
28
- }
29
- catch {
30
- // Re-detection failed (e.g. manifest became unparseable mid-session) —
31
- // keep the existing in-memory project rather than crashing.
32
- }
33
- }, [initialProject.root]);
34
- const [state, setState] = useState('setup');
35
- const [currentCommand, setCurrentCommand] = useState('');
36
- const [signingPassword, setSigningPassword] = useState('');
37
- const [devPassword, setDevPassword] = useState('');
38
- // When true, skip the keychain "use saved / enter new" choice and go straight
39
- // to manual entry (e.g. the saved password just failed and we're retrying).
40
- const [signingRetry, setSigningRetry] = useState(false);
41
- // Read the saved signing password from the keychain once (keychain access is
42
- // slow and this component re-renders frequently).
43
- const signingUsername = project.devProperties?.signingUsername;
44
- const storedSigningPassword = useMemo(() => (signingUsername ? getSigningPassword(signingUsername) : null), [signingUsername]);
45
- // Map a signing-capable command to the screen it lands on once the signing
46
- // password is resolved.
47
- const signedDestination = (command = currentCommand) => {
48
- if (command === 'dev-signed')
49
- return 'dev';
50
- if (command === 'watch-signed')
51
- return 'watch';
52
- return 'sign';
53
- };
54
- // Decide the next step once a signing password is needed: proceed if we already
55
- // have one this session, offer the keychain choice if one is saved, otherwise
56
- // prompt for manual entry.
57
- const routeToSigningStep = (command = currentCommand) => {
58
- const step = decideSigningStep({
59
- hasSessionPassword: Boolean(signingPassword),
60
- hasStoredPassword: Boolean(storedSigningPassword),
61
- isRetry: signingRetry,
62
- });
63
- if (step === 'proceed') {
64
- setState(signedDestination(command));
65
- }
66
- else if (step === 'choice') {
67
- setState('signing-password-choice');
68
- }
69
- else {
70
- setState('signing-password-input');
71
- }
72
- };
73
- // Check if dev password is available (either from file or session)
74
- const hasDevPassword = Boolean(project.devProperties?.password || devPassword);
75
- // OAuth2 / cookie configs authenticate with a token or session resolved at
76
- // deploy time, so they need no basic password. `svc dev`/`watch` stay basic.
77
- const authMethod = project.devProperties?.authMethod ?? 'basic';
78
- const isTokenAuth = authMethod === 'oauth2' || authMethod === 'cookie';
79
- const deployAuthReady = isTokenAuth || hasDevPassword;
80
- // Get effective dev properties with session password if needed
81
- const getEffectiveDevProperties = () => {
82
- if (!project.devProperties)
83
- return undefined;
84
- // Non-basic configs authenticate by token/cookie — never graft a password.
85
- if (isTokenAuth)
86
- return project.devProperties;
87
- if (project.devProperties.password)
88
- return project.devProperties;
89
- return { ...project.devProperties, password: devPassword };
90
- };
91
- const handleDevPasswordSubmit = (password, remember) => {
92
- setDevPassword(password);
93
- if (remember &&
94
- project.devProperties?.domain &&
95
- project.devProperties.username &&
96
- password) {
97
- saveDeployPassword(project.devProperties.domain, project.devProperties.username, password);
98
- }
99
- // Continue to the intended command
100
- if (currentCommand === 'dev' || currentCommand === 'dev-signed') {
101
- if (currentCommand === 'dev-signed') {
102
- routeToSigningStep();
103
- }
104
- else {
105
- setState('dev');
106
- }
107
- }
108
- else if (currentCommand.startsWith('deploy')) {
109
- setState('deploy');
110
- }
111
- };
112
- const handleUseSavedSigning = () => {
113
- if (storedSigningPassword) {
114
- setSigningPassword(storedSigningPassword);
115
- }
116
- setState(signedDestination());
117
- };
118
- const handleEnterNewSigning = () => {
119
- setState('signing-password-input');
120
- };
121
- const handleSigningPasswordSubmit = (password, remember) => {
122
- setSigningPassword(password);
123
- if (remember && project.devProperties?.signingUsername && password) {
124
- saveSigningPassword(project.devProperties.signingUsername, password);
125
- }
126
- setState(signedDestination());
127
- };
128
- const handleCommandSelect = (command) => {
129
- setCurrentCommand(command);
130
- // Fresh selection from the menu — re-offer the saved keychain password.
131
- setSigningRetry(false);
132
- switch (command) {
133
- case 'info':
134
- setState('info');
135
- break;
136
- case 'setup-signing':
137
- setState('setup-signing');
138
- break;
139
- case 'change-auth':
140
- if (!project.hasDevProperties || !project.devProperties) {
141
- console.log('\x1b[31mDevelopment properties not configured. Create a .dev_properties.json file first.\x1b[0m');
142
- return;
143
- }
144
- setState('change-auth-method');
145
- break;
146
- case 'dev':
147
- if (!project.hasDevProperties || !project.devProperties) {
148
- console.log('\x1b[31mDevelopment properties not configured. Create a .dev_properties.json file first.\x1b[0m');
149
- return;
150
- }
151
- if (isTokenAuth) {
152
- console.log(NONBASIC_DEV_UNSUPPORTED);
153
- return;
154
- }
155
- if (!hasDevPassword) {
156
- setState('dev-password-input');
157
- }
158
- else {
159
- setState('dev');
160
- }
161
- break;
162
- case 'dev-signed':
163
- if (!project.hasDevProperties || !project.devProperties) {
164
- console.log('\x1b[31mDevelopment properties not configured. Create a .dev_properties.json file first.\x1b[0m');
165
- return;
166
- }
167
- if (!project.hasSigningProperties) {
168
- console.log('\x1b[31mSigning credentials not configured. Run svc setup-signing first.\x1b[0m');
169
- return;
170
- }
171
- if (isTokenAuth) {
172
- console.log(NONBASIC_DEV_UNSUPPORTED);
173
- return;
174
- }
175
- // Need both dev password and signing password
176
- if (!hasDevPassword) {
177
- setState('dev-password-input');
178
- }
179
- else {
180
- routeToSigningStep(command);
181
- }
182
- break;
183
- case 'watch':
184
- // Build/sign-only: no deploy and no signing, so no credentials needed.
185
- setState('watch');
186
- break;
187
- case 'watch-signed':
188
- if (!project.hasDevProperties || !project.devProperties) {
189
- console.log('\x1b[31mDevelopment properties not configured. Create a .dev_properties.json file first.\x1b[0m');
190
- return;
191
- }
192
- if (!project.hasSigningProperties) {
193
- console.log('\x1b[31mSigning credentials not configured. Run svc setup-signing first.\x1b[0m');
194
- return;
195
- }
196
- if (isTokenAuth) {
197
- console.log(NONBASIC_DEV_UNSUPPORTED);
198
- return;
199
- }
200
- routeToSigningStep(command);
201
- break;
202
- case 'sign':
203
- if (!project.hasDevProperties || !project.devProperties) {
204
- console.log('\x1b[31mDevelopment properties not configured. Create a .dev_properties.json file first.\x1b[0m');
205
- return;
206
- }
207
- if (!project.hasSigningProperties) {
208
- console.log('\x1b[31mSigning credentials not configured. Run svc setup-signing first.\x1b[0m');
209
- return;
210
- }
211
- routeToSigningStep(command);
212
- break;
213
- case 'build':
214
- setState('build');
215
- break;
216
- case 'deploy':
217
- case 'deploy-force':
218
- case 'deploy-production':
219
- if (!project.hasDevProperties || !project.devProperties) {
220
- console.log('\x1b[31mDevelopment properties not configured. Create a .dev_properties.json file first.\x1b[0m');
221
- return;
222
- }
223
- if (!deployAuthReady) {
224
- setState('dev-password-input');
225
- }
226
- else {
227
- setState('deploy');
228
- }
229
- break;
230
- }
231
- };
232
- if (state === 'change-auth-method') {
233
- return (_jsx(DevPropertiesForm, { projectRoot: project.root, initialProperties: project.devProperties, packageJson: project.packageJson, authOnly: true, onComplete: () => {
234
- reloadProject();
235
- setState('menu');
236
- }, onCancel: () => setState('menu') }));
237
- }
238
- if (state === 'setup') {
239
- return (_jsx(SetupFlow, { project: project, onReload: reloadProject, onComplete: () => setState('menu') }));
240
- }
241
- if (state === 'menu') {
242
- return _jsx(MainMenu, { project: project, onSelect: handleCommandSelect });
243
- }
244
- if (state === 'info') {
245
- return _jsx(InfoScreen, { project: project, onBack: () => setState('menu') });
246
- }
247
- if (state === 'dev-password-input') {
248
- return (_jsx(PasswordInput, { label: "Enter Development Password (usually Sitevision Cloud Password)", showRememberOption: Boolean(project.devProperties?.domain && project.devProperties?.username), onSubmit: handleDevPasswordSubmit, onCancel: () => setState('menu') }, "dev-password"));
249
- }
250
- if (state === 'signing-password-choice') {
251
- return (_jsx(KeychainPasswordChoice, { onUseSaved: handleUseSavedSigning, onEnterNew: handleEnterNewSigning, onCancel: () => setState('menu') }, "signing-password-choice"));
252
- }
253
- if (state === 'signing-password-input') {
254
- return (_jsx(PasswordInput, { label: "Enter Signing Password (developer.sitevision.se)", showRememberOption: Boolean(project.devProperties?.signingUsername), defaultRemember: Boolean(storedSigningPassword), rememberLabel: storedSigningPassword
255
- ? 'Update saved password in OS keychain: '
256
- : 'Save to OS keychain: ', onSubmit: handleSigningPasswordSubmit, onCancel: () => setState('menu') }, "signing-password"));
257
- }
258
- if (state === 'dev') {
259
- return (_jsx(DevScreen, { projectRoot: project.root, manifest: project.manifest, devProperties: getEffectiveDevProperties(), signed: currentCommand === 'dev-signed', onBack: () => setState('menu'), onRetryCredentials: () => {
260
- setDevPassword('');
261
- if (project.devProperties)
262
- project.devProperties.password = undefined;
263
- if (currentCommand === 'dev-signed') {
264
- setSigningPassword('');
265
- // The saved password may be what failed — don't re-offer it.
266
- setSigningRetry(true);
267
- }
268
- setState('dev-password-input');
269
- }, signingCredentials: currentCommand === 'dev-signed' &&
270
- project.devProperties?.signingUsername
271
- ? {
272
- username: project.devProperties.signingUsername,
273
- password: signingPassword,
274
- certificateName: project.devProperties.certificateName,
275
- }
276
- : undefined }));
277
- }
278
- if (state === 'watch') {
279
- const watchSigned = currentCommand === 'watch-signed';
280
- return (_jsx(DevScreen, { projectRoot: project.root, manifest: project.manifest, devProperties: project.devProperties, signed: watchSigned, deploy: false, onBack: () => setState('menu'), onRetryCredentials: watchSigned
281
- ? () => {
282
- setSigningPassword('');
283
- // The saved password may be what failed — don't re-offer it.
284
- setSigningRetry(true);
285
- routeToSigningStep('watch-signed');
286
- }
287
- : undefined, signingCredentials: watchSigned && project.devProperties?.signingUsername
288
- ? {
289
- username: project.devProperties.signingUsername,
290
- password: signingPassword,
291
- certificateName: project.devProperties.certificateName,
292
- }
293
- : undefined }));
294
- }
295
- if (state === 'build') {
296
- return (_jsx(BuildScreen, { projectRoot: project.root, manifest: project.manifest, createZip: true, onBack: () => setState('menu') }));
297
- }
298
- if (state === 'sign') {
299
- return (_jsx(SignScreen, { projectRoot: project.root, manifest: project.manifest, devProperties: project.devProperties, password: signingPassword, onBack: () => setState('menu'), onRetryCredentials: () => {
300
- setSigningPassword('');
301
- setState('signing-password-input');
302
- } }));
303
- }
304
- if (state === 'deploy') {
305
- return (_jsx(DeployScreen, { projectRoot: project.root, manifest: project.manifest, devProperties: getEffectiveDevProperties(), force: currentCommand === 'deploy-force', production: currentCommand === 'deploy-production', activate: currentCommand === 'deploy-production', onBack: () => setState('menu'), onRetryCredentials: () => {
306
- setDevPassword('');
307
- if (project.devProperties)
308
- project.devProperties.password = undefined;
309
- setState('dev-password-input');
310
- }, onChangeAuthMethod: () => setState('change-auth-method') }));
311
- }
312
- if (state === 'setup-signing') {
313
- return (_jsx(SigningPropertiesForm, { projectRoot: project.root, onComplete: () => {
314
- // Re-detect so the newly written signing credentials are reflected
315
- // in memory (hasSigningProperties, keychain password) without a restart.
316
- reloadProject();
317
- setState('menu');
318
- }, onCancel: () => setState('menu') }));
319
- }
320
- return null;
321
- }
package/dist/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { type Command } from './types.js';
3
- import type { SitevisionManifest } from '../types/index.js';
4
- interface BuildScreenProps {
5
- projectRoot: string;
6
- manifest: SitevisionManifest;
7
- createZip?: boolean;
8
- onBack?: () => void;
9
- }
10
- export declare function BuildScreen({ projectRoot, manifest, createZip, onBack, }: BuildScreenProps): React.JSX.Element;
11
- export declare const buildCommand: Command;
12
- export {};
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { type Command } from './types.js';
3
- import type { SitevisionManifest, DevProperties } from '../types/index.js';
4
- interface DeployScreenProps {
5
- projectRoot: string;
6
- manifest: SitevisionManifest;
7
- devProperties: DevProperties;
8
- force: boolean;
9
- production: boolean;
10
- activate: boolean;
11
- onBack?: () => void;
12
- onRetryCredentials?: () => void;
13
- onChangeAuthMethod?: () => void;
14
- }
15
- export declare function DeployScreen({ projectRoot, manifest, devProperties, force, production, activate, onBack, onRetryCredentials, onChangeAuthMethod, }: DeployScreenProps): React.JSX.Element;
16
- export declare const deployCommand: Command;
17
- export {};
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { type Command } from './types.js';
3
- import { type DevOptions } from '../utils/tasks.js';
4
- import type { ProjectInfo, SigningCredentials } from '../types/index.js';
5
- interface DevScreenProps {
6
- project: ProjectInfo;
7
- options: DevOptions;
8
- }
9
- /** Standalone `svc dev` / `svc watch`: one task, its log, Ctrl+C or q to stop. */
10
- export declare function DevScreen({ project, options }: DevScreenProps): React.JSX.Element;
11
- /** Resolve signing credentials for signed dev/watch, prompting if needed. */
12
- export declare function resolveSigningForCli(project: ProjectInfo): Promise<SigningCredentials | undefined>;
13
- export declare const devCommand: Command;
14
- export {};
@@ -1,4 +0,0 @@
1
- import { type Command } from './types.js';
2
- export declare const commands: Command[];
3
- export declare function getCommand(name: string): Command | undefined;
4
- export declare function getAllCommands(): Command[];
@@ -1,2 +0,0 @@
1
- import { type Command } from './types.js';
2
- export declare const infoCommand: Command;
@@ -1,2 +0,0 @@
1
- import { type Command } from './types.js';
2
- export declare const setupSigningCommand: Command;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { type Command } from './types.js';
3
- import type { SitevisionManifest, DevProperties } from '../types/index.js';
4
- interface SignScreenProps {
5
- projectRoot: string;
6
- manifest: SitevisionManifest;
7
- devProperties: DevProperties;
8
- password: string;
9
- onBack?: () => void;
10
- onRetryCredentials?: () => void;
11
- }
12
- export declare function SignScreen({ projectRoot, manifest, devProperties, password, onBack, onRetryCredentials, }: SignScreenProps): React.JSX.Element;
13
- export declare const signCommand: Command;
14
- export {};
@@ -1,18 +0,0 @@
1
- import { type ProjectInfo } from '../utils/project-detection.js';
2
- export interface CommandContext {
3
- project: ProjectInfo;
4
- flags: Record<string, any>;
5
- args: string[];
6
- }
7
- export interface Command {
8
- name: string;
9
- description: string;
10
- requiresProject: boolean;
11
- flags?: Record<string, {
12
- type: 'string' | 'boolean';
13
- description: string;
14
- alias?: string;
15
- default?: any;
16
- }>;
17
- execute: (context: CommandContext) => Promise<void>;
18
- }
@@ -1,2 +0,0 @@
1
- import { type Command } from './types.js';
2
- export declare const watchCommand: Command;
@@ -1,10 +0,0 @@
1
- interface Props {
2
- art?: string[];
3
- onDone: () => void;
4
- }
5
- /**
6
- * One-shot startup flair: wipes the big wordmark in left-to-right while a
7
- * rainbow gradient drifts across it, then calls `onDone`. Purely decorative.
8
- */
9
- export declare function AnimatedLogo({ art, onDone }: Props): import("react").JSX.Element;
10
- export {};
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import type { DevProperties } from '../types/index.js';
3
- interface Credential {
4
- accessToken?: string;
5
- sessionCookie?: string;
6
- }
7
- interface Props {
8
- method: 'oauth2' | 'cookie';
9
- devProperties: DevProperties;
10
- onComplete: (credential: Credential) => void;
11
- onError: (message: string) => void;
12
- onCancel: () => void;
13
- }
14
- /**
15
- * Ink-native interactive login for OAuth2 and session-cookie auth. Drives the
16
- * browser and (for cookie) the "press Enter to capture" handoff through Ink's
17
- * own input, so it works inside the TUI as well as the standalone command —
18
- * neither needs to own raw stdin the way the old console prompt did.
19
- */
20
- export declare function AuthLoginScreen({ method, devProperties, onComplete, onError, onCancel, }: Props): React.JSX.Element;
21
- export {};
@@ -1,11 +0,0 @@
1
- import type { DevProperties, PackageJson } from '../types/index.js';
2
- interface Props {
3
- projectRoot: string;
4
- initialProperties?: DevProperties;
5
- packageJson: PackageJson;
6
- authOnly?: boolean;
7
- onComplete: () => void;
8
- onCancel: () => void;
9
- }
10
- export declare function DevPropertiesForm({ projectRoot, initialProperties, packageJson, authOnly, onComplete, onCancel, }: Props): import("react").JSX.Element;
11
- export {};