@fireberry/cli 0.0.5-beta.18 → 0.0.5-beta.19
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/api/requests.d.ts +1 -1
- package/dist/api/requests.js +3 -3
- package/dist/api/types.d.ts +1 -0
- package/dist/commands/create.js +1 -1
- package/dist/commands/install.js +13 -4
- package/dist/commands/push.js +1 -1
- package/package.json +1 -1
- package/src/api/requests.ts +4 -3
- package/src/api/types.ts +1 -0
- package/src/commands/create.ts +1 -1
- package/src/commands/install.ts +15 -4
- package/src/commands/push.ts +1 -1
package/dist/api/requests.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../config/env.js";
|
|
2
2
|
import type { CreateAppRequest, Manifest, ZippedComponent } from "./types.js";
|
|
3
3
|
export declare const createApp: (data: CreateAppRequest) => Promise<void>;
|
|
4
|
-
export declare const pushComponents: (appId: string, components: ZippedComponent[]) => Promise<void>;
|
|
4
|
+
export declare const pushComponents: (appId: string, components: ZippedComponent[], manifest: Manifest) => Promise<void>;
|
|
5
5
|
export declare const installApp: (manifest: Manifest) => Promise<void>;
|
|
6
6
|
export declare const deleteApp: (manifest: Manifest) => Promise<void>;
|
package/dist/api/requests.js
CHANGED
|
@@ -9,10 +9,10 @@ export const createApp = async (data) => {
|
|
|
9
9
|
throw new Error(error instanceof Error ? error.message : "Unknown error");
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
-
export const pushComponents = async (appId, components) => {
|
|
12
|
+
export const pushComponents = async (appId, components, manifest) => {
|
|
13
13
|
const url = `/services/developer/push`;
|
|
14
14
|
try {
|
|
15
|
-
await api.post(url, { appId, components });
|
|
15
|
+
await api.post(url, { appId, components, manifest });
|
|
16
16
|
}
|
|
17
17
|
catch (error) {
|
|
18
18
|
throw new Error(error instanceof Error ? error.message : "Unknown error");
|
|
@@ -21,7 +21,7 @@ export const pushComponents = async (appId, components) => {
|
|
|
21
21
|
export const installApp = async (manifest) => {
|
|
22
22
|
const url = `/services/developer/install`;
|
|
23
23
|
try {
|
|
24
|
-
await api.post(url, { manifest });
|
|
24
|
+
await api.post(url, { manifest }, { timeout: 300000 }); // 5 minutes
|
|
25
25
|
}
|
|
26
26
|
catch (error) {
|
|
27
27
|
throw new Error(error instanceof Error ? error.message : "Unknown error");
|
package/dist/api/types.d.ts
CHANGED
package/dist/commands/create.js
CHANGED
|
@@ -35,7 +35,7 @@ export async function runCreate({ name }) {
|
|
|
35
35
|
}
|
|
36
36
|
const spinner = ora(`Creating app "${chalk.cyan(appName)}"...`).start();
|
|
37
37
|
try {
|
|
38
|
-
await createApp({ appId });
|
|
38
|
+
await createApp({ appId, componentId });
|
|
39
39
|
await fs.ensureDir(appDir);
|
|
40
40
|
const templatesDir = path.join(__dirname, "..", "..", "src", "templates");
|
|
41
41
|
const manifestTemplate = await fs.readFile(path.join(templatesDir, "manifest.yml"), "utf-8");
|
package/dist/commands/install.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import ora from "ora";
|
|
1
2
|
import { installApp } from "../api/requests.js";
|
|
2
3
|
import { getManifest, validateManifestComponents, } from "../utils/components.utils.js";
|
|
3
4
|
export async function runInstall() {
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const spinner = ora("Loading manifest...").start();
|
|
6
|
+
try {
|
|
7
|
+
const manifest = await getManifest();
|
|
8
|
+
await validateManifestComponents(manifest);
|
|
9
|
+
spinner.start("Installing app on Fireberry...");
|
|
10
|
+
await installApp(manifest);
|
|
11
|
+
spinner.succeed("App installed successfully");
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
spinner.fail("Installation failed");
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
8
17
|
}
|
package/dist/commands/push.js
CHANGED
|
@@ -18,7 +18,7 @@ export async function runPush() {
|
|
|
18
18
|
console.log(chalk.gray(` ${idx + 1}. ${comp.title} (${comp.id}) - ${sizeKB} KB`));
|
|
19
19
|
});
|
|
20
20
|
spinner.start("Uploading to Fireberry...");
|
|
21
|
-
await pushComponents(manifest.app.id, zippedComponents);
|
|
21
|
+
await pushComponents(manifest.app.id, zippedComponents, manifest);
|
|
22
22
|
spinner.succeed("Components pushed successfully");
|
|
23
23
|
}
|
|
24
24
|
else {
|
package/package.json
CHANGED
package/src/api/requests.ts
CHANGED
|
@@ -13,11 +13,12 @@ export const createApp = async (data: CreateAppRequest): Promise<void> => {
|
|
|
13
13
|
|
|
14
14
|
export const pushComponents = async (
|
|
15
15
|
appId: string,
|
|
16
|
-
components: ZippedComponent[]
|
|
16
|
+
components: ZippedComponent[],
|
|
17
|
+
manifest: Manifest
|
|
17
18
|
): Promise<void> => {
|
|
18
19
|
const url = `/services/developer/push`;
|
|
19
20
|
try {
|
|
20
|
-
await api.post<void>(url, { appId, components });
|
|
21
|
+
await api.post<void>(url, { appId, components, manifest });
|
|
21
22
|
} catch (error) {
|
|
22
23
|
throw new Error(error instanceof Error ? error.message : "Unknown error");
|
|
23
24
|
}
|
|
@@ -26,7 +27,7 @@ export const pushComponents = async (
|
|
|
26
27
|
export const installApp = async (manifest: Manifest): Promise<void> => {
|
|
27
28
|
const url = `/services/developer/install`;
|
|
28
29
|
try {
|
|
29
|
-
await api.post<void>(url, { manifest });
|
|
30
|
+
await api.post<void>(url, { manifest }, { timeout: 300000 }); // 5 minutes
|
|
30
31
|
} catch (error) {
|
|
31
32
|
throw new Error(error instanceof Error ? error.message : "Unknown error");
|
|
32
33
|
}
|
package/src/api/types.ts
CHANGED
package/src/commands/create.ts
CHANGED
|
@@ -50,7 +50,7 @@ export async function runCreate({ name }: CreateOptions): Promise<void> {
|
|
|
50
50
|
const spinner = ora(`Creating app "${chalk.cyan(appName)}"...`).start();
|
|
51
51
|
|
|
52
52
|
try {
|
|
53
|
-
await createApp({ appId });
|
|
53
|
+
await createApp({ appId, componentId });
|
|
54
54
|
|
|
55
55
|
await fs.ensureDir(appDir);
|
|
56
56
|
|
package/src/commands/install.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import ora from "ora";
|
|
1
2
|
import { installApp } from "../api/requests.js";
|
|
2
3
|
import {
|
|
3
4
|
getManifest,
|
|
@@ -5,8 +6,18 @@ import {
|
|
|
5
6
|
} from "../utils/components.utils.js";
|
|
6
7
|
|
|
7
8
|
export async function runInstall(): Promise<void> {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const spinner = ora("Loading manifest...").start();
|
|
10
|
+
|
|
11
|
+
try {
|
|
12
|
+
const manifest = await getManifest();
|
|
13
|
+
|
|
14
|
+
await validateManifestComponents(manifest);
|
|
15
|
+
|
|
16
|
+
spinner.start("Installing app on Fireberry...");
|
|
17
|
+
await installApp(manifest);
|
|
18
|
+
spinner.succeed("App installed successfully");
|
|
19
|
+
} catch (error) {
|
|
20
|
+
spinner.fail("Installation failed");
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
12
23
|
}
|
package/src/commands/push.ts
CHANGED
|
@@ -30,7 +30,7 @@ export async function runPush(): Promise<void> {
|
|
|
30
30
|
|
|
31
31
|
spinner.start("Uploading to Fireberry...");
|
|
32
32
|
|
|
33
|
-
await pushComponents(manifest.app.id, zippedComponents);
|
|
33
|
+
await pushComponents(manifest.app.id, zippedComponents, manifest);
|
|
34
34
|
spinner.succeed("Components pushed successfully");
|
|
35
35
|
} else {
|
|
36
36
|
spinner.succeed("No components to push");
|