@editframe/cli 0.21.0-beta.0 → 0.23.6-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 +1 -1
- package/dist/VERSION.js +1 -1
- package/dist/commands/auth.js +1 -2
- package/dist/commands/process.js +1 -2
- package/dist/commands/render.js +1 -3
- package/dist/operations/syncAssetsDirectory/SyncImage.js +1 -1
- package/dist/utils/launchBrowserAndWaitForSDK.js +7 -8
- package/dist/utils/startPreviewServer.js +1 -2
- package/package.json +5 -5
- package/src/operations/syncAssetsDirectory/SyncImage.ts +1 -1
package/dist/VERSION.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.23.6-beta.0";
|
package/dist/VERSION.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const VERSION = "0.
|
|
1
|
+
const VERSION = "0.23.6-beta.0";
|
|
2
2
|
export { VERSION };
|
package/dist/commands/auth.js
CHANGED
|
@@ -8,8 +8,7 @@ const getApiData = async () => {
|
|
|
8
8
|
return (await getClient().authenticatedFetch("/api/v1/organization")).json();
|
|
9
9
|
};
|
|
10
10
|
var authCommand = program.command("auth").description("Fetch organization data using API token").action(async () => {
|
|
11
|
-
|
|
12
|
-
log("Options:", options);
|
|
11
|
+
log("Options:", authCommand.opts());
|
|
13
12
|
const spinner = ora("Loading...").start();
|
|
14
13
|
try {
|
|
15
14
|
const apiData = await getApiData();
|
package/dist/commands/process.js
CHANGED
|
@@ -26,8 +26,7 @@ program.command("process [directory]").description("Process's a directory's inde
|
|
|
26
26
|
interactive: false,
|
|
27
27
|
headless: true
|
|
28
28
|
}, async (page) => {
|
|
29
|
-
|
|
30
|
-
await processRenderInfo(renderInfo);
|
|
29
|
+
await processRenderInfo(await page.evaluate(getRenderInfo));
|
|
31
30
|
});
|
|
32
31
|
});
|
|
33
32
|
export {};
|
package/dist/commands/render.js
CHANGED
|
@@ -22,9 +22,7 @@ import * as tar from "tar";
|
|
|
22
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
|
-
const
|
|
26
|
-
const assetMd5 = await md5FilePath(assetPath);
|
|
27
|
-
const syncStatus = new SyncStatus(join(srcDir, "assets", ".cache", assetMd5, basename$1));
|
|
25
|
+
const syncStatus = new SyncStatus(join(srcDir, "assets", ".cache", await md5FilePath(path.join(srcDir, src)), basename$1));
|
|
28
26
|
const info = await syncStatus.readInfo();
|
|
29
27
|
if (!info) throw new Error(`SyncStatus info is not found for ${syncStatus.infoPath}`);
|
|
30
28
|
return info.id;
|
|
@@ -57,7 +57,7 @@ var SyncImage = class {
|
|
|
57
57
|
if (!this.created) throw new Error("Image not created. Should have been prevented by .isComplete()");
|
|
58
58
|
await uploadImageFile(getClient(), {
|
|
59
59
|
id: this.created.id,
|
|
60
|
-
byte_size: Number.parseInt(this.probeResult.format.size || "0")
|
|
60
|
+
byte_size: Number.parseInt(this.probeResult.format.size || "0", 10)
|
|
61
61
|
}, createReadableStreamFromReadable(createReadStream(this.path))).whenUploaded();
|
|
62
62
|
}
|
|
63
63
|
async markSynced() {
|
|
@@ -11,24 +11,23 @@ async function launchBrowserAndWaitForSDK(options, fn) {
|
|
|
11
11
|
devtools: options.interactive === true
|
|
12
12
|
});
|
|
13
13
|
});
|
|
14
|
-
|
|
14
|
+
await fn(await withSpinner("Loading Editframe SDK", async () => {
|
|
15
15
|
const pageOptions = {};
|
|
16
16
|
if (options.interactive === true) pageOptions.viewport = null;
|
|
17
|
-
const page
|
|
18
|
-
page
|
|
17
|
+
const page = await browser.newPage(pageOptions);
|
|
18
|
+
page.on("console", (msg) => {
|
|
19
19
|
browserLog(chalk.blue(`browser (${msg.type()}) |`), msg.text());
|
|
20
20
|
});
|
|
21
21
|
const url = options.url + (options.efInteractive ? "" : "?EF_NONINTERACTIVE=1");
|
|
22
22
|
process.stderr.write("\nLoading url: ");
|
|
23
23
|
process.stderr.write(url);
|
|
24
24
|
process.stderr.write("\n");
|
|
25
|
-
await page
|
|
26
|
-
await page
|
|
25
|
+
await page.goto(url);
|
|
26
|
+
await page.waitForFunction(() => {
|
|
27
27
|
return window.EF_REGISTERED;
|
|
28
28
|
}, [], { timeout: 1e4 });
|
|
29
|
-
return page
|
|
30
|
-
});
|
|
31
|
-
await fn(page);
|
|
29
|
+
return page;
|
|
30
|
+
}));
|
|
32
31
|
if (options.interactive !== true) {
|
|
33
32
|
await browser.close();
|
|
34
33
|
process.exit(0);
|
|
@@ -16,13 +16,12 @@ var PreviewServer = class PreviewServer {
|
|
|
16
16
|
var startPreviewServer = async (directory) => {
|
|
17
17
|
return await withSpinner("Starting vite...", async () => {
|
|
18
18
|
const resolvedDirectory = path.resolve(process.cwd(), directory);
|
|
19
|
-
const cacheRoot = path.join(resolvedDirectory, "assets");
|
|
20
19
|
const devServer = await createServer({
|
|
21
20
|
server: { watch: null },
|
|
22
21
|
root: resolvedDirectory,
|
|
23
22
|
plugins: [vitePluginEditframe({
|
|
24
23
|
root: resolvedDirectory,
|
|
25
|
-
cacheRoot
|
|
24
|
+
cacheRoot: path.join(resolvedDirectory, "assets")
|
|
26
25
|
})]
|
|
27
26
|
});
|
|
28
27
|
await devServer.listen();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.6-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.
|
|
27
|
-
"@editframe/assets": "0.
|
|
28
|
-
"@editframe/elements": "0.
|
|
29
|
-
"@editframe/vite-plugin": "0.
|
|
26
|
+
"@editframe/api": "0.23.6-beta.0",
|
|
27
|
+
"@editframe/assets": "0.23.6-beta.0",
|
|
28
|
+
"@editframe/elements": "0.23.6-beta.0",
|
|
29
|
+
"@editframe/vite-plugin": "0.23.6-beta.0",
|
|
30
30
|
"@inquirer/prompts": "^5.3.8",
|
|
31
31
|
"axios": "^1.6.8",
|
|
32
32
|
"chalk": "^5.3.0",
|
|
@@ -100,7 +100,7 @@ export class SyncImage implements SubAssetSync<CreateImageFileResult> {
|
|
|
100
100
|
getClient(),
|
|
101
101
|
{
|
|
102
102
|
id: this.created.id,
|
|
103
|
-
byte_size: Number.parseInt(this.probeResult.format.size || "0"),
|
|
103
|
+
byte_size: Number.parseInt(this.probeResult.format.size || "0", 10),
|
|
104
104
|
},
|
|
105
105
|
createReadableStreamFromReadable(createReadStream(this.path)),
|
|
106
106
|
).whenUploaded();
|