@ms-cloudpack/common-types 0.17.0 → 0.18.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.
@@ -79,5 +79,13 @@ export interface AppConfig {
79
79
  * A list of package names that should never be excluded or included from the bundle.
80
80
  */
81
81
  neverExcludeDependencies?: string[];
82
+ /**
83
+ * Key value pairs of external bundler capabilities that can be enabled in the package settings.
84
+ * Key is the name of the capability, which will be used in the package settings to enable the capability.
85
+ * Value is the import identifier for the capability module.
86
+ *
87
+ * (Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)
88
+ */
89
+ bundlerCapabilitiesRegistry?: Record<string, string>;
82
90
  }
83
91
  //# sourceMappingURL=AppConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppConfig.d.ts","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IAEpC;;;OAGG;IACH,SAAS,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IAEjC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,WAAW,CAAC,EAAE;QACZ;;WAEG;QACH,cAAc,EAAE,MAAM,CAAC;QACvB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAClB;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAE1B;;OAEG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpC;;;;;;OAMG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtD"}
@@ -1 +1 @@
1
- {"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { DevServer } from './DevServer.js';\nimport type { Features } from './Features.js';\nimport type { PackageSettings } from './PackageSettings.js';\nimport type { ShorthandRoute } from './Route.js';\nimport type { TelemetryConfig } from './TelemetryConfig.js';\n\n/**\n * Per-application user-provided configuration for Cloudpack.\n */\nexport interface AppConfig {\n /**\n * Extend the configuration from another file: either an import path or a relative path\n * (resolved from the config file's location).\n *\n * If an array, later files will take precedence when merging.\n * (The user config always takes precedence over any extended config.)\n *\n * Config merging approach:\n * - Objects will be deeply merged.\n * - Primitive values will be overwritten.\n * - Arrays will be overwritten, EXCEPT for `packageSettings`, which will be concatenated.\n */\n extends?: string | string[];\n\n /**\n * A set of options for configuring how the dev server works.\n */\n devServer?: DevServer;\n\n /**\n * A set of options for configuring telemetry\n */\n telemetry?: TelemetryConfig;\n\n /**\n * A set of options for configuring the experience. Features can be set to true to change the default\n * behavior.\n */\n features?: Features;\n\n /**\n * Help message to display when Cloudpack starts up.\n */\n helpMessage?: string;\n\n /**\n * An array of PackageSettings objects, used to provide settings for how we bundle packages.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * An optional list of commands (followed by a string array of args for that command)\n * to be executed prior to Cloudpack bundle\n */\n dependsOn?: [string, string[]][];\n\n /**\n * Glob pattern to match `patch-package` patch files, relative to the project root\n * (usually the same as the repository root).\n * @default \"patches/*.patch\"\n */\n patchFilesGlobPattern?: string;\n\n /**\n * Azure Blob Storage configuration for remote cache - uploading and downloading packages.\n * If this is not provided, the remote cache will not be used.\n */\n remoteCache?: {\n /**\n * The name of the Azure Blob Storage account.\n */\n storageAccount: string;\n /**\n * The name of the container to use for the remote cache. Container must already exist.\n */\n container: string;\n /**\n * The Microsoft Entra tenant (directory) ID. This will ensure that only users from this tenant can access the remote cache.\n */\n tenantId?: string;\n };\n\n /**\n * Defines what routes to support from the app server, and which scripts will be loaded\n * for each.\n */\n routes?: ShorthandRoute[];\n\n /**\n * A list of package names that should never be excluded or included from the bundle.\n */\n neverExcludeDependencies?: string[];\n}\n"]}
1
+ {"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { DevServer } from './DevServer.js';\nimport type { Features } from './Features.js';\nimport type { PackageSettings } from './PackageSettings.js';\nimport type { ShorthandRoute } from './Route.js';\nimport type { TelemetryConfig } from './TelemetryConfig.js';\n\n/**\n * Per-application user-provided configuration for Cloudpack.\n */\nexport interface AppConfig {\n /**\n * Extend the configuration from another file: either an import path or a relative path\n * (resolved from the config file's location).\n *\n * If an array, later files will take precedence when merging.\n * (The user config always takes precedence over any extended config.)\n *\n * Config merging approach:\n * - Objects will be deeply merged.\n * - Primitive values will be overwritten.\n * - Arrays will be overwritten, EXCEPT for `packageSettings`, which will be concatenated.\n */\n extends?: string | string[];\n\n /**\n * A set of options for configuring how the dev server works.\n */\n devServer?: DevServer;\n\n /**\n * A set of options for configuring telemetry\n */\n telemetry?: TelemetryConfig;\n\n /**\n * A set of options for configuring the experience. Features can be set to true to change the default\n * behavior.\n */\n features?: Features;\n\n /**\n * Help message to display when Cloudpack starts up.\n */\n helpMessage?: string;\n\n /**\n * An array of PackageSettings objects, used to provide settings for how we bundle packages.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * An optional list of commands (followed by a string array of args for that command)\n * to be executed prior to Cloudpack bundle\n */\n dependsOn?: [string, string[]][];\n\n /**\n * Glob pattern to match `patch-package` patch files, relative to the project root\n * (usually the same as the repository root).\n * @default \"patches/*.patch\"\n */\n patchFilesGlobPattern?: string;\n\n /**\n * Azure Blob Storage configuration for remote cache - uploading and downloading packages.\n * If this is not provided, the remote cache will not be used.\n */\n remoteCache?: {\n /**\n * The name of the Azure Blob Storage account.\n */\n storageAccount: string;\n /**\n * The name of the container to use for the remote cache. Container must already exist.\n */\n container: string;\n /**\n * The Microsoft Entra tenant (directory) ID. This will ensure that only users from this tenant can access the remote cache.\n */\n tenantId?: string;\n };\n\n /**\n * Defines what routes to support from the app server, and which scripts will be loaded\n * for each.\n */\n routes?: ShorthandRoute[];\n\n /**\n * A list of package names that should never be excluded or included from the bundle.\n */\n neverExcludeDependencies?: string[];\n\n /**\n * Key value pairs of external bundler capabilities that can be enabled in the package settings.\n * Key is the name of the capability, which will be used in the package settings to enable the capability.\n * Value is the import identifier for the capability module.\n *\n * (Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)\n */\n bundlerCapabilitiesRegistry?: Record<string, string>;\n}\n"]}
@@ -1,20 +1,24 @@
1
1
  /**
2
2
  * A function that takes a config object and options object and returns a new config object.
3
3
  * This is used to implement a bundler capability.
4
+ * TConfig is the type of the bundler's config object. (ie: WebpackConfiguration, OriBuildOptions,etc)
5
+ * TOptions is the type of the options object that's passed to the capability. (ie: { banner: string } or any other type that the capability needs when enabled)
4
6
  */
5
- type BundlerCapabilityFn<TConfig, TOptions extends object> = (config: TConfig, options: TOptions) => TConfig;
7
+ export type BundlerCapabilityFunction<TConfig, TOptions extends object> = (config: TConfig, options: TOptions) => TConfig;
6
8
  /**
7
9
  * A bundler capability is a feature that can be enabled for a package to modify the bundling process.
10
+ * TOptions is the type of the options object that's passed to the capability. (ie: { banner: string } or any other type that the capability needs when enabled)
8
11
  */
9
12
  export type BundlerCapability<TOptions extends object> = {
10
13
  description: string;
11
14
  implementations: {
12
- [bundler: string]: BundlerCapabilityFn<unknown, TOptions>;
15
+ [bundler: string]: BundlerCapabilityFunction<unknown, TOptions>;
13
16
  };
14
17
  };
15
18
  /**
16
19
  * The metadata for a bundler capability.
17
20
  * It's the same as the BundlerCapability but without the implementations. This is used to split the definition and the bundler specific implementations.
21
+ * TOptions is the type of the options object that's passed to the capability. (ie: { banner: string } or any other type that the capability needs when enabled)
18
22
  */
19
23
  export type BundlerCapabilityMetaData<TOptions extends object> = Omit<BundlerCapability<TOptions>, 'implementations'>;
20
24
  /**
@@ -36,9 +40,16 @@ export type InternalBundlerCapabilities = {
36
40
  * It's a partial of the InternalBundlerCapabilities with the value being the options object or false.
37
41
  * If the value is false, the capability will be disabled for the package.
38
42
  */
39
- export type BundlerCapabilitiesOptions = {
43
+ export type InternalBundlerCapabilitiesOptions = {
40
44
  [key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;
41
45
  };
46
+ type ExternalBundlerCapabilitiesOptions = Record<string, object | false>;
47
+ /**
48
+ * This is the type that's being used PackageSettings to enable/disable bundler capabilities.
49
+ * It's a partial of the InternalBundlerCapabilities with the value being the options object or false.
50
+ * If the value is false, the capability will be disabled for the package.
51
+ */
52
+ export type BundlerCapabilitiesOptions = InternalBundlerCapabilitiesOptions & ExternalBundlerCapabilitiesOptions;
42
53
  /**
43
54
  * This is the metadata for the bundler capabilities that cloudpack provides.
44
55
  * It's a mapping from the capability name to the metadata object.
@@ -51,9 +62,19 @@ export type InternalBundlerCapabilitiesMetaData = {
51
62
  /**
52
63
  * This is a bundler specific implementation of the internal bundler capabilities.
53
64
  * It's a mapping from the capability name to the capability function.
65
+ * TConfig is the type of the bundler's config object. (ie: WebpackConfiguration, OriBuildOptions,etc)
54
66
  */
55
67
  export type InternalBundlerCapabilityImplementations<TConfig> = {
56
- [key in keyof InternalBundlerCapabilities]: BundlerCapabilityFn<TConfig, InternalBundlerCapabilities[key]>;
68
+ [key in keyof InternalBundlerCapabilities]: BundlerCapabilityFunction<TConfig, InternalBundlerCapabilities[key]>;
69
+ };
70
+ /**
71
+ * This is the type of the external bundler capability module that's being imported.
72
+ * TConfig is the type of the bundler's config object. (ie: WebpackConfiguration, OriBuildOptions,etc)
73
+ */
74
+ export type ExternalBundlerCapabilityModule<TConfig extends object> = {
75
+ default: BundlerCapability<TConfig> & {
76
+ name: string;
77
+ };
57
78
  };
58
79
  export {};
59
80
  //# sourceMappingURL=BundlerCapability.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BundlerCapability.d.ts","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,KAAK,mBAAmB,CAAC,OAAO,EAAE,QAAQ,SAAS,MAAM,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC;AAE7G;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,QAAQ,SAAS,MAAM,IAAI;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE;QACf,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;KAC3D,CAAC;CACH,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CAAC,QAAQ,SAAS,MAAM,IAAI,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAEtH;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC;;;OAGG;IACH,cAAc,EAAE;QAAE,UAAU,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC1C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG;KACtC,GAAG,IAAI,MAAM,2BAA2B,CAAC,CAAC,EAAE,2BAA2B,CAAC,GAAG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AEF,KAAK,kCAAkC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,kCAAkC,GAAG,kCAAkC,CAAC;AAEjH;;;;;GAKG;AACH,MAAM,MAAM,mCAAmC,GAAG;KAC/C,GAAG,IAAI,MAAM,2BAA2B,GAAG,yBAAyB,CAAC,2BAA2B,CAAC,GAAG,CAAC,CAAC;CACxG,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,wCAAwC,CAAC,OAAO,IAAI;KAC7D,GAAG,IAAI,MAAM,2BAA2B,GAAG,yBAAyB,CAAC,OAAO,EAAE,2BAA2B,CAAC,GAAG,CAAC,CAAC;CACjH,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,+BAA+B,CAAC,OAAO,SAAS,MAAM,IAAI;IACpE,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BundlerCapability.js","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"","sourcesContent":["/**\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 */\ntype BundlerCapabilityFn<TConfig, TOptions extends object> = (config: TConfig, options: TOptions) => TConfig;\n\n/**\n * A bundler capability is a feature that can be enabled for a package to modify the bundling process.\n */\nexport type BundlerCapability<TOptions extends object> = {\n description: string;\n implementations: {\n [bundler: string]: BundlerCapabilityFn<unknown, TOptions>;\n };\n};\n\n/**\n * The metadata for a bundler capability.\n * It's the same as the BundlerCapability but without the implementations. This is used to split the definition and the bundler specific implementations.\n */\nexport type BundlerCapabilityMetaData<TOptions extends object> = Omit<BundlerCapability<TOptions>, 'implementations'>;\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 * Options: List of file extensions to inline. Do not include the leading dot.\n */\n 'asset-inline': { extensions: string[] };\n};\n\n/**\n * This is the type that's being used PackageSettings to enable/disable bundler capabilities.\n * It's a partial of the InternalBundlerCapabilities with the value being the options object or false.\n * If the value is false, the capability will be disabled for the package.\n */\nexport type BundlerCapabilitiesOptions = {\n [key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;\n};\n\n/**\n * This is the metadata for the bundler capabilities that cloudpack provides.\n * It's a mapping from the capability name to the metadata object.\n * The metadata object contains the description of the capability and the list of implementations for each bundler.\n * This is used to generate the documentation for the bundler capabilities.\n */\nexport type InternalBundlerCapabilitiesMetaData = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityMetaData<InternalBundlerCapabilities[key]>;\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 */\nexport type InternalBundlerCapabilityImplementations<TConfig> = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityFn<TConfig, InternalBundlerCapabilities[key]>;\n};\n"]}
1
+ {"version":3,"file":"BundlerCapability.js","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"","sourcesContent":["/**\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 * 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 } or any other type that the capability needs when enabled)\n */\nexport type BundlerCapabilityFunction<TConfig, TOptions extends object> = (\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 * TOptions is the type of the options object that's passed to the capability. (ie: { banner: string } or any other type that the capability needs when enabled)\n */\nexport type BundlerCapability<TOptions extends object> = {\n description: string;\n implementations: {\n [bundler: string]: BundlerCapabilityFunction<unknown, TOptions>;\n };\n};\n\n/**\n * The metadata for a bundler capability.\n * It's the same as the BundlerCapability but without the implementations. This is used to split the definition and the bundler specific implementations.\n * TOptions is the type of the options object that's passed to the capability. (ie: { banner: string } or any other type that the capability needs when enabled)\n */\nexport type BundlerCapabilityMetaData<TOptions extends object> = Omit<BundlerCapability<TOptions>, 'implementations'>;\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 * Options: List of file extensions to inline. Do not include the leading dot.\n */\n 'asset-inline': { extensions: string[] };\n};\n\n/**\n * This is the type that's being used PackageSettings to enable/disable bundler capabilities.\n * It's a partial of the InternalBundlerCapabilities with the value being the options object or false.\n * If the value is false, the capability will be disabled for the package.\n */\nexport type InternalBundlerCapabilitiesOptions = {\n [key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;\n};\n\ntype ExternalBundlerCapabilitiesOptions = Record<string, object | false>;\n\n/**\n * This is the type that's being used PackageSettings to enable/disable bundler capabilities.\n * It's a partial of the InternalBundlerCapabilities with the value being the options object or false.\n * If the value is false, the capability will be disabled for the package.\n */\nexport type BundlerCapabilitiesOptions = InternalBundlerCapabilitiesOptions & ExternalBundlerCapabilitiesOptions;\n\n/**\n * This is the metadata for the bundler capabilities that cloudpack provides.\n * It's a mapping from the capability name to the metadata object.\n * The metadata object contains the description of the capability and the list of implementations for each bundler.\n * This is used to generate the documentation for the bundler capabilities.\n */\nexport type InternalBundlerCapabilitiesMetaData = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityMetaData<InternalBundlerCapabilities[key]>;\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 * 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 * 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> & { name: string };\n};\n"]}
@@ -1,12 +1,11 @@
1
- import type { PackageSettings } from './PackageSettings.js';
1
+ import type { GeneratedPackageSettings } from './PackageSettings.js';
2
2
  /**
3
3
  * Per-application generated configuration for Cloudpack.
4
4
  */
5
5
  export interface GeneratedConfig {
6
6
  /**
7
- * Settings to customize how packages are bundled.
8
- * For the generated config, these should just contain generated exports maps.
7
+ * Generated settings to correct issues with packages or optimize their bundling process.
9
8
  */
10
- packageSettings?: PackageSettings[];
9
+ packageSettings?: GeneratedPackageSettings[];
11
10
  }
12
11
  //# sourceMappingURL=GeneratedConfig.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GeneratedConfig.d.ts","sourceRoot":"","sources":["../src/GeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;CACrC"}
1
+ {"version":3,"file":"GeneratedConfig.d.ts","sourceRoot":"","sources":["../src/GeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,eAAe,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC9C"}
@@ -1 +1 @@
1
- {"version":3,"file":"GeneratedConfig.js","sourceRoot":"","sources":["../src/GeneratedConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageSettings } from './PackageSettings.js';\n\n/**\n * Per-application generated configuration for Cloudpack.\n */\nexport interface GeneratedConfig {\n /**\n * Settings to customize how packages are bundled.\n * For the generated config, these should just contain generated exports maps.\n */\n packageSettings?: PackageSettings[];\n}\n"]}
1
+ {"version":3,"file":"GeneratedConfig.js","sourceRoot":"","sources":["../src/GeneratedConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { GeneratedPackageSettings } from './PackageSettings.js';\n\n/**\n * Per-application generated configuration for Cloudpack.\n */\nexport interface GeneratedConfig {\n /**\n * Generated settings to correct issues with packages or optimize their bundling process.\n */\n packageSettings?: GeneratedPackageSettings[];\n}\n"]}
@@ -1,10 +1,6 @@
1
1
  import type { BundlerCapabilitiesOptions } from './BundlerCapability.js';
2
2
  import type { PackageJsonExports } from './PackageJson.js';
3
- /**
4
- * Which package(s) the settings should be applied to.
5
- * A string is a shorthand for matching the name with any version (`*` to match any name).
6
- */
7
- export type PackageSettingsMatch = string | {
3
+ interface PackageSettingsMatchObject {
8
4
  /** Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name. */
9
5
  name: string;
10
6
  /**
@@ -14,7 +10,12 @@ export type PackageSettingsMatch = string | {
14
10
  * explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`.
15
11
  */
16
12
  version?: string;
17
- };
13
+ }
14
+ /**
15
+ * Which package(s) the settings should be applied to.
16
+ * A string is a shorthand for matching the name with any version (`*` to match any name).
17
+ */
18
+ export type PackageSettingsMatch = string | PackageSettingsMatchObject;
18
19
  /**
19
20
  * Settings overrides for bundling a package (or multiple packages, depending on `match`).
20
21
  */
@@ -23,7 +24,7 @@ export interface PackageSettings {
23
24
  * Which package(s) the settings should be applied to.
24
25
  * A string is a shorthand for matching the name with any version (`*` to match any name).
25
26
  */
26
- match?: PackageSettingsMatch;
27
+ match: PackageSettingsMatch;
27
28
  /**
28
29
  * The dependencies which should be included when computing the import map. This is primarily used when
29
30
  * devDependencies are needed by the app. This often happens when a library has a demo app which relies
@@ -113,4 +114,15 @@ export interface PackageSettings {
113
114
  */
114
115
  bundlerCapabilities?: BundlerCapabilitiesOptions;
115
116
  }
117
+ /**
118
+ * Subset of PackageSettings used in the generated config.
119
+ */
120
+ export type GeneratedPackageSettings = Pick<PackageSettings, 'includedDependencies' | 'excludedDependencies' | 'dynamicImports' | 'exports'> & {
121
+ /**
122
+ * This will be a string (name) for internal packages, or match with name and version for external.
123
+ * The match in this case will NOT contain wildcards in the name.
124
+ */
125
+ match: string | Required<PackageSettingsMatchObject>;
126
+ };
127
+ export {};
116
128
  //# sourceMappingURL=PackageSettings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PackageSettings.d.ts","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN;IACE,iGAAiG;IACjG,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAE7B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;;;OAIG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzC;;;;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;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAE1D;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE;QACL;;;;;;WAMG;QACH,4BAA4B,CAAC,EAAE,oBAAoB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;KACpG,CAAC;IAEF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,eAAe,EACf,sBAAsB,GAAG,sBAAsB,GAAG,gBAAgB,GAAG,SAAS,CAC/E,GAAG;IACF;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,0BAA0B,CAAC,CAAC;CACtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundlerCapabilitiesOptions } from './BundlerCapability.js';\nimport type { PackageJsonExports } from './PackageJson.js';\n\n/**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n */\nexport type PackageSettingsMatch =\n | string\n | {\n /** Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name. */\n name: string;\n\n /**\n * Version of the package. Unspecified matches any version.\n *\n * Note that if the package version is a prerelease, it will only match `*` or ranges that\n * explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`.\n */\n version?: string;\n };\n\n/**\n * Settings overrides for bundling a package (or multiple packages, depending on `match`).\n */\nexport interface PackageSettings {\n /**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n */\n match?: PackageSettingsMatch;\n\n /**\n * The dependencies which should be included when computing the import map. This is primarily used when\n * devDependencies are needed by the app. This often happens when a library has a demo app which relies\n * on devDependencies. Accepts `$devDependencies` as a special value to include all devDependencies.\n */\n includedDependencies?: string[];\n\n /**\n * The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency\n * which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.\n * Accepts `$peerDependencies` as a special value to exclude all peerDependencies.\n */\n excludedDependencies?: string[];\n\n /**\n * Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which\n * are small and don't need to be loaded separately, or ones which have issues being resolved by the browser.\n */\n inlinedDependencies?: string[];\n\n /**\n * The exports map that should be used for this package, ignoring entries which are defined in the original\n * package.json. This is useful for libraries which have a missing or broken exports map, or when we want to\n * trim the exports to reduce the api surface we expose to the inner loop experience.\n */\n exports?: PackageJsonExports;\n\n /**\n * Forces the package to be bundled using a specific bundler.\n */\n bundler?: string;\n\n /**\n * @deprecated Use `bundler`.\n *\n * This should be removed once repo configs are updated to use `bundler`.\n */\n bundlerType?: string;\n\n /**\n * Any bundler-specific options to be merged with the calculated bundler options.\n * `bundler` is also required if this is specified.\n *\n * This is an escape hatch which is generally not recommended, since it locks the package to\n * a specific bundler implementation.\n */\n bundlerOptions?: Record<string, unknown>;\n\n /**\n * Paths used for file monitoring and input hashing. Supports glob matching.\n * Defaults to `[/src/**, *.json]` and excludes node_modules.\n * Use `...` to include the default paths.\n */\n inputPaths?: string[];\n\n /**\n * Controls the behavior of the `verifyExports` feature when checking consumed exports from this package:\n * - If true, don't check this package's exports at all.\n * - If an object, this is a mapping from package import paths to export names to ignore. Examples:\n * - To ignore top-level exports: `{ \".\": [\"badName\"] }`\n * - To ignore exports from another path: `{ \"./lib/foo\": [\"badName\"] }`\n */\n ignoreMissingExports?: boolean | Record<string, string[]>;\n\n /**\n * Only relevant for packages bundled with rollup: globs of files that include dynamic (async)\n * imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to\n * that plugin's [limitations](https://www.npmjs.com/package/\\@rollup/plugin-dynamic-import-vars#limitations)).\n * Files matching `*.dynamic.*` are automatically included.\n *\n * This is not needed for ori/esbuild and webpack because they should handle these types of imports automatically.\n */\n dynamicImports?: string[];\n\n /**\n * Ignore these warning messages from the bundler (partial string matches).\n * This is intended for non-actionable messages from external dependencies which can't easily\n * be fixed, to avoid confusing users.\n */\n ignoredBundlerWarnings?: string[];\n\n /**\n * Setting to control how the package is linked in the resolve map.\n */\n link?: {\n /**\n * Controls the behavior of duplicated dependencies in the resolve map by link. By default, `allow-duplication`\n * is used, which allows multiple versions of the same package to exist in the resolve map to satisfy the semver.\n * If `force-host-version` is used, the package will be deduplicated to the version of the host package ignoring\n * semver requirements. If `force-remote-version` is used, the package will be deduplicated to the version of the\n * remote package ignoring semver requirements.\n */\n duplicatedDependencyBehavior?: 'force-host-version' | 'allow-duplication' | 'force-remote-version';\n };\n\n /**\n * Setting to control the bundler capabilities for this package.\n * This is used to enable or disable specific bundler capabilities.\n */\n bundlerCapabilities?: BundlerCapabilitiesOptions;\n}\n"]}
1
+ {"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundlerCapabilitiesOptions } from './BundlerCapability.js';\nimport type { PackageJsonExports } from './PackageJson.js';\n\ninterface PackageSettingsMatchObject {\n /** Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name. */\n name: string;\n\n /**\n * Version of the package. Unspecified matches any version.\n *\n * Note that if the package version is a prerelease, it will only match `*` or ranges that\n * explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`.\n */\n version?: string;\n}\n\n/**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n */\nexport type PackageSettingsMatch = string | PackageSettingsMatchObject;\n\n/**\n * Settings overrides for bundling a package (or multiple packages, depending on `match`).\n */\nexport interface PackageSettings {\n /**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n */\n match: PackageSettingsMatch;\n\n /**\n * The dependencies which should be included when computing the import map. This is primarily used when\n * devDependencies are needed by the app. This often happens when a library has a demo app which relies\n * on devDependencies. Accepts `$devDependencies` as a special value to include all devDependencies.\n */\n includedDependencies?: string[];\n\n /**\n * The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency\n * which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.\n * Accepts `$peerDependencies` as a special value to exclude all peerDependencies.\n */\n excludedDependencies?: string[];\n\n /**\n * Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which\n * are small and don't need to be loaded separately, or ones which have issues being resolved by the browser.\n */\n inlinedDependencies?: string[];\n\n /**\n * The exports map that should be used for this package, ignoring entries which are defined in the original\n * package.json. This is useful for libraries which have a missing or broken exports map, or when we want to\n * trim the exports to reduce the api surface we expose to the inner loop experience.\n */\n exports?: PackageJsonExports;\n\n /**\n * Forces the package to be bundled using a specific bundler.\n */\n bundler?: string;\n\n /**\n * @deprecated Use `bundler`.\n *\n * This should be removed once repo configs are updated to use `bundler`.\n */\n bundlerType?: string;\n\n /**\n * Any bundler-specific options to be merged with the calculated bundler options.\n * `bundler` is also required if this is specified.\n *\n * This is an escape hatch which is generally not recommended, since it locks the package to\n * a specific bundler implementation.\n */\n bundlerOptions?: Record<string, unknown>;\n\n /**\n * Paths used for file monitoring and input hashing. Supports glob matching.\n * Defaults to `[/src/**, *.json]` and excludes node_modules.\n * Use `...` to include the default paths.\n */\n inputPaths?: string[];\n\n /**\n * Controls the behavior of the `verifyExports` feature when checking consumed exports from this package:\n * - If true, don't check this package's exports at all.\n * - If an object, this is a mapping from package import paths to export names to ignore. Examples:\n * - To ignore top-level exports: `{ \".\": [\"badName\"] }`\n * - To ignore exports from another path: `{ \"./lib/foo\": [\"badName\"] }`\n */\n ignoreMissingExports?: boolean | Record<string, string[]>;\n\n /**\n * Only relevant for packages bundled with rollup: globs of files that include dynamic (async)\n * imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to\n * that plugin's [limitations](https://www.npmjs.com/package/\\@rollup/plugin-dynamic-import-vars#limitations)).\n * Files matching `*.dynamic.*` are automatically included.\n *\n * This is not needed for ori/esbuild and webpack because they should handle these types of imports automatically.\n */\n dynamicImports?: string[];\n\n /**\n * Ignore these warning messages from the bundler (partial string matches).\n * This is intended for non-actionable messages from external dependencies which can't easily\n * be fixed, to avoid confusing users.\n */\n ignoredBundlerWarnings?: string[];\n\n /**\n * Setting to control how the package is linked in the resolve map.\n */\n link?: {\n /**\n * Controls the behavior of duplicated dependencies in the resolve map by link. By default, `allow-duplication`\n * is used, which allows multiple versions of the same package to exist in the resolve map to satisfy the semver.\n * If `force-host-version` is used, the package will be deduplicated to the version of the host package ignoring\n * semver requirements. If `force-remote-version` is used, the package will be deduplicated to the version of the\n * remote package ignoring semver requirements.\n */\n duplicatedDependencyBehavior?: 'force-host-version' | 'allow-duplication' | 'force-remote-version';\n };\n\n /**\n * Setting to control the bundler capabilities for this package.\n * This is used to enable or disable specific bundler capabilities.\n */\n bundlerCapabilities?: BundlerCapabilitiesOptions;\n}\n\n/**\n * Subset of PackageSettings used in the generated config.\n */\nexport type GeneratedPackageSettings = Pick<\n PackageSettings,\n 'includedDependencies' | 'excludedDependencies' | 'dynamicImports' | 'exports'\n> & {\n /**\n * This will be a string (name) for internal packages, or match with name and version for external.\n * The match in this case will NOT contain wildcards in the name.\n */\n match: string | Required<PackageSettingsMatchObject>;\n};\n"]}
package/lib/index.d.ts CHANGED
@@ -18,12 +18,12 @@ export type { Features } from './Features.js';
18
18
  export type { GeneratedConfig } from './GeneratedConfig.js';
19
19
  export type { HttpsConfig } from './HttpsConfig.js';
20
20
  export type { ModuleType } from './ModuleType.js';
21
- export type { PackageSettings, PackageSettingsMatch } from './PackageSettings.js';
21
+ export type { PackageSettings, PackageSettingsMatch, GeneratedPackageSettings } from './PackageSettings.js';
22
22
  export type { BootstrapRoute, RedirectRoute, RenderedRoute, Route, SharedRouteOptions, ShorthandRenderedRoute, ShorthandRoute, StaticRoute, } from './Route.js';
23
23
  export { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } from './Route.js';
24
24
  export type { TelemetryConfig } from './TelemetryConfig.js';
25
25
  export type { AppConfig } from './AppConfig.js';
26
- export type { InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, } from './BundlerCapability.js';
26
+ export type { InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, ExternalBundlerCapabilityModule, BundlerCapabilityFunction, } from './BundlerCapability.js';
27
27
  export type { RenderFunction } from './RenderFunction.js';
28
28
  export type { RenderFunctionOptions } from './RenderFunctionOptions.js';
29
29
  export type { RenderFunctionResult, ExpandedRenderFunctionResult } from './RenderFunctionResult.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,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,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA6C/C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { allFeatures } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\n PackageDefinitionsCache,\n PackageImporterContext,\n} from './PackageDefinitionsCache.js';\nexport type {\n LiteralOrString,\n PackageJson,\n PackageJsonDependencies,\n PackageJsonExportCondition,\n PackageJsonExports,\n PackageJsonExportsObject,\n PackageJsonExportsValue,\n PackageJsonImports,\n} from './PackageJson.js';\nexport type { BundleContext } from './BundleContext.js';\nexport type { BundleMessage } from './BundleMessage.js';\nexport type { BundleMessageLocation } from './BundleMessageLocation.js';\nexport type { BundleMessageNote } from './BundleMessageNote.js';\nexport type { BundleMode } from './BundleMode.js';\nexport type { BundleOptions } from './BundleOptions.js';\nexport type { BundleOutputFile } from './BundleOutputFile.js';\nexport type { BundleResult } from './BundleResult.js';\nexport type { BundlerPluginResult } from './BundlerPluginResult.js';\nexport type { BundlerPlugin } from './BundlerPlugin.js';\nexport type { CloudpackConfig } from './CloudpackConfig.js';\nexport type { DevServer } from './DevServer.js';\nexport type { Feature } from './Feature.js';\nexport type { Features } from './Features.js';\nexport type { GeneratedConfig } from './GeneratedConfig.js';\nexport type { HttpsConfig } from './HttpsConfig.js';\nexport type { ModuleType } from './ModuleType.js';\nexport type { PackageSettings, PackageSettingsMatch } from './PackageSettings.js';\nexport type {\n BootstrapRoute,\n RedirectRoute,\n RenderedRoute,\n Route,\n SharedRouteOptions,\n ShorthandRenderedRoute,\n ShorthandRoute,\n StaticRoute,\n} from './Route.js';\nexport { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n InternalBundlerCapabilityImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n} from './BundlerCapability.js';\nexport type { RenderFunction } from './RenderFunction.js';\nexport type { RenderFunctionOptions } from './RenderFunctionOptions.js';\nexport type { RenderFunctionResult, ExpandedRenderFunctionResult } from './RenderFunctionResult.js';\nexport type { RenderFunctionScript } from './RenderFunctionScript.js';\nexport type { Request, Response } from 'express';\nexport type { Session } from './Session.js';\nexport type { ResolveMap } from './ResolveMap.js';\nexport type { ResolveMapEntry } from './ResolveMapEntry.js';\nexport type { LinkedPath } from './LinkedPath.js';\nexport type { ImportMap } from './ImportMap.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA6C/C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { allFeatures } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\n PackageDefinitionsCache,\n PackageImporterContext,\n} from './PackageDefinitionsCache.js';\nexport type {\n LiteralOrString,\n PackageJson,\n PackageJsonDependencies,\n PackageJsonExportCondition,\n PackageJsonExports,\n PackageJsonExportsObject,\n PackageJsonExportsValue,\n PackageJsonImports,\n} from './PackageJson.js';\nexport type { BundleContext } from './BundleContext.js';\nexport type { BundleMessage } from './BundleMessage.js';\nexport type { BundleMessageLocation } from './BundleMessageLocation.js';\nexport type { BundleMessageNote } from './BundleMessageNote.js';\nexport type { BundleMode } from './BundleMode.js';\nexport type { BundleOptions } from './BundleOptions.js';\nexport type { BundleOutputFile } from './BundleOutputFile.js';\nexport type { BundleResult } from './BundleResult.js';\nexport type { BundlerPluginResult } from './BundlerPluginResult.js';\nexport type { BundlerPlugin } from './BundlerPlugin.js';\nexport type { CloudpackConfig } from './CloudpackConfig.js';\nexport type { DevServer } from './DevServer.js';\nexport type { Feature } from './Feature.js';\nexport type { Features } from './Features.js';\nexport type { GeneratedConfig } from './GeneratedConfig.js';\nexport type { HttpsConfig } from './HttpsConfig.js';\nexport type { ModuleType } from './ModuleType.js';\nexport type { PackageSettings, PackageSettingsMatch, GeneratedPackageSettings } from './PackageSettings.js';\nexport type {\n BootstrapRoute,\n RedirectRoute,\n RenderedRoute,\n Route,\n SharedRouteOptions,\n ShorthandRenderedRoute,\n ShorthandRoute,\n StaticRoute,\n} from './Route.js';\nexport { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n InternalBundlerCapabilityImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n ExternalBundlerCapabilityModule,\n BundlerCapabilityFunction,\n} from './BundlerCapability.js';\nexport type { RenderFunction } from './RenderFunction.js';\nexport type { RenderFunctionOptions } from './RenderFunctionOptions.js';\nexport type { RenderFunctionResult, ExpandedRenderFunctionResult } from './RenderFunctionResult.js';\nexport type { RenderFunctionScript } from './RenderFunctionScript.js';\nexport type { Request, Response } from 'express';\nexport type { Session } from './Session.js';\nexport type { ResolveMap } from './ResolveMap.js';\nexport type { ResolveMapEntry } from './ResolveMapEntry.js';\nexport type { LinkedPath } from './LinkedPath.js';\nexport type { ImportMap } from './ImportMap.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/common-types",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Common types for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -101,6 +101,13 @@
101
101
  },
102
102
  "description": "A list of package names that should never be excluded or included from the bundle."
103
103
  },
104
+ "bundlerCapabilitiesRegistry": {
105
+ "type": "object",
106
+ "additionalProperties": {
107
+ "type": "string"
108
+ },
109
+ "description": "Key value pairs of external bundler capabilities that can be enabled in the package settings. Key is the name of the capability, which will be used in the package settings to enable the capability. Value is the import identifier for the capability module.\n\n(Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)"
110
+ },
104
111
  "$schema": {
105
112
  "type": "string"
106
113
  }
@@ -850,6 +857,9 @@
850
857
  "description": "Setting to control the bundler capabilities for this package. This is used to enable or disable specific bundler capabilities."
851
858
  }
852
859
  },
860
+ "required": [
861
+ "match"
862
+ ],
853
863
  "additionalProperties": false,
854
864
  "description": "Settings overrides for bundling a package (or multiple packages, depending on `match`)."
855
865
  },
@@ -959,6 +969,12 @@
959
969
  },
960
970
  "BundlerCapabilitiesOptions": {
961
971
  "type": "object",
972
+ "additionalProperties": {
973
+ "type": [
974
+ "object",
975
+ "boolean"
976
+ ]
977
+ },
962
978
  "properties": {
963
979
  "asset-inline": {
964
980
  "anyOf": [
@@ -985,7 +1001,6 @@
985
1001
  ]
986
1002
  }
987
1003
  },
988
- "additionalProperties": false,
989
1004
  "description": "This is the type that's being used PackageSettings to enable/disable bundler capabilities. It's a partial of the InternalBundlerCapabilities with the value being the options object or false. If the value is false, the capability will be disabled for the package."
990
1005
  }
991
1006
  }
@@ -5,9 +5,9 @@
5
5
  "packageSettings": {
6
6
  "type": "array",
7
7
  "items": {
8
- "$ref": "#/definitions/PackageSettings"
8
+ "$ref": "#/definitions/GeneratedPackageSettings"
9
9
  },
10
- "description": "Settings to customize how packages are bundled. For the generated config, these should just contain generated exports maps."
10
+ "description": "Generated settings to correct issues with packages or optimize their bundling process."
11
11
  },
12
12
  "$schema": {
13
13
  "type": "string"
@@ -16,12 +16,32 @@
16
16
  "additionalProperties": false,
17
17
  "description": "Per-application generated configuration for Cloudpack.",
18
18
  "definitions": {
19
- "PackageSettings": {
19
+ "GeneratedPackageSettings": {
20
20
  "type": "object",
21
+ "additionalProperties": false,
21
22
  "properties": {
22
23
  "match": {
23
- "$ref": "#/definitions/PackageSettingsMatch",
24
- "description": "Which package(s) the settings should be applied to. A string is a shorthand for matching the name with any version (`*` to match any name)."
24
+ "anyOf": [
25
+ {
26
+ "type": "string"
27
+ },
28
+ {
29
+ "type": "object",
30
+ "properties": {
31
+ "name": {
32
+ "type": "string",
33
+ "description": "Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name."
34
+ },
35
+ "version": {
36
+ "type": "string",
37
+ "description": "Version of the package. Unspecified matches any version.\n\nNote that if the package version is a prerelease, it will only match `*` or ranges that explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`."
38
+ }
39
+ },
40
+ "additionalProperties": false,
41
+ "description": "Make all properties in T required"
42
+ }
43
+ ],
44
+ "description": "This will be a string (name) for internal packages, or match with name and version for external. The match in this case will NOT contain wildcards in the name."
25
45
  },
26
46
  "includedDependencies": {
27
47
  "type": "array",
@@ -37,117 +57,22 @@
37
57
  },
38
58
  "description": "The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it. Accepts `$peerDependencies` as a special value to exclude all peerDependencies."
39
59
  },
40
- "inlinedDependencies": {
60
+ "dynamicImports": {
41
61
  "type": "array",
42
62
  "items": {
43
63
  "type": "string"
44
64
  },
45
- "description": "Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which are small and don't need to be loaded separately, or ones which have issues being resolved by the browser."
65
+ "description": "Only relevant for packages bundled with rollup: globs of files that include dynamic (async) imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to that plugin's [limitations](https://www.npmjs.com/package/\\@rollup/plugin-dynamic-import-vars#limitations)). Files matching `*.dynamic.*` are automatically included.\n\nThis is not needed for ori/esbuild and webpack because they should handle these types of imports automatically."
46
66
  },
47
67
  "exports": {
48
68
  "$ref": "#/definitions/PackageJsonExports",
49
69
  "description": "The exports map that should be used for this package, ignoring entries which are defined in the original package.json. This is useful for libraries which have a missing or broken exports map, or when we want to trim the exports to reduce the api surface we expose to the inner loop experience."
50
- },
51
- "bundler": {
52
- "type": "string",
53
- "description": "Forces the package to be bundled using a specific bundler."
54
- },
55
- "bundlerType": {
56
- "type": "string",
57
- "deprecated": "Use `bundler`.\n\nThis should be removed once repo configs are updated to use `bundler`."
58
- },
59
- "bundlerOptions": {
60
- "type": "object",
61
- "additionalProperties": {},
62
- "description": "Any bundler-specific options to be merged with the calculated bundler options. `bundler` is also required if this is specified.\n\nThis is an escape hatch which is generally not recommended, since it locks the package to a specific bundler implementation."
63
- },
64
- "inputPaths": {
65
- "type": "array",
66
- "items": {
67
- "type": "string"
68
- },
69
- "description": "Paths used for file monitoring and input hashing. Supports glob matching. Defaults to `[/src/**, *.json]` and excludes node_modules. Use `...` to include the default paths."
70
- },
71
- "ignoreMissingExports": {
72
- "anyOf": [
73
- {
74
- "type": "boolean"
75
- },
76
- {
77
- "type": "object",
78
- "additionalProperties": {
79
- "type": "array",
80
- "items": {
81
- "type": "string"
82
- }
83
- },
84
- "description": "Construct a type with a set of properties K of type T"
85
- }
86
- ],
87
- "description": "Controls the behavior of the `verifyExports` feature when checking consumed exports from this package:\n- If true, don't check this package's exports at all.\n- If an object, this is a mapping from package import paths to export names to ignore. Examples: - To ignore top-level exports: `{ \".\": [\"badName\"] }` - To ignore exports from another path: `{ \"./lib/foo\": [\"badName\"] }`"
88
- },
89
- "dynamicImports": {
90
- "type": "array",
91
- "items": {
92
- "type": "string"
93
- },
94
- "description": "Only relevant for packages bundled with rollup: globs of files that include dynamic (async) imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to that plugin's [limitations](https://www.npmjs.com/package/\\@rollup/plugin-dynamic-import-vars#limitations)). Files matching `*.dynamic.*` are automatically included.\n\nThis is not needed for ori/esbuild and webpack because they should handle these types of imports automatically."
95
- },
96
- "ignoredBundlerWarnings": {
97
- "type": "array",
98
- "items": {
99
- "type": "string"
100
- },
101
- "description": "Ignore these warning messages from the bundler (partial string matches). This is intended for non-actionable messages from external dependencies which can't easily be fixed, to avoid confusing users."
102
- },
103
- "link": {
104
- "type": "object",
105
- "properties": {
106
- "duplicatedDependencyBehavior": {
107
- "type": "string",
108
- "enum": [
109
- "force-host-version",
110
- "allow-duplication",
111
- "force-remote-version"
112
- ],
113
- "description": "Controls the behavior of duplicated dependencies in the resolve map by link. By default, `allow-duplication` is used, which allows multiple versions of the same package to exist in the resolve map to satisfy the semver. If `force-host-version` is used, the package will be deduplicated to the version of the host package ignoring semver requirements. If `force-remote-version` is used, the package will be deduplicated to the version of the remote package ignoring semver requirements."
114
- }
115
- },
116
- "additionalProperties": false,
117
- "description": "Setting to control how the package is linked in the resolve map."
118
- },
119
- "bundlerCapabilities": {
120
- "$ref": "#/definitions/BundlerCapabilitiesOptions",
121
- "description": "Setting to control the bundler capabilities for this package. This is used to enable or disable specific bundler capabilities."
122
70
  }
123
71
  },
124
- "additionalProperties": false,
125
- "description": "Settings overrides for bundling a package (or multiple packages, depending on `match`)."
126
- },
127
- "PackageSettingsMatch": {
128
- "anyOf": [
129
- {
130
- "type": "string"
131
- },
132
- {
133
- "type": "object",
134
- "properties": {
135
- "name": {
136
- "type": "string",
137
- "description": "Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name."
138
- },
139
- "version": {
140
- "type": "string",
141
- "description": "Version of the package. Unspecified matches any version.\n\nNote that if the package version is a prerelease, it will only match `*` or ranges that explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`."
142
- }
143
- },
144
- "required": [
145
- "name"
146
- ],
147
- "additionalProperties": false
148
- }
72
+ "required": [
73
+ "match"
149
74
  ],
150
- "description": "Which package(s) the settings should be applied to. A string is a shorthand for matching the name with any version (`*` to match any name)."
75
+ "description": "Subset of PackageSettings used in the generated config."
151
76
  },
152
77
  "PackageJsonExports": {
153
78
  "anyOf": [
@@ -227,37 +152,6 @@
227
152
  "$ref": "#/definitions/PackageJsonExportsValue"
228
153
  },
229
154
  "description": "Definition of the root exports object. Keys can be either conditions or import paths."
230
- },
231
- "BundlerCapabilitiesOptions": {
232
- "type": "object",
233
- "properties": {
234
- "asset-inline": {
235
- "anyOf": [
236
- {
237
- "type": "object",
238
- "properties": {
239
- "extensions": {
240
- "type": "array",
241
- "items": {
242
- "type": "string"
243
- }
244
- }
245
- },
246
- "required": [
247
- "extensions"
248
- ],
249
- "additionalProperties": false,
250
- "description": "Inlines assets into the bundle. Options: List of file extensions to inline. Do not include the leading dot."
251
- },
252
- {
253
- "type": "boolean",
254
- "const": false
255
- }
256
- ]
257
- }
258
- },
259
- "additionalProperties": false,
260
- "description": "This is the type that's being used PackageSettings to enable/disable bundler capabilities. It's a partial of the InternalBundlerCapabilities with the value being the options object or false. If the value is false, the capability will be disabled for the package."
261
155
  }
262
156
  }
263
157
  }
@@ -104,6 +104,13 @@
104
104
  "type": "string"
105
105
  },
106
106
  "description": "A list of package names that should never be excluded or included from the bundle."
107
+ },
108
+ "bundlerCapabilitiesRegistry": {
109
+ "type": "object",
110
+ "additionalProperties": {
111
+ "type": "string"
112
+ },
113
+ "description": "Key value pairs of external bundler capabilities that can be enabled in the package settings. Key is the name of the capability, which will be used in the package settings to enable the capability. Value is the import identifier for the capability module.\n\n(Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)"
107
114
  }
108
115
  },
109
116
  "additionalProperties": false,
@@ -851,6 +858,9 @@
851
858
  "description": "Setting to control the bundler capabilities for this package. This is used to enable or disable specific bundler capabilities."
852
859
  }
853
860
  },
861
+ "required": [
862
+ "match"
863
+ ],
854
864
  "additionalProperties": false,
855
865
  "description": "Settings overrides for bundling a package (or multiple packages, depending on `match`)."
856
866
  },
@@ -960,6 +970,12 @@
960
970
  },
961
971
  "BundlerCapabilitiesOptions": {
962
972
  "type": "object",
973
+ "additionalProperties": {
974
+ "type": [
975
+ "object",
976
+ "boolean"
977
+ ]
978
+ },
963
979
  "properties": {
964
980
  "asset-inline": {
965
981
  "anyOf": [
@@ -986,7 +1002,6 @@
986
1002
  ]
987
1003
  }
988
1004
  },
989
- "additionalProperties": false,
990
1005
  "description": "This is the type that's being used PackageSettings to enable/disable bundler capabilities. It's a partial of the InternalBundlerCapabilities with the value being the options object or false. If the value is false, the capability will be disabled for the package."
991
1006
  }
992
1007
  },