@ms-cloudpack/common-types 0.31.1 → 0.32.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/lib/BundleOptions.d.ts +9 -0
- package/lib/BundleOptions.d.ts.map +1 -1
- package/lib/BundleOptions.js.map +1 -1
- package/lib/BundlerCapability.d.ts +7 -2
- package/lib/BundlerCapability.d.ts.map +1 -1
- package/lib/BundlerCapability.js.map +1 -1
- package/lib/Session.d.ts +10 -0
- package/lib/Session.d.ts.map +1 -1
- package/lib/Session.js.map +1 -1
- package/package.json +1 -1
- package/schema/AppConfig.json +16 -5
- package/schema/UserConfig.json +16 -5
package/lib/BundleOptions.d.ts
CHANGED
|
@@ -4,6 +4,10 @@ import type { TargetEnvironment } from './TargetEnvironment.js';
|
|
|
4
4
|
* Options for creating bundles with a bundler plugin.
|
|
5
5
|
*/
|
|
6
6
|
export interface BundleOptions extends Pick<PackageSettings, 'bundler' | 'bundlerOptions' | 'dynamicImports' | 'ignoredBundlerWarnings' | 'bundlerCapabilities' | 'unsafeCjsExportNames'> {
|
|
7
|
+
/**
|
|
8
|
+
* Original (not transformed) name of the package being bundled.
|
|
9
|
+
*/
|
|
10
|
+
packageName: string;
|
|
7
11
|
/**
|
|
8
12
|
* The absolute input path for the entry points.
|
|
9
13
|
*/
|
|
@@ -59,5 +63,10 @@ export interface BundleOptions extends Pick<PackageSettings, 'bundler' | 'bundle
|
|
|
59
63
|
* to `dispose` if returned.
|
|
60
64
|
*/
|
|
61
65
|
incremental?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Bundler aliases for deduped packages. Maps package names to their resolved paths
|
|
68
|
+
* to ensure all imports use the same version when bundling inlined dependencies.
|
|
69
|
+
*/
|
|
70
|
+
dedupeAliases?: Record<string, string>;
|
|
62
71
|
}
|
|
63
72
|
//# sourceMappingURL=BundleOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleOptions.d.ts","sourceRoot":"","sources":["../src/BundleOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,aACf,SAAQ,IAAI,CACV,eAAe,EACb,SAAS,GACT,gBAAgB,GAChB,gBAAgB,GAChB,wBAAwB,GACxB,qBAAqB,GACrB,sBAAsB,CACzB;IACD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;;;;;;OAYG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;;;;;OAMG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IAErC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BundleOptions.d.ts","sourceRoot":"","sources":["../src/BundleOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,aACf,SAAQ,IAAI,CACV,eAAe,EACb,SAAS,GACT,gBAAgB,GAChB,gBAAgB,GAChB,wBAAwB,GACxB,qBAAqB,GACrB,sBAAsB,CACzB;IACD;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;;;;;;OAYG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;;;;;OAMG;IACH,iBAAiB,EAAE,iBAAiB,CAAC;IAErC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACxC"}
|
package/lib/BundleOptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleOptions.js","sourceRoot":"","sources":["../src/BundleOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageSettings } from './PackageSettings.js';\nimport type { TargetEnvironment } from './TargetEnvironment.js';\n\n/**\n * Options for creating bundles with a bundler plugin.\n */\nexport interface BundleOptions\n extends Pick<\n PackageSettings,\n | 'bundler'\n | 'bundlerOptions'\n | 'dynamicImports'\n | 'ignoredBundlerWarnings'\n | 'bundlerCapabilities'\n | 'unsafeCjsExportNames'\n > {\n /**\n * The absolute input path for the entry points.\n */\n inputPath: string;\n\n /**\n * Mapping from output file to source file paths.\n * - Key is the output file path, relative to `outputPath` (with forward slashes and leading `./`)\n * and *without* the extension (unless it's non-JS).\n * - Value is the input file path, relative to `inputPath` (with forward slashes and leading `./`)\n * including the extension.\n *\n * For example:\n * `{ './lib/index': './src/index.js' }`\n *\n * Note: Non-javascript extensions, such as `.css` or `.scss`, will not be stripped from the key.\n * This is to ensure the bundler keeps the original extension intact and adds `.js` after it.\n */\n entries: Record<string, string>;\n\n /**\n * Target environment for the bundle.\n *\n * WARNING: `'node'` environment is a work in progress and may not be fully supported.\n * Also, currently it causes package to be bundled in **production mode** since import maps\n * aren't supported in Node yet.\n */\n targetEnvironment: TargetEnvironment;\n\n /**\n * The output path for bundled files. This can be either relative to `inputPath`, or absolute.\n * Defaults to `inputPath`.\n */\n outputPath?: string;\n\n /**\n * List of dependencies which should be externalized.\n */\n external?: string[];\n\n /**\n * List of dependencies which should be inlined.\n */\n inlined?: string[];\n\n /**\n * If true, minify the output.\n */\n minify?: boolean;\n\n /**\n * If true, will generate sourcemap files for the output. This has a tax on performance.\n * Defaults to true unless the `disableSourceMaps` feature is enabled.\n * (To set a bundler-specific sourcemap option, use `bundlerOptions`.)\n */\n sourcemap?: boolean;\n\n /**\n * If true, the bundler is expected to stay alive and take requests to rebuild on demand. File watching is\n * managed at a higher layer. When we no longer care about incremental bundling, the bundler will receive a call\n * to `dispose` if returned.\n */\n incremental?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BundleOptions.js","sourceRoot":"","sources":["../src/BundleOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageSettings } from './PackageSettings.js';\nimport type { TargetEnvironment } from './TargetEnvironment.js';\n\n/**\n * Options for creating bundles with a bundler plugin.\n */\nexport interface BundleOptions\n extends Pick<\n PackageSettings,\n | 'bundler'\n | 'bundlerOptions'\n | 'dynamicImports'\n | 'ignoredBundlerWarnings'\n | 'bundlerCapabilities'\n | 'unsafeCjsExportNames'\n > {\n /**\n * Original (not transformed) name of the package being bundled.\n */\n packageName: string;\n\n /**\n * The absolute input path for the entry points.\n */\n inputPath: string;\n\n /**\n * Mapping from output file to source file paths.\n * - Key is the output file path, relative to `outputPath` (with forward slashes and leading `./`)\n * and *without* the extension (unless it's non-JS).\n * - Value is the input file path, relative to `inputPath` (with forward slashes and leading `./`)\n * including the extension.\n *\n * For example:\n * `{ './lib/index': './src/index.js' }`\n *\n * Note: Non-javascript extensions, such as `.css` or `.scss`, will not be stripped from the key.\n * This is to ensure the bundler keeps the original extension intact and adds `.js` after it.\n */\n entries: Record<string, string>;\n\n /**\n * Target environment for the bundle.\n *\n * WARNING: `'node'` environment is a work in progress and may not be fully supported.\n * Also, currently it causes package to be bundled in **production mode** since import maps\n * aren't supported in Node yet.\n */\n targetEnvironment: TargetEnvironment;\n\n /**\n * The output path for bundled files. This can be either relative to `inputPath`, or absolute.\n * Defaults to `inputPath`.\n */\n outputPath?: string;\n\n /**\n * List of dependencies which should be externalized.\n */\n external?: string[];\n\n /**\n * List of dependencies which should be inlined.\n */\n inlined?: string[];\n\n /**\n * If true, minify the output.\n */\n minify?: boolean;\n\n /**\n * If true, will generate sourcemap files for the output. This has a tax on performance.\n * Defaults to true unless the `disableSourceMaps` feature is enabled.\n * (To set a bundler-specific sourcemap option, use `bundlerOptions`.)\n */\n sourcemap?: boolean;\n\n /**\n * If true, the bundler is expected to stay alive and take requests to rebuild on demand. File watching is\n * managed at a higher layer. When we no longer care about incremental bundling, the bundler will receive a call\n * to `dispose` if returned.\n */\n incremental?: boolean;\n\n /**\n * Bundler aliases for deduped packages. Maps package names to their resolved paths\n * to ensure all imports use the same version when bundling inlined dependencies.\n */\n dedupeAliases?: Record<string, string>;\n}\n"]}
|
|
@@ -29,10 +29,15 @@ export type BundlerCapability<TOptions extends object> = {
|
|
|
29
29
|
export type InternalBundlerCapabilities = {
|
|
30
30
|
/**
|
|
31
31
|
* Inlines assets into the bundle.
|
|
32
|
-
*
|
|
32
|
+
*
|
|
33
|
+
* Extensions can be specified as:
|
|
34
|
+
* - Array: `['avif']` - use only these extensions (replaces defaults)
|
|
35
|
+
* - Object: `{ 'svg': false, 'avif': true }` - modify defaults (remove svg, add avif)
|
|
36
|
+
*
|
|
37
|
+
* Do not include the leading dot.
|
|
33
38
|
*/
|
|
34
39
|
'asset-inline': {
|
|
35
|
-
extensions: string[]
|
|
40
|
+
extensions: string[] | Record<string, boolean>;
|
|
36
41
|
};
|
|
37
42
|
/**
|
|
38
43
|
* Replace identifiers at build time.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundlerCapability.d.ts","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,MAAM,yBAAyB,CAAC,OAAO,EAAE,QAAQ,SAAS,MAAM,GAAG,OAAO,IAAI,CAClF,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,KACd,OAAO,CAAC;AAEb;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,MAAM,IAAI;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE;QACf,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KACjE,CAAC;CACH,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC
|
|
1
|
+
{"version":3,"file":"BundlerCapability.d.ts","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,MAAM,yBAAyB,CAAC,OAAO,EAAE,QAAQ,SAAS,MAAM,GAAG,OAAO,IAAI,CAClF,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,QAAQ,KACd,OAAO,CAAC;AAEb;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,MAAM,IAAI;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE;QACf,CAAC,OAAO,EAAE,MAAM,GAAG,yBAAyB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KACjE,CAAC;CACH,CAAC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IG;AACH,MAAM,MAAM,+BAA+B,CAAC,OAAO,SAAS,MAAM,IAAI;IACpE,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundlerCapability.js","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"","sourcesContent":["import type { AppConfig } from './AppConfig.js';\n\n/**\n * A function that takes a config object and options object and returns a new config object.\n * This is used to implement a bundler capability.\n *\n * - `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)\n * - `TOptions` is the type of the options object that's passed to the capability. (ie: `{ banner: string }`\n * or any other type that the capability needs when enabled) or a boolean to indicate if the capability is enabled.\n */\nexport type BundlerCapabilityFunction<TConfig, TOptions extends object | boolean> = (\n config: TConfig,\n options: TOptions,\n) => TConfig;\n\n/**\n * A bundler capability is a feature that can be enabled for a package to modify the bundling process.\n *\n * `TOptions` is the type of the options object that's passed to the capability. (ie: `{ banner: string }`\n * or any other type that the capability needs when enabled)\n */\nexport type BundlerCapability<TOptions extends object> = {\n name: string;\n description: string;\n implementations: {\n [bundler: string]: BundlerCapabilityFunction<unknown, TOptions>;\n };\n};\n\n/**\n * This is the list of the bundler capabilities that cloudpack provides.\n * - key: The name of the capability which will be used in the cloudpack config to enable the capability\n * - value: Options object which will be passed to the capability function\n */\nexport type InternalBundlerCapabilities = {\n /**\n * Inlines assets into the bundle.\n *
|
|
1
|
+
{"version":3,"file":"BundlerCapability.js","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"","sourcesContent":["import type { AppConfig } from './AppConfig.js';\n\n/**\n * A function that takes a config object and options object and returns a new config object.\n * This is used to implement a bundler capability.\n *\n * - `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)\n * - `TOptions` is the type of the options object that's passed to the capability. (ie: `{ banner: string }`\n * or any other type that the capability needs when enabled) or a boolean to indicate if the capability is enabled.\n */\nexport type BundlerCapabilityFunction<TConfig, TOptions extends object | boolean> = (\n config: TConfig,\n options: TOptions,\n) => TConfig;\n\n/**\n * A bundler capability is a feature that can be enabled for a package to modify the bundling process.\n *\n * `TOptions` is the type of the options object that's passed to the capability. (ie: `{ banner: string }`\n * or any other type that the capability needs when enabled)\n */\nexport type BundlerCapability<TOptions extends object> = {\n name: string;\n description: string;\n implementations: {\n [bundler: string]: BundlerCapabilityFunction<unknown, TOptions>;\n };\n};\n\n/**\n * This is the list of the bundler capabilities that cloudpack provides.\n * - key: The name of the capability which will be used in the cloudpack config to enable the capability\n * - value: Options object which will be passed to the capability function\n */\nexport type InternalBundlerCapabilities = {\n /**\n * Inlines assets into the bundle.\n *\n * Extensions can be specified as:\n * - Array: `['avif']` - use only these extensions (replaces defaults)\n * - Object: `{ 'svg': false, 'avif': true }` - modify defaults (remove svg, add avif)\n *\n * Do not include the leading dot.\n */\n 'asset-inline': { extensions: string[] | Record<string, boolean> };\n\n /**\n * Replace identifiers at build time.\n * Values must be valid JS literals as strings (e.g. JSON.stringify('value')).\n */\n define: {\n [key: string]: string;\n };\n\n /**\n * Bundler capability to support Density externals.\n * This is not a real capability, it's just an indicator that a package needs to use density post-bundle task.\n * Since there is no actual way to execute post-bundle tasks, I'm using this as a workaround.\n * This will be removed once we have a proper way to execute post-bundle tasks with the plugins.\n * Options: List of entries that should be treated as density externals.\n */\n density:\n | boolean\n | {\n entries: string[];\n };\n\n /**\n * Adds aliases to externalized packages.\n */\n alias: {\n [key: string]: string;\n };\n\n /**\n * Enables React Native type resolution of .web.ts extensions.\n * Options: object is empty because it's just an indicator. No options are needed.\n */\n 'resolve-web-extensions': boolean;\n\n /**\n * Enables Relay support for the package.\n */\n relay: NonNullable<AppConfig['relay']>;\n};\n\n/**\n * This is the type that's being used `PackageSettings` to enable/disable bundler capabilities.\n * - Key: internal capability name\n * - Value: options object to configure the capability, or false to disable it\n */\nexport type InternalBundlerCapabilitiesOptions = {\n [key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | boolean;\n};\n\ntype ExternalBundlerCapabilitiesOptions = Record<string, object | boolean>;\n\n/**\n * Options used in `PackageSettings` to configure or disable bundler capabilities.\n * - Key: capability name, either internal (Cloudpack-provided) or external (as specified in\n * `AppConfig.bundlerCapabilitiesRegistry`)\n * - Value: options object to configure the capability, or false to disable it.\n */\nexport type BundlerCapabilitiesOptions = InternalBundlerCapabilitiesOptions & ExternalBundlerCapabilitiesOptions;\n\n/**\n * Metadata for the bundler capabilities that cloudpack provides.\n * - Key: capability name\n * - Value: metadata object with description\n */\nexport type InternalBundlerCapabilitiesMetaData = {\n [key in keyof InternalBundlerCapabilities]: Pick<BundlerCapability<object>, 'description'>;\n};\n\n/**\n * This is a bundler specific implementation of the internal bundler capabilities.\n * It's a mapping from the capability name to the capability function.\n *\n * `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)\n */\nexport type InternalBundlerCapabilityImplementations<TConfig> = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityFunction<TConfig, InternalBundlerCapabilities[key]>;\n};\n\n/**\n * This is the type of the external bundler capability module that's being imported.\n *\n * `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)\n */\nexport type ExternalBundlerCapabilityModule<TConfig extends object> = {\n default: BundlerCapability<TConfig>;\n};\n"]}
|
package/lib/Session.d.ts
CHANGED
|
@@ -97,5 +97,15 @@ export interface Session {
|
|
|
97
97
|
* The path to the cache folder for the session.
|
|
98
98
|
*/
|
|
99
99
|
readonly cachePath: string;
|
|
100
|
+
/**
|
|
101
|
+
* Cached bundler aliases for deduped packages.
|
|
102
|
+
* Maps package names to their resolved paths to ensure all imports use the same version.
|
|
103
|
+
* Recalculated when resolveMap changes.
|
|
104
|
+
*
|
|
105
|
+
* Note: Using package names (without versions) as keys is safe here because packages in
|
|
106
|
+
* resolve.dedupe are guaranteed to have only one version used throughout the entire app.
|
|
107
|
+
* The dedupe configuration enforces that all imports resolve to a single canonical version.
|
|
108
|
+
*/
|
|
109
|
+
readonly dedupeAliases: Record<string, string>;
|
|
100
110
|
}
|
|
101
111
|
//# sourceMappingURL=Session.d.ts.map
|
package/lib/Session.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,EAAE,eAAe,CAAC;IAExB;;;;;;OAMG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,IAAI,EAAE;QACJ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,+FAA+F;QAC/F,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,4CAA4C;QAC5C,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;KAC1B,CAAC;IAEF;;;OAGG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,QAAQ,CAAC,uBAAuB,EAAE,MAAM,IAAI,CAAC;IAE7C;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAE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AAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChD"}
|
package/lib/Session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Session.js","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":"","sourcesContent":["import type { ImportMap } from './ImportMap.js';\nimport type { LinkedPath } from './LinkedPath.js';\nimport type { ResolveMap } from './ResolveMap.js';\nimport type { CloudpackConfig } from './CloudpackConfig.js';\n\nexport interface Session {\n /**\n * UUID for the session.\n */\n readonly id: string;\n\n /**\n * The config used by the session.\n */\n config: CloudpackConfig;\n\n /**\n * Used to resolve packages in the dependency graph.\n * Setting this will clear the `importMap`.\n *\n * NOTE: If the session (or whole API context) was created with `skipResolveDependencies`,\n * this will only contain the entry point package(s).\n */\n resolveMap: ResolveMap;\n\n /**\n * Reload sequence to ensure that the client is always up to date with the latest changes.\n * (This is initially sent to the client via `pageSessionContext.currentSequence` and is updated\n * via the `reloadCountSource`. It's read directly, not used as a URL cache breaker.)\n */\n sequence: number;\n\n /**\n * URLs of the active servers hosting this session.\n * Each URL will only be set after the server is started.\n */\n urls: {\n appServer?: string;\n /** If `useSingleWebServer` is enabled, this will be a URL for bundles under the app server. */\n bundleServer?: string;\n apiServer?: string;\n /** Api server urls only used for linking */\n hostApiServer?: string[];\n };\n\n /**\n * Used to force a hard refresh on the client.\n * (Update with `incrementSessionVersion`.)\n */\n readonly sessionVersion: number;\n\n /**\n * Increment the session version to force a hard refresh on the client.\n */\n readonly incrementSessionVersion: () => void;\n\n /**\n * The name of the project folder.\n * Used to differentiate between multiple projects.\n */\n readonly projectName: string;\n\n /**\n * Cache-breaker version of each target (input path).\n * Used to force a client cache refresh on a single target.\n *\n * Update with `incrementTargetVersion`. (This will be empty by default.)\n */\n readonly targetVersions: Readonly<Record<string, number>>;\n\n /**\n * Increments the cache-breaker version for the given target (input path).\n * Used to force a client cache refresh on a single target.\n */\n readonly incrementTargetVersion: (inputPath: string) => void;\n\n /**\n * The current import map **for the browser**.\n * This will only be set in contexts where an import map is needed, such as during `start`.\n */\n importMap: ImportMap | undefined;\n\n /**\n * Cached mapping from absolute package path to all import paths for that package, calculated by\n * `createImportMap`. This is used by `addImportMapHash` to update the import map after bundling.\n * (Caching the import paths is useful for performance, as calculating them can be expensive.)\n * @example '/path/to/foo': `['foo', 'foo/bar']`\n */\n readonly packageImportPaths: Map<string, string[]>;\n\n /**\n * Linked paths that are used to resolve packages from other repos.\n */\n linkedPaths: LinkedPath[];\n\n /**\n * Add the linked path and regenerates the resolve map.\n */\n readonly addLinkedPath: (linkedPath: LinkedPath) => Promise<{ resolveMap: ResolveMap; linkedPaths: LinkedPath[] }>;\n\n /**\n * Remove the linked path and regenerates the resolve map.\n */\n readonly removeLinkedPath: (linkedPath: LinkedPath) => Promise<{ resolveMap: ResolveMap; linkedPaths: LinkedPath[] }>;\n\n /**\n * The path to the cache folder for the session.\n */\n readonly cachePath: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Session.js","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":"","sourcesContent":["import type { ImportMap } from './ImportMap.js';\nimport type { LinkedPath } from './LinkedPath.js';\nimport type { ResolveMap } from './ResolveMap.js';\nimport type { CloudpackConfig } from './CloudpackConfig.js';\n\nexport interface Session {\n /**\n * UUID for the session.\n */\n readonly id: string;\n\n /**\n * The config used by the session.\n */\n config: CloudpackConfig;\n\n /**\n * Used to resolve packages in the dependency graph.\n * Setting this will clear the `importMap`.\n *\n * NOTE: If the session (or whole API context) was created with `skipResolveDependencies`,\n * this will only contain the entry point package(s).\n */\n resolveMap: ResolveMap;\n\n /**\n * Reload sequence to ensure that the client is always up to date with the latest changes.\n * (This is initially sent to the client via `pageSessionContext.currentSequence` and is updated\n * via the `reloadCountSource`. It's read directly, not used as a URL cache breaker.)\n */\n sequence: number;\n\n /**\n * URLs of the active servers hosting this session.\n * Each URL will only be set after the server is started.\n */\n urls: {\n appServer?: string;\n /** If `useSingleWebServer` is enabled, this will be a URL for bundles under the app server. */\n bundleServer?: string;\n apiServer?: string;\n /** Api server urls only used for linking */\n hostApiServer?: string[];\n };\n\n /**\n * Used to force a hard refresh on the client.\n * (Update with `incrementSessionVersion`.)\n */\n readonly sessionVersion: number;\n\n /**\n * Increment the session version to force a hard refresh on the client.\n */\n readonly incrementSessionVersion: () => void;\n\n /**\n * The name of the project folder.\n * Used to differentiate between multiple projects.\n */\n readonly projectName: string;\n\n /**\n * Cache-breaker version of each target (input path).\n * Used to force a client cache refresh on a single target.\n *\n * Update with `incrementTargetVersion`. (This will be empty by default.)\n */\n readonly targetVersions: Readonly<Record<string, number>>;\n\n /**\n * Increments the cache-breaker version for the given target (input path).\n * Used to force a client cache refresh on a single target.\n */\n readonly incrementTargetVersion: (inputPath: string) => void;\n\n /**\n * The current import map **for the browser**.\n * This will only be set in contexts where an import map is needed, such as during `start`.\n */\n importMap: ImportMap | undefined;\n\n /**\n * Cached mapping from absolute package path to all import paths for that package, calculated by\n * `createImportMap`. This is used by `addImportMapHash` to update the import map after bundling.\n * (Caching the import paths is useful for performance, as calculating them can be expensive.)\n * @example '/path/to/foo': `['foo', 'foo/bar']`\n */\n readonly packageImportPaths: Map<string, string[]>;\n\n /**\n * Linked paths that are used to resolve packages from other repos.\n */\n linkedPaths: LinkedPath[];\n\n /**\n * Add the linked path and regenerates the resolve map.\n */\n readonly addLinkedPath: (linkedPath: LinkedPath) => Promise<{ resolveMap: ResolveMap; linkedPaths: LinkedPath[] }>;\n\n /**\n * Remove the linked path and regenerates the resolve map.\n */\n readonly removeLinkedPath: (linkedPath: LinkedPath) => Promise<{ resolveMap: ResolveMap; linkedPaths: LinkedPath[] }>;\n\n /**\n * The path to the cache folder for the session.\n */\n readonly cachePath: string;\n\n /**\n * Cached bundler aliases for deduped packages.\n * Maps package names to their resolved paths to ensure all imports use the same version.\n * Recalculated when resolveMap changes.\n *\n * Note: Using package names (without versions) as keys is safe here because packages in\n * resolve.dedupe are guaranteed to have only one version used throughout the entire app.\n * The dedupe configuration enforces that all imports resolve to a single canonical version.\n */\n readonly dedupeAliases: Record<string, string>;\n}\n"]}
|
package/package.json
CHANGED
package/schema/AppConfig.json
CHANGED
|
@@ -1180,17 +1180,28 @@
|
|
|
1180
1180
|
"type": "object",
|
|
1181
1181
|
"properties": {
|
|
1182
1182
|
"extensions": {
|
|
1183
|
-
"
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1183
|
+
"anyOf": [
|
|
1184
|
+
{
|
|
1185
|
+
"type": "array",
|
|
1186
|
+
"items": {
|
|
1187
|
+
"type": "string"
|
|
1188
|
+
}
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
"type": "object",
|
|
1192
|
+
"additionalProperties": {
|
|
1193
|
+
"type": "boolean"
|
|
1194
|
+
},
|
|
1195
|
+
"description": "Construct a type with a set of properties K of type T"
|
|
1196
|
+
}
|
|
1197
|
+
]
|
|
1187
1198
|
}
|
|
1188
1199
|
},
|
|
1189
1200
|
"required": [
|
|
1190
1201
|
"extensions"
|
|
1191
1202
|
],
|
|
1192
1203
|
"additionalProperties": false,
|
|
1193
|
-
"description": "Inlines assets into the bundle
|
|
1204
|
+
"description": "Inlines assets into the bundle.\n\nExtensions can be specified as:\n- Array: `['avif']` - use only these extensions (replaces defaults)\n- Object: `{ 'svg': false, 'avif': true }` - modify defaults (remove svg, add avif)\n\nDo not include the leading dot."
|
|
1194
1205
|
},
|
|
1195
1206
|
{
|
|
1196
1207
|
"type": "boolean"
|
package/schema/UserConfig.json
CHANGED
|
@@ -1181,17 +1181,28 @@
|
|
|
1181
1181
|
"type": "object",
|
|
1182
1182
|
"properties": {
|
|
1183
1183
|
"extensions": {
|
|
1184
|
-
"
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1184
|
+
"anyOf": [
|
|
1185
|
+
{
|
|
1186
|
+
"type": "array",
|
|
1187
|
+
"items": {
|
|
1188
|
+
"type": "string"
|
|
1189
|
+
}
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
"type": "object",
|
|
1193
|
+
"additionalProperties": {
|
|
1194
|
+
"type": "boolean"
|
|
1195
|
+
},
|
|
1196
|
+
"description": "Construct a type with a set of properties K of type T"
|
|
1197
|
+
}
|
|
1198
|
+
]
|
|
1188
1199
|
}
|
|
1189
1200
|
},
|
|
1190
1201
|
"required": [
|
|
1191
1202
|
"extensions"
|
|
1192
1203
|
],
|
|
1193
1204
|
"additionalProperties": false,
|
|
1194
|
-
"description": "Inlines assets into the bundle
|
|
1205
|
+
"description": "Inlines assets into the bundle.\n\nExtensions can be specified as:\n- Array: `['avif']` - use only these extensions (replaces defaults)\n- Object: `{ 'svg': false, 'avif': true }` - modify defaults (remove svg, add avif)\n\nDo not include the leading dot."
|
|
1195
1206
|
},
|
|
1196
1207
|
{
|
|
1197
1208
|
"type": "boolean"
|