@ms-cloudpack/common-types 0.32.1 → 0.33.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.
@@ -14,11 +14,11 @@ export type BundlerCapabilityFunction<TConfig, TOptions extends object | boolean
14
14
  * `TOptions` is the type of the options object that's passed to the capability. (ie: `{ banner: string }`
15
15
  * or any other type that the capability needs when enabled)
16
16
  */
17
- export type BundlerCapability<TOptions extends object> = {
17
+ export type BaseBundlerCapability<TOptions extends object, Bundlers extends string, AllBundlerConfigs extends Record<Bundlers, any>> = {
18
18
  name: string;
19
19
  description: string;
20
20
  implementations: {
21
- [bundler: string]: BundlerCapabilityFunction<unknown, TOptions>;
21
+ [key in Bundlers]?: BundlerCapabilityFunction<AllBundlerConfigs[key], TOptions>;
22
22
  };
23
23
  };
24
24
  /**
@@ -94,7 +94,7 @@ export type BundlerCapabilitiesOptions = InternalBundlerCapabilitiesOptions & Ex
94
94
  * - Value: metadata object with description
95
95
  */
96
96
  export type InternalBundlerCapabilitiesMetaData = {
97
- [key in keyof InternalBundlerCapabilities]: Pick<BundlerCapability<object>, 'description'>;
97
+ [key in keyof InternalBundlerCapabilities]: Pick<BaseBundlerCapability<object, string, object>, 'description'>;
98
98
  };
99
99
  /**
100
100
  * This is a bundler specific implementation of the internal bundler capabilities.
@@ -108,10 +108,10 @@ export type InternalBundlerCapabilityImplementations<TConfig> = {
108
108
  /**
109
109
  * This is the type of the external bundler capability module that's being imported.
110
110
  *
111
- * `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)
111
+ * `TOptions` is the type of the capability's options.
112
112
  */
113
- export type ExternalBundlerCapabilityModule<TConfig extends object> = {
114
- default: BundlerCapability<TConfig>;
113
+ export type ExternalBundlerCapabilityModule<TOptions extends object, Bundlers extends string, AllBundlerConfigs extends Record<Bundlers, any>> = {
114
+ default: BaseBundlerCapability<TOptions, Bundlers, AllBundlerConfigs>;
115
115
  };
116
116
  export {};
117
117
  //# sourceMappingURL=BundlerCapability.d.ts.map
@@ -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;;;;;;;;OAQG;IACH,cAAc,EAAE;QAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAEnE;;;OAGG;IACH,MAAM,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF;;;;;;OAMG;IACH,OAAO,EACH,OAAO,GACP;QACE,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IAEN;;OAEG;IACH,KAAK,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF;;;OAGG;IACH,wBAAwB,EAAE,OAAO,CAAC;IAElC;;OAEG;IACH,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;CACxC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kCAAk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AAC;AAEF;;;;;GAKG;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;;;;GAIG;AACH,MAAM,MAAM,+BAA+B,CACzC,QAAQ,SAAS,MAAM,EACvB,QAAQ,SAAS,MAAM,EAEvB,iBAAiB,SAAS,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,IAC7C;IACF,OAAO,EAAE,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;CACvE,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 *\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"]}
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 BaseBundlerCapability<\n TOptions extends object,\n Bundlers extends string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n AllBundlerConfigs extends Record<Bundlers, any>,\n> = {\n name: string;\n description: string;\n implementations: {\n [key in Bundlers]?: BundlerCapabilityFunction<AllBundlerConfigs[key], 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<BaseBundlerCapability<object, string, 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 * `TOptions` is the type of the capability's options.\n */\nexport type ExternalBundlerCapabilityModule<\n TOptions extends object,\n Bundlers extends string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n AllBundlerConfigs extends Record<Bundlers, any>,\n> = {\n default: BaseBundlerCapability<TOptions, Bundlers, AllBundlerConfigs>;\n};\n"]}
@@ -3,7 +3,7 @@ export interface ModuleResolutionConfig {
3
3
  * Folder names or directory paths where to find modules.
4
4
  *
5
5
  * **Note: This completely replaces the default node_modules lookup.
6
- * To keep node_modules, include it explicitly: ["node_modules", "{configDir}/store"]**
6
+ * To keep node_modules, include it explicitly: `["node_modules", "{configDir}/store"]`**
7
7
  *
8
8
  * Absolute and relative paths can both be used, but be aware that they will behave a bit differently.
9
9
  *
@@ -12,15 +12,15 @@ export interface ModuleResolutionConfig {
12
12
  * With an absolute path, it will only search in the given directory.
13
13
  *
14
14
  * Template variables:
15
- * - {configDir} can be used to build paths relative to the configuration directory.
16
- * For example: {configDir}/store resolves to an absolute path pointing to the 'store'
15
+ * - `{configDir}` can be used to build paths relative to the configuration directory.
16
+ * For example: `{configDir}/store` resolves to an absolute path pointing to the 'store'
17
17
  * subdirectory within the directory containing the configuration file.
18
18
  *
19
19
  * Restrictions:
20
- * - The {configDir} template must appear at the beginning of the path
21
- * - Only one {configDir} template is allowed per path
22
- * - Invalid: "some/path/{configDir}" or "{configDir}/{configDir}/nested"
23
- * - Valid: "{configDir}/store", "{configDir}/components"
20
+ * - The `{configDir}` template must appear at the beginning of the path
21
+ * - Only one `{configDir}` template is allowed per path
22
+ * - Invalid: `some/path/{configDir}` or `{configDir}/{configDir}/nested`
23
+ * - Valid: `{configDir}/store`, `{configDir}/components`
24
24
  */
25
25
  modules?: string[];
26
26
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ModuleResolutionConfig.js","sourceRoot":"","sources":["../src/ModuleResolutionConfig.ts"],"names":[],"mappings":"","sourcesContent":["export interface ModuleResolutionConfig {\n /**\n * Folder names or directory paths where to find modules.\n *\n * **Note: This completely replaces the default node_modules lookup.\n * To keep node_modules, include it explicitly: [\"node_modules\", \"{configDir}/store\"]**\n *\n * Absolute and relative paths can both be used, but be aware that they will behave a bit differently.\n *\n * A relative path will be scanned similarly to how Node scans for node_modules, by looking through the current directory as well as its ancestors (i.e. ./node_modules, ../node_modules, and on).\n *\n * With an absolute path, it will only search in the given directory.\n *\n * Template variables:\n * - {configDir} can be used to build paths relative to the configuration directory.\n * For example: {configDir}/store resolves to an absolute path pointing to the 'store'\n * subdirectory within the directory containing the configuration file.\n *\n * Restrictions:\n * - The {configDir} template must appear at the beginning of the path\n * - Only one {configDir} template is allowed per path\n * - Invalid: \"some/path/{configDir}\" or \"{configDir}/{configDir}/nested\"\n * - Valid: \"{configDir}/store\", \"{configDir}/components\"\n */\n modules?: string[];\n\n /**\n * Array of module names to enforce consistent resolution using the application's module resolution strategy.\n *\n * Prevents multiple instances of the same package when dealing with duplicate dependencies\n * that may arise from package hoisting or linked dependencies in monorepo setups.\n *\n * Example: [\"react\", \"lodash\"] ensures these packages are always resolved using\n * the same resolution path that the application would normally use.\n *\n * This settings will be ignored for inlinedDependencies.\n */\n dedupe?: string[];\n}\n"]}
1
+ {"version":3,"file":"ModuleResolutionConfig.js","sourceRoot":"","sources":["../src/ModuleResolutionConfig.ts"],"names":[],"mappings":"","sourcesContent":["export interface ModuleResolutionConfig {\n /**\n * Folder names or directory paths where to find modules.\n *\n * **Note: This completely replaces the default node_modules lookup.\n * To keep node_modules, include it explicitly: `[\"node_modules\", \"{configDir}/store\"]`**\n *\n * Absolute and relative paths can both be used, but be aware that they will behave a bit differently.\n *\n * A relative path will be scanned similarly to how Node scans for node_modules, by looking through the current directory as well as its ancestors (i.e. ./node_modules, ../node_modules, and on).\n *\n * With an absolute path, it will only search in the given directory.\n *\n * Template variables:\n * - `{configDir}` can be used to build paths relative to the configuration directory.\n * For example: `{configDir}/store` resolves to an absolute path pointing to the 'store'\n * subdirectory within the directory containing the configuration file.\n *\n * Restrictions:\n * - The `{configDir}` template must appear at the beginning of the path\n * - Only one `{configDir}` template is allowed per path\n * - Invalid: `some/path/{configDir}` or `{configDir}/{configDir}/nested`\n * - Valid: `{configDir}/store`, `{configDir}/components`\n */\n modules?: string[];\n\n /**\n * Array of module names to enforce consistent resolution using the application's module resolution strategy.\n *\n * Prevents multiple instances of the same package when dealing with duplicate dependencies\n * that may arise from package hoisting or linked dependencies in monorepo setups.\n *\n * Example: [\"react\", \"lodash\"] ensures these packages are always resolved using\n * the same resolution path that the application would normally use.\n *\n * This settings will be ignored for inlinedDependencies.\n */\n dedupe?: string[];\n}\n"]}
@@ -106,11 +106,12 @@ export interface PackageSettings {
106
106
  */
107
107
  bundlerOptions?: Record<string, unknown>;
108
108
  /**
109
- * Paths used for file monitoring and input hashing. Supports glob matching.
109
+ * Paths used for file monitoring and input hashing. Supports glob matching and `!` for exclusions.
110
110
  * Defaults are under `@ms-cloudpack/path-utilities` in `sourceFilesGlobs`.
111
- * Use `...` to include the default paths.
111
+ * Use `...` to include the default paths. (`node_modules` is always ignored.)
112
112
  *
113
113
  * For input hashing, both positive and negative globs are considered.
114
+ *
114
115
  * For file watching, behavior depends on the watcher backend:
115
116
  * - Parcel watcher (default): only negative globs are respected for ignoring files
116
117
  * - Chokidar watcher: both positive and negative globs are supported
@@ -1 +1 @@
1
- {"version":3,"file":"PackageSettings.d.ts","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAA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AE/B;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B;;;;;;;;;;;;OAYG;IACH,oBAAoB,CAAC,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC;IAElE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEzC;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;IAE9D;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,eAAe,EACf,sBAAsB,GAAG,sBAAsB,GAAG,gBAAgB,CACnE,GAAG;IACF;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,0BAA0B,CAAC,CAAC;IAErD;;OAEG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { LinkOptions } from './LinkOptions.js';\nimport type { BundlerCapabilitiesOptions } from './BundlerCapability.js';\nimport type { PackageJsonExports, GeneratedExports } from './PackageJson.js';\n\nexport interface PackageSettingsMatchObject {\n /**\n * Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name.\n *\n * To negate a match, use `!` as the first character (e.g. `!@scope/foo` or `!@scope/*`).\n */\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 * An array allows multiple matches to be specified.\n */\n match: PackageSettingsMatch | 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.\n *\n * 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 *\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\n * libraries which are small and don't need to be loaded separately, have issues being resolved\n * by the browser, or provide reusable scss files.\n */\n inlinedDependencies?: string[];\n\n /**\n * Use this exports map instead of the original entry points from package.json. (Any Cloudpack-\n * generated exports will be merged.) This is useful if a library's exports map is missing\n * or broken, or to skip bundling entries which aren't needed at runtime.\n *\n * Generally, keys should be relative import paths starting with ./ (use . for the top-level import).\n * Other standard exports map syntax (such as conditions) is also supported.\n * For example:\n * ```json\n * {\n * \".\": \"./lib/index.js\",\n * \"./foo\": \"./lib/foo.js\",\n * }\n * ```\n */\n exports?: PackageJsonExports;\n\n /**\n * If specified, Cloudpack will not attempt to auto-generate ESM stubs for the package, but will\n * instead use the array of named exports you provide (per entry key). Any keys not included\n * will have a default export, but no named exports (so `{}` means that all entries should have\n * only a default export).\n * An entry 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 *\n * You can also use the special value `'types'` to generate stubs based on the TypeScript declaration file\n * if it exists. This will generate named exports for all types in the declaration file and relative imported files.\n *\n * Note: This is an escape hatch and should be used with caution, as it can lead to unexpected behavior.\n */\n unsafeCjsExportNames?: { [entryKey: string]: string[] } | 'types';\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. It's better to use built-in or custom bundler capabilities.\n *\n * WARNING: When merging package settings, `bundlerOptions` will be **overwritten** with\n * the last specified value.\n */\n bundlerOptions?: Record<string, unknown>;\n\n /**\n * Paths used for file monitoring and input hashing. Supports glob matching.\n * Defaults are under `@ms-cloudpack/path-utilities` in `sourceFilesGlobs`.\n * Use `...` to include the default paths.\n *\n * For input hashing, both positive and negative globs are considered.\n * For file watching, behavior depends on the watcher backend:\n * - Parcel watcher (default): only negative globs are respected for ignoring files\n * - Chokidar watcher: both positive and negative globs are supported\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 | { [path: 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 * Settings to control how the package is linked in the resolve map.\n */\n link?: LinkOptions;\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'\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 /**\n * Generated exports. This will always be a simple object with import paths.\n */\n exports?: GeneratedExports;\n};\n"]}
1
+ {"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { LinkOptions } from './LinkOptions.js';\nimport type { BundlerCapabilitiesOptions } from './BundlerCapability.js';\nimport type { PackageJsonExports, GeneratedExports } from './PackageJson.js';\n\nexport interface PackageSettingsMatchObject {\n /**\n * Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name.\n *\n * To negate a match, use `!` as the first character (e.g. `!@scope/foo` or `!@scope/*`).\n */\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 * An array allows multiple matches to be specified.\n */\n match: PackageSettingsMatch | 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.\n *\n * 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 *\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\n * libraries which are small and don't need to be loaded separately, have issues being resolved\n * by the browser, or provide reusable scss files.\n */\n inlinedDependencies?: string[];\n\n /**\n * Use this exports map instead of the original entry points from package.json. (Any Cloudpack-\n * generated exports will be merged.) This is useful if a library's exports map is missing\n * or broken, or to skip bundling entries which aren't needed at runtime.\n *\n * Generally, keys should be relative import paths starting with ./ (use . for the top-level import).\n * Other standard exports map syntax (such as conditions) is also supported.\n * For example:\n * ```json\n * {\n * \".\": \"./lib/index.js\",\n * \"./foo\": \"./lib/foo.js\",\n * }\n * ```\n */\n exports?: PackageJsonExports;\n\n /**\n * If specified, Cloudpack will not attempt to auto-generate ESM stubs for the package, but will\n * instead use the array of named exports you provide (per entry key). Any keys not included\n * will have a default export, but no named exports (so `{}` means that all entries should have\n * only a default export).\n * An entry 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 *\n * You can also use the special value `'types'` to generate stubs based on the TypeScript declaration file\n * if it exists. This will generate named exports for all types in the declaration file and relative imported files.\n *\n * Note: This is an escape hatch and should be used with caution, as it can lead to unexpected behavior.\n */\n unsafeCjsExportNames?: { [entryKey: string]: string[] } | 'types';\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. It's better to use built-in or custom bundler capabilities.\n *\n * WARNING: When merging package settings, `bundlerOptions` will be **overwritten** with\n * the last specified value.\n */\n bundlerOptions?: Record<string, unknown>;\n\n /**\n * Paths used for file monitoring and input hashing. Supports glob matching and `!` for exclusions.\n * Defaults are under `@ms-cloudpack/path-utilities` in `sourceFilesGlobs`.\n * Use `...` to include the default paths. (`node_modules` is always ignored.)\n *\n * For input hashing, both positive and negative globs are considered.\n *\n * For file watching, behavior depends on the watcher backend:\n * - Parcel watcher (default): only negative globs are respected for ignoring files\n * - Chokidar watcher: both positive and negative globs are supported\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 | { [path: 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 * Settings to control how the package is linked in the resolve map.\n */\n link?: LinkOptions;\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'\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 /**\n * Generated exports. This will always be a simple object with import paths.\n */\n exports?: GeneratedExports;\n};\n"]}
package/lib/Route.d.ts CHANGED
@@ -87,6 +87,10 @@ export interface StaticRoute extends SharedRouteOptions {
87
87
  */
88
88
  export interface ShorthandBootstrapRoute extends SharedRouteOptions, Pick<ShorthandRenderedRoute, 'entry' | 'serverEntry' | 'exportEntry'> {
89
89
  type: 'bootstrap';
90
+ /**
91
+ * Defer execution of scripts until the entry has loaded (default: false).
92
+ */
93
+ deferScripts?: boolean;
90
94
  }
91
95
  /**
92
96
  * A route that serves a bootstrap script.
@@ -1 +1 @@
1
- {"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;OAWG;IACH,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;CAClC;AAED;;;GAGG;AACH,M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K,WAAW,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAqB;IAC7D,OAAO,gBAAgB,CAAC,KAAc,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,MAAM,kBAAkB,GAAG,KAAsB,CAAC;IAClD,OAAO,CACL,CAAC,gBAAgB,CAAC,KAAK,CAAC;QACxB,6CAA6C;QAC7C,CAAC,CAAC,CAAC,kBAAkB,CAAC,YAAY,IAAI,kBAAkB,CAAC,KAAK,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAClG,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAqB;IAC5D,OAAO,eAAe,CAAC,KAAc,CAAC,IAAI,aAAa,IAAI,KAAK,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAA6B;IAC3D,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAA6B;IACxD,OAAO,SAAS,IAAI,KAAK,CAAC;AAC5B,CAAC","sourcesContent":["import type { ExpandedSourcePath } from './ExpandedSourcePath.js';\n\n/**\n * A route match can be a string path or an object with a path and domain.\n */\nexport type RouteMatch = string | { path: string; domain?: string };\n\nexport interface SharedRouteOptions {\n /**\n * The URL path to match. Paths should usually start with a slash, e.g. `'/my-route'`.\n * You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n *\n * See the [Express docs](https://expressjs.com/en/guide/routing.html#route-paths) for the full\n * supported routing syntax.\n *\n * If you need a route to match on a specific domain, you can pass an object (path, domain) in where\n * the domain is a string which can have wildcards (`*`). e.g. `'word.*'` will match `word.com`, `word.net`, etc.\n *\n * Use an array to handle multiple paths with the same route handler.\n */\n match: RouteMatch | RouteMatch[];\n}\n\n/**\n * A server-rendered route with optional shorthand `entry` info (as specified in `AppConfig`/`cloudpack.config.json`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport interface ShorthandRenderedRoute extends SharedRouteOptions {\n /**\n * Path to a .js or .html file (relative to the app path) for rendering the route.\n *\n * If a .js file, it must export a default function implementing `RenderFunction` from `@ms-cloudpack/common-types`.\n * @deprecated Use `serverEntry` instead. (Please talk to the team if you have a scenario where\n * bundling the script causes a problem.)\n */\n renderScript?: string;\n\n /**\n * The key in the exports map which represents the entry point app script for this route.\n * @deprecated Use `entry` instead.\n */\n exportEntry?: string;\n\n /**\n * Additional source file path(s) to bundle and include in the HTML.\n * This **overwrites** any original exports map for the package.\n *\n * Usually this should be an actual source path, though it could also be an exports map key if necessary.\n */\n entry?: string | string[];\n\n /**\n * Path to a TS, JS, or HTML file (relative to the app path) for rendering the route on the server.\n * (Also supports export map keys.) If a JS or TS file, it will be bundled before rendering.\n *\n * If JS or TS, it must export a default function implementing `RenderRouteFunction` defined in\n * `@ms-cloudpack/app-server`.\n */\n serverEntry?: string;\n}\n\n/**\n * A server-rendered route with full `entry` info (used in the processed `CloudpackConfig`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport type RenderedRoute = Omit<ShorthandRenderedRoute, 'exportEntry' | 'entry' | 'serverEntry'> & {\n /**\n * The source entry or entries to be included on the page for this route.\n */\n entry?: ExpandedSourcePath[];\n\n /**\n * Path to a TS, JS, or HTML file (relative to the app path) for rendering the route on the server.\n * If a JS or TS file, it will be bundled before rendering.\n *\n * If JS or TS, it must export a default function implementing `RenderRouteFunction` defined in\n * `@ms-cloudpack/app-server`.\n */\n serverEntry?: ExpandedSourcePath;\n};\n\n/**\n * A route with a staticPath property serves static files from the specified path.\n */\nexport interface StaticRoute extends SharedRouteOptions {\n /**\n * The path relative to the app root to static assets.\n */\n staticPath: string;\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface ShorthandBootstrapRoute\n extends SharedRouteOptions,\n Pick<ShorthandRenderedRoute, 'entry' | 'serverEntry' | 'exportEntry'> {\n type: 'bootstrap';\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface BootstrapRoute\n extends Omit<ShorthandBootstrapRoute, 'entry' | 'serverEntry'>,\n Pick<RenderedRoute, 'entry' | 'serverEntry'> {}\n\n/**\n * A route that redirects to another url.\n */\nexport interface RedirectRoute extends SharedRouteOptions {\n /**\n * The url to redirect to.\n */\n redirectTo: string;\n}\n\n/**\n * A route that proxies requests to another server.\n * This is handled by https://github.com/chimurai/http-proxy-middleware.\n */\nexport interface ProxyRoute extends SharedRouteOptions {\n /**\n * The target host to proxy to. (protocol + host).\n */\n proxyTo: string;\n\n /**\n * For virtual hosted sites.\n */\n changeOrigin?: boolean;\n /**\n * Rewrite target's url path. Object-keys will be used as RegExp to match paths.\n */\n pathRewrite?: Record<string, string>;\n}\n\n/**\n * Route as specified in `AppConfig` (`cloudpack.config.json`).\n */\n// WARNING: Be sure to add new route types to Route as well!\nexport type ShorthandRoute =\n | ShorthandRenderedRoute\n | ShorthandBootstrapRoute\n | StaticRoute\n | RedirectRoute\n | ProxyRoute;\n\n/**\n * Processed route as used in the processed `CloudpackConfig`.\n */\n// WARNING: Be sure to add new route types to ShorthandRoute as well!\nexport type Route = RenderedRoute | BootstrapRoute | StaticRoute | RedirectRoute | ProxyRoute;\n\n/**\n * Type guard to check if a route is a static route.\n */\nexport function isStaticRoute(route: Route | ShorthandRoute): route is StaticRoute {\n return 'staticPath' in route;\n}\n\n/**\n * Type guard to check if a route is a bootstrap route.\n */\nexport function isBootstrapRoute(route: Route): route is BootstrapRoute {\n return 'type' in route && route.type === 'bootstrap';\n}\n\n/**\n * Type guard to check if a route is a shorthand bootstrap route.\n */\nexport function isShorthandBootstrapRoute(route: ShorthandRoute): route is ShorthandBootstrapRoute {\n return isBootstrapRoute(route as Route);\n}\n\n/*\n * Type guard to check if a route is a rendered route.\n */\nexport function isRenderedRoute(route: Route): route is RenderedRoute {\n const maybeRenderedRoute = route as RenderedRoute;\n return (\n !isBootstrapRoute(route) &&\n // eslint-disable-next-line etc/no-deprecated\n !!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry || maybeRenderedRoute.serverEntry)\n );\n}\n\n/**\n * Type guard to check if a route is a shorthand rendered route.\n */\nexport function isShorthandRenderedRoute(route: ShorthandRoute): route is ShorthandRenderedRoute {\n return isRenderedRoute(route as Route) || 'exportEntry' in route;\n}\n\n/**\n * Type guard to check if a route is a redirect route.\n */\nexport function isRedirectRoute(route: Route | ShorthandRoute): route is RedirectRoute {\n return 'redirectTo' in route;\n}\n\n/**\n * Type guard to check if a route is a proxy route.\n */\nexport function isProxyRoute(route: Route | ShorthandRoute): route is ProxyRoute {\n return 'proxyTo' in route;\n}\n"]}
1
+ {"version":3,"file":"Route.js","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AA8JA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAA6B;IACzD,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAY;IAC3C,OAAO,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAqB;IAC7D,OAAO,gBAAgB,CAAC,KAAc,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,MAAM,kBAAkB,GAAG,KAAsB,CAAC;IAClD,OAAO,CACL,CAAC,gBAAgB,CAAC,KAAK,CAAC;QACxB,6CAA6C;QAC7C,CAAC,CAAC,CAAC,kBAAkB,CAAC,YAAY,IAAI,kBAAkB,CAAC,KAAK,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAClG,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAqB;IAC5D,OAAO,eAAe,CAAC,KAAc,CAAC,IAAI,aAAa,IAAI,KAAK,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAA6B;IAC3D,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAA6B;IACxD,OAAO,SAAS,IAAI,KAAK,CAAC;AAC5B,CAAC","sourcesContent":["import type { ExpandedSourcePath } from './ExpandedSourcePath.js';\n\n/**\n * A route match can be a string path or an object with a path and domain.\n */\nexport type RouteMatch = string | { path: string; domain?: string };\n\nexport interface SharedRouteOptions {\n /**\n * The URL path to match. Paths should usually start with a slash, e.g. `'/my-route'`.\n * You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n *\n * See the [Express docs](https://expressjs.com/en/guide/routing.html#route-paths) for the full\n * supported routing syntax.\n *\n * If you need a route to match on a specific domain, you can pass an object (path, domain) in where\n * the domain is a string which can have wildcards (`*`). e.g. `'word.*'` will match `word.com`, `word.net`, etc.\n *\n * Use an array to handle multiple paths with the same route handler.\n */\n match: RouteMatch | RouteMatch[];\n}\n\n/**\n * A server-rendered route with optional shorthand `entry` info (as specified in `AppConfig`/`cloudpack.config.json`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport interface ShorthandRenderedRoute extends SharedRouteOptions {\n /**\n * Path to a .js or .html file (relative to the app path) for rendering the route.\n *\n * If a .js file, it must export a default function implementing `RenderFunction` from `@ms-cloudpack/common-types`.\n * @deprecated Use `serverEntry` instead. (Please talk to the team if you have a scenario where\n * bundling the script causes a problem.)\n */\n renderScript?: string;\n\n /**\n * The key in the exports map which represents the entry point app script for this route.\n * @deprecated Use `entry` instead.\n */\n exportEntry?: string;\n\n /**\n * Additional source file path(s) to bundle and include in the HTML.\n * This **overwrites** any original exports map for the package.\n *\n * Usually this should be an actual source path, though it could also be an exports map key if necessary.\n */\n entry?: string | string[];\n\n /**\n * Path to a TS, JS, or HTML file (relative to the app path) for rendering the route on the server.\n * (Also supports export map keys.) If a JS or TS file, it will be bundled before rendering.\n *\n * If JS or TS, it must export a default function implementing `RenderRouteFunction` defined in\n * `@ms-cloudpack/app-server`.\n */\n serverEntry?: string;\n}\n\n/**\n * A server-rendered route with full `entry` info (used in the processed `CloudpackConfig`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport type RenderedRoute = Omit<ShorthandRenderedRoute, 'exportEntry' | 'entry' | 'serverEntry'> & {\n /**\n * The source entry or entries to be included on the page for this route.\n */\n entry?: ExpandedSourcePath[];\n\n /**\n * Path to a TS, JS, or HTML file (relative to the app path) for rendering the route on the server.\n * If a JS or TS file, it will be bundled before rendering.\n *\n * If JS or TS, it must export a default function implementing `RenderRouteFunction` defined in\n * `@ms-cloudpack/app-server`.\n */\n serverEntry?: ExpandedSourcePath;\n};\n\n/**\n * A route with a staticPath property serves static files from the specified path.\n */\nexport interface StaticRoute extends SharedRouteOptions {\n /**\n * The path relative to the app root to static assets.\n */\n staticPath: string;\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface ShorthandBootstrapRoute\n extends SharedRouteOptions,\n Pick<ShorthandRenderedRoute, 'entry' | 'serverEntry' | 'exportEntry'> {\n type: 'bootstrap';\n /**\n * Defer execution of scripts until the entry has loaded (default: false).\n */\n deferScripts?: boolean;\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface BootstrapRoute\n extends Omit<ShorthandBootstrapRoute, 'entry' | 'serverEntry'>,\n Pick<RenderedRoute, 'entry' | 'serverEntry'> {}\n\n/**\n * A route that redirects to another url.\n */\nexport interface RedirectRoute extends SharedRouteOptions {\n /**\n * The url to redirect to.\n */\n redirectTo: string;\n}\n\n/**\n * A route that proxies requests to another server.\n * This is handled by https://github.com/chimurai/http-proxy-middleware.\n */\nexport interface ProxyRoute extends SharedRouteOptions {\n /**\n * The target host to proxy to. (protocol + host).\n */\n proxyTo: string;\n\n /**\n * For virtual hosted sites.\n */\n changeOrigin?: boolean;\n /**\n * Rewrite target's url path. Object-keys will be used as RegExp to match paths.\n */\n pathRewrite?: Record<string, string>;\n}\n\n/**\n * Route as specified in `AppConfig` (`cloudpack.config.json`).\n */\n// WARNING: Be sure to add new route types to Route as well!\nexport type ShorthandRoute =\n | ShorthandRenderedRoute\n | ShorthandBootstrapRoute\n | StaticRoute\n | RedirectRoute\n | ProxyRoute;\n\n/**\n * Processed route as used in the processed `CloudpackConfig`.\n */\n// WARNING: Be sure to add new route types to ShorthandRoute as well!\nexport type Route = RenderedRoute | BootstrapRoute | StaticRoute | RedirectRoute | ProxyRoute;\n\n/**\n * Type guard to check if a route is a static route.\n */\nexport function isStaticRoute(route: Route | ShorthandRoute): route is StaticRoute {\n return 'staticPath' in route;\n}\n\n/**\n * Type guard to check if a route is a bootstrap route.\n */\nexport function isBootstrapRoute(route: Route): route is BootstrapRoute {\n return 'type' in route && route.type === 'bootstrap';\n}\n\n/**\n * Type guard to check if a route is a shorthand bootstrap route.\n */\nexport function isShorthandBootstrapRoute(route: ShorthandRoute): route is ShorthandBootstrapRoute {\n return isBootstrapRoute(route as Route);\n}\n\n/*\n * Type guard to check if a route is a rendered route.\n */\nexport function isRenderedRoute(route: Route): route is RenderedRoute {\n const maybeRenderedRoute = route as RenderedRoute;\n return (\n !isBootstrapRoute(route) &&\n // eslint-disable-next-line etc/no-deprecated\n !!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry || maybeRenderedRoute.serverEntry)\n );\n}\n\n/**\n * Type guard to check if a route is a shorthand rendered route.\n */\nexport function isShorthandRenderedRoute(route: ShorthandRoute): route is ShorthandRenderedRoute {\n return isRenderedRoute(route as Route) || 'exportEntry' in route;\n}\n\n/**\n * Type guard to check if a route is a redirect route.\n */\nexport function isRedirectRoute(route: Route | ShorthandRoute): route is RedirectRoute {\n return 'redirectTo' in route;\n}\n\n/**\n * Type guard to check if a route is a proxy route.\n */\nexport function isProxyRoute(route: Route | ShorthandRoute): route is ProxyRoute {\n return 'proxyTo' in route;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export type { BootstrapRoute, ProxyRoute, RedirectRoute, RenderedRoute, Route, R
25
25
  export { isBootstrapRoute, isProxyRoute, isRenderedRoute, isStaticRoute, isRedirectRoute, isShorthandBootstrapRoute, isShorthandRenderedRoute, } from './Route.js';
26
26
  export type { TelemetryConfig } from './TelemetryConfig.js';
27
27
  export type { AppConfig } from './AppConfig.js';
28
- export type { BundlerCapability, InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, ExternalBundlerCapabilityModule, BundlerCapabilityFunction, } from './BundlerCapability.js';
28
+ export type { BaseBundlerCapability, InternalBundlerCapabilitiesOptions, InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, ExternalBundlerCapabilityModule, BundlerCapabilityFunction, } from './BundlerCapability.js';
29
29
  export type { RemoteCacheConfig } from './RemoteCacheConfig.js';
30
30
  export type { RenderFunction, RenderFunctionOptions, RenderFunctionResult, ExpandedRenderFunctionResult, RequestInfo, ServerEntryFunction, ServerEntryFunctionOptions, ServerEntryFunctionResult, } from './RenderFunction.js';
31
31
  export type { Request, Response, RequestHandler } from 'express';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjG,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,iCAAiC,EACjC,uBAAuB,EACvB,sBAAsB,EACtB,mCAAmC,GACpC,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,eAAe,EACf,WAAW,EACX,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,aAAa,EAAE,MAA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Ae,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,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,eAAe,EAAmC,MAAM,kBAAkB,CAAC;AA0DjG,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,eAAe,EACf,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,YAAY,CAAC","sourcesContent":["export { allFeatures, defaultFeatures, type Features, type FeatureName } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\n PackageDefinitionTransformFactory,\n PackageDefinitionsCache,\n PackageImporterContext,\n SerializablePackageDefinitionsCache,\n} from './PackageDefinitionsCache.js';\nexport type {\n LiteralOrString,\n PackageJson,\n PackageJsonCloudpackMeta,\n PackageJsonDependencies,\n PackageJsonExportCondition,\n PackageJsonExports,\n PackageJsonExportsObject,\n GeneratedExports,\n PackageJsonExportsValue,\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 { BundlerResult } from './BundlerResult.js';\nexport type { Bundler } from './Bundler.js';\nexport type { CloudpackConfig, CloudpackLinkConfig } from './CloudpackConfig.js';\nexport type { ServerConfig } from './ServerConfig.js';\nexport type { ExpandedSourcePath } from './ExpandedSourcePath.js';\nexport type { Feature } from './Feature.js';\nexport type { GeneratedConfig } from './GeneratedConfig.js';\nexport type { HttpsConfig } from './HttpsConfig.js';\nexport type { LinkOptions } from './LinkOptions.js';\nexport type { ModuleType } from './ModuleType.js';\nexport type { PackageHashesCache, PackageHashOptions, SerializablePackageHashesCache } from './PackageHashesCache.js';\nexport type {\n PackageSettings,\n PackageSettingsMatch,\n PackageSettingsMatchObject,\n GeneratedPackageSettings,\n} from './PackageSettings.js';\nexport type {\n BootstrapRoute,\n ProxyRoute,\n RedirectRoute,\n RenderedRoute,\n Route,\n RouteMatch,\n SharedRouteOptions,\n ShorthandRenderedRoute,\n ShorthandBootstrapRoute,\n ShorthandRoute,\n StaticRoute,\n} from './Route.js';\nexport {\n isBootstrapRoute,\n isProxyRoute,\n isRenderedRoute,\n isStaticRoute,\n isRedirectRoute,\n isShorthandBootstrapRoute,\n isShorthandRenderedRoute,\n} from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n BundlerCapability,\n InternalBundlerCapabilityImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n ExternalBundlerCapabilityModule,\n BundlerCapabilityFunction,\n} from './BundlerCapability.js';\nexport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nexport type {\n RenderFunction,\n RenderFunctionOptions,\n RenderFunctionResult,\n ExpandedRenderFunctionResult,\n RequestInfo,\n ServerEntryFunction,\n ServerEntryFunctionOptions,\n ServerEntryFunctionResult,\n} from './RenderFunction.js';\nexport type { Request, Response, RequestHandler } 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';\nexport type { UserPreferences } from './UserPreferences.js';\nexport type { TargetEnvironment } from './TargetEnvironment.js';\nexport type { NestedPartial } from './NestedPartial.js';\nexport type { WithOptional } from './WithOptional.js';\nexport type { WithRequired } from './WithRequired.js';\nexport type { ModuleResolutionConfig } from './ModuleResolutionConfig.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAmC,MAAM,kBAAkB,CAAC;AA0DjG,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,eAAe,EACf,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,YAAY,CAAC","sourcesContent":["export { allFeatures, defaultFeatures, type Features, type FeatureName } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\n PackageDefinitionTransformFactory,\n PackageDefinitionsCache,\n PackageImporterContext,\n SerializablePackageDefinitionsCache,\n} from './PackageDefinitionsCache.js';\nexport type {\n LiteralOrString,\n PackageJson,\n PackageJsonCloudpackMeta,\n PackageJsonDependencies,\n PackageJsonExportCondition,\n PackageJsonExports,\n PackageJsonExportsObject,\n GeneratedExports,\n PackageJsonExportsValue,\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 { BundlerResult } from './BundlerResult.js';\nexport type { Bundler } from './Bundler.js';\nexport type { CloudpackConfig, CloudpackLinkConfig } from './CloudpackConfig.js';\nexport type { ServerConfig } from './ServerConfig.js';\nexport type { ExpandedSourcePath } from './ExpandedSourcePath.js';\nexport type { Feature } from './Feature.js';\nexport type { GeneratedConfig } from './GeneratedConfig.js';\nexport type { HttpsConfig } from './HttpsConfig.js';\nexport type { LinkOptions } from './LinkOptions.js';\nexport type { ModuleType } from './ModuleType.js';\nexport type { PackageHashesCache, PackageHashOptions, SerializablePackageHashesCache } from './PackageHashesCache.js';\nexport type {\n PackageSettings,\n PackageSettingsMatch,\n PackageSettingsMatchObject,\n GeneratedPackageSettings,\n} from './PackageSettings.js';\nexport type {\n BootstrapRoute,\n ProxyRoute,\n RedirectRoute,\n RenderedRoute,\n Route,\n RouteMatch,\n SharedRouteOptions,\n ShorthandRenderedRoute,\n ShorthandBootstrapRoute,\n ShorthandRoute,\n StaticRoute,\n} from './Route.js';\nexport {\n isBootstrapRoute,\n isProxyRoute,\n isRenderedRoute,\n isStaticRoute,\n isRedirectRoute,\n isShorthandBootstrapRoute,\n isShorthandRenderedRoute,\n} from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n BaseBundlerCapability,\n InternalBundlerCapabilitiesOptions,\n InternalBundlerCapabilityImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n ExternalBundlerCapabilityModule,\n BundlerCapabilityFunction,\n} from './BundlerCapability.js';\nexport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nexport type {\n RenderFunction,\n RenderFunctionOptions,\n RenderFunctionResult,\n ExpandedRenderFunctionResult,\n RequestInfo,\n ServerEntryFunction,\n ServerEntryFunctionOptions,\n ServerEntryFunctionResult,\n} from './RenderFunction.js';\nexport type { Request, Response, RequestHandler } 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';\nexport type { UserPreferences } from './UserPreferences.js';\nexport type { TargetEnvironment } from './TargetEnvironment.js';\nexport type { NestedPartial } from './NestedPartial.js';\nexport type { WithOptional } from './WithOptional.js';\nexport type { WithRequired } from './WithRequired.js';\nexport type { ModuleResolutionConfig } from './ModuleResolutionConfig.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/common-types",
3
- "version": "0.32.1",
3
+ "version": "0.33.0",
4
4
  "description": "Common types for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,14 +13,6 @@
13
13
  "import": "./lib/index.js"
14
14
  }
15
15
  },
16
- "dependencies": {
17
- "@ms-cloudpack/common-types-browser": "^0.6.3",
18
- "@types/express": "^4.17.16"
19
- },
20
- "devDependencies": {
21
- "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
22
- "@ms-cloudpack/scripts": "^0.0.1"
23
- },
24
16
  "scripts": {
25
17
  "api": "cloudpack-scripts api",
26
18
  "build:watch": "cloudpack-scripts build-watch",
@@ -29,6 +21,14 @@
29
21
  "lint": "cloudpack-scripts lint",
30
22
  "schema": "cloudpack-scripts schema"
31
23
  },
24
+ "dependencies": {
25
+ "@ms-cloudpack/common-types-browser": "^0.6.4",
26
+ "@types/express": "^4.17.16"
27
+ },
28
+ "devDependencies": {
29
+ "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
30
+ "@ms-cloudpack/scripts": "^0.0.1"
31
+ },
32
32
  "files": [
33
33
  "lib/**/!(*.test.*)",
34
34
  "schema"
@@ -706,6 +706,10 @@
706
706
  "type": {
707
707
  "type": "string",
708
708
  "const": "bootstrap"
709
+ },
710
+ "deferScripts": {
711
+ "type": "boolean",
712
+ "description": "Defer execution of scripts until the entry has loaded (default: false)."
709
713
  }
710
714
  },
711
715
  "required": [
@@ -997,7 +1001,7 @@
997
1001
  "items": {
998
1002
  "type": "string"
999
1003
  },
1000
- "description": "Paths used for file monitoring and input hashing. Supports glob matching. Defaults are under `@ms-cloudpack/path-utilities` in `sourceFilesGlobs`. Use `...` to include the default paths.\n\nFor input hashing, both positive and negative globs are considered. For file watching, behavior depends on the watcher backend:\n- Parcel watcher (default): only negative globs are respected for ignoring files\n- Chokidar watcher: both positive and negative globs are supported"
1004
+ "description": "Paths used for file monitoring and input hashing. Supports glob matching and `!` for exclusions. Defaults are under `@ms-cloudpack/path-utilities` in `sourceFilesGlobs`. Use `...` to include the default paths. (`node_modules` is always ignored.)\n\nFor input hashing, both positive and negative globs are considered.\n\nFor file watching, behavior depends on the watcher backend:\n- Parcel watcher (default): only negative globs are respected for ignoring files\n- Chokidar watcher: both positive and negative globs are supported"
1001
1005
  },
1002
1006
  "ignoreMissingExports": {
1003
1007
  "anyOf": [
@@ -1356,7 +1360,7 @@
1356
1360
  "items": {
1357
1361
  "type": "string"
1358
1362
  },
1359
- "description": "Folder names or directory paths where to find modules.\n\n**Note: This completely replaces the default node_modules lookup. To keep node_modules, include it explicitly: [\"node_modules\", \"{configDir}/store\"]**\n\nAbsolute and relative paths can both be used, but be aware that they will behave a bit differently.\n\nA relative path will be scanned similarly to how Node scans for node_modules, by looking through the current directory as well as its ancestors (i.e. ./node_modules, ../node_modules, and on).\n\nWith an absolute path, it will only search in the given directory.\n\nTemplate variables:\n- {configDir} can be used to build paths relative to the configuration directory. For example: {configDir}/store resolves to an absolute path pointing to the 'store' subdirectory within the directory containing the configuration file.\n\n Restrictions: - The {configDir} template must appear at the beginning of the path - Only one {configDir} template is allowed per path - Invalid: \"some/path/{configDir}\" or \"{configDir}/{configDir}/nested\" - Valid: \"{configDir}/store\", \"{configDir}/components\""
1363
+ "description": "Folder names or directory paths where to find modules.\n\n**Note: This completely replaces the default node_modules lookup. To keep node_modules, include it explicitly: `[\"node_modules\", \"{configDir}/store\"]`**\n\nAbsolute and relative paths can both be used, but be aware that they will behave a bit differently.\n\nA relative path will be scanned similarly to how Node scans for node_modules, by looking through the current directory as well as its ancestors (i.e. ./node_modules, ../node_modules, and on).\n\nWith an absolute path, it will only search in the given directory.\n\nTemplate variables:\n- `{configDir}` can be used to build paths relative to the configuration directory. For example: `{configDir}/store` resolves to an absolute path pointing to the 'store' subdirectory within the directory containing the configuration file.\n\n Restrictions: - The `{configDir}` template must appear at the beginning of the path - Only one `{configDir}` template is allowed per path - Invalid: `some/path/{configDir}` or `{configDir}/{configDir}/nested` - Valid: `{configDir}/store`, `{configDir}/components`"
1360
1364
  },
1361
1365
  "dedupe": {
1362
1366
  "type": "array",
@@ -707,6 +707,10 @@
707
707
  "type": {
708
708
  "type": "string",
709
709
  "const": "bootstrap"
710
+ },
711
+ "deferScripts": {
712
+ "type": "boolean",
713
+ "description": "Defer execution of scripts until the entry has loaded (default: false)."
710
714
  }
711
715
  },
712
716
  "required": [
@@ -998,7 +1002,7 @@
998
1002
  "items": {
999
1003
  "type": "string"
1000
1004
  },
1001
- "description": "Paths used for file monitoring and input hashing. Supports glob matching. Defaults are under `@ms-cloudpack/path-utilities` in `sourceFilesGlobs`. Use `...` to include the default paths.\n\nFor input hashing, both positive and negative globs are considered. For file watching, behavior depends on the watcher backend:\n- Parcel watcher (default): only negative globs are respected for ignoring files\n- Chokidar watcher: both positive and negative globs are supported"
1005
+ "description": "Paths used for file monitoring and input hashing. Supports glob matching and `!` for exclusions. Defaults are under `@ms-cloudpack/path-utilities` in `sourceFilesGlobs`. Use `...` to include the default paths. (`node_modules` is always ignored.)\n\nFor input hashing, both positive and negative globs are considered.\n\nFor file watching, behavior depends on the watcher backend:\n- Parcel watcher (default): only negative globs are respected for ignoring files\n- Chokidar watcher: both positive and negative globs are supported"
1002
1006
  },
1003
1007
  "ignoreMissingExports": {
1004
1008
  "anyOf": [
@@ -1357,7 +1361,7 @@
1357
1361
  "items": {
1358
1362
  "type": "string"
1359
1363
  },
1360
- "description": "Folder names or directory paths where to find modules.\n\n**Note: This completely replaces the default node_modules lookup. To keep node_modules, include it explicitly: [\"node_modules\", \"{configDir}/store\"]**\n\nAbsolute and relative paths can both be used, but be aware that they will behave a bit differently.\n\nA relative path will be scanned similarly to how Node scans for node_modules, by looking through the current directory as well as its ancestors (i.e. ./node_modules, ../node_modules, and on).\n\nWith an absolute path, it will only search in the given directory.\n\nTemplate variables:\n- {configDir} can be used to build paths relative to the configuration directory. For example: {configDir}/store resolves to an absolute path pointing to the 'store' subdirectory within the directory containing the configuration file.\n\n Restrictions: - The {configDir} template must appear at the beginning of the path - Only one {configDir} template is allowed per path - Invalid: \"some/path/{configDir}\" or \"{configDir}/{configDir}/nested\" - Valid: \"{configDir}/store\", \"{configDir}/components\""
1364
+ "description": "Folder names or directory paths where to find modules.\n\n**Note: This completely replaces the default node_modules lookup. To keep node_modules, include it explicitly: `[\"node_modules\", \"{configDir}/store\"]`**\n\nAbsolute and relative paths can both be used, but be aware that they will behave a bit differently.\n\nA relative path will be scanned similarly to how Node scans for node_modules, by looking through the current directory as well as its ancestors (i.e. ./node_modules, ../node_modules, and on).\n\nWith an absolute path, it will only search in the given directory.\n\nTemplate variables:\n- `{configDir}` can be used to build paths relative to the configuration directory. For example: `{configDir}/store` resolves to an absolute path pointing to the 'store' subdirectory within the directory containing the configuration file.\n\n Restrictions: - The `{configDir}` template must appear at the beginning of the path - Only one `{configDir}` template is allowed per path - Invalid: `some/path/{configDir}` or `{configDir}/{configDir}/nested` - Valid: `{configDir}/store`, `{configDir}/components`"
1361
1365
  },
1362
1366
  "dedupe": {
1363
1367
  "type": "array",