@vendure/cloud-config 0.3.2 → 0.5.0-dev.20261014172655.g652e750
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/README.md +13 -4
- package/dist/cloud-asset-server-plugin.d.ts.map +1 -1
- package/dist/cloud-asset-server-plugin.js +22 -38
- package/dist/cloud-asset-server-plugin.js.map +1 -1
- package/dist/cloud-config.d.ts.map +1 -1
- package/dist/cloud-dashboard-plugin.d.ts.map +1 -1
- package/dist/cloud-dashboard-plugin.js +20 -36
- package/dist/cloud-dashboard-plugin.js.map +1 -1
- package/dist/cloud-plugin-declaration.d.ts.map +1 -1
- package/dist/cloud-plugin-declaration.js +18 -23
- package/dist/cloud-plugin-declaration.js.map +1 -1
- package/dist/composition.d.ts.map +1 -1
- package/dist/composition.js +22 -32
- package/dist/composition.js.map +1 -1
- package/dist/define-cloud-config.d.ts.map +1 -1
- package/dist/define-cloud-config.js +12 -17
- package/dist/define-cloud-config.js.map +1 -1
- package/dist/durable-workflow-reads.d.ts +20 -0
- package/dist/durable-workflow-reads.d.ts.map +1 -0
- package/dist/durable-workflow-reads.js +57 -0
- package/dist/durable-workflow-reads.js.map +1 -0
- package/dist/durable-workflows.d.ts +74 -0
- package/dist/durable-workflows.d.ts.map +1 -0
- package/dist/durable-workflows.js +102 -0
- package/dist/durable-workflows.js.map +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +3 -6
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +70 -104
- package/dist/migrations.js.map +1 -1
- package/dist/outbound-hosts.d.ts +6 -0
- package/dist/outbound-hosts.d.ts.map +1 -1
- package/dist/outbound-hosts.js +114 -55
- package/dist/outbound-hosts.js.map +1 -1
- package/dist/path.d.ts.map +1 -1
- package/dist/path.js +6 -7
- package/dist/path.js.map +1 -1
- package/dist/platform-capabilities.d.ts +1 -1
- package/dist/platform-capabilities.d.ts.map +1 -1
- package/dist/platform-capabilities.js +13 -15
- package/dist/platform-capabilities.js.map +1 -1
- package/dist/platform-fields.d.ts.map +1 -1
- package/dist/platform-fields.js +10 -15
- package/dist/platform-fields.js.map +1 -1
- package/dist/plugin-attribution.d.ts +1 -0
- package/dist/plugin-attribution.d.ts.map +1 -1
- package/dist/plugin-attribution.js +25 -30
- package/dist/plugin-attribution.js.map +1 -1
- package/dist/runtime-backstop.d.ts.map +1 -1
- package/dist/runtime-backstop.js +2 -5
- package/dist/runtime-backstop.js.map +1 -1
- package/dist/secrets.d.ts.map +1 -1
- package/dist/secrets.js +20 -50
- package/dist/secrets.js.map +1 -1
- package/dist/stack.d.ts.map +1 -1
- package/dist/stack.js +12 -21
- package/dist/stack.js.map +1 -1
- package/dist/superseded-plugins.d.ts.map +1 -1
- package/dist/superseded-plugins.js +4 -7
- package/dist/superseded-plugins.js.map +1 -1
- package/dist/vendure-extension.d.ts +2 -0
- package/dist/vendure-extension.d.ts.map +1 -1
- package/dist/vendure-extension.js +53 -34
- package/dist/vendure-extension.js.map +1 -1
- package/package.json +13 -6
package/dist/stack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../src/stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,
|
|
1
|
+
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../src/stack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,6FAA6F;AAC7F,iGAAiG;AACjG,EAAE;AACF,2EAA2E;AAC3E,uFAAuF;AACvF,6FAA6F;AAC7F,iD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AAC,SAAS,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,KAAK,CAAC,iBAAiB,GAAG,eAAe,CAAC;QAC1C,KAAK,CAAC,eAAe,GAAG,aAAa,CAAC;IACxC,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"superseded-plugins.d.ts","sourceRoot":"","sources":["../src/superseded-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAc,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"superseded-plugins.d.ts","sourceRoot":"","sources":["../src/superseded-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAc,MAAM,yBAAyB,CAAC;AAa9F,MAAM,WAAW,gBAAgB;IAG/B,MAAM,EAAE,MAAM,CAAC;IAEf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAqBD,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,EAAqB,CAAC;AAEhF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAE/E;AAED,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,gBAAgB,CAAC;IAG7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,6BAA8B,SAAQ,gBAAgB;IACjE,QAAQ,CAAC,YAAY,EAAE,SAAS,2BAA2B,EAAE,CAAC;gBAElD,YAAY,EAAE,SAAS,2BAA2B,EAAE;CAiBjE;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,WAAW,GAAE,iBAA6B,GACzC,IAAI,CAUN"}
|
|
@@ -2,13 +2,10 @@ import { CloudConfigError } from "./errors.js";
|
|
|
2
2
|
import { pluginName } from "./plugin-attribution.js";
|
|
3
3
|
const SUPERSEDED_SPECS = [
|
|
4
4
|
{
|
|
5
|
-
// The behavioural check
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// check has been told to ignore, and the boot succeeds with their storage strategy discarded.
|
|
10
|
-
// `DashboardPlugin` is not exposed to this: the platform's plugin is
|
|
11
|
-
// `CloudDashboardServerPlugin`, which is a different name.
|
|
5
|
+
// The behavioural check ignores the names of the platform's own plugins. The platform serves
|
|
6
|
+
// assets with the upstream `AssetServerPlugin`, configured by `CloudAssetServerPlugin`, so a
|
|
7
|
+
// customer declaring it writes `assetOptions.assetStorageStrategy` under an ignored name. The
|
|
8
|
+
// boot succeeds with their storage strategy discarded.
|
|
12
9
|
plugin: "AssetServerPlugin",
|
|
13
10
|
replacement: "CloudAssetServerPlugin",
|
|
14
11
|
reason: "Vendure Cloud stores assets in a bucket it creates for this environment and serves them at /assets. CloudAssetServerPlugin keeps your presets, transform strategies, naming, previews and cache header, and supplies the storage and the URLs.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"superseded-plugins.js","sourceRoot":"","sources":["../src/superseded-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAA2C,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"superseded-plugins.js","sourceRoot":"","sources":["../src/superseded-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAA2C,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAsB9F,MAAM,gBAAgB,GAAG;IACvB;QACE,6FAA6F;QAC7F,6FAA6F;QAC7F,8FAA8F;QAC9F,uDAAuD;QACvD,MAAM,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AE,CAAC;QAC7B,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,UAAU;YAAE,SAAS;QAC1B,YAAY,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IACD,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,6BAA6B,CAAC,YAAY,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -20,6 +20,8 @@ export interface VendureExtension {
|
|
|
20
20
|
export type CloudPluginEntry = VendurePluginEntry | VendureExtension;
|
|
21
21
|
export declare class InvalidVendureExtensionError extends CloudConfigError {
|
|
22
22
|
}
|
|
23
|
+
export declare class InvalidOutboundHostsError extends InvalidVendureExtensionError {
|
|
24
|
+
}
|
|
23
25
|
export declare class DuplicateVendureExtensionIdError extends CloudConfigError {
|
|
24
26
|
readonly id: string;
|
|
25
27
|
constructor(id: string);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendure-extension.d.ts","sourceRoot":"","sources":["../src/vendure-extension.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAI1D,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"vendure-extension.d.ts","sourceRoot":"","sources":["../src/vendure-extension.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,gBAAgB,EA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AAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAQtF;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAEhF;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAChD,QAAQ,CAAC,UAAU,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACjD,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;CACjE;AAQD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,gBAAgB,CAyB/F"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { dirname, isAbsolute, resolve } from "node:path";
|
|
2
2
|
import { CloudConfigError } from "./errors.js";
|
|
3
|
+
import { parseOutboundHost } from "./outbound-hosts.js";
|
|
3
4
|
import { stackFrameFiles } from "./stack.js";
|
|
4
|
-
// Registered for
|
|
5
|
-
//
|
|
6
|
-
// silently treats as plugins, and core would be handed an object it cannot configure.
|
|
5
|
+
// Registered on `Symbol.for` like the config handle's symbol (ADR-0043). A second copy of this
|
|
6
|
+
// package would otherwise produce extensions that `defineCloudConfig` treats as plugins.
|
|
7
7
|
const EXTENSION = Symbol.for("vendure-cloud.vendure-extension");
|
|
8
8
|
export class InvalidVendureExtensionError extends CloudConfigError {
|
|
9
9
|
}
|
|
10
|
+
// A declared outbound host entry that is not a bare public hostname. Its own class so the managed
|
|
11
|
+
// build can name this failure without reading the message, which quotes the extension's id. A
|
|
12
|
+
// value that is not a list has no entries to name, so it stays the general error.
|
|
13
|
+
export class InvalidOutboundHostsError extends InvalidVendureExtensionError {
|
|
14
|
+
}
|
|
10
15
|
export class DuplicateVendureExtensionIdError extends CloudConfigError {
|
|
11
16
|
id;
|
|
12
17
|
constructor(id) {
|
|
@@ -14,24 +19,19 @@ export class DuplicateVendureExtensionIdError extends CloudConfigError {
|
|
|
14
19
|
this.id = id;
|
|
15
20
|
}
|
|
16
21
|
}
|
|
17
|
-
// ADR-0047's one mechanical trap: `migrations: ['./migrations/*.js']` written in a package's
|
|
18
|
-
//
|
|
19
|
-
// referenced it.
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// matches nothing and raises nothing. Reading the call stack also works whichever module
|
|
23
|
-
// system the build emits, including CommonJS output, where `import.meta` is unavailable.
|
|
22
|
+
// ADR-0047's one mechanical trap: `migrations: ['./migrations/*.js']` written in a package's own
|
|
23
|
+
// index means that package's directory, not the directory of the configuration file that
|
|
24
|
+
// referenced it. A glob left behind after copying a declaration to another file matches nothing
|
|
25
|
+
// and raises nothing. The declaring file is read off the call stack, which also works in
|
|
26
|
+
// CommonJS output, where `import.meta` is unavailable.
|
|
24
27
|
//
|
|
25
|
-
// Installing our own `prepareStackTrace`
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
// would resolve against a source tree that the image does not ship. Replacing the hook
|
|
30
|
-
// bypasses them and yields the emitted file, which is what the migrations sit beside.
|
|
28
|
+
// Installing our own `prepareStackTrace` bypasses `source-map-support` and
|
|
29
|
+
// `--enable-source-maps`, which return the original `.ts` path. The runtime image runs
|
|
30
|
+
// `node --enable-source-maps` (`apps/vc-builder/src/runtime.ts`), where the glob would resolve
|
|
31
|
+
// against a source tree the image does not ship.
|
|
31
32
|
function declaringFile(boundary) {
|
|
32
|
-
// The first frame specifically
|
|
33
|
-
//
|
|
34
|
-
// hand back whichever of our own callers happened to be beneath it.
|
|
33
|
+
// The first frame specifically. A caller that is not a file on disk has no declaring file, and
|
|
34
|
+
// the next frame down would be one of our own callers.
|
|
35
35
|
return stackFrameFiles(boundary, 2)[0];
|
|
36
36
|
}
|
|
37
37
|
export function defineVendureExtension(extension) {
|
|
@@ -41,9 +41,8 @@ export function defineVendureExtension(extension) {
|
|
|
41
41
|
}
|
|
42
42
|
const migrations = [...(extension.migrations ?? [])];
|
|
43
43
|
const declaredIn = declaringFile(defineVendureExtension);
|
|
44
|
-
// Raised at definition time
|
|
45
|
-
//
|
|
46
|
-
// matches nothing.
|
|
44
|
+
// Raised at definition time so a runtime that cannot report the declaring file fails on its first
|
|
45
|
+
// run, not with a glob that matches nothing.
|
|
47
46
|
if (declaredIn === undefined && migrations.some((glob) => !isAbsolute(glob))) {
|
|
48
47
|
throw new InvalidVendureExtensionError(`Vendure Cloud: the Vendure Extension "${id}" declares migrations as relative globs, and this runtime does not report the file that declared them.\n A relative glob is relative to that file, so it cannot be resolved. Write them as absolute paths instead.\n`);
|
|
49
48
|
}
|
|
@@ -52,20 +51,41 @@ export function defineVendureExtension(extension) {
|
|
|
52
51
|
id,
|
|
53
52
|
plugins: Object.freeze([...extension.plugins]),
|
|
54
53
|
migrations: Object.freeze(migrations),
|
|
55
|
-
outboundHosts: Object.freeze(
|
|
54
|
+
outboundHosts: Object.freeze(declaredOutboundHosts(id, extension.outboundHosts)),
|
|
56
55
|
declaredIn,
|
|
57
56
|
});
|
|
58
57
|
}
|
|
58
|
+
// Raised while the configuration is evaluated, which the managed build does before an image exists,
|
|
59
|
+
// so a bad declaration fails the build rather than a deployment.
|
|
60
|
+
function declaredOutboundHosts(id, declared) {
|
|
61
|
+
if (declared === undefined)
|
|
62
|
+
return [];
|
|
63
|
+
if (!Array.isArray(declared)) {
|
|
64
|
+
throw new InvalidVendureExtensionError(`Vendure Cloud: the Vendure Extension "${id}" declares outboundHosts as something other than a list.\n Declare a list of public hostnames, such as ['api.example.com'].\n`);
|
|
65
|
+
}
|
|
66
|
+
const hosts = [];
|
|
67
|
+
const problems = [];
|
|
68
|
+
declared.forEach((value, index) => {
|
|
69
|
+
const parsed = parseOutboundHost(value);
|
|
70
|
+
if ("host" in parsed)
|
|
71
|
+
hosts.push(parsed.host);
|
|
72
|
+
else
|
|
73
|
+
problems.push(` outboundHosts[${index}] ${parsed.problem}.\n`);
|
|
74
|
+
});
|
|
75
|
+
if (problems.length > 0) {
|
|
76
|
+
throw new InvalidOutboundHostsError(`Vendure Cloud: the Vendure Extension "${id}" declares outbound hosts that are not public hostnames.\n${problems.join("")} Declare each as a bare public hostname, such as 'api.example.com'.\n`);
|
|
77
|
+
}
|
|
78
|
+
return hosts;
|
|
79
|
+
}
|
|
59
80
|
export function isVendureExtension(value) {
|
|
60
81
|
return typeof value === "object" && value !== null && EXTENSION in value;
|
|
61
82
|
}
|
|
62
|
-
// String path resolution only; `loadExtensionMigrations` in `migrations.ts`
|
|
63
|
-
//
|
|
64
|
-
//
|
|
83
|
+
// String path resolution only; `loadExtensionMigrations` in `migrations.ts` reads what the result
|
|
84
|
+
// matches. Recording which extension owns each applied migration on the Deployment row is the
|
|
85
|
+
// other half of ADR-0048 and is CLO-423.
|
|
65
86
|
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
// index arithmetic that can be got wrong.
|
|
87
|
+
// The singular form exists because the loader reports an unmatched glob by the text the author
|
|
88
|
+
// wrote, and pairing that text with a positional result needs index arithmetic.
|
|
69
89
|
export function resolveMigrationGlob(extension, glob) {
|
|
70
90
|
if (isAbsolute(glob))
|
|
71
91
|
return glob;
|
|
@@ -77,13 +97,12 @@ export function resolveMigrationGlob(extension, glob) {
|
|
|
77
97
|
export function resolveExtensionMigrations(extension) {
|
|
78
98
|
return extension.migrations.map((glob) => resolveMigrationGlob(extension, glob));
|
|
79
99
|
}
|
|
80
|
-
// Turns the array a customer wrote
|
|
81
|
-
//
|
|
100
|
+
// Turns the array a customer wrote, plugins and extensions mixed, into the flat array core takes,
|
|
101
|
+
// in declaration order, and records which extension each plugin came from so
|
|
82
102
|
// `recordPlatformFieldWrites` can name both.
|
|
83
103
|
//
|
|
84
|
-
// A plugin declared by two extensions maps to the first
|
|
85
|
-
//
|
|
86
|
-
// no finer answer available here. Detecting that overlap at all is CLO-418.
|
|
104
|
+
// A plugin declared by two extensions maps to the first. Attribution is per plugin class, because
|
|
105
|
+
// core keeps the configuration function there. CLO-418 detects the overlap.
|
|
87
106
|
export function flattenVendureExtensions(entries) {
|
|
88
107
|
const plugins = [];
|
|
89
108
|
const extensions = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendure-extension.js","sourceRoot":"","sources":["../src/vendure-extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"vendure-extension.js","sourceRoot":"","sources":["../src/vendure-extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAK7C,+FAA+F;AAC/F,yFAAyF;AACzF,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;AAsChE,MAAM,OAAO,4BAA6B,SAAQ,gBAAgB;CAAG;AAErE,kGAAkG;AAClG,8FAA8F;AAC9F,kFAAkF;AAClF,MAAM,OAAO,yBAA0B,SAAQ,4BAA4B;CAAG;AAE9E,MAAM,OAAO,gCAAiC,SAAQ,gBAAgB;IAC3D,EAAE,CAAS;IAEpB,YAAY,EAAU;QACpB,KAAK,CACH,4CAA4C,EAAE,gOAAgO,CAC/Q,CAAC;QACF,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;CACF;AAED,iGAAiG;AACjG,yFAAyF;AACzF,gGAAgG;AAChG,yFAAyF;AACzF,uDAAuD;AACvD,EAAE;AACF,2EAA2E;AAC3E,uFAAuF;AACvF,+FAA+F;A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AAO,EAAE,CAAC;YACnC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACrB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC7B,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;AAC9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure/cloud-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-dev.20261014172655.g652e750",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Cloud Config interface a Vendure Cloud application is written against.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"README.md"
|
|
37
37
|
],
|
|
38
38
|
"publishConfig": {
|
|
39
|
-
"access": "public"
|
|
39
|
+
"access": "public",
|
|
40
|
+
"tag": "dev"
|
|
40
41
|
},
|
|
41
42
|
"scripts": {
|
|
42
43
|
"build": "tsc",
|
|
@@ -49,18 +50,24 @@
|
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"reflect-metadata": "^0.2.2",
|
|
52
|
-
"tinyglobby": "^0.2.
|
|
53
|
+
"tinyglobby": "^0.2.17"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
56
|
"@vendure/asset-server-plugin": "^3.7.0",
|
|
56
57
|
"@vendure/core": "^3.7.0"
|
|
57
58
|
},
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"@vendure/core": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
58
64
|
"devDependencies": {
|
|
59
65
|
"@types/node": "^22.20.1",
|
|
60
66
|
"@vendure-cloud/tsconfig": "workspace:*",
|
|
61
|
-
"@vendure/asset-server-plugin": "3.7.
|
|
62
|
-
"@vendure/core": "3.7.
|
|
67
|
+
"@vendure/asset-server-plugin": "3.7.3",
|
|
68
|
+
"@vendure/core": "3.7.3",
|
|
63
69
|
"typescript": "catalog:",
|
|
64
70
|
"vitest": "^3.2.6"
|
|
65
|
-
}
|
|
71
|
+
},
|
|
72
|
+
"gitHead": "652e7506f4aefd79a05bb85e8e9f7e7559506938"
|
|
66
73
|
}
|