@wp-playground/blueprints 0.1.33 → 0.1.36
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/package.json +2 -2
- package/src/index.ts +1 -0
- package/src/lib/resources.ts +8 -2
- package/src/lib/steps/define-site-url.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/blueprints",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.36",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"import": "./index.js",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "2ff5ba0809e54aef3dc6feea764fa100739d815a"
|
|
24
24
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './lib/steps';
|
|
2
2
|
export * from './lib/steps/handlers';
|
|
3
3
|
export { runBlueprintSteps, compileBlueprint } from './lib/compile';
|
|
4
|
+
export { setPluginProxyURL } from './lib/resources';
|
|
4
5
|
export type { Blueprint } from './lib/blueprint';
|
|
5
6
|
export type {
|
|
6
7
|
CompiledStep,
|
package/src/lib/resources.ts
CHANGED
|
@@ -275,6 +275,11 @@ export class UrlResource extends FetchResource {
|
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
let pluginProxyURL = '/plugin-proxy';
|
|
279
|
+
export function setPluginProxyURL(url: string) {
|
|
280
|
+
pluginProxyURL = url;
|
|
281
|
+
}
|
|
282
|
+
|
|
278
283
|
/**
|
|
279
284
|
* A `Resource` that represents a WordPress core theme.
|
|
280
285
|
*/
|
|
@@ -290,9 +295,10 @@ export class CoreThemeResource extends FetchResource {
|
|
|
290
295
|
}
|
|
291
296
|
getURL() {
|
|
292
297
|
const zipName = toDirectoryZipName(this.resource.slug);
|
|
293
|
-
return
|
|
298
|
+
return `${pluginProxyURL}?theme=` + zipName;
|
|
294
299
|
}
|
|
295
300
|
}
|
|
301
|
+
|
|
296
302
|
/**
|
|
297
303
|
* A resource that fetches a WordPress plugin from wordpress.org.
|
|
298
304
|
*/
|
|
@@ -312,7 +318,7 @@ export class CorePluginResource extends FetchResource {
|
|
|
312
318
|
/** @inheritDoc */
|
|
313
319
|
getURL() {
|
|
314
320
|
const zipName = toDirectoryZipName(this.resource.slug);
|
|
315
|
-
return
|
|
321
|
+
return `${pluginProxyURL}?plugin=` + zipName;
|
|
316
322
|
}
|
|
317
323
|
}
|
|
318
324
|
|
|
@@ -16,11 +16,12 @@ export const defineSiteUrl: StepHandler<DefineSiteUrlStep> = async (
|
|
|
16
16
|
playground,
|
|
17
17
|
{ siteUrl }
|
|
18
18
|
) => {
|
|
19
|
+
const documentRoot = await playground.documentRoot;
|
|
19
20
|
await updateFile(
|
|
20
21
|
playground,
|
|
21
|
-
|
|
22
|
+
`${documentRoot}/wp-config.php`,
|
|
22
23
|
(contents) =>
|
|
23
|
-
`<?php
|
|
24
|
+
`<?php
|
|
24
25
|
if ( ! defined( 'WP_HOME' ) ) {
|
|
25
26
|
define('WP_HOME', "${siteUrl}");
|
|
26
27
|
}
|