@ms-cloudpack/common-types 0.28.1 → 0.29.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.
@@ -5,6 +5,7 @@ import type { RemoteCacheConfig } from './RemoteCacheConfig.js';
5
5
  import type { ShorthandRoute } from './Route.js';
6
6
  import type { TelemetryConfig } from './TelemetryConfig.js';
7
7
  import type { DefineFlags } from '@ms-cloudpack/common-types-browser';
8
+ import type { ModuleResolutionConfig } from './ModuleResolutionConfig.js';
8
9
  /**
9
10
  * Per-application user-provided configuration for Cloudpack.
10
11
  */
@@ -101,5 +102,18 @@ export interface AppConfig {
101
102
  * @default 'ori'
102
103
  */
103
104
  defaultBundler?: string;
105
+ /**
106
+ * Configuration for module resolution, specifying where to look for modules.
107
+ */
108
+ resolve?: ModuleResolutionConfig;
109
+ /**
110
+ * Enables Relay support for generated artifacts.
111
+ *
112
+ * Note: Root directory will be resolved relative to the config directory.
113
+ */
114
+ relay?: {
115
+ rootDir: string;
116
+ artifactDirectory?: string;
117
+ };
104
118
  }
105
119
  //# 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,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;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C;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { ServerConfig } from './ServerConfig.js';\nimport type { Features } from './allFeatures.js';\nimport type { PackageSettings } from './PackageSettings.js';\nimport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nimport type { ShorthandRoute } from './Route.js';\nimport type { TelemetryConfig } from './TelemetryConfig.js';\nimport type { DefineFlags } from '@ms-cloudpack/common-types-browser';\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). Relative paths or deep imports into another\n * package (without an exports map) must include the file extension.\n *\n * If an array, later files will take precedence when merging.\n * (The current file's 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 * @deprecated - use \"server\" instead.\n */\n devServer?: ServerConfig;\n\n /**\n * Configuration for the dev server.\n */\n server?: ServerConfig;\n\n /**\n * Configuration for telemetry.\n */\n telemetry?: TelemetryConfig;\n\n /**\n * Enable additional Cloudpack features.\n */\n features?: Features;\n\n /**\n * Help message to display when Cloudpack starts up.\n */\n helpMessage?: string;\n\n /**\n * Settings to customize how packages are bundled.\n * Later settings in the array take precedence over earlier ones.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * Commands to execute prior to Cloudpack bundling.\n * Each entry has a command and an array of arguments: `['command', ['arg1', 'arg2']]`.\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 *\n * Note that if you're using `yarn patch` (v2+), those patches will be handled automatically\n * (not by this glob pattern).\n * @default \"patches/*.patch\"\n */\n patchFilesGlobPattern?: string;\n\n /**\n * Azure Blob Storage configuration for remote cache - uploading and downloading packages\n * via `cloudpack sync`. If this is not provided, the remote cache will not be used.\n */\n remoteCache?: RemoteCacheConfig;\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 * Ignore these package names when calculating included and excluded dependencies.\n * This is mainly intended for helper packages such as `tslib`.\n *\n * Include `...` to merge with the default list (`tslib` and `@babel/runtime` as of writing).\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 `PackageSettings.bundlerCapabilities`.\n * - Value is the import specifier (local path or package name) for the capability module.\n */\n bundlerCapabilitiesRegistry?: Record<string, string>;\n\n /**\n * Key value pairs that will be used to define global variables in the runtime.\n */\n define?: DefineFlags;\n\n /**\n * Advanced use only: Override the bundler that's used by default (if a package's source type\n * doesn't indicate that a specific bundler should be used, and there are no applicable package\n * settings). This will **significantly** decrease performance and should only be modified if\n * `ori` is incompatible with your repo/build for some reason.\n *\n * In most cases, you should use `packageSettings` to change the bundler instead: for example,\n * if your repo's packages must be built with rspack/webpack to support some custom config,\n * use `packageSettings: [{ match: [\"@yourscope/*\", \"your-unscoped-package\"], bundler: \"rspack\" }]`.\n * @default 'ori'\n */\n defaultBundler?: string;\n}\n"]}
1
+ {"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { ServerConfig } from './ServerConfig.js';\nimport type { Features } from './allFeatures.js';\nimport type { PackageSettings } from './PackageSettings.js';\nimport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nimport type { ShorthandRoute } from './Route.js';\nimport type { TelemetryConfig } from './TelemetryConfig.js';\nimport type { DefineFlags } from '@ms-cloudpack/common-types-browser';\nimport type { ModuleResolutionConfig } from './ModuleResolutionConfig.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). Relative paths or deep imports into another\n * package (without an exports map) must include the file extension.\n *\n * If an array, later files will take precedence when merging.\n * (The current file's 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 * @deprecated - use \"server\" instead.\n */\n devServer?: ServerConfig;\n\n /**\n * Configuration for the dev server.\n */\n server?: ServerConfig;\n\n /**\n * Configuration for telemetry.\n */\n telemetry?: TelemetryConfig;\n\n /**\n * Enable additional Cloudpack features.\n */\n features?: Features;\n\n /**\n * Help message to display when Cloudpack starts up.\n */\n helpMessage?: string;\n\n /**\n * Settings to customize how packages are bundled.\n * Later settings in the array take precedence over earlier ones.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * Commands to execute prior to Cloudpack bundling.\n * Each entry has a command and an array of arguments: `['command', ['arg1', 'arg2']]`.\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 *\n * Note that if you're using `yarn patch` (v2+), those patches will be handled automatically\n * (not by this glob pattern).\n * @default \"patches/*.patch\"\n */\n patchFilesGlobPattern?: string;\n\n /**\n * Azure Blob Storage configuration for remote cache - uploading and downloading packages\n * via `cloudpack sync`. If this is not provided, the remote cache will not be used.\n */\n remoteCache?: RemoteCacheConfig;\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 * Ignore these package names when calculating included and excluded dependencies.\n * This is mainly intended for helper packages such as `tslib`.\n *\n * Include `...` to merge with the default list (`tslib` and `@babel/runtime` as of writing).\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 `PackageSettings.bundlerCapabilities`.\n * - Value is the import specifier (local path or package name) for the capability module.\n */\n bundlerCapabilitiesRegistry?: Record<string, string>;\n\n /**\n * Key value pairs that will be used to define global variables in the runtime.\n */\n define?: DefineFlags;\n\n /**\n * Advanced use only: Override the bundler that's used by default (if a package's source type\n * doesn't indicate that a specific bundler should be used, and there are no applicable package\n * settings). This will **significantly** decrease performance and should only be modified if\n * `ori` is incompatible with your repo/build for some reason.\n *\n * In most cases, you should use `packageSettings` to change the bundler instead: for example,\n * if your repo's packages must be built with rspack/webpack to support some custom config,\n * use `packageSettings: [{ match: [\"@yourscope/*\", \"your-unscoped-package\"], bundler: \"rspack\" }]`.\n * @default 'ori'\n */\n defaultBundler?: string;\n\n /**\n * Configuration for module resolution, specifying where to look for modules.\n */\n resolve?: ModuleResolutionConfig;\n\n /**\n * Enables Relay support for generated artifacts.\n *\n * Note: Root directory will be resolved relative to the config directory.\n */\n relay?: { rootDir: string; artifactDirectory?: string };\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import type { AppConfig } from './AppConfig.js';
1
2
  /**
2
3
  * A function that takes a config object and options object and returns a new config object.
3
4
  * This is used to implement a bundler capability.
@@ -59,6 +60,12 @@ export type InternalBundlerCapabilities = {
59
60
  * Options: object is empty because it's just an indicator. No options are needed.
60
61
  */
61
62
  'resolve-web-extensions': boolean;
63
+ /**
64
+ * Enables Relay support for the package.
65
+ *
66
+ * Note: Ori does not support options.
67
+ */
68
+ relay: NonNullable<AppConfig['relay']>;
62
69
  };
63
70
  /**
64
71
  * This is the type that's being used `PackageSettings` to enable/disable bundler capabilities.
@@ -1 +1 @@
1
- {"version":3,"file":"BundlerCapability.d.ts","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"AAAA;;;;;;;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,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F;;;;GAIG;AACH,MAAM,MAAM,kCAAkC,GAAG;KAC9C,GAAG,IAAI,MAAM,2BAA2B,CAAC,CAAC,EAAE,2BAA2B,CAAC,GAAG,CAAC,GAAG,OAAO;CACxF,CAAC;AAEF,KAAK,kCAAkC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,kCAAkC,GAAG,kCAAkC,CAAC;AAEjH;;;;GAIG;AACH,MAAM,MAAM,mCAAmC,GAAG;KAC/C,GAAG,IAAI,MAAM,2BAA2B,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;CAC3F,CAAC;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,CAAC,OAAO,SAAS,MAAM,IAAI;IACpE,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACrC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BundlerCapability.js","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"","sourcesContent":["/**\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 * Options: List of file extensions to inline. Do not include the leading dot.\n */\n 'asset-inline': { extensions: string[] };\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: object is empty because it's just an indicator. No options are needed.\n */\n density: boolean;\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/**\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 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 * Options: List of file extensions to inline. Do not include the leading dot.\n */\n 'asset-inline': { extensions: string[] };\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: object is empty because it's just an indicator. No options are needed.\n */\n density: boolean;\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 * Note: Ori does not support options.\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"]}
@@ -0,0 +1,27 @@
1
+ export interface ModuleResolutionConfig {
2
+ /**
3
+ * Folder names or directory paths where to find modules.
4
+ *
5
+ * **Note: This completely replaces the default node_modules lookup.
6
+ * To keep node_modules, include it explicitly: ["node_modules", "{configDir}/store"]**
7
+ *
8
+ * Absolute and relative paths can both be used, but be aware that they will behave a bit differently.
9
+ *
10
+ * 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).
11
+ *
12
+ * With an absolute path, it will only search in the given directory.
13
+ *
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'
17
+ * subdirectory within the directory containing the configuration file.
18
+ *
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"
24
+ */
25
+ modules?: string[];
26
+ }
27
+ //# sourceMappingURL=ModuleResolutionConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModuleResolutionConfig.d.ts","sourceRoot":"","sources":["../src/ModuleResolutionConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ModuleResolutionConfig.js.map
@@ -0,0 +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"]}
package/lib/index.d.ts CHANGED
@@ -39,4 +39,5 @@ export type { TargetEnvironment } from './TargetEnvironment.js';
39
39
  export type { NestedPartial } from './NestedPartial.js';
40
40
  export type { WithOptional } from './WithOptional.js';
41
41
  export type { WithRequired } from './WithRequired.js';
42
+ export type { ModuleResolutionConfig } from './ModuleResolutionConfig.js';
42
43
  //# sourceMappingURL=index.d.ts.map
@@ -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,2BAA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B,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACjE,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;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';\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 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/common-types",
3
- "version": "0.28.1",
3
+ "version": "0.29.0",
4
4
  "description": "Common types for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -102,6 +102,26 @@
102
102
  "description": "Advanced use only: Override the bundler that's used by default (if a package's source type doesn't indicate that a specific bundler should be used, and there are no applicable package settings). This will **significantly** decrease performance and should only be modified if `ori` is incompatible with your repo/build for some reason.\n\nIn most cases, you should use `packageSettings` to change the bundler instead: for example, if your repo's packages must be built with rspack/webpack to support some custom config, use `packageSettings: [{ match: [\"@yourscope/*\", \"your-unscoped-package\"], bundler: \"rspack\" }]`.",
103
103
  "default": "ori"
104
104
  },
105
+ "resolve": {
106
+ "$ref": "#/definitions/ModuleResolutionConfig",
107
+ "description": "Configuration for module resolution, specifying where to look for modules."
108
+ },
109
+ "relay": {
110
+ "type": "object",
111
+ "properties": {
112
+ "rootDir": {
113
+ "type": "string"
114
+ },
115
+ "artifactDirectory": {
116
+ "type": "string"
117
+ }
118
+ },
119
+ "required": [
120
+ "rootDir"
121
+ ],
122
+ "additionalProperties": false,
123
+ "description": "Enables Relay support for generated artifacts.\n\nNote: Root directory will be resolved relative to the config directory."
124
+ },
105
125
  "$schema": {
106
126
  "type": "string"
107
127
  }
@@ -1218,6 +1238,29 @@
1218
1238
  "type": "boolean"
1219
1239
  }
1220
1240
  ]
1241
+ },
1242
+ "relay": {
1243
+ "anyOf": [
1244
+ {
1245
+ "type": "object",
1246
+ "additionalProperties": false,
1247
+ "properties": {
1248
+ "rootDir": {
1249
+ "type": "string"
1250
+ },
1251
+ "artifactDirectory": {
1252
+ "type": "string"
1253
+ }
1254
+ },
1255
+ "required": [
1256
+ "rootDir"
1257
+ ],
1258
+ "description": "Exclude null and undefined from T"
1259
+ },
1260
+ {
1261
+ "type": "boolean"
1262
+ }
1263
+ ]
1221
1264
  }
1222
1265
  },
1223
1266
  "description": "Options used in `PackageSettings` to configure or disable bundler capabilities.\n- Key: capability name, either internal (Cloudpack-provided) or external (as specified in `AppConfig.bundlerCapabilitiesRegistry`)\n- Value: options object to configure the capability, or false to disable it."
@@ -1271,6 +1314,19 @@
1271
1314
  ]
1272
1315
  },
1273
1316
  "description": "DefineFlags is an interface that represents a collection of global variables that will be defined on the window object. Each define flag is represented by a key-value pair"
1317
+ },
1318
+ "ModuleResolutionConfig": {
1319
+ "type": "object",
1320
+ "properties": {
1321
+ "modules": {
1322
+ "type": "array",
1323
+ "items": {
1324
+ "type": "string"
1325
+ },
1326
+ "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\""
1327
+ }
1328
+ },
1329
+ "additionalProperties": false
1274
1330
  }
1275
1331
  }
1276
1332
  }
@@ -105,6 +105,26 @@
105
105
  "type": "string",
106
106
  "description": "Advanced use only: Override the bundler that's used by default (if a package's source type doesn't indicate that a specific bundler should be used, and there are no applicable package settings). This will **significantly** decrease performance and should only be modified if `ori` is incompatible with your repo/build for some reason.\n\nIn most cases, you should use `packageSettings` to change the bundler instead: for example, if your repo's packages must be built with rspack/webpack to support some custom config, use `packageSettings: [{ match: [\"@yourscope/*\", \"your-unscoped-package\"], bundler: \"rspack\" }]`.",
107
107
  "default": "ori"
108
+ },
109
+ "resolve": {
110
+ "$ref": "#/definitions/ModuleResolutionConfig",
111
+ "description": "Configuration for module resolution, specifying where to look for modules."
112
+ },
113
+ "relay": {
114
+ "type": "object",
115
+ "properties": {
116
+ "rootDir": {
117
+ "type": "string"
118
+ },
119
+ "artifactDirectory": {
120
+ "type": "string"
121
+ }
122
+ },
123
+ "required": [
124
+ "rootDir"
125
+ ],
126
+ "additionalProperties": false,
127
+ "description": "Enables Relay support for generated artifacts.\n\nNote: Root directory will be resolved relative to the config directory."
108
128
  }
109
129
  },
110
130
  "additionalProperties": false,
@@ -1219,6 +1239,29 @@
1219
1239
  "type": "boolean"
1220
1240
  }
1221
1241
  ]
1242
+ },
1243
+ "relay": {
1244
+ "anyOf": [
1245
+ {
1246
+ "type": "object",
1247
+ "additionalProperties": false,
1248
+ "properties": {
1249
+ "rootDir": {
1250
+ "type": "string"
1251
+ },
1252
+ "artifactDirectory": {
1253
+ "type": "string"
1254
+ }
1255
+ },
1256
+ "required": [
1257
+ "rootDir"
1258
+ ],
1259
+ "description": "Exclude null and undefined from T"
1260
+ },
1261
+ {
1262
+ "type": "boolean"
1263
+ }
1264
+ ]
1222
1265
  }
1223
1266
  },
1224
1267
  "description": "Options used in `PackageSettings` to configure or disable bundler capabilities.\n- Key: capability name, either internal (Cloudpack-provided) or external (as specified in `AppConfig.bundlerCapabilitiesRegistry`)\n- Value: options object to configure the capability, or false to disable it."
@@ -1272,6 +1315,19 @@
1272
1315
  ]
1273
1316
  },
1274
1317
  "description": "DefineFlags is an interface that represents a collection of global variables that will be defined on the window object. Each define flag is represented by a key-value pair"
1318
+ },
1319
+ "ModuleResolutionConfig": {
1320
+ "type": "object",
1321
+ "properties": {
1322
+ "modules": {
1323
+ "type": "array",
1324
+ "items": {
1325
+ "type": "string"
1326
+ },
1327
+ "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\""
1328
+ }
1329
+ },
1330
+ "additionalProperties": false
1275
1331
  }
1276
1332
  },
1277
1333
  "properties": {