@editframe/cli 0.20.3-beta.0 → 0.21.0-beta.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/dist/VERSION.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.20.3-beta.0";
1
+ export declare const VERSION = "0.21.0-beta.0";
package/dist/VERSION.js CHANGED
@@ -1,2 +1,2 @@
1
- const VERSION = "0.20.3-beta.0";
1
+ const VERSION = "0.21.0-beta.0";
2
2
  export { VERSION };
@@ -3,12 +3,11 @@ import { program } from "commander";
3
3
  import chalk from "chalk";
4
4
  import debug from "debug";
5
5
  import ora from "ora";
6
- const log = debug("ef:cli:auth");
6
+ var log = debug("ef:cli:auth");
7
7
  const getApiData = async () => {
8
- const response = await getClient().authenticatedFetch("/api/v1/organization");
9
- return response.json();
8
+ return (await getClient().authenticatedFetch("/api/v1/organization")).json();
10
9
  };
11
- const authCommand = program.command("auth").description("Fetch organization data using API token").action(async () => {
10
+ var authCommand = program.command("auth").description("Fetch organization data using API token").action(async () => {
12
11
  const options = authCommand.opts();
13
12
  log("Options:", options);
14
13
  const spinner = ora("Loading...").start();
@@ -22,3 +21,4 @@ const authCommand = program.command("auth").description("Fetch organization data
22
21
  log("Error:", error);
23
22
  }
24
23
  });
24
+ export {};
@@ -3,36 +3,32 @@ import chalk from "chalk";
3
3
  import ora from "ora";
4
4
  import { exec } from "node:child_process";
5
5
  import os from "node:os";
6
- const checks = {
6
+ var checks = {
7
7
  ffmpeg: {
8
8
  message: () => {
9
9
  const platform = os.platform();
10
10
  const message = ["Processing assets for <ef-video>, <ef-audio>, <ef-captions>, and <ef-waveform>\n elements requires ffmpeg to be installed."];
11
11
  switch (platform) {
12
- case "darwin": {
12
+ case "darwin":
13
13
  message.push("On platform=darwin you can install ffmpeg using Homebrew:");
14
14
  message.push(" - brew install ffmpeg");
15
15
  message.push("Or you can download ffmpeg from https://ffmpeg.org/download.html");
16
16
  break;
17
- }
18
- case "linux": {
17
+ case "linux":
19
18
  message.push("You can install ffmpeg using your distribution's package manager.");
20
19
  break;
21
- }
22
- case "win32": {
20
+ case "win32":
23
21
  message.push("You can download ffmpeg from https://ffmpeg.org/download.html");
24
22
  message.push("You can use package managers like Chocolatey or Scoop to install ffmpeg.");
25
23
  message.push(" - choco install ffmpeg-full");
26
24
  message.push(" - scoop install ffmpeg");
27
25
  message.push(" - winget install ffmpeg");
28
26
  break;
29
- }
30
- default: {
27
+ default:
31
28
  message.push(`Unrecognized platform ${platform}`);
32
29
  message.push("You can download ffmpeg from https://ffmpeg.org/download.html");
33
30
  message.push("Or try installing it from your operating system's package manager");
34
31
  break;
35
- }
36
32
  }
37
33
  return message;
38
34
  },
@@ -85,3 +81,4 @@ program.command("check").description("Check on dependencies and other requiremen
85
81
  }
86
82
  }
87
83
  });
84
+ export {};
@@ -6,3 +6,4 @@ program.command("preview [directory]").description("Preview a directory's index.
6
6
  stdio: "inherit"
7
7
  });
8
8
  });
9
+ export {};
@@ -20,3 +20,4 @@ program.command("process-file <file>").description("Upload a audio/video to Edit
20
20
  console.log("Processed file info");
21
21
  console.log(info);
22
22
  });
23
+ export {};
@@ -30,3 +30,4 @@ program.command("process [directory]").description("Process's a directory's inde
30
30
  await processRenderInfo(renderInfo);
31
31
  });
32
32
  });
33
+ export {};
@@ -19,7 +19,7 @@ import { inspect } from "node:util";
19
19
  import { RenderInfo, getRenderInfo } from "@editframe/elements";
20
20
  import { parse } from "node-html-parser";
21
21
  import * as tar from "tar";
22
- const log = debug("ef:cli:render");
22
+ var log = debug("ef:cli:render");
23
23
  const buildAssetId = async (srcDir, src, basename$1) => {
24
24
  log(`Building image asset id for ${src}\n`);
25
25
  const assetPath = path.join(srcDir, src);
@@ -106,13 +106,6 @@ program.command("render [directory]").description("Render a directory's index.ht
106
106
  process.stderr.write(`Render is in '${render?.status}' status. It cannot be recreated while in this status.\n`);
107
107
  return;
108
108
  }
109
- /**
110
- * This tar stream is created with the dist directory as the root.
111
- * This is acheived by setting the cwd option to the dist directory.
112
- * And the files to be included in the tar stream are all files in the dist directory.
113
- *
114
- * The renderer expects to find the index.html file at the root of the tar stream.
115
- */
116
109
  const tarStream = tar.create({
117
110
  gzip: true,
118
111
  cwd: distDir
@@ -125,3 +118,4 @@ program.command("render [directory]").description("Render a directory's index.ht
125
118
  process.stderr.write("\n");
126
119
  });
127
120
  });
121
+ export {};
@@ -4,3 +4,4 @@ import { join } from "node:path";
4
4
  program.command("sync").description("Sync assets to Editframe servers for rendering").argument("[directory]", "Path to project directory to sync.").action(async (directory = ".") => {
5
5
  await syncAssetDirectory(join(process.cwd(), directory, "src", "assets", ".cache"));
6
6
  });
7
+ export {};
@@ -4,8 +4,8 @@ import chalk from "chalk";
4
4
  import debug from "debug";
5
5
  import ora from "ora";
6
6
  import { input, select } from "@inquirer/prompts";
7
- const log = debug("ef:cli:auth");
8
- const topics = [
7
+ var log = debug("ef:cli:auth");
8
+ var topics = [
9
9
  "render.created",
10
10
  "render.rendering",
11
11
  "render.pending",
@@ -13,33 +13,26 @@ const topics = [
13
13
  "render.completed"
14
14
  ];
15
15
  const testWebhookURL = async ({ webhookURL, topic }) => {
16
- const response = await getClient().authenticatedFetch("/api/v1/test_webhook", {
16
+ return (await getClient().authenticatedFetch("/api/v1/test_webhook", {
17
17
  method: "POST",
18
18
  body: JSON.stringify({
19
19
  webhookURL,
20
20
  topic
21
21
  })
22
- });
23
- return response.json();
22
+ })).json();
24
23
  };
25
- const webhookCommand = program.command("webhook").description("Test webhook URL with a topic").option("-u, --webhookURL <webhookURL>", "Webhook URL").addOption(new Option("-t, --topic <topic>", "Topic").choices(topics)).action(async () => {
24
+ var webhookCommand = program.command("webhook").description("Test webhook URL with a topic").option("-u, --webhookURL <webhookURL>", "Webhook URL").addOption(new Option("-t, --topic <topic>", "Topic").choices(topics)).action(async () => {
26
25
  const options = webhookCommand.opts();
27
26
  log("Options:", options);
28
27
  let { webhookURL, topic } = options;
29
- if (!webhookURL) {
30
- const answer = await input({ message: "Enter a webhook URL:" });
31
- webhookURL = answer;
32
- }
33
- if (!topic) {
34
- const answer = await select({
35
- message: "Select a topic:",
36
- choices: [...topics.map((topic$1) => ({
37
- title: topic$1,
38
- value: topic$1
39
- }))]
40
- });
41
- topic = answer;
42
- }
28
+ if (!webhookURL) webhookURL = await input({ message: "Enter a webhook URL:" });
29
+ if (!topic) topic = await select({
30
+ message: "Select a topic:",
31
+ choices: [...topics.map((topic$1) => ({
32
+ title: topic$1,
33
+ value: topic$1
34
+ }))]
35
+ });
43
36
  const spinner = ora("Testing...").start();
44
37
  try {
45
38
  const apiData = await testWebhookURL({
@@ -55,3 +48,4 @@ const webhookCommand = program.command("webhook").description("Test webhook URL
55
48
  log("Error:", error);
56
49
  }
57
50
  });
51
+ export {};
package/dist/index.js CHANGED
@@ -12,3 +12,4 @@ import "dotenv/config";
12
12
  import { Option, program } from "commander";
13
13
  program.name("editframe").addOption(new Option("-t, --token <token>", "API Token").env("EF_TOKEN")).addOption(new Option("--ef-host <host>", "Editframe Host").env("EF_HOST").default("https://editframe.dev")).addOption(new Option("--ef-render-host <host>", "Editframe Render Host").env("EF_RENDER_HOST").default("https://editframe.dev")).version(VERSION);
14
14
  program.parse(process.argv);
15
+ export {};
@@ -3,11 +3,11 @@ import { SyncFragmentIndex } from "./SyncFragmentIndex.js";
3
3
  import { SyncImage } from "./SyncImage.js";
4
4
  import { SyncTrack } from "./SyncTrack.js";
5
5
  import debug from "debug";
6
- const trackMatch = /\.track-[\d]+.mp4$/i;
7
- const fragmentIndexMatch = /\.tracks.json$/i;
8
- const captionsMatch = /\.captions.json$/i;
9
- const imageMatch = /\.(png|jpe?g|gif|webp)$/i;
10
- const log = debug("ef:SubAssetSync");
6
+ var trackMatch = /\.track-[\d]+.mp4$/i;
7
+ var fragmentIndexMatch = /\.tracks.json$/i;
8
+ var captionsMatch = /\.captions.json$/i;
9
+ var imageMatch = /\.(png|jpe?g|gif|webp)$/i;
10
+ var log = debug("ef:SubAssetSync");
11
11
  const getAssetSync = (subAssetPath, md5) => {
12
12
  log("getAssetSync", {
13
13
  subAssetPath,
@@ -1,7 +1,7 @@
1
1
  import fs from "node:fs/promises";
2
2
  import { z } from "zod";
3
- const SYNC_VERSION = "1";
4
- const SyncStatusSchema = z.object({
3
+ var SYNC_VERSION = "1";
4
+ var SyncStatusSchema = z.object({
5
5
  version: z.string(),
6
6
  complete: z.boolean(),
7
7
  id: z.string(),
@@ -16,7 +16,6 @@ var SyncStatus = class {
16
16
  async isSynced() {
17
17
  const syncInfo = await this.readInfo();
18
18
  if (!syncInfo) return false;
19
- console.log("syncInfo.infoPath", this.infoPath);
20
19
  return syncInfo.version === SYNC_VERSION && syncInfo.complete;
21
20
  }
22
21
  async readInfo() {
@@ -39,6 +39,5 @@ const doAssetSync = async function* (assetSync) {
39
39
  status: "success",
40
40
  message: `Synced ${assetSync.label}: ${assetSync.path}`
41
41
  };
42
- return;
43
42
  };
44
43
  export { doAssetSync };
@@ -3,11 +3,10 @@ import { getAssetSync } from "./syncAssetsDirectory/SubAssetSync.js";
3
3
  import path from "node:path";
4
4
  import fs from "node:fs/promises";
5
5
  const syncAssetDirectory = async (cacheDir) => {
6
- const stat = await fs.stat(cacheDir).catch((error) => {
6
+ if (!(await fs.stat(cacheDir).catch((error) => {
7
7
  if (error.code === "ENOENT") return;
8
8
  throw error;
9
- });
10
- if (!stat?.isDirectory()) {
9
+ }))?.isDirectory()) {
11
10
  console.error(`No assets cache directory found at ${cacheDir}`);
12
11
  return;
13
12
  }
@@ -28,8 +27,7 @@ const syncAssetDirectory = async (cacheDir) => {
28
27
  for (const assetMd5 of assets) {
29
28
  reportInfo(assetMd5, `Syncing asset: ${assetMd5}`);
30
29
  const assetDir = path.join(cacheDir, assetMd5);
31
- const stat$1 = await fs.stat(assetDir);
32
- if (!stat$1.isDirectory()) {
30
+ if (!(await fs.stat(assetDir)).isDirectory()) {
33
31
  reportError(assetMd5, "Invalid asset. Did not find asset directory.");
34
32
  return;
35
33
  }
@@ -1,8 +1,7 @@
1
1
  import { Stream } from "node:stream";
2
2
  const createReadableStreamFromReadable = (source) => {
3
3
  const pump = new StreamPump(source);
4
- const stream = new ReadableStream(pump, pump);
5
- return stream;
4
+ return new ReadableStream(pump, pump);
6
5
  };
7
6
  var StreamPump = class {
8
7
  constructor(stream) {
@@ -1,7 +1,7 @@
1
1
  import "dotenv/config";
2
2
  import { program } from "commander";
3
3
  import { Client } from "@editframe/api";
4
- let client;
4
+ var client;
5
5
  const getClient = () => {
6
6
  if (!client) {
7
7
  const programOpts = program.opts();
@@ -2,7 +2,7 @@ import { withSpinner } from "./withSpinner.js";
2
2
  import chalk from "chalk";
3
3
  import debug from "debug";
4
4
  import { chromium } from "playwright";
5
- const browserLog = debug("ef:cli::browser");
5
+ var browserLog = debug("ef:cli::browser");
6
6
  async function launchBrowserAndWaitForSDK(options, fn) {
7
7
  const browser = await withSpinner("Launching chrome", async () => {
8
8
  return chromium.launch({
@@ -13,7 +13,7 @@ var PreviewServer = class PreviewServer {
13
13
  return `http://localhost:${this.previewServer.config.server.port}`;
14
14
  }
15
15
  };
16
- const startPreviewServer = async (directory) => {
16
+ var startPreviewServer = async (directory) => {
17
17
  return await withSpinner("Starting vite...", async () => {
18
18
  const resolvedDirectory = path.resolve(process.cwd(), directory);
19
19
  const cacheRoot = path.join(resolvedDirectory, "assets");
@@ -1,8 +1,8 @@
1
1
  import debug from "debug";
2
2
  import ora from "ora";
3
3
  import { z } from "zod";
4
- const log = debug("ef:cli:validateVideoResolution");
5
- const schema = z.object({
4
+ var log = debug("ef:cli:validateVideoResolution");
5
+ var schema = z.object({
6
6
  width: z.number().int(),
7
7
  height: z.number().int()
8
8
  }).refine((data) => data.width % 2 === 0, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/cli",
3
- "version": "0.20.3-beta.0",
3
+ "version": "0.21.0-beta.0",
4
4
  "description": "Command line interface for EditFrame",
5
5
  "bin": {
6
6
  "editframe": "./dist/index.js"
@@ -23,10 +23,10 @@
23
23
  "vite-tsconfig-paths": "^4.3.2"
24
24
  },
25
25
  "dependencies": {
26
- "@editframe/api": "0.20.3-beta.0",
27
- "@editframe/assets": "0.20.3-beta.0",
28
- "@editframe/elements": "0.20.3-beta.0",
29
- "@editframe/vite-plugin": "0.20.3-beta.0",
26
+ "@editframe/api": "0.21.0-beta.0",
27
+ "@editframe/assets": "0.21.0-beta.0",
28
+ "@editframe/elements": "0.21.0-beta.0",
29
+ "@editframe/vite-plugin": "0.21.0-beta.0",
30
30
  "@inquirer/prompts": "^5.3.8",
31
31
  "axios": "^1.6.8",
32
32
  "chalk": "^5.3.0",
@@ -40,7 +40,7 @@
40
40
  "parse5-html-rewriting-stream": "^7.0.0",
41
41
  "playwright": "^1.53.0",
42
42
  "promptly": "^3.2.0",
43
- "rolldown-vite": "^6.3.21",
43
+ "rolldown-vite": "^7.1.15",
44
44
  "tailwindcss": "^3.4.3",
45
45
  "tar": "^7.1.0",
46
46
  "zod": "^3.23.8"
@@ -24,7 +24,6 @@ export class SyncStatus {
24
24
  if (!syncInfo) {
25
25
  return false;
26
26
  }
27
- console.log("syncInfo.infoPath", this.infoPath);
28
27
  return syncInfo.version === SYNC_VERSION && syncInfo.complete;
29
28
  }
30
29