@vendure/cloud-config 0.0.0 → 0.2.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/README.md CHANGED
@@ -253,8 +253,9 @@ how the build happens to be written. A bundler is the route back to a second cop
253
253
  `@vendure/core`, and a minifier rewrites the class names that `CloudConfigError` and
254
254
  `pluginName` read at runtime to build the messages ADR-0044 requires. `tsc` can do neither,
255
255
  and `packages/cloud/test/published-output.test.ts` builds every publishable package and
256
- asserts it: one emitted file per source file, every dependency still a bare import, and every
257
- exported class still carrying its own name.
256
+ asserts it: one emitted file per source file, every dependency still a bare import, every
257
+ exported class still carrying its own name, and the entry point's import loading no more of the
258
+ module graph than a stated budget.
258
259
 
259
260
  Read ADR-0045's packaging decision only. Its delivery decision — that the customer pins these
260
261
  packages in their own lockfile and the platform reports a vulnerable version rather than
@@ -0,0 +1,27 @@
1
+ import type { AssetServerOptions } from "@vendure/asset-server-plugin";
2
+ import type { FlattenedCloudConfig, PlatformOwned } from "./cloud-config.js";
3
+ import type { VendurePluginEntry } from "./vendure-extension.js";
4
+ export declare const CLOUD_ASSET_SERVER_PLUGIN_KIND = "asset-server";
5
+ export declare const CLOUD_ASSET_ROUTE = "assets";
6
+ export declare const MAX_IMAGE_TRANSFORM_DIMENSION = 6000;
7
+ export declare const PLATFORM_SUPPLIED_ASSET_SERVER_OPTIONS: {
8
+ readonly storageStrategyFactory: "Assets are stored in a bucket Vendure Cloud creates for this environment and only this environment's task can read. Remove storageStrategyFactory. To move assets you already hold, copy them in rather than pointing the platform at your own bucket.";
9
+ readonly assetUploadDir: "The upload directory is inside the runtime image, which is the only place the process may write. Remove assetUploadDir.";
10
+ readonly assetUrlPrefix: "Asset URLs are built by Vendure Cloud from the host each request arrived on, so a store reached on its custom domain serves asset URLs on that domain. A fixed prefix here would pin every asset URL to one hostname. Remove assetUrlPrefix.";
11
+ readonly route: "Assets are served at /assets, and the platform's cache sits on that exact path. Moving the route would take the asset path out from under it. Remove route.";
12
+ };
13
+ export type CustomerAssetServerOptions = Omit<AssetServerOptions, keyof typeof PLATFORM_SUPPLIED_ASSET_SERVER_OPTIONS>;
14
+ export type CloudAssetServerPluginOptions = CustomerAssetServerOptions & {
15
+ storageStrategyFactory?: PlatformOwned<(typeof PLATFORM_SUPPLIED_ASSET_SERVER_OPTIONS)["storageStrategyFactory"]>;
16
+ assetUploadDir?: PlatformOwned<(typeof PLATFORM_SUPPLIED_ASSET_SERVER_OPTIONS)["assetUploadDir"]>;
17
+ assetUrlPrefix?: PlatformOwned<(typeof PLATFORM_SUPPLIED_ASSET_SERVER_OPTIONS)["assetUrlPrefix"]>;
18
+ route?: PlatformOwned<(typeof PLATFORM_SUPPLIED_ASSET_SERVER_OPTIONS)["route"]>;
19
+ };
20
+ export type CloudAssetServerSettings = CustomerAssetServerOptions;
21
+ export declare const CloudAssetServerPlugin: {
22
+ new (): {};
23
+ } & {
24
+ init(options?: CloudAssetServerPluginOptions): VendurePluginEntry;
25
+ };
26
+ export declare function resolveAssetServerSettings(config: FlattenedCloudConfig): CloudAssetServerSettings;
27
+ //# sourceMappingURL=cloud-asset-server-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-asset-server-plugin.d.ts","sourceRoot":"","sources":["../src/cloud-asset-server-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAG7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAcjE,eAAO,MAAM,8BAA8B,iBAAiB,CAAC;AAK7D,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAQ1C,eAAO,MAAM,6BAA6B,OAAO,CAAC;AAMlD,eAAO,MAAM,sCAAsC;;;;;CASzC,CAAC;AAMX,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,kBAAkB,EAClB,MAAM,OAAO,sCAAsC,CACpD,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,0BAA0B,GAAG;IACvE,sBAAsB,CAAC,EAAE,aAAa,CACpC,CAAC,OAAO,sCAAsC,CAAC,CAAC,wBAAwB,CAAC,CAC1E,CAAC;IACF,cAAc,CAAC,EAAE,aAAa,CAAC,CAAC,OAAO,sCAAsC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAClG,cAAc,CAAC,EAAE,aAAa,CAAC,CAAC,OAAO,sCAAsC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAClG,KAAK,CAAC,EAAE,aAAa,CAAC,CAAC,OAAO,sCAAsC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CACjF,CAAC;AAMF,MAAM,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAWlE,eAAO,MAAM,sBAAsB;;;mBAOjB,6BAA6B,GAAQ,kBAAkB;CAQxE,CAAC;AAuBF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,oBAAoB,GAAG,wBAAwB,CAMjG"}
@@ -0,0 +1,68 @@
1
+ import { declareCloudPlugin, listCloudPluginDeclarations } from "./cloud-plugin-declaration.js";
2
+ // ADR-0044 rules `AssetServerPlugin` platform-supplied and wrapped, and ADR-0051 decides which of
3
+ // its options the platform takes. This is the wrapper's declaration side: what a customer writes in
4
+ // their configuration file. The plugin that serves and stores assets is built by the platform
5
+ // runtime, which is the only place that knows the bucket, the credential chain and the hostname.
6
+ //
7
+ // The option types are imported from `@vendure/asset-server-plugin`. It is a peer dependency of
8
+ // this package and a direct dependency of the `@vendure/cloud` facade, so a customer gets it
9
+ // without declaring it and the tree holds one copy. One copy is what
10
+ // `AssetServer.sanitizeFilePath` needs: it branches on `instanceof S3AssetStorageStrategy`, and
11
+ // against a second copy that check fails and every asset request takes the local-filesystem
12
+ // branch.
13
+ export const CLOUD_ASSET_SERVER_PLUGIN_KIND = "asset-server";
14
+ // Fixed platform-wide (ADR-0051). The ingress carries an `/assets/*` cache behaviour whose path
15
+ // pattern the control plane applies without reading customer code, so a customer-settable route
16
+ // would move the asset path out from under it and nothing would report the move.
17
+ export const CLOUD_ASSET_ROUTE = "assets";
18
+ // The widest transform the platform renders, in pixels, on either axis. The number is a bound on
19
+ // an unauthenticated amplification vector rather than a size the platform prefers: without it,
20
+ // `?w=1` through `?w=10000` is ten thousand `sharp` runs and ten thousand stored objects, asked
21
+ // for by anyone. It is set well above what a storefront asks for so that nobody meets it by
22
+ // accident, and it is documented because a store legitimately serving something wider discovers it
23
+ // as a smaller image rather than as an error.
24
+ export const MAX_IMAGE_TRANSFORM_DIMENSION = 6000;
25
+ // The four options that leave the type, with the explanation each one's build-time error carries.
26
+ // Written as literals rather than assembled, for the reason `platform-fields.ts` records: the
27
+ // explanation is what TypeScript prints when the field is set, so it is the message and not a key
28
+ // into one.
29
+ export const PLATFORM_SUPPLIED_ASSET_SERVER_OPTIONS = {
30
+ storageStrategyFactory: "Assets are stored in a bucket Vendure Cloud creates for this environment and only this environment's task can read. Remove storageStrategyFactory. To move assets you already hold, copy them in rather than pointing the platform at your own bucket.",
31
+ assetUploadDir: "The upload directory is inside the runtime image, which is the only place the process may write. Remove assetUploadDir.",
32
+ assetUrlPrefix: "Asset URLs are built by Vendure Cloud from the host each request arrived on, so a store reached on its custom domain serves asset URLs on that domain. A fixed prefix here would pin every asset URL to one hostname. Remove assetUrlPrefix.",
33
+ route: "Assets are served at /assets, and the platform's cache sits on that exact path. Moving the route would take the asset path out from under it. Remove route.",
34
+ };
35
+ const PLATFORM_SUPPLIED_OPTION_NAMES = Object.keys(PLATFORM_SUPPLIED_ASSET_SERVER_OPTIONS);
36
+ // A class carrying the default declaration, with `init` on it. A customer who wants a preset or a
37
+ // transform strategy of their own writes `CloudAssetServerPlugin.init({ ... })`; one who wants the
38
+ // defaults but wants assets visible in their file can write a bare `CloudAssetServerPlugin`. The
39
+ // second is redundant, because the platform injects the default declaration when the customer
40
+ // writes neither, and it is supported so that writing it is not read as a plugin nobody recognises.
41
+ export const CloudAssetServerPlugin = Object.assign(declareCloudPlugin("CloudAssetServerPlugin", CLOUD_ASSET_SERVER_PLUGIN_KIND, {}), {
42
+ init(options = {}) {
43
+ return declareCloudPlugin("CloudAssetServerPlugin", CLOUD_ASSET_SERVER_PLUGIN_KIND, withoutPlatformSuppliedOptions(options));
44
+ },
45
+ });
46
+ // The branded options cannot be set from TypeScript, and a configuration file compiled from
47
+ // JavaScript is not type-checked at all. Dropping them here rather than trusting the type is what
48
+ // makes the platform's values authoritative in both cases, and it costs one object copy at boot.
49
+ function withoutPlatformSuppliedOptions(options) {
50
+ const customer = { ...options };
51
+ for (const name of PLATFORM_SUPPLIED_OPTION_NAMES) {
52
+ delete customer[name];
53
+ }
54
+ return customer;
55
+ }
56
+ // ADR-0044's rule that a wrapped plugin the customer declared replaces the platform's injected
57
+ // default rather than joining it: the customer's declaration when there is one, an empty one when
58
+ // there is not, and never both.
59
+ //
60
+ // A configuration declaring it more than once takes the last, which is what the upstream plugin's
61
+ // static options do and therefore what a customer who has met that plugin expects. ADR-0044 calls a
62
+ // double declaration a documentation problem rather than something to defend against, so this
63
+ // resolves it quietly rather than refusing the boot over it.
64
+ export function resolveAssetServerSettings(config) {
65
+ const declarations = listCloudPluginDeclarations(config.plugins, CLOUD_ASSET_SERVER_PLUGIN_KIND);
66
+ return declarations[declarations.length - 1]?.options ?? {};
67
+ }
68
+ //# sourceMappingURL=cloud-asset-server-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-asset-server-plugin.js","sourceRoot":"","sources":["../src/cloud-asset-server-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAIhG,kGAAkG;AAClG,oGAAoG;AACpG,8FAA8F;AAC9F,iGAAiG;AACjG,EAAE;AACF,gGAAgG;AAChG,6FAA6F;AAC7F,qEAAqE;AACrE,gGA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9C,CAAC;AAED,+FAA+F;AAC/F,kGAAkG;AAClG,gCAAgC;AAChC,EAAE;AACF,kGAAkG;AAClG,oGAAoG;AACpG,8FAA8F;AAC9F,6DAA6D;AAC7D,MAAM,UAAU,0BAA0B,CAAC,MAA4B;IACrE,MAAM,YAAY,GAAG,2BAA2B,CAC9C,MAAM,CAAC,OAAgC,EACvC,8BAA8B,CAC/B,CAAC;IACF,OAAO,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,OAAO,IAAI,EAAE,CAAC;AAC9D,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export { PLATFORM_OWNED_FIELDS, findPlatformOwnedField, type PlatformOwnedField,
6
6
  export { PlatformFieldSetByConfigError, listPlatformOwnedFieldsSetIn, } from "./runtime-backstop.js";
7
7
  export { PlatformFieldSetByPluginError, PLUGIN_CONFIGURATION_METADATA_KEY, assertNoCustomerPluginWroteAPlatformField, pluginName, recordPlatformFieldWrites, type ExtensionOfPlugin, type PendingPlatformFieldWrites, type PlatformFieldWrite, type PluginConstructor, type PluginLike, } from "./plugin-attribution.js";
8
8
  export { CLOUD_PLUGIN_COMPATIBILITY, composeCloudConfig, PlatformFieldOverwrittenError, applyPlatformFields, assertPlatformFieldsHold, hoistCloudPluginsLast, platformDefaultFieldValues, type ComposeCloudConfigOptions, type PlatformFieldValues, } from "./composition.js";
9
+ export { CLOUD_ASSET_ROUTE, CLOUD_ASSET_SERVER_PLUGIN_KIND, CloudAssetServerPlugin, MAX_IMAGE_TRANSFORM_DIMENSION, PLATFORM_SUPPLIED_ASSET_SERVER_OPTIONS, resolveAssetServerSettings, type CloudAssetServerPluginOptions, type CloudAssetServerSettings, type CustomerAssetServerOptions, } from "./cloud-asset-server-plugin.js";
9
10
  export { CLOUD_DASHBOARD_PLUGIN_KIND, CloudDashboardPlugin, DEFAULT_DASHBOARD_ROUTE, InvalidDashboardRouteError, PLATFORM_SUPPLIED_DASHBOARD_OPTIONS, resolveDashboardSettings, type CloudDashboardPluginOptions, type CloudDashboardSettings, } from "./cloud-dashboard-plugin.js";
10
11
  export { declareCloudPlugin, isCloudPluginDeclaration, listCloudPluginDeclarations, readCloudPluginDeclaration, type CloudPluginDeclaration, } from "./cloud-plugin-declaration.js";
11
12
  export { SUPERSEDED_PLUGINS, SupersededPluginDeclaredError, assertNoSupersededPluginDeclared, findSupersededPlugin, type SupersededPlugin, type SupersededPluginDeclaration, } from "./superseded-plugins.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gCAAgC,EAChC,4BAA4B,EAC5B,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,EAC1B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,EACzB,qCAAqC,EACrC,8BAA8B,EAC9B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yCAAyC,EACzC,UAAU,EACV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;AACxC,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC1B,mCAAmC,EACnC,wBAAwB,EACxB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,GAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,gCAAgC,EAChC,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,2BAA2B,GACjC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,EACb,MAAM,GACP,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export { PLATFORM_OWNED_FIELDS, findPlatformOwnedField, } from "./platform-field
5
5
  export { PlatformFieldSetByConfigError, listPlatformOwnedFieldsSetIn, } from "./runtime-backstop.js";
6
6
  export { PlatformFieldSetByPluginError, PLUGIN_CONFIGURATION_METADATA_KEY, assertNoCustomerPluginWroteAPlatformField, pluginName, recordPlatformFieldWrites, } from "./plugin-attribution.js";
7
7
  export { CLOUD_PLUGIN_COMPATIBILITY, composeCloudConfig, PlatformFieldOverwrittenError, applyPlatformFields, assertPlatformFieldsHold, hoistCloudPluginsLast, platformDefaultFieldValues, } from "./composition.js";
8
+ export { CLOUD_ASSET_ROUTE, CLOUD_ASSET_SERVER_PLUGIN_KIND, CloudAssetServerPlugin, MAX_IMAGE_TRANSFORM_DIMENSION, PLATFORM_SUPPLIED_ASSET_SERVER_OPTIONS, resolveAssetServerSettings, } from "./cloud-asset-server-plugin.js";
8
9
  export { CLOUD_DASHBOARD_PLUGIN_KIND, CloudDashboardPlugin, DEFAULT_DASHBOARD_ROUTE, InvalidDashboardRouteError, PLATFORM_SUPPLIED_DASHBOARD_OPTIONS, resolveDashboardSettings, } from "./cloud-dashboard-plugin.js";
9
10
  export { declareCloudPlugin, isCloudPluginDeclaration, listCloudPluginDeclarations, readCloudPluginDeclaration, } from "./cloud-plugin-declaration.js";
10
11
  export { SUPERSEDED_PLUGINS, SupersededPluginDeclaredError, assertNoSupersededPluginDeclared, findSupersededPlugin, } from "./superseded-plugins.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,GAGhB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,gCAAgC,EAChC,4BAA4B,EAC5B,sBAAsB,EACtB,kBAAkB,EAClB,0BAA0B,GAK3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,yBAAyB,EACzB,qCAAqC,EACrC,8BAA8B,GAI/B,MAAM,iBAAiB,CAAC;AAYzB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAGvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,6BAA6B,EAC7B,iCAAiC,EACjC,yCAAyC,EACzC,UAAU,EACV,yBAAyB,GAM1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,qBAAqB,EACrB,0BAA0B,GAG3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,uBAAuB,E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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"}
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;AAkB9F,MAAM,WAAW,gBAAgB;IAI/B,MAAM,EAAE,MAAM,CAAC;IAGf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAwBD,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;IAI7B,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"}
@@ -1,6 +1,18 @@
1
1
  import { CloudConfigError } from "./errors.js";
2
2
  import { pluginName } from "./plugin-attribution.js";
3
3
  const SUPERSEDED_SPECS = [
4
+ {
5
+ // The behavioural check cannot see this one. It attributes each write to the class name that
6
+ // made it, then ignores the names the platform's own plugins carry. The platform serves assets
7
+ // with the upstream `AssetServerPlugin` itself, configured by `CloudAssetServerPlugin`, so a
8
+ // customer declaring that plugin writes `assetOptions.assetStorageStrategy` under a name the
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.
12
+ plugin: "AssetServerPlugin",
13
+ replacement: "CloudAssetServerPlugin",
14
+ 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.",
15
+ },
4
16
  {
5
17
  plugin: "DashboardPlugin",
6
18
  replacement: "CloudDashboardPlugin",
@@ -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;AA6B9F,MAAM,gBAAgB,GAAG;IACvB;QACE,MAAM,EAAE,iBAAiB;QACzB,WAAW,EAAE,sBAAsB;QACnC,MAAM,EACJ,oKAAoK;KACvK;CAC6C,CAAC;AAEjD,MAAM,CAAC,MAAM,kBAAkB,GAAgC,gBAAgB,CAAC;AAEhF,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC;AAC7E,CAAC;AAUD,MAAM,OAAO,6BAA8B,SAAQ,gBAAgB;IACxD,YAAY,CAAyC;IAE9D,YAAY,YAAoD;QAC9D,MAAM,MAAM,GAAG,YAAY;aACxB,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE;YACjC,MAAM,KAAK,G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,gCAAgC,CAC9C,OAA8B,EAC9B,cAAiC,IAAI,GAAG,EAAE;IAE1C,MAAM,YAAY,GAAkC,EAAE,CAAC;IACvD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendure/cloud-config",
3
- "version": "0.0.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "The Cloud Config interface a Vendure Cloud application is written against.",
6
6
  "license": "MIT",
@@ -52,11 +52,13 @@
52
52
  "tinyglobby": "^0.2.15"
53
53
  },
54
54
  "peerDependencies": {
55
+ "@vendure/asset-server-plugin": "^3.7.0",
55
56
  "@vendure/core": "^3.7.0"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@types/node": "^22.20.0",
59
60
  "@vendure-cloud/tsconfig": "workspace:*",
61
+ "@vendure/asset-server-plugin": "3.7.2",
60
62
  "@vendure/core": "3.7.2",
61
63
  "typescript": "catalog:",
62
64
  "vitest": "^3.2.6"