eddev 2.0.0-beta.74 → 2.0.0-beta.75
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.0.0-beta.
|
|
1
|
+
export declare const VERSION = "2.0.0-beta.75";
|
package/dist/node/cli/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "2.0.0-beta.
|
|
1
|
+
export const VERSION = "2.0.0-beta.75";
|
|
@@ -12,7 +12,6 @@ import { loadRouteManifest } from "./manifest/routes-manifest.js";
|
|
|
12
12
|
import { loadViewManifest } from "./manifest/view-manifest.js";
|
|
13
13
|
import { loadWidgetManifest } from "./manifest/widget-manifest.js";
|
|
14
14
|
import { WPInfo } from "./wp-info.js";
|
|
15
|
-
import { fetchWP } from "../utils/fetch-wp.js";
|
|
16
15
|
const console = createConsole("Project", "project");
|
|
17
16
|
export const projectLog = console;
|
|
18
17
|
/**
|
|
@@ -47,7 +46,7 @@ export class Project {
|
|
|
47
46
|
}
|
|
48
47
|
async verifyOriginAccess() {
|
|
49
48
|
try {
|
|
50
|
-
const response = await
|
|
49
|
+
const response = await this.wp.ping();
|
|
51
50
|
if (!response.ok) {
|
|
52
51
|
return {
|
|
53
52
|
success: false,
|
|
@@ -68,7 +67,7 @@ export class Project {
|
|
|
68
67
|
message: [
|
|
69
68
|
`Failed to access WordPress origin at ${this.origin}`,
|
|
70
69
|
`Using API Key?: ${ProjectEnvUtils.getSafe("SITE_API_KEY") ? "Yes" : "No"}`,
|
|
71
|
-
`The following error occurred
|
|
70
|
+
`The following error occurred:${err}`,
|
|
72
71
|
].join("\n"),
|
|
73
72
|
};
|
|
74
73
|
}
|
|
@@ -6,8 +6,13 @@ export class WPInfo {
|
|
|
6
6
|
constructor(siteUrl) {
|
|
7
7
|
this.siteUrl = siteUrl;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
async ping() {
|
|
10
|
+
if (!this.siteUrl) {
|
|
11
|
+
throw new Error("Attempted to ping WordPress, but SITE_URL was not present in the environment.");
|
|
12
|
+
}
|
|
13
|
+
const url = resolveURL(this.siteUrl, "/wp-json/ed/v1/handshake");
|
|
14
|
+
const response = await fetchWP(url);
|
|
15
|
+
return response;
|
|
11
16
|
}
|
|
12
17
|
async getInfo(force = false) {
|
|
13
18
|
if (!this.siteUrl) {
|
|
@@ -15,7 +20,7 @@ export class WPInfo {
|
|
|
15
20
|
}
|
|
16
21
|
if (this.cached && !force)
|
|
17
22
|
return this.cached;
|
|
18
|
-
const url = this.
|
|
23
|
+
const url = resolveURL(this.siteUrl, "/wp-json/ed/v1/dev/site-info");
|
|
19
24
|
const response = await fetchWP(url);
|
|
20
25
|
const result = (await response.json());
|
|
21
26
|
this.cached = result;
|