sitevision-cli 1.0.0-beta.8 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +138 -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 +44 -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 +162 -32
- 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 +27 -4
- package/readme.md +113 -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
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { useMemo, useState } from 'react';
|
|
4
|
+
import { Box, Text, useInput } from 'ink';
|
|
5
|
+
import { t } from '../utils/i18n.js';
|
|
6
|
+
import { ACCENT } from './Frame.js';
|
|
7
|
+
/**
|
|
8
|
+
* CHANGELOG.md without its title, or undefined when it isn't shipped. With
|
|
9
|
+
* `since`, only the releases above that version's heading.
|
|
10
|
+
*/
|
|
11
|
+
export function readChangelog(since) {
|
|
12
|
+
try {
|
|
13
|
+
const lines = readFileSync(new URL('../../CHANGELOG.md', import.meta.url), 'utf8')
|
|
14
|
+
.replace(/^# .*\n/, '')
|
|
15
|
+
.trim()
|
|
16
|
+
.split('\n');
|
|
17
|
+
const end = since ? lines.indexOf(`## ${since}`) : -1;
|
|
18
|
+
return end > 0 ? lines.slice(0, end) : lines;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function ChangelogPanel({ since, height, onClose, }) {
|
|
25
|
+
const lines = useMemo(() => readChangelog(since), [since]);
|
|
26
|
+
const [top, setTop] = useState(0);
|
|
27
|
+
const visible = Math.max(1, height - 1);
|
|
28
|
+
const max = Math.max(0, (lines?.length ?? 0) - visible);
|
|
29
|
+
useInput((input, key) => {
|
|
30
|
+
if (key.escape || key.return || input === 'q')
|
|
31
|
+
onClose();
|
|
32
|
+
else if (key.upArrow)
|
|
33
|
+
setTop(n => Math.max(0, n - 1));
|
|
34
|
+
else if (key.downArrow)
|
|
35
|
+
setTop(n => Math.min(max, n + 1));
|
|
36
|
+
else if (key.pageUp)
|
|
37
|
+
setTop(n => Math.max(0, n - visible));
|
|
38
|
+
else if (key.pageDown)
|
|
39
|
+
setTop(n => Math.min(max, n + visible));
|
|
40
|
+
});
|
|
41
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, children: [_jsxs(Text, { children: [_jsx(Text, { bold: true, children: since
|
|
42
|
+
? t("What's new since {version}", { version: since })
|
|
43
|
+
: t('Changelog') }), _jsxs(Text, { dimColor: true, children: [" \u00B7 ", t('↑↓ scroll · Esc close')] })] }), lines ? (lines.slice(top, top + visible).map((line, i) => line.startsWith('## ') ? (_jsx(Text, { bold: true, color: ACCENT, children: line.slice(3) }, top + i)) : (_jsx(Text, { wrap: "truncate", children: line || ' ' }, top + i)))) : (_jsx(Text, { dimColor: true, children: t('No changelog found.') }))] }));
|
|
44
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
import { ACCENT } from './Frame.js';
|
|
5
|
+
import { actions, fuzzyMatch } from './actions.js';
|
|
6
|
+
import { t } from '../utils/i18n.js';
|
|
7
|
+
export const GROUPS = [
|
|
8
|
+
{ id: 'app', label: 'APP' },
|
|
9
|
+
{ id: 'setup', label: 'SETUP' },
|
|
10
|
+
{ id: 'auth', label: 'AUTH' },
|
|
11
|
+
];
|
|
12
|
+
export function CommandPalette({ project, onRun, onClose, height, }) {
|
|
13
|
+
const [query, setQuery] = useState('');
|
|
14
|
+
const [index, setIndex] = useState(0);
|
|
15
|
+
const matches = actions.filter(a => !a.hidden?.(project) && fuzzyMatch(query, t(a.label)));
|
|
16
|
+
const ordered = GROUPS.flatMap(g => matches.filter(a => a.group === g.id));
|
|
17
|
+
useInput((input, key) => {
|
|
18
|
+
if (key.escape) {
|
|
19
|
+
onClose();
|
|
20
|
+
}
|
|
21
|
+
else if (key.return) {
|
|
22
|
+
const action = ordered[index];
|
|
23
|
+
if (action)
|
|
24
|
+
onRun(action);
|
|
25
|
+
}
|
|
26
|
+
else if (key.upArrow) {
|
|
27
|
+
setIndex(i => (i > 0 ? i - 1 : Math.max(0, ordered.length - 1)));
|
|
28
|
+
}
|
|
29
|
+
else if (key.downArrow) {
|
|
30
|
+
setIndex(i => (i < ordered.length - 1 ? i + 1 : 0));
|
|
31
|
+
}
|
|
32
|
+
else if (key.backspace || key.delete) {
|
|
33
|
+
setQuery(q => q.slice(0, -1));
|
|
34
|
+
setIndex(0);
|
|
35
|
+
}
|
|
36
|
+
else if (!key.ctrl && !key.meta && input) {
|
|
37
|
+
setQuery(q => q + input);
|
|
38
|
+
setIndex(0);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
// Rows available inside the box: borders (2), title, query, footer.
|
|
42
|
+
const maxRows = Math.max(3, height - 5);
|
|
43
|
+
const rows = [];
|
|
44
|
+
let lastGroup;
|
|
45
|
+
// Keep the selection visible: skip leading rows when it is far down.
|
|
46
|
+
let skip = 0;
|
|
47
|
+
while (index - skip + 1 + 3 > maxRows)
|
|
48
|
+
skip += 1;
|
|
49
|
+
for (const [i, action] of ordered.entries()) {
|
|
50
|
+
if (i < skip)
|
|
51
|
+
continue;
|
|
52
|
+
if (rows.length >= maxRows)
|
|
53
|
+
break;
|
|
54
|
+
if (action.group !== lastGroup) {
|
|
55
|
+
rows.push(_jsx(Text, { bold: true, dimColor: true, children: t(GROUPS.find(g => g.id === action.group).label) }, `g-${action.group}`));
|
|
56
|
+
lastGroup = action.group;
|
|
57
|
+
}
|
|
58
|
+
const enabled = action.enabled?.(project) ?? true;
|
|
59
|
+
const detail = action.detail?.(project);
|
|
60
|
+
rows.push(_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Box, { flexShrink: 1, marginRight: 1, children: _jsxs(Text, { backgroundColor: i === index ? ACCENT : undefined, color: i === index ? 'black' : undefined, dimColor: !enabled && i !== index, wrap: "truncate", children: [' ', t(action.label), detail && _jsxs(Text, { dimColor: i !== index, children: [" \u00B7 ", detail] })] }) }), _jsx(Box, { flexShrink: 0, children: _jsx(Text, { bold: true, color: ACCENT, children: action.key ?? '—' }) })] }, action.id));
|
|
61
|
+
}
|
|
62
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, children: [_jsxs(Text, { children: [_jsx(Text, { bold: true, children: t('Commands') }), _jsxs(Text, { dimColor: true, children: [" ", project.manifest.id] })] }), _jsxs(Text, { children: [_jsx(Text, { color: ACCENT, children: "\u276F " }), query, _jsx(Text, { inverse: true, children: " " }), _jsxs(Text, { dimColor: true, children: [" ", t('{n} actions', { n: ordered.length })] })] }), rows, _jsx(Text, { dimColor: true, children: t('type to filter · ↑↓ move · Enter run · Esc close') })] }));
|
|
63
|
+
}
|