@editframe/cli 0.7.0-beta.9 → 0.8.0-beta.1

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 (55) hide show
  1. package/dist/VERSION.d.ts +1 -0
  2. package/dist/VERSION.js +4 -0
  3. package/dist/commands/auth.d.ts +9 -0
  4. package/dist/commands/auth.js +33 -0
  5. package/dist/commands/check.d.ts +1 -0
  6. package/dist/commands/check.js +114 -0
  7. package/dist/commands/preview.d.ts +1 -0
  8. package/dist/commands/preview.js +5 -0
  9. package/dist/commands/process-file.d.ts +1 -0
  10. package/dist/commands/process-file.js +32 -0
  11. package/dist/commands/process.d.ts +1 -0
  12. package/dist/commands/process.js +35 -0
  13. package/dist/commands/render.d.ts +1 -0
  14. package/dist/commands/render.js +151 -0
  15. package/dist/commands/sync.d.ts +1 -0
  16. package/dist/commands/sync.js +5 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +17 -0
  19. package/dist/operations/getRenderInfo.d.ts +15 -0
  20. package/dist/operations/getRenderInfo.js +59 -0
  21. package/dist/operations/processRenderInfo.d.ts +3 -0
  22. package/dist/operations/processRenderInfo.js +30 -0
  23. package/dist/operations/syncAssetsDirectory.d.ts +1 -0
  24. package/dist/operations/syncAssetsDirectory.js +250 -0
  25. package/dist/utils/attachWorkbench.d.ts +3 -0
  26. package/dist/utils/index.d.ts +3 -0
  27. package/dist/utils/index.js +14 -0
  28. package/dist/utils/launchBrowserAndWaitForSDK.d.ts +10 -0
  29. package/dist/utils/launchBrowserAndWaitForSDK.js +49 -0
  30. package/dist/utils/startDevServer.d.ts +8 -0
  31. package/dist/utils/startPreviewServer.d.ts +8 -0
  32. package/dist/utils/startPreviewServer.js +38 -0
  33. package/dist/utils/validateVideoResolution.d.ts +9 -0
  34. package/dist/utils/validateVideoResolution.js +29 -0
  35. package/dist/utils/withSpinner.d.ts +1 -0
  36. package/dist/utils/withSpinner.js +15 -0
  37. package/package.json +7 -7
  38. package/src/commands/auth.ts +1 -1
  39. package/src/commands/process-file.ts +50 -0
  40. package/src/commands/process.ts +5 -5
  41. package/src/commands/render.ts +16 -9
  42. package/src/commands/sync.ts +1 -1
  43. package/src/operations/processRenderInfo.ts +1 -1
  44. package/src/operations/syncAssetsDirectory.ts +1 -1
  45. package/src/utils/launchBrowserAndWaitForSDK.ts +1 -1
  46. package/src/utils/startDevServer.ts +1 -1
  47. package/src/utils/startPreviewServer.ts +1 -1
  48. package/src/utils/validateVideoResolution.ts +36 -0
  49. package/.env +0 -1
  50. package/.env.example +0 -1
  51. package/CHANGELOG.md +0 -8
  52. package/src/VERSION.ts +0 -1
  53. package/src/index.ts +0 -29
  54. package/tsconfig.json +0 -5
  55. package/vite.config.ts +0 -22
@@ -3,7 +3,7 @@ import path from "node:path";
3
3
 
4
4
  import { vitePluginEditframe as editframe } from "@editframe/vite-plugin";
5
5
 
6
- import { withSpinner } from "./withSpinner";
6
+ import { withSpinner } from "./withSpinner.ts";
7
7
 
8
8
  export class PreviewServer {
9
9
  static async start(directory: string) {
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ import ora from "ora";
3
+ import debug from "debug";
4
+
5
+ const log = debug("ef:cli:validateVideoResolution");
6
+
7
+ type VideoPayload = {
8
+ width: number;
9
+ height: number;
10
+ };
11
+
12
+ const schema = z
13
+ .object({
14
+ width: z.number().int(),
15
+ height: z.number().int(),
16
+ })
17
+ .refine((data) => data.width % 2 === 0, {
18
+ message: "Width must be divisible by 2",
19
+ path: ["width"],
20
+ })
21
+ .refine((data) => data.height % 2 === 0, {
22
+ message: "Height must be divisible by 2",
23
+ });
24
+ export const validateVideoResolution = async (rawPayload: VideoPayload) => {
25
+ const spinner = ora("Validating video resolution").start();
26
+ const result = schema.safeParse(rawPayload);
27
+ if (result.success) {
28
+ spinner.succeed("Video resolution is valid");
29
+ return result.data;
30
+ }
31
+ spinner.fail("Invalid video resolution");
32
+ process.stderr.write(result.error?.errors.map((e) => e.message).join("\n"));
33
+ process.stderr.write("\n");
34
+ log("Error:", result.error?.errors.map((e) => e.message).join("\n"));
35
+ process.exit(1);
36
+ };
package/.env DELETED
@@ -1 +0,0 @@
1
- EF_HOST=http://localhost:3000
package/.env.example DELETED
@@ -1 +0,0 @@
1
- EF_HOST=http://localhost:3000
package/CHANGELOG.md DELETED
@@ -1,8 +0,0 @@
1
- # @editframe/cli
2
-
3
- ## 0.7.0-beta.9
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [[`17c4452`](https://github.com/editframe/elements/commit/17c4452f679b042ac0accd9bf520728455e8cc2c)]:
8
- - @editframe/elements@0.7.0-beta.9
package/src/VERSION.ts DELETED
@@ -1 +0,0 @@
1
- export const VERSION = "0.7.0-beta.8";
package/src/index.ts DELETED
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env node
2
- import "dotenv/config";
3
- import { program, Option } from "commander";
4
-
5
- import { VERSION } from "./VERSION";
6
-
7
- program
8
- .name("editframe")
9
- .addOption(new Option("-t, --token <token>", "API Token").env("EF_TOKEN"))
10
- .addOption(
11
- new Option("--ef-host <host>", "Editframe Host")
12
- .env("EF_HOST")
13
- .default("https://editframe.dev"),
14
- )
15
- .addOption(
16
- new Option("--ef-render-host <host>", "Editframe Render Host")
17
- .env("EF_RENDER_HOST")
18
- .default("https://editframe.dev"),
19
- )
20
- .version(VERSION);
21
-
22
- import "./commands/auth";
23
- import "./commands/sync";
24
- import "./commands/render";
25
- import "./commands/preview";
26
- import "./commands/process";
27
- import "./commands/check";
28
-
29
- program.parse(process.argv);
package/tsconfig.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "include": ["src/**/*.ts", "../api/src/util/authenticatedFetch.ts"],
3
- "exclude": [""],
4
- "extends": "../../tsconfig.json"
5
- }
package/vite.config.ts DELETED
@@ -1,22 +0,0 @@
1
- import { execPromise } from "../../lib/util/execPromise";
2
-
3
- import path from "node:path";
4
-
5
- import { defineViteBuildConfig } from "../defineViteBuildConfig";
6
-
7
- const root = path.dirname(new URL(import.meta.url).pathname);
8
-
9
- export default defineViteBuildConfig({
10
- root: root,
11
- name: "editframe-cli",
12
- plugins: [
13
- {
14
- name: "chmod-executables",
15
- async closeBundle() {
16
- const cliExecPath = path.join(__dirname, "dist/index.js");
17
- process.stderr.write(`marking ${cliExecPath} as executable\n`);
18
- await execPromise(`chmod +x ${cliExecPath}`);
19
- },
20
- },
21
- ],
22
- });