MCPcopy
hub / github.com/FredKSchott/snowpack / createRemotePackageSDK

Function createRemotePackageSDK

snowpack/src/util.ts:36–48  ·  view source on GitHub ↗
(config: SnowpackConfig)

Source from the content-addressed store, hash-verified

34) => Promise<any> = require('../../assets/require-or-import.js');
35
36export function createRemotePackageSDK(config: SnowpackConfig) {
37 // This should only be called when config.packageOptions.source is 'remote'.
38 if (config.packageOptions.source !== 'remote') {
39 throw new Error('expected "remote" packageOptions.source');
40 }
41
42 // For consistency with previous behavior, we default to REMOTE_PACKAGE_ORIGIN
43 // if no origin is provided. We could simply leave it undefined and allow
44 // SkypackSDK to use its own default.
45 return new SkypackSDK({
46 origin: config.packageOptions.origin || REMOTE_PACKAGE_ORIGIN,
47 });
48}
49
50// A note on cache naming/versioning: We currently version our global caches
51// with the version of the last breaking change. This allows us to re-use the

Callers 3

addCommandFunction · 0.90
rmCommandFunction · 0.90
constructorMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected