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.
- package/CHANGELOG.md +50 -0
- package/LICENSE +21 -0
- package/dist/cli.js +56 -35
- package/dist/commands/TaskScreen.js +32 -0
- package/dist/commands/build.js +6 -185
- package/dist/commands/deploy.js +85 -238
- package/dist/commands/dev.js +34 -37
- package/dist/commands/info.js +1 -1
- package/dist/commands/setup-signing.js +43 -28
- package/dist/commands/sign.js +9 -86
- package/dist/commands/use-finish.js +17 -0
- package/dist/commands/watch.js +0 -8
- package/dist/components/AuthLoginScreen.js +27 -12
- package/dist/shell/ConfigForm.js +90 -29
- package/dist/shell/Frame.js +4 -1
- package/dist/shell/Help.js +2 -1
- package/dist/shell/Settings.js +59 -6
- package/dist/shell/Shell.js +124 -41
- package/dist/shell/Tabs.js +8 -2
- package/dist/shell/actions.js +0 -0
- package/dist/utils/config.js +46 -3
- package/dist/utils/create-app.js +9 -2
- package/dist/utils/i18n.js +36 -13
- package/dist/utils/jsonc.js +2 -1
- package/dist/utils/keychain.js +44 -4
- package/dist/utils/oauth2-auth.js +35 -7
- package/dist/utils/password-prompt.js +23 -3
- package/dist/utils/process-runner.js +4 -2
- package/dist/utils/project-detection.js +84 -33
- package/dist/utils/session-cookie-auth.js +5 -4
- package/dist/utils/sitevision-api.js +21 -14
- package/dist/utils/sitevision-scripts-runner.js +32 -15
- package/dist/utils/tasks.js +130 -64
- package/dist/utils/version-check.js +3 -3
- package/dist/utils/webpack-runner.js +6 -5
- package/dist/utils/workspace.js +41 -3
- package/dist/utils/zip.js +18 -19
- package/package.json +24 -3
- package/readme.md +11 -4
- package/dist/app.d.ts +0 -6
- package/dist/app.js +0 -321
- package/dist/cli.d.ts +0 -2
- package/dist/commands/build.d.ts +0 -12
- package/dist/commands/deploy.d.ts +0 -17
- package/dist/commands/dev.d.ts +0 -14
- 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 -11
- package/dist/components/DevPropertiesForm.js +0 -246
- 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 -88
- 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/scaffold/inquirer-stub.d.ts +0 -6
- package/dist/scaffold/register.d.ts +0 -1
- package/dist/shell/AddonPicker.d.ts +0 -14
- package/dist/shell/Changelog.d.ts +0 -10
- package/dist/shell/CommandPalette.d.ts +0 -12
- package/dist/shell/ConfigForm.d.ts +0 -42
- package/dist/shell/Frame.d.ts +0 -59
- package/dist/shell/Help.d.ts +0 -9
- package/dist/shell/Popover.d.ts +0 -12
- package/dist/shell/Settings.d.ts +0 -6
- package/dist/shell/Shell.d.ts +0 -11
- package/dist/shell/Tabs.d.ts +0 -36
- package/dist/shell/actions.d.ts +0 -49
- package/dist/types/index.d.ts +0 -295
- package/dist/utils/branding.d.ts +0 -28
- package/dist/utils/config.d.ts +0 -27
- package/dist/utils/create-app.d.ts +0 -53
- package/dist/utils/environments.d.ts +0 -20
- package/dist/utils/i18n.d.ts +0 -12
- package/dist/utils/jsonc.d.ts +0 -19
- package/dist/utils/keychain.d.ts +0 -15
- package/dist/utils/oauth2-auth.d.ts +0 -64
- package/dist/utils/password-prompt.d.ts +0 -14
- package/dist/utils/process-runner.d.ts +0 -32
- package/dist/utils/project-detection.d.ts +0 -210
- package/dist/utils/session-cookie-auth.d.ts +0 -35
- 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 -155
- package/dist/utils/sitevision-scripts-runner.d.ts +0 -84
- package/dist/utils/tasks.d.ts +0 -61
- package/dist/utils/version-check.d.ts +0 -9
- package/dist/utils/webpack-runner.d.ts +0 -76
- package/dist/utils/workspace.d.ts +0 -17
- package/dist/utils/zip.d.ts +0 -71
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { Box, Text, useInput } from 'ink';
|
|
4
|
-
import { getAppType, localizedText, migrateLegacyPassword, getPackageJsonSyncChanges, syncDevPropertiesToPackageJson, readSvcConfig, writeSvcConfig, writeDevProperties, } from '../utils/project-detection.js';
|
|
5
|
-
import { ProcessRunner } from '../utils/process-runner.js';
|
|
6
|
-
import { ProcessOutputComponent } from './ProcessOutput.js';
|
|
7
|
-
import { StatusIndicator } from './StatusIndicator.js';
|
|
8
|
-
import { DevPropertiesForm } from './DevPropertiesForm.js';
|
|
9
|
-
import { SigningPropertiesForm } from './SigningPropertiesForm.js';
|
|
10
|
-
export function SetupFlow({ project, onReload, onComplete }) {
|
|
11
|
-
const [step, setStep] = useState('check-node-modules');
|
|
12
|
-
const [runner, setRunner] = useState(null);
|
|
13
|
-
const [commandStatus, setCommandStatus] = useState('running');
|
|
14
|
-
const [syncChanges, setSyncChanges] = useState([]);
|
|
15
|
-
const [syncDecision, setSyncDecision] = useState(false);
|
|
16
|
-
// Set when the user picks OAuth2 for an existing config, so the form opens in
|
|
17
|
-
// the OAuth2 branch without mutating the shared project object.
|
|
18
|
-
const [pendingAuthMethod, setPendingAuthMethod] = useState(undefined);
|
|
19
|
-
const appType = getAppType(project.manifest);
|
|
20
|
-
// Auto-advance through checks
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
if (step === 'check-node-modules') {
|
|
23
|
-
if (project.hasNodeModules) {
|
|
24
|
-
setStep('check-dev-properties');
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
setStep('confirm-npm-install');
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
else if (step === 'check-dev-properties') {
|
|
31
|
-
if (project.hasDevProperties) {
|
|
32
|
-
if (project.hasLegacyPassword) {
|
|
33
|
-
setStep('confirm-password-migration');
|
|
34
|
-
}
|
|
35
|
-
else if (project.devProperties?.authMethod === undefined) {
|
|
36
|
-
setStep('confirm-auth-method');
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
setStep('check-package-sync');
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
setStep('confirm-dev-setup');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else if (step === 'check-package-sync') {
|
|
47
|
-
const preference = readSvcConfig(project.root).syncPackageJson;
|
|
48
|
-
const properties = project.devProperties;
|
|
49
|
-
const changes = preference !== false && properties
|
|
50
|
-
? getPackageJsonSyncChanges(project.root, properties)
|
|
51
|
-
: [];
|
|
52
|
-
if (changes.length === 0 || !properties) {
|
|
53
|
-
setStep('check-signing-properties');
|
|
54
|
-
}
|
|
55
|
-
else if (preference === true) {
|
|
56
|
-
syncDevPropertiesToPackageJson(project.root, properties);
|
|
57
|
-
onReload();
|
|
58
|
-
setStep('check-signing-properties');
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
setSyncChanges(changes);
|
|
62
|
-
setStep('confirm-package-sync');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
else if (step === 'check-signing-properties') {
|
|
66
|
-
if (project.hasSigningProperties) {
|
|
67
|
-
setStep('show-info');
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
setStep('confirm-signing-setup');
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
else if (step === 'show-info') {
|
|
74
|
-
// Auto-advance to menu after displaying info
|
|
75
|
-
onComplete();
|
|
76
|
-
}
|
|
77
|
-
}, [step, project, onComplete]); // Removed specific props from dependency array to allow re-check after updates
|
|
78
|
-
useInput(input => {
|
|
79
|
-
if (step === 'confirm-npm-install') {
|
|
80
|
-
if (input === 'y' || input === 'Y') {
|
|
81
|
-
setStep('running-npm-install');
|
|
82
|
-
setCommandStatus('running');
|
|
83
|
-
// npm install is a native command, not a script
|
|
84
|
-
const newRunner = new ProcessRunner('npm', ['install'], project.root);
|
|
85
|
-
newRunner.on('exit', (code) => {
|
|
86
|
-
if (code === 0) {
|
|
87
|
-
setCommandStatus('success');
|
|
88
|
-
// Force project info refresh would be ideal here
|
|
89
|
-
// For now, assume success and move on
|
|
90
|
-
setTimeout(() => setStep('check-dev-properties'), 1000);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
setCommandStatus('error');
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
setRunner(newRunner);
|
|
97
|
-
newRunner.run().catch(() => setCommandStatus('error'));
|
|
98
|
-
}
|
|
99
|
-
else if (input === 'n' || input === 'N') {
|
|
100
|
-
setStep('check-dev-properties');
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
else if (step === 'confirm-dev-setup') {
|
|
104
|
-
if (input === 'y' || input === 'Y') {
|
|
105
|
-
setStep('setup-dev-properties');
|
|
106
|
-
}
|
|
107
|
-
else if (input === 'n' || input === 'N') {
|
|
108
|
-
setStep('check-signing-properties');
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
else if (step === 'confirm-password-migration') {
|
|
112
|
-
if (input === 'y' || input === 'Y') {
|
|
113
|
-
migrateLegacyPassword(project);
|
|
114
|
-
// The file was rewritten (plaintext stripped, password moved to
|
|
115
|
-
// keychain) — re-detect so hasLegacyPassword/password reflect that.
|
|
116
|
-
onReload();
|
|
117
|
-
setStep('check-package-sync');
|
|
118
|
-
}
|
|
119
|
-
else if (input === 'n' || input === 'N') {
|
|
120
|
-
setStep('check-package-sync');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
else if (step === 'confirm-package-sync') {
|
|
124
|
-
if (['y', 'Y', 'n', 'N'].includes(input)) {
|
|
125
|
-
const accepted = input.toLowerCase() === 'y';
|
|
126
|
-
if (accepted && project.devProperties) {
|
|
127
|
-
syncDevPropertiesToPackageJson(project.root, project.devProperties);
|
|
128
|
-
onReload();
|
|
129
|
-
}
|
|
130
|
-
setSyncDecision(accepted);
|
|
131
|
-
setStep('confirm-save-sync-choice');
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
else if (step === 'confirm-save-sync-choice') {
|
|
135
|
-
if (input === 'y' || input === 'Y') {
|
|
136
|
-
writeSvcConfig(project.root, { syncPackageJson: syncDecision });
|
|
137
|
-
setStep('check-signing-properties');
|
|
138
|
-
}
|
|
139
|
-
else if (input === 'n' || input === 'N') {
|
|
140
|
-
setStep('check-signing-properties');
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
else if (step === 'confirm-signing-setup') {
|
|
144
|
-
if (input === 'y' || input === 'Y') {
|
|
145
|
-
setStep('setup-signing-properties');
|
|
146
|
-
}
|
|
147
|
-
else if (input === 'n' || input === 'N') {
|
|
148
|
-
setStep('show-info');
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
else if (step === 'confirm-auth-method') {
|
|
152
|
-
if (input === 'o' || input === 'O') {
|
|
153
|
-
// Choosing OAuth2 needs endpoints — collect them in the full form.
|
|
154
|
-
setPendingAuthMethod('oauth2');
|
|
155
|
-
setStep('setup-dev-properties');
|
|
156
|
-
}
|
|
157
|
-
else if (input === 'c' || input === 'C') {
|
|
158
|
-
setPendingAuthMethod('cookie');
|
|
159
|
-
setStep('setup-dev-properties');
|
|
160
|
-
}
|
|
161
|
-
else if (['b', 'B', '\r'].includes(input)) {
|
|
162
|
-
if (project.devProperties) {
|
|
163
|
-
writeDevProperties(project.root, {
|
|
164
|
-
...project.devProperties,
|
|
165
|
-
authMethod: 'basic',
|
|
166
|
-
});
|
|
167
|
-
onReload();
|
|
168
|
-
}
|
|
169
|
-
setStep('check-package-sync');
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
// Setup Dev Properties Form
|
|
174
|
-
if (step === 'setup-dev-properties') {
|
|
175
|
-
return (_jsx(DevPropertiesForm, { projectRoot: project.root, initialProperties: pendingAuthMethod && project.devProperties
|
|
176
|
-
? { ...project.devProperties, authMethod: pendingAuthMethod }
|
|
177
|
-
: project.devProperties, packageJson: project.packageJson, onComplete: () => {
|
|
178
|
-
// Re-detect from disk/keychain so devProperties (incl. the keychain
|
|
179
|
-
// password) populate in memory — otherwise the rest of this flow and
|
|
180
|
-
// the menu would see stale state until the CLI is restarted.
|
|
181
|
-
onReload();
|
|
182
|
-
setStep('check-package-sync');
|
|
183
|
-
}, onCancel: () => setStep('check-signing-properties') }));
|
|
184
|
-
}
|
|
185
|
-
// Setup Signing Properties Form
|
|
186
|
-
if (step === 'setup-signing-properties') {
|
|
187
|
-
return (_jsx(SigningPropertiesForm, { projectRoot: project.root, onComplete: () => {
|
|
188
|
-
// Re-detect so signing credentials are reflected in memory before
|
|
189
|
-
// the info screen / menu render.
|
|
190
|
-
onReload();
|
|
191
|
-
setStep('show-info');
|
|
192
|
-
}, onCancel: () => setStep('show-info') }));
|
|
193
|
-
}
|
|
194
|
-
// Running npm install
|
|
195
|
-
if (step === 'running-npm-install') {
|
|
196
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(StatusIndicator, { status: commandStatus, label: "Installing dependencies" }) }), runner && _jsx(ProcessOutputComponent, { runner: runner })] }));
|
|
197
|
-
}
|
|
198
|
-
// Confirm npm install
|
|
199
|
-
if (step === 'confirm-npm-install') {
|
|
200
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "Sitevision CLI" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: "\u26A0 node_modules not found" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { children: "Would you like to run npm install? (y/n)" }) })] }));
|
|
201
|
-
}
|
|
202
|
-
// Confirm dev setup
|
|
203
|
-
if (step === 'confirm-dev-setup') {
|
|
204
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "Sitevision CLI" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: "\u26A0 dev properties not configured" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { children: "Would you like to set up dev properties? (y/n)" }) })] }));
|
|
205
|
-
}
|
|
206
|
-
// Confirm legacy password migration
|
|
207
|
-
if (step === 'confirm-password-migration') {
|
|
208
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "Sitevision CLI" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: "\u26A0 Plaintext password found in .dev_properties.json" }) }), _jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { children: "Move it to the OS keychain and remove it from the file? (y/n)" }), _jsx(Text, { dimColor: true, children: "Recommended \u2014 storing passwords in project files is insecure." })] })] }));
|
|
209
|
-
}
|
|
210
|
-
// Ask which auth method an existing config should use (setting is missing)
|
|
211
|
-
if (step === 'confirm-auth-method') {
|
|
212
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "Sitevision CLI" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: "\u26A0 Deploy authentication method not set" }) }), _jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { children: "Which method should deploys use? [B]asic / [O]Auth2 / [C]ookie" }), _jsx(Text, { dimColor: true, children: "B = Basic (default), O = OAuth2 bearer, C = session cookie (SSO)." })] })] }));
|
|
213
|
-
}
|
|
214
|
-
// Confirm package.json sync
|
|
215
|
-
if (step === 'confirm-package-sync') {
|
|
216
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "Sitevision CLI" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: "\u26A0 package.json is out of sync with .dev_properties.json" }) }), _jsx(Box, { marginBottom: 1, flexDirection: "column", marginLeft: 2, children: syncChanges.map(change => (_jsxs(Box, { children: [_jsx(Text, { color: change.from === undefined ? 'green' : 'yellow', children: change.from === undefined ? '+ ' : '~ ' }), _jsxs(Text, { bold: true, children: [change.key, ": "] }), change.from !== undefined && (_jsxs(Text, { dimColor: true, children: [change.from, " \u2192 "] })), _jsx(Text, { children: change.to })] }, change.key))) }), _jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { children: "Update package.json from .dev_properties.json? (y/n)" }), _jsx(Text, { dimColor: true, children: "sitevision-scripts reads these fields from package.json." })] })] }));
|
|
217
|
-
}
|
|
218
|
-
// Offer to persist the sync decision in .svcconfig
|
|
219
|
-
if (step === 'confirm-save-sync-choice') {
|
|
220
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "Sitevision CLI" }) }), _jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { children: "Remember this choice in .svcconfig? (y/n)" }), _jsx(Text, { dimColor: true, children: syncDecision
|
|
221
|
-
? 'svc will update package.json automatically from now on.'
|
|
222
|
-
: 'svc will stop asking about package.json sync.' })] })] }));
|
|
223
|
-
}
|
|
224
|
-
// Confirm signing setup
|
|
225
|
-
if (step === 'confirm-signing-setup') {
|
|
226
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "Sitevision CLI" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "yellow", children: "\u26A0 signing credentials not configured" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { children: "Signing credentials are required for signing apps on developer.sitevision.se" }) }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { children: "Would you like to set up signing credentials? (y/n)" }) })] }));
|
|
227
|
-
}
|
|
228
|
-
// Show info
|
|
229
|
-
if (step === 'show-info') {
|
|
230
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "Sitevision Project Information" }) }), _jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, children: "Name: " }), _jsx(Text, { children: localizedText(project.manifest.name) })] }), _jsxs(Box, { children: [_jsx(Text, { bold: true, children: "ID: " }), _jsx(Text, { children: project.manifest.id })] }), _jsxs(Box, { children: [_jsx(Text, { bold: true, children: "Version: " }), _jsx(Text, { children: project.manifest.version })] }), _jsxs(Box, { children: [_jsx(Text, { bold: true, children: "Type: " }), _jsx(Text, { color: "green", children: project.manifest.type }), _jsxs(Text, { dimColor: true, children: [" (", appType, ")"] })] }), _jsxs(Box, { children: [_jsx(Text, { bold: true, children: "Bundled: " }), _jsx(Text, { children: project.manifest.bundled ? 'Yes' : 'No' })] })] }), project.hasDevProperties && project.devProperties && (_jsxs(_Fragment, { children: [_jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: "Development Configuration" }) }), _jsxs(Box, { flexDirection: "column", marginLeft: 2, children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, children: "Domain: " }), _jsx(Text, { children: project.devProperties.domain })] }), _jsxs(Box, { children: [_jsx(Text, { bold: true, children: "Site: " }), _jsx(Text, { children: project.devProperties.siteName })] }), _jsxs(Box, { children: [_jsx(Text, { bold: true, children: "Addon: " }), _jsx(Text, { children: project.devProperties.addonName })] }), _jsxs(Box, { children: [_jsx(Text, { bold: true, children: "Username: " }), _jsx(Text, { children: project.devProperties.username })] }), _jsxs(Box, { children: [_jsx(Text, { bold: true, children: "Use HTTP: " }), _jsx(Text, { children: project.devProperties.useHTTPForDevDeploy ? 'Yes' : 'No' })] })] })] })), !project.hasDevProperties && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: "yellow", children: "\u26A0 No dev properties configured" }) })), _jsxs(Box, { marginTop: 1, children: [_jsx(Text, { bold: true, children: "Project Root: " }), _jsx(Text, { dimColor: true, children: project.root })] })] }));
|
|
231
|
-
}
|
|
232
|
-
return null;
|
|
233
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Box, Text } from 'ink';
|
|
4
|
-
import { TextInput } from './TextInput.js';
|
|
5
|
-
import { writeDevProperties, readDevProperties, } from '../utils/project-detection.js';
|
|
6
|
-
const STEPS = [
|
|
7
|
-
{ id: 'username', label: 'Signing Username' },
|
|
8
|
-
{ id: 'certificate', label: 'Certificate Name' },
|
|
9
|
-
];
|
|
10
|
-
export function SigningPropertiesForm({ projectRoot, onComplete, onCancel, }) {
|
|
11
|
-
const [stepIndex, setStepIndex] = useState(0);
|
|
12
|
-
// Read existing properties to preserve other fields
|
|
13
|
-
const [properties, setProperties] = useState(() => readDevProperties(projectRoot) || {});
|
|
14
|
-
const currentStep = STEPS[stepIndex];
|
|
15
|
-
const handleNext = (key, value) => {
|
|
16
|
-
const newProperties = { ...properties, [key]: value };
|
|
17
|
-
setProperties(newProperties);
|
|
18
|
-
if (stepIndex < STEPS.length - 1) {
|
|
19
|
-
setStepIndex(stepIndex + 1);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
// Save and finish
|
|
23
|
-
writeDevProperties(projectRoot, newProperties);
|
|
24
|
-
onComplete();
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const renderInput = () => {
|
|
28
|
-
switch (currentStep?.id) {
|
|
29
|
-
case 'username':
|
|
30
|
-
return (_jsx(TextInput, { label: "Signing Username (developer.sitevision.se)", defaultValue: properties.signingUsername, onSubmit: (value) => handleNext('signingUsername', value), onCancel: onCancel }, "username"));
|
|
31
|
-
case 'certificate':
|
|
32
|
-
return (_jsx(TextInput, { label: "Certificate Name (Optional)", defaultValue: properties.certificateName, placeholder: "Leave empty for default", onSubmit: (value) => handleNext('certificateName', value), onCancel: onCancel }, "certificate"));
|
|
33
|
-
default:
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: "cyan", children: "Setup Signing Properties" }), _jsxs(Text, { children: [' ', "Step ", stepIndex + 1, " of ", STEPS.length, ": ", currentStep?.label] })] }), _jsx(Box, { marginBottom: 1, children: STEPS.map((s, i) => (_jsx(Box, { marginRight: 1, children: _jsx(Text, { color: i === stepIndex ? 'green' : i < stepIndex ? 'green' : 'gray', children: i < stepIndex ? '✓' : i === stepIndex ? '●' : '○' }) }, s.id))) }), _jsx(Box, { borderStyle: "single", borderColor: "gray", padding: 1, children: renderInput() })] }));
|
|
38
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
label: string;
|
|
3
|
-
defaultValue?: string;
|
|
4
|
-
placeholder?: string;
|
|
5
|
-
onSubmit: (value: string) => void;
|
|
6
|
-
onCancel?: () => void;
|
|
7
|
-
type?: 'text' | 'password';
|
|
8
|
-
}
|
|
9
|
-
export declare function TextInput({ label, defaultValue, placeholder, onSubmit, onCancel, type, }: Props): import("react").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Box, Text, useInput } from 'ink';
|
|
4
|
-
export function TextInput({ label, defaultValue = '', placeholder, onSubmit, onCancel, type = 'text', }) {
|
|
5
|
-
const [value, setValue] = useState(defaultValue);
|
|
6
|
-
useInput((input, key) => {
|
|
7
|
-
if (key.return) {
|
|
8
|
-
if (value === '' && defaultValue) {
|
|
9
|
-
onSubmit(defaultValue);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
onSubmit(value);
|
|
13
|
-
}
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
if (key.escape && onCancel) {
|
|
17
|
-
onCancel();
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (key.delete || key.backspace) {
|
|
21
|
-
setValue(prev => prev.slice(0, -1));
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (!key.ctrl && !key.meta) {
|
|
25
|
-
setValue(prev => prev + input);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { bold: true, color: "cyan", children: label }) }), _jsxs(Box, { borderStyle: "round", borderColor: "cyan", paddingX: 1, children: [_jsx(Text, { children: type === 'password' ? '*'.repeat(value.length) : value }), value === '' && placeholder && _jsx(Text, { dimColor: true, children: placeholder })] }), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dimColor: true, children: ["Press Enter to submit", onCancel ? ', Esc to cancel' : ''] }) })] }));
|
|
29
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type ProjectInfo } from '../utils/project-detection.js';
|
|
2
|
-
interface Props {
|
|
3
|
-
project: ProjectInfo;
|
|
4
|
-
onComplete: () => void;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* First-run welcome screen. Shows the branding once and, when signing
|
|
8
|
-
* credentials are configured but no password is stored yet, offers to save the
|
|
9
|
-
* signing password to the OS keychain. If signing isn't set up, it just shows
|
|
10
|
-
* the branding — the user can still save a signing password later (the regular
|
|
11
|
-
* signing flow offers a "remember" option every time).
|
|
12
|
-
*/
|
|
13
|
-
export declare function WelcomeScreen({ project, onComplete }: Props): import("react").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { SimpleAppType } from '../types/index.js';
|
|
2
|
-
import { type AddonNode } from '../utils/sitevision-api.js';
|
|
3
|
-
export declare function AddonPicker({ domain, appType, initialQuery, load, onSelect, onClose, height, }: {
|
|
4
|
-
domain: string;
|
|
5
|
-
appType?: SimpleAppType;
|
|
6
|
-
initialQuery: string;
|
|
7
|
-
load: () => Promise<{
|
|
8
|
-
addons?: AddonNode[];
|
|
9
|
-
error?: string;
|
|
10
|
-
}>;
|
|
11
|
-
onSelect: (name: string) => void;
|
|
12
|
-
onClose: () => void;
|
|
13
|
-
height: number;
|
|
14
|
-
}): import("react").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CHANGELOG.md without its title, or undefined when it isn't shipped. With
|
|
3
|
-
* `since`, only the releases above that version's heading.
|
|
4
|
-
*/
|
|
5
|
-
export declare function readChangelog(since?: string): string[] | undefined;
|
|
6
|
-
export declare function ChangelogPanel({ since, height, onClose, }: {
|
|
7
|
-
since?: string;
|
|
8
|
-
height: number;
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
}): import("react").JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ProjectInfo } from '../types/index.js';
|
|
2
|
-
import { type Action } from './actions.js';
|
|
3
|
-
export declare const GROUPS: {
|
|
4
|
-
id: Action['group'];
|
|
5
|
-
label: string;
|
|
6
|
-
}[];
|
|
7
|
-
export declare function CommandPalette({ project, onRun, onClose, height, }: {
|
|
8
|
-
project: ProjectInfo;
|
|
9
|
-
onRun: (action: Action) => void;
|
|
10
|
-
onClose: () => void;
|
|
11
|
-
height: number;
|
|
12
|
-
}): import("react").JSX.Element;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { DevProperties, SitevisionManifest } from '../types/index.js';
|
|
2
|
-
type Method = 'basic' | 'oauth2' | 'cookie';
|
|
3
|
-
interface Field {
|
|
4
|
-
key: string;
|
|
5
|
-
label: string;
|
|
6
|
-
kind?: 'text' | 'method' | 'bool' | 'secret';
|
|
7
|
-
required?: boolean | Method;
|
|
8
|
-
when?: Method;
|
|
9
|
-
section?: string;
|
|
10
|
-
hint?: string;
|
|
11
|
-
perApp?: boolean;
|
|
12
|
-
help: string;
|
|
13
|
-
manifestKey?: string;
|
|
14
|
-
lang?: string;
|
|
15
|
-
}
|
|
16
|
-
/** Rows for manifest.json: one per text field, one per language of a localized one. */
|
|
17
|
-
export declare function manifestFields(manifest?: SitevisionManifest): Field[];
|
|
18
|
-
type Values = Record<string, string>;
|
|
19
|
-
/** What the form edits: an app, or the workspace root (no addon, no package.json). */
|
|
20
|
-
export interface ConfigTarget {
|
|
21
|
-
root: string;
|
|
22
|
-
devProperties?: Partial<DevProperties>;
|
|
23
|
-
base?: Partial<DevProperties>;
|
|
24
|
-
environment?: string;
|
|
25
|
-
workspace?: boolean;
|
|
26
|
-
workspaceRoot?: string;
|
|
27
|
-
manifest?: SitevisionManifest;
|
|
28
|
-
manifestPath?: string;
|
|
29
|
-
}
|
|
30
|
-
/** Apply the form to disk and the keychain. Exported for the test. */
|
|
31
|
-
export declare function saveConfig(project: ConfigTarget, values: Values, edited: Set<string>): void;
|
|
32
|
-
export declare function visibleFields(method: Method, workspace?: boolean, envMode?: boolean): Field[];
|
|
33
|
-
export declare function ConfigForm({ project, active, width, height, pickAddon, onSaved, onEditingChange, }: {
|
|
34
|
-
project: ConfigTarget;
|
|
35
|
-
active: boolean;
|
|
36
|
-
width: number;
|
|
37
|
-
height: number;
|
|
38
|
-
pickAddon: () => Promise<string | null>;
|
|
39
|
-
onSaved: () => void;
|
|
40
|
-
onEditingChange: (editing: boolean) => void;
|
|
41
|
-
}): import("react").JSX.Element;
|
|
42
|
-
export {};
|
package/dist/shell/Frame.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type { ProjectInfo } from '../types/index.js';
|
|
3
|
-
import { type Task } from '../utils/tasks.js';
|
|
4
|
-
export declare const ACCENT = "cyan";
|
|
5
|
-
export declare const NARROW_BELOW = 100;
|
|
6
|
-
/** Navigator width for a terminal: a quarter of the columns, within 32..48. */
|
|
7
|
-
export declare function navWidth(columns: number): number;
|
|
8
|
-
export interface TopBarProps {
|
|
9
|
-
context: string;
|
|
10
|
-
domain?: string;
|
|
11
|
-
auth: {
|
|
12
|
-
ready: boolean;
|
|
13
|
-
label: string;
|
|
14
|
-
};
|
|
15
|
-
version: string;
|
|
16
|
-
environment?: {
|
|
17
|
-
name: string;
|
|
18
|
-
color: 'green' | 'yellow' | 'red';
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export declare function TopBar({ context, domain, auth, version, environment, }: TopBarProps): import("react").JSX.Element;
|
|
22
|
-
/** Three-letter type marker; unknown manifest types show as "???". */
|
|
23
|
-
export declare function typeGlyph(manifest: ProjectInfo['manifest']): string;
|
|
24
|
-
export declare function appStatus(project: ProjectInfo): {
|
|
25
|
-
deps: boolean;
|
|
26
|
-
config: boolean;
|
|
27
|
-
sync: number;
|
|
28
|
-
signing: boolean;
|
|
29
|
-
scriptsWarning: string | undefined;
|
|
30
|
-
};
|
|
31
|
-
/** The name shown for an app in the navigator, and what the filter matches. */
|
|
32
|
-
export declare function appLabel(app: ProjectInfo): string;
|
|
33
|
-
/** Indices into `apps` whose label fuzzy-matches the filter. */
|
|
34
|
-
export declare function navMatches(apps: ProjectInfo[], filter: string): number[];
|
|
35
|
-
/** Next selectable index when moving by `delta`, wrapping at both ends. */
|
|
36
|
-
export declare function navMove(ring: number[], selected: number, delta: number): number;
|
|
37
|
-
export interface NavigatorProps {
|
|
38
|
-
apps: ProjectInfo[];
|
|
39
|
-
groupOf: (app: ProjectInfo) => string;
|
|
40
|
-
selected: number;
|
|
41
|
-
focused: boolean;
|
|
42
|
-
tasks: Task[];
|
|
43
|
-
height: number;
|
|
44
|
-
single: boolean;
|
|
45
|
-
settingsSelected?: boolean;
|
|
46
|
-
width: number;
|
|
47
|
-
filter?: string;
|
|
48
|
-
}
|
|
49
|
-
export declare function Navigator({ apps, groupOf, selected, focused, tasks, height, single, settingsSelected, width, filter, }: NavigatorProps): import("react").JSX.Element;
|
|
50
|
-
export declare function NavigatorStrip({ apps, selected, focused, width, filter, }: Pick<NavigatorProps, 'apps' | 'selected' | 'focused' | 'width' | 'filter'>): import("react").JSX.Element;
|
|
51
|
-
export declare function elapsed(task: Task): string;
|
|
52
|
-
export interface Hint {
|
|
53
|
-
key: string;
|
|
54
|
-
label: string;
|
|
55
|
-
}
|
|
56
|
-
export declare function BottomBar({ hints, right }: {
|
|
57
|
-
hints: Hint[];
|
|
58
|
-
right: ReactNode;
|
|
59
|
-
}): import("react").JSX.Element;
|
package/dist/shell/Help.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type Hint } from './Frame.js';
|
|
2
|
-
import type { Tab } from './actions.js';
|
|
3
|
-
export type Where = Tab | 'nav' | 'workspace';
|
|
4
|
-
export declare function HelpPanel({ here, where, height, onClose, }: {
|
|
5
|
-
here: Hint[];
|
|
6
|
-
where: Where;
|
|
7
|
-
height: number;
|
|
8
|
-
onClose: () => void;
|
|
9
|
-
}): import("react").JSX.Element;
|
package/dist/shell/Popover.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* A bordered box floating centred over the frame. Render it as the last child
|
|
4
|
-
* of the root so it draws on top; Ink paints in tree order.
|
|
5
|
-
*/
|
|
6
|
-
export declare function Popover({ columns, rows, width, height, children, }: {
|
|
7
|
-
columns: number;
|
|
8
|
-
rows: number;
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
children: ReactNode;
|
|
12
|
-
}): import("react").JSX.Element;
|
package/dist/shell/Settings.d.ts
DELETED
package/dist/shell/Shell.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ProjectInfo } from '../types/index.js';
|
|
2
|
-
interface Props {
|
|
3
|
-
apps: ProjectInfo[];
|
|
4
|
-
workspaceRoot?: string;
|
|
5
|
-
version: string;
|
|
6
|
-
minimal?: boolean;
|
|
7
|
-
updatedFrom?: string;
|
|
8
|
-
handover?: (job: () => Promise<void>) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare function Shell({ apps: initialApps, workspaceRoot, version, minimal, updatedFrom, handover, }: Props): import("react").JSX.Element;
|
|
11
|
-
export {};
|
package/dist/shell/Tabs.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ProjectInfo } from '../types/index.js';
|
|
2
|
-
import { type Task } from '../utils/tasks.js';
|
|
3
|
-
import { type Executable } from '../utils/sitevision-api.js';
|
|
4
|
-
import { type Tab } from './actions.js';
|
|
5
|
-
export declare const TABS: {
|
|
6
|
-
id: Tab;
|
|
7
|
-
label: string;
|
|
8
|
-
short: string;
|
|
9
|
-
}[];
|
|
10
|
-
export declare function TabBar({ tab, narrow, focused, }: {
|
|
11
|
-
tab: Tab;
|
|
12
|
-
narrow: boolean;
|
|
13
|
-
focused: boolean;
|
|
14
|
-
}): import("react").JSX.Element;
|
|
15
|
-
export declare function Overview({ project, tasks, height, }: {
|
|
16
|
-
project: ProjectInfo;
|
|
17
|
-
tasks: Task[];
|
|
18
|
-
height: number;
|
|
19
|
-
}): import("react").JSX.Element;
|
|
20
|
-
export interface VersionsState {
|
|
21
|
-
loading: boolean;
|
|
22
|
-
executables?: Executable[];
|
|
23
|
-
error?: string;
|
|
24
|
-
fetchedAt?: number;
|
|
25
|
-
}
|
|
26
|
-
export declare function Versions({ project, state, selected, }: {
|
|
27
|
-
project: ProjectInfo;
|
|
28
|
-
state?: VersionsState;
|
|
29
|
-
selected: number;
|
|
30
|
-
}): import("react").JSX.Element;
|
|
31
|
-
export declare function Log({ task, height, scroll, wrap, }: {
|
|
32
|
-
task?: Task;
|
|
33
|
-
height: number;
|
|
34
|
-
scroll: number;
|
|
35
|
-
wrap: boolean;
|
|
36
|
-
}): import("react").JSX.Element;
|
package/dist/shell/actions.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ProjectInfo, DeployConfig } from '../types/index.js';
|
|
2
|
-
export type Tab = 'overview' | 'config' | 'versions' | 'log';
|
|
3
|
-
export type Credential = {
|
|
4
|
-
accessToken?: string;
|
|
5
|
-
sessionCookie?: string;
|
|
6
|
-
};
|
|
7
|
-
export interface ActionContext {
|
|
8
|
-
project: ProjectInfo;
|
|
9
|
-
reload: () => void;
|
|
10
|
-
askPassword: (label: string, rememberLabel?: string) => Promise<{
|
|
11
|
-
password: string;
|
|
12
|
-
remember: boolean;
|
|
13
|
-
} | null>;
|
|
14
|
-
login: (method: 'oauth2' | 'cookie') => Promise<Credential | null>;
|
|
15
|
-
confirm: (message: string) => Promise<boolean>;
|
|
16
|
-
setTab: (tab: Tab) => void;
|
|
17
|
-
openWorkspaceSettings?: () => void;
|
|
18
|
-
openSettings: () => void;
|
|
19
|
-
openHelp: () => void;
|
|
20
|
-
openChangelog: () => void;
|
|
21
|
-
environment: string;
|
|
22
|
-
isProduction: boolean;
|
|
23
|
-
cycleEnvironment: () => void;
|
|
24
|
-
addEnvironment: () => Promise<void>;
|
|
25
|
-
createApp: () => Promise<void>;
|
|
26
|
-
notify: (text: string, level?: 'info' | 'ok' | 'warn' | 'error') => void;
|
|
27
|
-
quit: () => void;
|
|
28
|
-
}
|
|
29
|
-
export interface Action {
|
|
30
|
-
id: string;
|
|
31
|
-
key?: string;
|
|
32
|
-
group: 'app' | 'setup' | 'auth';
|
|
33
|
-
label: string;
|
|
34
|
-
detail?: (project: ProjectInfo) => string | undefined;
|
|
35
|
-
enabled?: (project: ProjectInfo) => boolean;
|
|
36
|
-
hidden?: (project: ProjectInfo) => boolean;
|
|
37
|
-
run: (ctx: ActionContext) => Promise<void>;
|
|
38
|
-
}
|
|
39
|
-
export declare function forgetSession(project: ProjectInfo): void;
|
|
40
|
-
/** Top-bar auth state without prompting for anything. */
|
|
41
|
-
export declare function authState(project: ProjectInfo): {
|
|
42
|
-
ready: boolean;
|
|
43
|
-
label: string;
|
|
44
|
-
};
|
|
45
|
-
export declare function resolveDeployConfig(ctx: ActionContext, fresh?: boolean): Promise<DeployConfig | null>;
|
|
46
|
-
export declare const actions: Action[];
|
|
47
|
-
export declare function actionForKey(key: string): Action | undefined;
|
|
48
|
-
/** Subsequence match, case-insensitive: "dpp" matches "Deploy to production". */
|
|
49
|
-
export declare function fuzzyMatch(query: string, text: string): boolean;
|