@pulse-editor/cli 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/commands/login.js +3 -3
- package/dist/components/commands/publish.js +1 -1
- package/dist/components/header.js +1 -1
- package/dist/lib/__tests__/backend-url.test.js +1 -1
- package/dist/lib/__tests__/token.test.js +2 -2
- package/dist/lib/backend/__tests__/publish-app.test.js +2 -2
- package/dist/lib/backend-url.d.ts +1 -1
- package/dist/lib/backend-url.js +1 -1
- package/dist/lib/server/express.js +2 -2
- package/package.json +1 -1
|
@@ -143,11 +143,11 @@ export default function Login({ cli }) {
|
|
|
143
143
|
}, {
|
|
144
144
|
isActive: loginMethod === "flow" && flowState === "idle" && Boolean(authUrl),
|
|
145
145
|
});
|
|
146
|
-
return (_jsxs(_Fragment, { children: [isShowLoginMethod && (_jsxs(_Fragment, { children: [_jsx(Text, { children: "Login to the
|
|
146
|
+
return (_jsxs(_Fragment, { children: [isShowLoginMethod && (_jsxs(_Fragment, { children: [_jsx(Text, { children: "Login to the Palmos Platform" }), _jsx(SelectInput, { items: loginMethodItems, onSelect: (item) => {
|
|
147
147
|
setLoginMethod(item.value);
|
|
148
148
|
}, isFocused: loginMethod === undefined }), _jsx(Text, { children: " " })] })), isMethodSelected &&
|
|
149
149
|
loginMethod === "token" &&
|
|
150
|
-
(token.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { children: "Enter your
|
|
150
|
+
(token.length === 0 ? (_jsxs(_Fragment, { children: [_jsx(Text, { children: "Enter your Palmos access token:" }), _jsx(TextInput, { mask: "*", value: tokenInput, onChange: setTokenInput, onSubmit: (value) => {
|
|
151
151
|
if (value.length === 0) {
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
@@ -167,5 +167,5 @@ export default function Login({ cli }) {
|
|
|
167
167
|
else {
|
|
168
168
|
exit();
|
|
169
169
|
}
|
|
170
|
-
} })] })] })), isTokenSaved && (_jsxs(Text, { children: ["Token saved to ", path.join(os.homedir(), ".
|
|
170
|
+
} })] })] })), isTokenSaved && (_jsxs(Text, { children: ["Token saved to ", path.join(os.homedir(), ".palmos")] }))] })) : (_jsx(Text, { children: "Authentication error: please enter valid credentials." }))), isMethodSelected && loginMethod === "flow" && (_jsx(_Fragment, { children: flowState === "error" ? (_jsxs(Text, { color: "red", children: ["Error: ", flowError] })) : flowState === "success" ? (_jsx(Text, { children: "\u2705 Login successful! Saving credentials..." })) : flowState === "waiting" || flowState === "opening" ? (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Box, { children: [_jsx(Spinner, { type: "dots" }), _jsx(Text, { children: " Waiting for browser authentication..." })] }), _jsx(Text, { dimColor: true, children: "If the browser did not open, visit: " }), authUrl && _jsx(TerminalLink, { url: authUrl })] })) : authUrl ? (_jsxs(Box, { flexDirection: "column", gap: 1, children: [_jsxs(Text, { children: ["Press ", _jsx(Text, { bold: true, children: "Enter" }), " to open your browser and login:"] }), _jsx(TerminalLink, { url: authUrl, label: "Open browser to login \u2192" })] })) : (_jsxs(Box, { children: [_jsx(Spinner, { type: "dots" }), _jsx(Text, { children: " Preparing login..." })] })) }))] }));
|
|
171
171
|
}
|
|
@@ -108,5 +108,5 @@ export default function Publish({ cli }) {
|
|
|
108
108
|
buildExtension();
|
|
109
109
|
}
|
|
110
110
|
}, [isAuthenticated]);
|
|
111
|
-
return (_jsx(_Fragment, { children: !isInProjectDir ? (_jsx(Text, { color: 'redBright', children: "\u26D4 The current directory does not contain a Pulse Editor project." })) : isCheckingAuth ? (_jsxs(Box, { children: [_jsx(Spinner, { type: "dots" }), _jsx(Text, { children: " Checking authentication..." })] })) : !isAuthenticated ? (_jsxs(Text, { children: ["You are not authenticated or your access token is invalid. Publishing to Extension Marketplace is in Beta access. Please visit", _jsx(Text, { color: 'blueBright', children: " https://
|
|
111
|
+
return (_jsx(_Fragment, { children: !isInProjectDir ? (_jsx(Text, { color: 'redBright', children: "\u26D4 The current directory does not contain a Pulse Editor project." })) : isCheckingAuth ? (_jsxs(Box, { children: [_jsx(Spinner, { type: "dots" }), _jsx(Text, { children: " Checking authentication..." })] })) : !isAuthenticated ? (_jsxs(Text, { children: ["You are not authenticated or your access token is invalid. Publishing to Extension Marketplace is in Beta access. Please visit", _jsx(Text, { color: 'blueBright', children: " https://palmos.ai/beta " }), "to apply for Beta access."] })) : (_jsxs(_Fragment, { children: [isBuilding && (_jsxs(Box, { children: [_jsx(Spinner, { type: "dots" }), _jsx(Text, { children: " Building..." })] })), isBuildingError && (_jsx(Text, { color: 'redBright', children: "\u274C Error building the extension. Please run `npm run build` to see the error." })), isZipping && (_jsxs(Box, { children: [_jsx(Spinner, { type: "dots" }), _jsx(Text, { children: " Compressing build..." })] })), isZippingError && (_jsxs(Text, { color: 'redBright', children: ["\u274C Error zipping the build output. ", failureMessage] })), isPublishing && (_jsxs(Box, { children: [_jsx(Spinner, { type: "dots" }), _jsx(Text, { children: " Publishing..." })] })), isPublishingError && (_jsxs(_Fragment, { children: [_jsx(Text, { color: 'redBright', children: "\u274C Failed to publish extension." }), failureMessage && (_jsxs(Text, { color: 'redBright', children: ["Error: ", failureMessage] }))] })), isPublished && (_jsx(Text, { color: 'greenBright', children: "\u2705 Extension published successfully." }))] })) }));
|
|
112
112
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
3
|
export default function Header() {
|
|
4
|
-
return (_jsxs(Box, { flexDirection: "column", alignItems: "center", children: [_jsx(Text, { color: 'whiteBright', children: "Palmos CLI" }), _jsx(Text, { children: "Version: 0.0.1" }), _jsx(Text, { color: 'blueBright', children: "https://
|
|
4
|
+
return (_jsxs(Box, { flexDirection: "column", alignItems: "center", children: [_jsx(Text, { color: 'whiteBright', children: "Palmos CLI" }), _jsx(Text, { children: "Version: 0.0.1" }), _jsx(Text, { color: 'blueBright', children: "https://palmos.ai" })] }));
|
|
5
5
|
}
|
|
@@ -5,6 +5,6 @@ describe("getBackendUrl", () => {
|
|
|
5
5
|
expect(getBackendUrl(true)).toBe("https://localhost:8080");
|
|
6
6
|
});
|
|
7
7
|
it("should return production URL when stage is false", () => {
|
|
8
|
-
expect(getBackendUrl(false)).toBe("https://
|
|
8
|
+
expect(getBackendUrl(false)).toBe("https://palmos.ai");
|
|
9
9
|
});
|
|
10
10
|
});
|
|
@@ -14,7 +14,7 @@ vi.mock("os", () => ({
|
|
|
14
14
|
},
|
|
15
15
|
}));
|
|
16
16
|
vi.mock("../backend-url.js", () => ({
|
|
17
|
-
getBackendUrl: vi.fn((stage) => stage ? "https://localhost:8080" : "https://
|
|
17
|
+
getBackendUrl: vi.fn((stage) => stage ? "https://localhost:8080" : "https://palmos.ai"),
|
|
18
18
|
}));
|
|
19
19
|
import fs from "fs";
|
|
20
20
|
describe("saveToken", () => {
|
|
@@ -114,7 +114,7 @@ describe("checkToken", () => {
|
|
|
114
114
|
globalThis.fetch = vi.fn().mockResolvedValue({ status: 200 });
|
|
115
115
|
const result = await checkToken("valid-token", false);
|
|
116
116
|
expect(result).toBe(true);
|
|
117
|
-
expect(fetch).toHaveBeenCalledWith("https://
|
|
117
|
+
expect(fetch).toHaveBeenCalledWith("https://palmos.ai/api/api-keys/check", expect.objectContaining({
|
|
118
118
|
method: "POST",
|
|
119
119
|
body: JSON.stringify({ token: "valid-token" }),
|
|
120
120
|
}));
|
|
@@ -9,7 +9,7 @@ vi.mock("../../token.js", () => ({
|
|
|
9
9
|
getToken: vi.fn(() => "test-token"),
|
|
10
10
|
}));
|
|
11
11
|
vi.mock("../../backend-url.js", () => ({
|
|
12
|
-
getBackendUrl: vi.fn((stage) => stage ? "https://localhost:8080" : "https://
|
|
12
|
+
getBackendUrl: vi.fn((stage) => stage ? "https://localhost:8080" : "https://palmos.ai"),
|
|
13
13
|
}));
|
|
14
14
|
import fs from "fs";
|
|
15
15
|
describe("publishApp", () => {
|
|
@@ -22,7 +22,7 @@ describe("publishApp", () => {
|
|
|
22
22
|
.mockReturnValueOnce('{"visibility": "public"}')
|
|
23
23
|
.mockReturnValueOnce(Buffer.from("fake-zip"));
|
|
24
24
|
const res = await publishApp(false);
|
|
25
|
-
expect(fetch).toHaveBeenCalledWith("https://
|
|
25
|
+
expect(fetch).toHaveBeenCalledWith("https://palmos.ai/api/app/publish", expect.objectContaining({
|
|
26
26
|
method: "POST",
|
|
27
27
|
headers: expect.objectContaining({
|
|
28
28
|
Authorization: "Bearer test-token",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getBackendUrl(stage: boolean): "https://localhost:8080" | "https://
|
|
1
|
+
export declare function getBackendUrl(stage: boolean): "https://localhost:8080" | "https://palmos.ai";
|
package/dist/lib/backend-url.js
CHANGED
|
@@ -33,14 +33,14 @@ const skillActions = pulseConfig?.actions || [];
|
|
|
33
33
|
const skillActionNames = skillActions.map((a) => a.name);
|
|
34
34
|
const app = express();
|
|
35
35
|
app.use(cors());
|
|
36
|
-
// Inject the client-side livereload script into HTML responses
|
|
36
|
+
// Inject the client-side livereload script into HTML responses in workspace
|
|
37
37
|
app.use(
|
|
38
38
|
// The port might not be right here for the ingress.
|
|
39
39
|
// I need this route to be exposed
|
|
40
40
|
connectLivereload({
|
|
41
41
|
// @ts-expect-error override server options
|
|
42
42
|
host: workspaceId
|
|
43
|
-
? `${workspaceId}.workspace.
|
|
43
|
+
? `${workspaceId}.workspace.palmos.ai"`
|
|
44
44
|
: undefined,
|
|
45
45
|
port: workspaceId ? 443 : 35729,
|
|
46
46
|
}));
|