@ms-cloudpack/common-types 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AppConfig.d.ts +8 -0
- package/lib/AppConfig.d.ts.map +1 -1
- package/lib/AppConfig.js.map +1 -1
- package/lib/BundlerCapability.d.ts +39 -9
- package/lib/BundlerCapability.d.ts.map +1 -1
- package/lib/BundlerCapability.js.map +1 -1
- package/lib/GeneratedConfig.d.ts +3 -4
- package/lib/GeneratedConfig.d.ts.map +1 -1
- package/lib/GeneratedConfig.js.map +1 -1
- package/lib/PackageDefinitionsCache.d.ts +27 -7
- package/lib/PackageDefinitionsCache.d.ts.map +1 -1
- package/lib/PackageDefinitionsCache.js.map +1 -1
- package/lib/PackageJson.d.ts +10 -8
- package/lib/PackageJson.d.ts.map +1 -1
- package/lib/PackageJson.js.map +1 -1
- package/lib/PackageSettings.d.ts +20 -7
- package/lib/PackageSettings.d.ts.map +1 -1
- package/lib/PackageSettings.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/schema/AppConfig.json +29 -4
- package/schema/GeneratedConfig.json +30 -136
- package/schema/UserConfig.json +29 -4
package/lib/AppConfig.d.ts
CHANGED
|
@@ -79,5 +79,13 @@ export interface AppConfig {
|
|
|
79
79
|
* A list of package names that should never be excluded or included from the bundle.
|
|
80
80
|
*/
|
|
81
81
|
neverExcludeDependencies?: string[];
|
|
82
|
+
/**
|
|
83
|
+
* Key value pairs of external bundler capabilities that can be enabled in the package settings.
|
|
84
|
+
* Key is the name of the capability, which will be used in the package settings to enable the capability.
|
|
85
|
+
* Value is the import identifier for the capability module.
|
|
86
|
+
*
|
|
87
|
+
* (Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)
|
|
88
|
+
*/
|
|
89
|
+
bundlerCapabilitiesRegistry?: Record<string, string>;
|
|
82
90
|
}
|
|
83
91
|
//# sourceMappingURL=AppConfig.d.ts.map
|
package/lib/AppConfig.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppConfig.d.ts","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IAEpC;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAEjC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,WAAW,CAAC,EAAE;QACZ;;WAEG;QACH,cAAc,EAAE,MAAM,CAAC;QACvB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAClB;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IAEF;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAE1B;;OAEG;IACH,wBAAwB,CAAC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AC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtD"}
|
package/lib/AppConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { DevServer } from './DevServer.js';\nimport type { Features } from './Features.js';\nimport type { PackageSettings } from './PackageSettings.js';\nimport type { ShorthandRoute } from './Route.js';\nimport type { TelemetryConfig } from './TelemetryConfig.js';\n\n/**\n * Per-application user-provided configuration for Cloudpack.\n */\nexport interface AppConfig {\n /**\n * Extend the configuration from another file: either an import path or a relative path\n * (resolved from the config file's location).\n *\n * If an array, later files will take precedence when merging.\n * (The user config always takes precedence over any extended config.)\n *\n * Config merging approach:\n * - Objects will be deeply merged.\n * - Primitive values will be overwritten.\n * - Arrays will be overwritten, EXCEPT for `packageSettings`, which will be concatenated.\n */\n extends?: string | string[];\n\n /**\n * A set of options for configuring how the dev server works.\n */\n devServer?: DevServer;\n\n /**\n * A set of options for configuring telemetry\n */\n telemetry?: TelemetryConfig;\n\n /**\n * A set of options for configuring the experience. Features can be set to true to change the default\n * behavior.\n */\n features?: Features;\n\n /**\n * Help message to display when Cloudpack starts up.\n */\n helpMessage?: string;\n\n /**\n * An array of PackageSettings objects, used to provide settings for how we bundle packages.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * An optional list of commands (followed by a string array of args for that command)\n * to be executed prior to Cloudpack bundle\n */\n dependsOn?: [string, string[]][];\n\n /**\n * Glob pattern to match `patch-package` patch files, relative to the project root\n * (usually the same as the repository root).\n * @default \"patches/*.patch\"\n */\n patchFilesGlobPattern?: string;\n\n /**\n * Azure Blob Storage configuration for remote cache - uploading and downloading packages.\n * If this is not provided, the remote cache will not be used.\n */\n remoteCache?: {\n /**\n * The name of the Azure Blob Storage account.\n */\n storageAccount: string;\n /**\n * The name of the container to use for the remote cache. Container must already exist.\n */\n container: string;\n /**\n * The Microsoft Entra tenant (directory) ID. This will ensure that only users from this tenant can access the remote cache.\n */\n tenantId?: string;\n };\n\n /**\n * Defines what routes to support from the app server, and which scripts will be loaded\n * for each.\n */\n routes?: ShorthandRoute[];\n\n /**\n * A list of package names that should never be excluded or included from the bundle.\n */\n neverExcludeDependencies?: string[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { DevServer } from './DevServer.js';\nimport type { Features } from './Features.js';\nimport type { PackageSettings } from './PackageSettings.js';\nimport type { ShorthandRoute } from './Route.js';\nimport type { TelemetryConfig } from './TelemetryConfig.js';\n\n/**\n * Per-application user-provided configuration for Cloudpack.\n */\nexport interface AppConfig {\n /**\n * Extend the configuration from another file: either an import path or a relative path\n * (resolved from the config file's location).\n *\n * If an array, later files will take precedence when merging.\n * (The user config always takes precedence over any extended config.)\n *\n * Config merging approach:\n * - Objects will be deeply merged.\n * - Primitive values will be overwritten.\n * - Arrays will be overwritten, EXCEPT for `packageSettings`, which will be concatenated.\n */\n extends?: string | string[];\n\n /**\n * A set of options for configuring how the dev server works.\n */\n devServer?: DevServer;\n\n /**\n * A set of options for configuring telemetry\n */\n telemetry?: TelemetryConfig;\n\n /**\n * A set of options for configuring the experience. Features can be set to true to change the default\n * behavior.\n */\n features?: Features;\n\n /**\n * Help message to display when Cloudpack starts up.\n */\n helpMessage?: string;\n\n /**\n * An array of PackageSettings objects, used to provide settings for how we bundle packages.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * An optional list of commands (followed by a string array of args for that command)\n * to be executed prior to Cloudpack bundle\n */\n dependsOn?: [string, string[]][];\n\n /**\n * Glob pattern to match `patch-package` patch files, relative to the project root\n * (usually the same as the repository root).\n * @default \"patches/*.patch\"\n */\n patchFilesGlobPattern?: string;\n\n /**\n * Azure Blob Storage configuration for remote cache - uploading and downloading packages.\n * If this is not provided, the remote cache will not be used.\n */\n remoteCache?: {\n /**\n * The name of the Azure Blob Storage account.\n */\n storageAccount: string;\n /**\n * The name of the container to use for the remote cache. Container must already exist.\n */\n container: string;\n /**\n * The Microsoft Entra tenant (directory) ID. This will ensure that only users from this tenant can access the remote cache.\n */\n tenantId?: string;\n };\n\n /**\n * Defines what routes to support from the app server, and which scripts will be loaded\n * for each.\n */\n routes?: ShorthandRoute[];\n\n /**\n * A list of package names that should never be excluded or included from the bundle.\n */\n neverExcludeDependencies?: string[];\n\n /**\n * Key value pairs of external bundler capabilities that can be enabled in the package settings.\n * Key is the name of the capability, which will be used in the package settings to enable the capability.\n * Value is the import identifier for the capability module.\n *\n * (Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)\n */\n bundlerCapabilitiesRegistry?: Record<string, string>;\n}\n"]}
|
|
@@ -1,26 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A function that takes a config object and options object and returns a new config object.
|
|
3
3
|
* This is used to implement a bundler capability.
|
|
4
|
+
*
|
|
5
|
+
* - `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)
|
|
6
|
+
* - `TOptions` is the type of the options object that's passed to the capability. (ie: `{ banner: string }`
|
|
7
|
+
* or any other type that the capability needs when enabled)
|
|
4
8
|
*/
|
|
5
|
-
type
|
|
9
|
+
export type BundlerCapabilityFunction<TConfig, TOptions extends object> = (config: TConfig, options: TOptions) => TConfig;
|
|
6
10
|
/**
|
|
7
11
|
* A bundler capability is a feature that can be enabled for a package to modify the bundling process.
|
|
12
|
+
*
|
|
13
|
+
* `TOptions` is the type of the options object that's passed to the capability. (ie: `{ banner: string }`
|
|
14
|
+
* or any other type that the capability needs when enabled)
|
|
8
15
|
*/
|
|
9
16
|
export type BundlerCapability<TOptions extends object> = {
|
|
10
17
|
description: string;
|
|
11
18
|
implementations: {
|
|
12
|
-
[bundler: string]:
|
|
19
|
+
[bundler: string]: BundlerCapabilityFunction<unknown, TOptions>;
|
|
13
20
|
};
|
|
14
21
|
};
|
|
15
22
|
/**
|
|
16
23
|
* The metadata for a bundler capability.
|
|
17
|
-
* It's the same as the BundlerCapability but without the implementations.
|
|
24
|
+
* It's the same as the `BundlerCapability` but without the implementations.
|
|
25
|
+
* This is used to split the definition and the bundler-specific implementations.
|
|
26
|
+
*
|
|
27
|
+
* `TOptions` is the type of the options object that's passed to the capability. (ie: `{ banner: string }`
|
|
28
|
+
* or any other type that the capability needs when enabled)
|
|
18
29
|
*/
|
|
19
30
|
export type BundlerCapabilityMetaData<TOptions extends object> = Omit<BundlerCapability<TOptions>, 'implementations'>;
|
|
20
31
|
/**
|
|
21
32
|
* This is the list of the bundler capabilities that cloudpack provides.
|
|
22
|
-
* key: The name of the capability which will be used in the cloudpack config to enable the capability
|
|
23
|
-
* value: Options object which will be passed to the capability function
|
|
33
|
+
* - key: The name of the capability which will be used in the cloudpack config to enable the capability
|
|
34
|
+
* - value: Options object which will be passed to the capability function
|
|
24
35
|
*/
|
|
25
36
|
export type InternalBundlerCapabilities = {
|
|
26
37
|
/**
|
|
@@ -32,13 +43,20 @@ export type InternalBundlerCapabilities = {
|
|
|
32
43
|
};
|
|
33
44
|
};
|
|
34
45
|
/**
|
|
35
|
-
* This is the type that's being used PackageSettings to enable/disable bundler capabilities.
|
|
36
|
-
* It's a partial of the InternalBundlerCapabilities with the value being the options object or false.
|
|
46
|
+
* This is the type that's being used `PackageSettings` to enable/disable bundler capabilities.
|
|
47
|
+
* It's a partial of the `InternalBundlerCapabilities` with the value being the options object or false.
|
|
37
48
|
* If the value is false, the capability will be disabled for the package.
|
|
38
49
|
*/
|
|
39
|
-
export type
|
|
50
|
+
export type InternalBundlerCapabilitiesOptions = {
|
|
40
51
|
[key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;
|
|
41
52
|
};
|
|
53
|
+
type ExternalBundlerCapabilitiesOptions = Record<string, object | false>;
|
|
54
|
+
/**
|
|
55
|
+
* This is the type that's being used `PackageSettings` to enable/disable bundler capabilities.
|
|
56
|
+
* It's a partial of the `InternalBundlerCapabilities` with the value being the options object or false.
|
|
57
|
+
* If the value is false, the capability will be disabled for the package.
|
|
58
|
+
*/
|
|
59
|
+
export type BundlerCapabilitiesOptions = InternalBundlerCapabilitiesOptions & ExternalBundlerCapabilitiesOptions;
|
|
42
60
|
/**
|
|
43
61
|
* This is the metadata for the bundler capabilities that cloudpack provides.
|
|
44
62
|
* It's a mapping from the capability name to the metadata object.
|
|
@@ -51,9 +69,21 @@ export type InternalBundlerCapabilitiesMetaData = {
|
|
|
51
69
|
/**
|
|
52
70
|
* This is a bundler specific implementation of the internal bundler capabilities.
|
|
53
71
|
* It's a mapping from the capability name to the capability function.
|
|
72
|
+
*
|
|
73
|
+
* `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)
|
|
54
74
|
*/
|
|
55
75
|
export type InternalBundlerCapabilityImplementations<TConfig> = {
|
|
56
|
-
[key in keyof InternalBundlerCapabilities]:
|
|
76
|
+
[key in keyof InternalBundlerCapabilities]: BundlerCapabilityFunction<TConfig, InternalBundlerCapabilities[key]>;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* This is the type of the external bundler capability module that's being imported.
|
|
80
|
+
*
|
|
81
|
+
* `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)
|
|
82
|
+
*/
|
|
83
|
+
export type ExternalBundlerCapabilityModule<TConfig extends object> = {
|
|
84
|
+
default: BundlerCapability<TConfig> & {
|
|
85
|
+
name: string;
|
|
86
|
+
};
|
|
57
87
|
};
|
|
58
88
|
export {};
|
|
59
89
|
//# sourceMappingURL=BundlerCapability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundlerCapability.d.ts","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BundlerCapability.d.ts","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"AAAA;;;;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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,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundlerCapability.js","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A function that takes a config object and options object and returns a new config object.\n * This is used to implement a bundler capability.\n */\
|
|
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)\n */\nexport type BundlerCapabilityFunction<TConfig, TOptions extends object> = (\n config: TConfig,\n options: TOptions,\n) => TConfig;\n\n/**\n * A bundler capability is a feature that can be enabled for a package to modify the bundling process.\n *\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 description: string;\n implementations: {\n [bundler: string]: BundlerCapabilityFunction<unknown, TOptions>;\n };\n};\n\n/**\n * The metadata for a bundler capability.\n * It's the same as the `BundlerCapability` but without the implementations.\n * This is used to split the definition and the bundler-specific implementations.\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 BundlerCapabilityMetaData<TOptions extends object> = Omit<BundlerCapability<TOptions>, 'implementations'>;\n\n/**\n * This is the list of the bundler capabilities that cloudpack provides.\n * - key: The name of the capability which will be used in the cloudpack config to enable the capability\n * - value: Options object which will be passed to the capability function\n */\nexport type InternalBundlerCapabilities = {\n /**\n * Inlines assets into the bundle.\n * Options: List of file extensions to inline. Do not include the leading dot.\n */\n 'asset-inline': { extensions: string[] };\n};\n\n/**\n * This is the type that's being used `PackageSettings` to enable/disable bundler capabilities.\n * It's a partial of the `InternalBundlerCapabilities` with the value being the options object or false.\n * If the value is false, the capability will be disabled for the package.\n */\nexport type InternalBundlerCapabilitiesOptions = {\n [key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;\n};\n\ntype ExternalBundlerCapabilitiesOptions = Record<string, object | false>;\n\n/**\n * This is the type that's being used `PackageSettings` to enable/disable bundler capabilities.\n * It's a partial of the `InternalBundlerCapabilities` with the value being the options object or false.\n * If the value is false, the capability will be disabled for the package.\n */\nexport type BundlerCapabilitiesOptions = InternalBundlerCapabilitiesOptions & ExternalBundlerCapabilitiesOptions;\n\n/**\n * This is the metadata for the bundler capabilities that cloudpack provides.\n * It's a mapping from the capability name to the metadata object.\n * The metadata object contains the description of the capability and the list of implementations for each bundler.\n * This is used to generate the documentation for the bundler capabilities.\n */\nexport type InternalBundlerCapabilitiesMetaData = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityMetaData<InternalBundlerCapabilities[key]>;\n};\n\n/**\n * This is a bundler specific implementation of the internal bundler capabilities.\n * It's a mapping from the capability name to the capability function.\n *\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> & { name: string };\n};\n"]}
|
package/lib/GeneratedConfig.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GeneratedPackageSettings } from './PackageSettings.js';
|
|
2
2
|
/**
|
|
3
3
|
* Per-application generated configuration for Cloudpack.
|
|
4
4
|
*/
|
|
5
5
|
export interface GeneratedConfig {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* For the generated config, these should just contain generated exports maps.
|
|
7
|
+
* Generated settings to correct issues with packages or optimize their bundling process.
|
|
9
8
|
*/
|
|
10
|
-
packageSettings?:
|
|
9
|
+
packageSettings?: GeneratedPackageSettings[];
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=GeneratedConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratedConfig.d.ts","sourceRoot":"","sources":["../src/GeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"GeneratedConfig.d.ts","sourceRoot":"","sources":["../src/GeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,eAAe,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeneratedConfig.js","sourceRoot":"","sources":["../src/GeneratedConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"GeneratedConfig.js","sourceRoot":"","sources":["../src/GeneratedConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { GeneratedPackageSettings } from './PackageSettings.js';\n\n/**\n * Per-application generated configuration for Cloudpack.\n */\nexport interface GeneratedConfig {\n /**\n * Generated settings to correct issues with packages or optimize their bundling process.\n */\n packageSettings?: GeneratedPackageSettings[];\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CloudpackConfig } from './CloudpackConfig.js';
|
|
1
2
|
import type { PackageJson } from './PackageJson.js';
|
|
2
3
|
/** Provides context about how a parent package imports/depends on another package. */
|
|
3
4
|
export interface PackageImporterContext {
|
|
@@ -10,13 +11,18 @@ export interface PackageImporterContext {
|
|
|
10
11
|
/** Version spec the parent requested for this package. */
|
|
11
12
|
versionRequirement: string;
|
|
12
13
|
}
|
|
13
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Transform applied to a `package.json` file after it's read.
|
|
16
|
+
* `PackageDefinitions` clones the original object, so it's okay for transforms to mutate properties.
|
|
17
|
+
* @returns The transformed definition, or undefined if there were no changes.
|
|
18
|
+
*/
|
|
14
19
|
export type PackageDefinitionTransform = (params: {
|
|
15
20
|
definition: PackageJson;
|
|
16
21
|
packagePath: string;
|
|
17
22
|
packages: PackageDefinitionsCache;
|
|
18
23
|
importerContext?: PackageImporterContext;
|
|
19
24
|
}) => PackageJson | undefined | Promise<PackageJson | undefined>;
|
|
25
|
+
export type PackageDefinitionTransformFactory = (config?: CloudpackConfig) => PackageDefinitionTransform;
|
|
20
26
|
export interface GetPackageDefinitionOptions {
|
|
21
27
|
/** If true, the package definition will be re-read from disk. */
|
|
22
28
|
refresh?: boolean;
|
|
@@ -30,21 +36,35 @@ export interface GetPackageDefinitionOptions {
|
|
|
30
36
|
* and optionally applying transforms.
|
|
31
37
|
*/
|
|
32
38
|
export interface PackageDefinitionsCache {
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Get a `package.json` (either from cache or disk) and apply transforms.
|
|
41
|
+
* Throws an error if the file isn't found or there's an error parsing it.
|
|
42
|
+
* (Use `tryGet` to avoid throwing.)
|
|
43
|
+
*/
|
|
44
|
+
get(packagePath: string, options?: GetPackageDefinitionOptions): Promise<PackageJson>;
|
|
45
|
+
/**
|
|
46
|
+
* Get a `package.json` (either from cache or disk) and apply transforms.
|
|
47
|
+
* Returns undefined if the file isn't found or there's an error parsing it.
|
|
48
|
+
*/
|
|
49
|
+
tryGet(packagePath: string, options?: GetPackageDefinitionOptions): Promise<PackageJson | undefined>;
|
|
50
|
+
/**
|
|
51
|
+
* Registers a transform factory function, which will be called on initialization, and when reset,
|
|
52
|
+
* to re-generate the transform function. Transform functions are called only when the package
|
|
53
|
+
* definition hasn't been loaded before, and the result will be cached.
|
|
54
|
+
* Calling `reset` will reset the cache.
|
|
55
|
+
*/
|
|
56
|
+
registerTransform(factory: PackageDefinitionTransformFactory): void;
|
|
37
57
|
/**
|
|
38
58
|
* Resets the cache. If a `newConfig` value is provided, the transform factories will be called with the new value
|
|
39
59
|
* to give them an opportunity to reflect changes to the config. It is `unknown` because the config type is
|
|
40
60
|
* application-specific.
|
|
41
61
|
*/
|
|
42
62
|
reset(options?: {
|
|
43
|
-
newConfig?:
|
|
63
|
+
newConfig?: CloudpackConfig;
|
|
44
64
|
}): void;
|
|
45
65
|
/**
|
|
46
66
|
* This is a helper function for testing, to get all package definitions in the cache.
|
|
47
67
|
*/
|
|
48
|
-
_getAll(options?: Pick<GetPackageDefinitionOptions, 'disableTransforms'>): Record<string, PackageJson>;
|
|
68
|
+
_getAll(options?: Pick<GetPackageDefinitionOptions, 'disableTransforms'>): Record<string, PackageJson | undefined>;
|
|
49
69
|
}
|
|
50
70
|
//# sourceMappingURL=PackageDefinitionsCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageDefinitionsCache.d.ts","sourceRoot":"","sources":["../src/PackageDefinitionsCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,sFAAsF;AACtF,MAAM,WAAW,sBAAsB;IACrC,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,YAAY,EAAE,MAAM,CA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GG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAErG;;;;;OAKG;IACH,iBAAiB,CAAC,OAAO,EAAE,iCAAiC,GAAG,IAAI,CAAC;IAEpE;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,eAAe,CAAA;KAAE,GAAG,IAAI,CAAC;IAEvD;;OAEG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,2BAA2B,EAAE,mBAAmB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC,CAAC;CACpH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageDefinitionsCache.js","sourceRoot":"","sources":["../src/PackageDefinitionsCache.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageJson } from './PackageJson.js';\n\n/** Provides context about how a parent package imports/depends on another package. */\nexport interface PackageImporterContext {\n /** Actual name of the package that requested this package. */\n parentName: string;\n /** Actual version of the package that requested this package. */\n parentVersion: string;\n /** Name under which this package is imported by the parent. */\n importedName: string;\n /** Version spec the parent requested for this package. */\n versionRequirement: string;\n}\n\n
|
|
1
|
+
{"version":3,"file":"PackageDefinitionsCache.js","sourceRoot":"","sources":["../src/PackageDefinitionsCache.ts"],"names":[],"mappings":"","sourcesContent":["import type { CloudpackConfig } from './CloudpackConfig.js';\nimport type { PackageJson } from './PackageJson.js';\n\n/** Provides context about how a parent package imports/depends on another package. */\nexport interface PackageImporterContext {\n /** Actual name of the package that requested this package. */\n parentName: string;\n /** Actual version of the package that requested this package. */\n parentVersion: string;\n /** Name under which this package is imported by the parent. */\n importedName: string;\n /** Version spec the parent requested for this package. */\n versionRequirement: string;\n}\n\n/**\n * Transform applied to a `package.json` file after it's read.\n * `PackageDefinitions` clones the original object, so it's okay for transforms to mutate properties.\n * @returns The transformed definition, or undefined if there were no changes.\n */\nexport type PackageDefinitionTransform = (params: {\n definition: PackageJson;\n packagePath: string;\n packages: PackageDefinitionsCache;\n importerContext?: PackageImporterContext;\n}) => PackageJson | undefined | Promise<PackageJson | undefined>;\n\nexport type PackageDefinitionTransformFactory = (config?: CloudpackConfig) => PackageDefinitionTransform;\n\nexport interface GetPackageDefinitionOptions {\n /** If true, the package definition will be re-read from disk. */\n refresh?: boolean;\n /** If true, transforms will not be applied. */\n disableTransforms?: boolean;\n /** Info about the package that is importing this package, if known. */\n importerContext?: PackageImporterContext;\n}\n\n/**\n * Utility class for reading and caching package definition (`package.json`) objects,\n * and optionally applying transforms.\n */\nexport interface PackageDefinitionsCache {\n /**\n * Get a `package.json` (either from cache or disk) and apply transforms.\n * Throws an error if the file isn't found or there's an error parsing it.\n * (Use `tryGet` to avoid throwing.)\n */\n get(packagePath: string, options?: GetPackageDefinitionOptions): Promise<PackageJson>;\n\n /**\n * Get a `package.json` (either from cache or disk) and apply transforms.\n * Returns undefined if the file isn't found or there's an error parsing it.\n */\n tryGet(packagePath: string, options?: GetPackageDefinitionOptions): Promise<PackageJson | undefined>;\n\n /**\n * Registers a transform factory function, which will be called on initialization, and when reset,\n * to re-generate the transform function. Transform functions are called only when the package\n * definition hasn't been loaded before, and the result will be cached.\n * Calling `reset` will reset the cache.\n */\n registerTransform(factory: PackageDefinitionTransformFactory): void;\n\n /**\n * Resets the cache. If a `newConfig` value is provided, the transform factories will be called with the new value\n * to give them an opportunity to reflect changes to the config. It is `unknown` because the config type is\n * application-specific.\n */\n reset(options?: { newConfig?: CloudpackConfig }): void;\n\n /**\n * This is a helper function for testing, to get all package definitions in the cache.\n */\n _getAll(options?: Pick<GetPackageDefinitionOptions, 'disableTransforms'>): Record<string, PackageJson | undefined>;\n}\n"]}
|
package/lib/PackageJson.d.ts
CHANGED
|
@@ -7,12 +7,18 @@ import type { PackageSettings } from './PackageSettings.js';
|
|
|
7
7
|
* potentially relevant to Cloudpack. Additional properties can be added as needed.
|
|
8
8
|
*/
|
|
9
9
|
export type PackageJson = {
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The name of the package. This is always set when reading via `PackageDefinitions`, but might be
|
|
12
|
+
* missing if reading package.json directly.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
12
15
|
/** A description of the package. */
|
|
13
16
|
description?: string;
|
|
14
|
-
/**
|
|
15
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Package semantic version. This is always set when reading via `PackageDefinitions`, but might be
|
|
19
|
+
* missing if reading package.json directly.
|
|
20
|
+
*/
|
|
21
|
+
version: string;
|
|
16
22
|
/** The files included in the package. */
|
|
17
23
|
files?: string[];
|
|
18
24
|
/** Indicates the structure of the package. https://docs.npmjs.com/cli/v9/configuring-npm/package-json#directories */
|
|
@@ -74,10 +80,6 @@ export type PackageJson = {
|
|
|
74
80
|
engines?: {
|
|
75
81
|
[engine in LiteralOrString<'npm' | 'node'>]?: string;
|
|
76
82
|
};
|
|
77
|
-
/** Operating systems the package can run on. */
|
|
78
|
-
os?: Array<LiteralOrString<'aix' | 'darwin' | 'freebsd' | 'linux' | 'openbsd' | 'sunos' | 'win32' | '!aix' | '!darwin' | '!freebsd' | '!linux' | '!openbsd' | '!sunos' | '!win32'>>;
|
|
79
|
-
/** CPU architectures the package can run on. */
|
|
80
|
-
cpu?: Array<LiteralOrString<'arm' | 'arm64' | 'ia32' | 'mips' | 'mipsel' | 'ppc' | 'ppc64' | 's390' | 's390x' | 'x32' | 'x64' | '!arm' | '!arm64' | '!ia32' | '!mips' | '!mipsel' | '!ppc' | '!ppc64' | '!s390' | '!s390x' | '!x32' | '!x64'>>;
|
|
81
83
|
/** If `true`, this package cannot be published. */
|
|
82
84
|
private?: boolean;
|
|
83
85
|
/** A set of config values that will be used during publishing. https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig */
|
package/lib/PackageJson.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageJson.d.ts","sourceRoot":"","sources":["../src/PackageJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB
|
|
1
|
+
{"version":3,"file":"PackageJson.d.ts","sourceRoot":"","sources":["../src/PackageJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB,qHAAqH;IACrH,WAAW,CAAC,EAAE;QACZ,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;QAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,2IAA2I;IAC3I,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAE7B,oEAAoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,8EAA8E;IAC9E,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAE/C,yFAAyF;IACzF,MAAM,CAAC,EACH,MAAM,GACN;QACE,CAAC,UAAU,EAAE,MAAM,GAAG,MA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;AAEnC;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,eAAe,EAAE,MAAM,GAAG,uBAAuB,CAAC;CACpD,CAAC;AACF,gHAAgH;AAChH,MAAM,MAAM,kBAAkB,GAAG,uBAAuB,GAAG,wBAAwB,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC;AAEhH,kEAAkE;AAClE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,GAAG,EAAE,IAAI,MAAM,EAAE,GAAG,MAAM,GAAG;SAAG,GAAG,IAAI,0BAA0B,GAAG,kBAAkB;KAAE,CAAC;CAC3F,CAAC;AAEF,mDAAmD;AACnD,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC"}
|
package/lib/PackageJson.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageJson.js","sourceRoot":"","sources":["../src/PackageJson.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMode } from './BundleMode.js';\nimport type { PackageSettings } from './PackageSettings.js';\n\n/**\n * Types for the `package.json` file, derived from [`type-fest`](https://github.com/sindresorhus/type-fest/blob/main/source/package-json.d.ts).\n *\n * This version intentionally does not permit arbitrary keys, and focuses on properties that are\n * potentially relevant to Cloudpack. Additional properties can be added as needed.\n */\nexport type PackageJson = {\n
|
|
1
|
+
{"version":3,"file":"PackageJson.js","sourceRoot":"","sources":["../src/PackageJson.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMode } from './BundleMode.js';\nimport type { PackageSettings } from './PackageSettings.js';\n\n/**\n * Types for the `package.json` file, derived from [`type-fest`](https://github.com/sindresorhus/type-fest/blob/main/source/package-json.d.ts).\n *\n * This version intentionally does not permit arbitrary keys, and focuses on properties that are\n * potentially relevant to Cloudpack. Additional properties can be added as needed.\n */\nexport type PackageJson = {\n /**\n * The name of the package. This is always set when reading via `PackageDefinitions`, but might be\n * missing if reading package.json directly.\n */\n name: string;\n\n /** A description of the package. */\n description?: string;\n\n /**\n * Package semantic version. This is always set when reading via `PackageDefinitions`, but might be\n * missing if reading package.json directly.\n */\n version: string;\n\n /** The files included in the package. */\n files?: string[];\n\n /** Indicates the structure of the package. https://docs.npmjs.com/cli/v9/configuring-npm/package-json#directories */\n directories?: {\n [directoryType: string]: string | undefined;\n bin?: string;\n lib?: string;\n };\n\n /** Resolution algorithm for importing \".js\" files from the package's scope. https://nodejs.org/api/esm.html#esm_package_json_type_field */\n type?: 'module' | 'commonjs';\n\n /** The module ID that is the primary entry point to the package. */\n main?: string;\n\n /** An ECMAScript module ID that is the primary entry point to the package. */\n module?: string;\n\n /** The executable file(s) for this package. */\n bin?: string | Partial<Record<string, string>>;\n\n /** A module ID with untranspiled code that is the primary entry point to the package. */\n esnext?:\n | string\n | {\n [moduleName: string]: string | undefined;\n main?: string;\n browser?: string;\n };\n\n /** A hint to JavaScript bundlers or component tools when packaging modules for client side use. */\n browser?: string | Partial<Record<string, string | false>>;\n\n /**\n * Denote which files in the package have side effects and may not be pruned by bundlers, even if unused.\n * If a boolean, applies to all files in the package. `false` indicates there are no side effects.\n * https://webpack.js.org/guides/tree-shaking/\n */\n sideEffects?: boolean | string[];\n\n /** Location of the bundled TypeScript declaration file. */\n types?: string;\n\n /** Location of the bundled TypeScript declaration file. Alias of `types`. */\n typings?: string;\n\n /** Location of TypeScript declaration files for different TypeScript versions. */\n typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>>;\n\n /** Subpath exports to define entry points of the package. https://nodejs.org/api/packages.html#subpath-exports */\n exports?: PackageJsonExports;\n\n /**\n * Subpath imports to define internal package import maps that only apply to import specifiers from\n * within the package itself. https://nodejs.org/api/packages.html#subpath-imports\n */\n imports?: PackageJsonImports;\n\n /** Dependencies that will be installed when the package is consumed. */\n dependencies?: PackageJsonDependencies;\n\n /** Dependencies for local development only. */\n devDependencies?: PackageJsonDependencies;\n\n /** Dependencies that must be installed alongside this package when consumed. */\n peerDependencies?: PackageJsonDependencies;\n\n /** Indicates which peer dependencies are optional. */\n peerDependenciesMeta?: Partial<Record<string, { optional: true }>>;\n\n optionalDependencies?: PackageJsonDependencies;\n bundledDependencies?: PackageJsonDependencies | string[];\n bundleDependencies?: PackageJsonDependencies | string[];\n\n resolutions?: PackageJsonDependencies;\n\n /** Required engine versions for running this package. */\n engines?: {\n [engine in LiteralOrString<'npm' | 'node'>]?: string;\n };\n\n /** If `true`, this package cannot be published. */\n private?: boolean;\n\n /** A set of config values that will be used during publishing. https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig */\n publishConfig?: {\n access?: 'public' | 'restricted';\n registry?: string;\n tag?: string;\n [additionalProperties: string]: unknown;\n };\n\n /** Defines which package manager is expected to be used when working on the current project. https://nodejs.org/api/corepack.html */\n packageManager?: string;\n\n /** Configuration for npm or yarn workspaces. */\n workspaces?:\n | string[]\n | {\n /** An array of workspace pattern strings which contain the workspace packages. */\n packages?: string[];\n\n /** Prevent hoisting of these dependencies within the workspace (yarn only). https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) */\n nohoist?: string[];\n };\n\n /**\n * Cached result of calling `getPackageSettings` for this package.\n * This excludes properties that are fully handled by `createPackageSettingsTransform`.\n *\n * This should NOT be used during init's analysis of the bundle result, since it might be\n * out of date due to pending generated settings updates. (If a package is re-enqueued after\n * analysis due to generated settings updates, we refresh the definition, which updates these\n * cached setting. So it's safe to use again on the next bundle attempt.)\n */\n cloudpack?: Omit<PackageSettings, 'match' | 'exports' | 'includedDependencies' | 'excludedDependencies'> & {\n mode: BundleMode;\n };\n};\n\n/**\n * Union type which has intellisense for specific keys but also allows arbitrary strings.\n * This is a workaround for a [TypeScript issue](https://github.com/Microsoft/TypeScript/issues/29729)\n */\nexport type LiteralOrString<LiteralType extends string> = LiteralType | (string & Record<never, never>);\n\n/** Conditions which provide a way to resolve a package entry point based on the environment. */\nexport type PackageJsonExportCondition = LiteralOrString<\n | 'browser'\n | 'default'\n | 'deno'\n | 'electron'\n | 'import'\n | 'module'\n | 'node-addons'\n | 'node'\n | 'react-native'\n | 'require'\n>;\n\n/**\n * The value of an `PackageJson.exports` object key. Note at the root of the object, keys can be represented\n * either by a condition, or a `string` to provide import paths (such as \"./foo\"). At subsequent levels\n * within the object, only conditions (string which don't start with \".\") can be used as keys.\n */\nexport type PackageJsonExportsValue =\n | null\n | string\n | { [condition in PackageJsonExportCondition]?: PackageJsonExportsValue }\n | Array<PackageJsonExportsValue>;\n\n/**\n * Definition of the root exports object. Keys can be either conditions or import paths.\n */\nexport type PackageJsonExportsObject = {\n [pathOrCondition: string]: PackageJsonExportsValue;\n};\n/** Entry points of a package, optionally with conditions and subpath exports. Used as `PackageJson.exports`. */\nexport type PackageJsonExports = PackageJsonExportsValue | PackageJsonExportsObject | Array<PackageJsonExports>;\n\n/** Import map entries of a module, optionally with conditions. */\nexport type PackageJsonImports = {\n [key: `#${string}`]: string | { [key in PackageJsonExportCondition]: PackageJsonExports };\n};\n\n/** Mapping from dependency name to semver spec. */\nexport type PackageJsonDependencies = Partial<Record<string, string>>;\n"]}
|
package/lib/PackageSettings.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { BundlerCapabilitiesOptions } from './BundlerCapability.js';
|
|
2
2
|
import type { PackageJsonExports } from './PackageJson.js';
|
|
3
|
-
|
|
4
|
-
* Which package(s) the settings should be applied to.
|
|
5
|
-
* A string is a shorthand for matching the name with any version (`*` to match any name).
|
|
6
|
-
*/
|
|
7
|
-
export type PackageSettingsMatch = string | {
|
|
3
|
+
interface PackageSettingsMatchObject {
|
|
8
4
|
/** Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name. */
|
|
9
5
|
name: string;
|
|
10
6
|
/**
|
|
@@ -14,7 +10,12 @@ export type PackageSettingsMatch = string | {
|
|
|
14
10
|
* explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`.
|
|
15
11
|
*/
|
|
16
12
|
version?: string;
|
|
17
|
-
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Which package(s) the settings should be applied to.
|
|
16
|
+
* A string is a shorthand for matching the name with any version (`*` to match any name).
|
|
17
|
+
*/
|
|
18
|
+
export type PackageSettingsMatch = string | PackageSettingsMatchObject;
|
|
18
19
|
/**
|
|
19
20
|
* Settings overrides for bundling a package (or multiple packages, depending on `match`).
|
|
20
21
|
*/
|
|
@@ -22,8 +23,9 @@ export interface PackageSettings {
|
|
|
22
23
|
/**
|
|
23
24
|
* Which package(s) the settings should be applied to.
|
|
24
25
|
* A string is a shorthand for matching the name with any version (`*` to match any name).
|
|
26
|
+
* An array allows multiple matches to be specified.
|
|
25
27
|
*/
|
|
26
|
-
match
|
|
28
|
+
match: PackageSettingsMatch | PackageSettingsMatch[];
|
|
27
29
|
/**
|
|
28
30
|
* The dependencies which should be included when computing the import map. This is primarily used when
|
|
29
31
|
* devDependencies are needed by the app. This often happens when a library has a demo app which relies
|
|
@@ -113,4 +115,15 @@ export interface PackageSettings {
|
|
|
113
115
|
*/
|
|
114
116
|
bundlerCapabilities?: BundlerCapabilitiesOptions;
|
|
115
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Subset of PackageSettings used in the generated config.
|
|
120
|
+
*/
|
|
121
|
+
export type GeneratedPackageSettings = Pick<PackageSettings, 'includedDependencies' | 'excludedDependencies' | 'dynamicImports' | 'exports'> & {
|
|
122
|
+
/**
|
|
123
|
+
* This will be a string (name) for internal packages, or match with name and version for external.
|
|
124
|
+
* The match in this case will NOT contain wildcards in the name.
|
|
125
|
+
*/
|
|
126
|
+
match: string | Required<PackageSettingsMatchObject>;
|
|
127
|
+
};
|
|
128
|
+
export {};
|
|
116
129
|
//# sourceMappingURL=PackageSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageSettings.d.ts","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,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E1B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE;QACL;;;;;;WAMG;QACH,4BAA4B,CAAC,EAAE,oBAAoB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;KACpG,CAAC;IAEF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,eAAe,EACf,sBAAsB,GAAG,sBAAsB,GAAG,gBAAgB,GAAG,SAAS,CAC/E,GAAG;IACF;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,0BAA0B,CAAC,CAAC;CACtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundlerCapabilitiesOptions } from './BundlerCapability.js';\nimport type { PackageJsonExports } from './PackageJson.js';\n\
|
|
1
|
+
{"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundlerCapabilitiesOptions } from './BundlerCapability.js';\nimport type { PackageJsonExports } from './PackageJson.js';\n\ninterface PackageSettingsMatchObject {\n /** Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name. */\n name: string;\n\n /**\n * Version of the package. Unspecified matches any version.\n *\n * Note that if the package version is a prerelease, it will only match `*` or ranges that\n * explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`.\n */\n version?: string;\n}\n\n/**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n */\nexport type PackageSettingsMatch = string | PackageSettingsMatchObject;\n\n/**\n * Settings overrides for bundling a package (or multiple packages, depending on `match`).\n */\nexport interface PackageSettings {\n /**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n * 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. Accepts `$devDependencies` as a special value to include all devDependencies.\n */\n includedDependencies?: string[];\n\n /**\n * The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency\n * which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.\n * Accepts `$peerDependencies` as a special value to exclude all peerDependencies.\n */\n excludedDependencies?: string[];\n\n /**\n * Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which\n * are small and don't need to be loaded separately, or ones which have issues being resolved by the browser.\n */\n inlinedDependencies?: string[];\n\n /**\n * The exports map that should be used for this package, ignoring entries which are defined in the original\n * package.json. This is useful for libraries which have a missing or broken exports map, or when we want to\n * trim the exports to reduce the api surface we expose to the inner loop experience.\n */\n exports?: PackageJsonExports;\n\n /**\n * Forces the package to be bundled using a specific bundler.\n */\n bundler?: string;\n\n /**\n * @deprecated Use `bundler`.\n *\n * This should be removed once repo configs are updated to use `bundler`.\n */\n bundlerType?: string;\n\n /**\n * Any bundler-specific options to be merged with the calculated bundler options.\n * `bundler` is also required if this is specified.\n *\n * This is an escape hatch which is generally not recommended, since it locks the package to\n * a specific bundler implementation.\n */\n bundlerOptions?: Record<string, unknown>;\n\n /**\n * Paths used for file monitoring and input hashing. Supports glob matching.\n * Defaults to `[/src/**, *.json]` and excludes node_modules.\n * Use `...` to include the default paths.\n */\n inputPaths?: string[];\n\n /**\n * Controls the behavior of the `verifyExports` feature when checking consumed exports from this package:\n * - If true, don't check this package's exports at all.\n * - If an object, this is a mapping from package import paths to export names to ignore. Examples:\n * - To ignore top-level exports: `{ \".\": [\"badName\"] }`\n * - To ignore exports from another path: `{ \"./lib/foo\": [\"badName\"] }`\n */\n ignoreMissingExports?: boolean | Record<string, string[]>;\n\n /**\n * Only relevant for packages bundled with rollup: globs of files that include dynamic (async)\n * imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to\n * that plugin's [limitations](https://www.npmjs.com/package/\\@rollup/plugin-dynamic-import-vars#limitations)).\n * Files matching `*.dynamic.*` are automatically included.\n *\n * This is not needed for ori/esbuild and webpack because they should handle these types of imports automatically.\n */\n dynamicImports?: string[];\n\n /**\n * Ignore these warning messages from the bundler (partial string matches).\n * This is intended for non-actionable messages from external dependencies which can't easily\n * be fixed, to avoid confusing users.\n */\n ignoredBundlerWarnings?: string[];\n\n /**\n * Setting to control how the package is linked in the resolve map.\n */\n link?: {\n /**\n * Controls the behavior of duplicated dependencies in the resolve map by link. By default, `allow-duplication`\n * is used, which allows multiple versions of the same package to exist in the resolve map to satisfy the semver.\n * If `force-host-version` is used, the package will be deduplicated to the version of the host package ignoring\n * semver requirements. If `force-remote-version` is used, the package will be deduplicated to the version of the\n * remote package ignoring semver requirements.\n */\n duplicatedDependencyBehavior?: 'force-host-version' | 'allow-duplication' | 'force-remote-version';\n };\n\n /**\n * Setting to control the bundler capabilities for this package.\n * This is used to enable or disable specific bundler capabilities.\n */\n bundlerCapabilities?: BundlerCapabilitiesOptions;\n}\n\n/**\n * Subset of PackageSettings used in the generated config.\n */\nexport type GeneratedPackageSettings = Pick<\n PackageSettings,\n 'includedDependencies' | 'excludedDependencies' | 'dynamicImports' | 'exports'\n> & {\n /**\n * This will be a string (name) for internal packages, or match with name and version for external.\n * The match in this case will NOT contain wildcards in the name.\n */\n match: string | Required<PackageSettingsMatchObject>;\n};\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { allFeatures } from './allFeatures.js';
|
|
2
|
-
export type { GetPackageDefinitionOptions, PackageDefinitionTransform, PackageDefinitionsCache, PackageImporterContext, } from './PackageDefinitionsCache.js';
|
|
2
|
+
export type { GetPackageDefinitionOptions, PackageDefinitionTransform, PackageDefinitionTransformFactory, PackageDefinitionsCache, PackageImporterContext, } from './PackageDefinitionsCache.js';
|
|
3
3
|
export type { LiteralOrString, PackageJson, PackageJsonDependencies, PackageJsonExportCondition, PackageJsonExports, PackageJsonExportsObject, PackageJsonExportsValue, PackageJsonImports, } from './PackageJson.js';
|
|
4
4
|
export type { BundleContext } from './BundleContext.js';
|
|
5
5
|
export type { BundleMessage } from './BundleMessage.js';
|
|
@@ -18,12 +18,12 @@ export type { Features } from './Features.js';
|
|
|
18
18
|
export type { GeneratedConfig } from './GeneratedConfig.js';
|
|
19
19
|
export type { HttpsConfig } from './HttpsConfig.js';
|
|
20
20
|
export type { ModuleType } from './ModuleType.js';
|
|
21
|
-
export type { PackageSettings, PackageSettingsMatch } from './PackageSettings.js';
|
|
21
|
+
export type { PackageSettings, PackageSettingsMatch, GeneratedPackageSettings } from './PackageSettings.js';
|
|
22
22
|
export type { BootstrapRoute, RedirectRoute, RenderedRoute, Route, SharedRouteOptions, ShorthandRenderedRoute, ShorthandRoute, StaticRoute, } from './Route.js';
|
|
23
23
|
export { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } from './Route.js';
|
|
24
24
|
export type { TelemetryConfig } from './TelemetryConfig.js';
|
|
25
25
|
export type { AppConfig } from './AppConfig.js';
|
|
26
|
-
export type { InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, } from './BundlerCapability.js';
|
|
26
|
+
export type { InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, ExternalBundlerCapabilityModule, BundlerCapabilityFunction, } from './BundlerCapability.js';
|
|
27
27
|
export type { RenderFunction } from './RenderFunction.js';
|
|
28
28
|
export type { RenderFunctionOptions } from './RenderFunctionOptions.js';
|
|
29
29
|
export type { RenderFunctionResult, ExpandedRenderFunctionResult } from './RenderFunctionResult.js';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources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AE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA8C/C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { allFeatures } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\n PackageDefinitionTransformFactory,\n PackageDefinitionsCache,\n PackageImporterContext,\n} from './PackageDefinitionsCache.js';\nexport type {\n LiteralOrString,\n PackageJson,\n PackageJsonDependencies,\n PackageJsonExportCondition,\n PackageJsonExports,\n PackageJsonExportsObject,\n PackageJsonExportsValue,\n PackageJsonImports,\n} from './PackageJson.js';\nexport type { BundleContext } from './BundleContext.js';\nexport type { BundleMessage } from './BundleMessage.js';\nexport type { BundleMessageLocation } from './BundleMessageLocation.js';\nexport type { BundleMessageNote } from './BundleMessageNote.js';\nexport type { BundleMode } from './BundleMode.js';\nexport type { BundleOptions } from './BundleOptions.js';\nexport type { BundleOutputFile } from './BundleOutputFile.js';\nexport type { BundleResult } from './BundleResult.js';\nexport type { BundlerPluginResult } from './BundlerPluginResult.js';\nexport type { BundlerPlugin } from './BundlerPlugin.js';\nexport type { CloudpackConfig } from './CloudpackConfig.js';\nexport type { DevServer } from './DevServer.js';\nexport type { Feature } from './Feature.js';\nexport type { Features } from './Features.js';\nexport type { GeneratedConfig } from './GeneratedConfig.js';\nexport type { HttpsConfig } from './HttpsConfig.js';\nexport type { ModuleType } from './ModuleType.js';\nexport type { PackageSettings, PackageSettingsMatch, GeneratedPackageSettings } from './PackageSettings.js';\nexport type {\n BootstrapRoute,\n RedirectRoute,\n RenderedRoute,\n Route,\n SharedRouteOptions,\n ShorthandRenderedRoute,\n ShorthandRoute,\n StaticRoute,\n} from './Route.js';\nexport { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n InternalBundlerCapabilityImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n ExternalBundlerCapabilityModule,\n BundlerCapabilityFunction,\n} from './BundlerCapability.js';\nexport type { RenderFunction } from './RenderFunction.js';\nexport type { RenderFunctionOptions } from './RenderFunctionOptions.js';\nexport type { RenderFunctionResult, ExpandedRenderFunctionResult } from './RenderFunctionResult.js';\nexport type { RenderFunctionScript } from './RenderFunctionScript.js';\nexport type { Request, Response } from 'express';\nexport type { Session } from './Session.js';\nexport type { ResolveMap } from './ResolveMap.js';\nexport type { ResolveMapEntry } from './ResolveMapEntry.js';\nexport type { LinkedPath } from './LinkedPath.js';\nexport type { ImportMap } from './ImportMap.js';\n"]}
|
package/package.json
CHANGED
package/schema/AppConfig.json
CHANGED
|
@@ -101,6 +101,13 @@
|
|
|
101
101
|
},
|
|
102
102
|
"description": "A list of package names that should never be excluded or included from the bundle."
|
|
103
103
|
},
|
|
104
|
+
"bundlerCapabilitiesRegistry": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"additionalProperties": {
|
|
107
|
+
"type": "string"
|
|
108
|
+
},
|
|
109
|
+
"description": "Key value pairs of external bundler capabilities that can be enabled in the package settings. Key is the name of the capability, which will be used in the package settings to enable the capability. Value is the import identifier for the capability module.\n\n(Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)"
|
|
110
|
+
},
|
|
104
111
|
"$schema": {
|
|
105
112
|
"type": "string"
|
|
106
113
|
}
|
|
@@ -749,8 +756,18 @@
|
|
|
749
756
|
"type": "object",
|
|
750
757
|
"properties": {
|
|
751
758
|
"match": {
|
|
752
|
-
"
|
|
753
|
-
|
|
759
|
+
"anyOf": [
|
|
760
|
+
{
|
|
761
|
+
"$ref": "#/definitions/PackageSettingsMatch"
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
"type": "array",
|
|
765
|
+
"items": {
|
|
766
|
+
"$ref": "#/definitions/PackageSettingsMatch"
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
],
|
|
770
|
+
"description": "Which package(s) the settings should be applied to. A string is a shorthand for matching the name with any version (`*` to match any name). An array allows multiple matches to be specified."
|
|
754
771
|
},
|
|
755
772
|
"includedDependencies": {
|
|
756
773
|
"type": "array",
|
|
@@ -850,6 +867,9 @@
|
|
|
850
867
|
"description": "Setting to control the bundler capabilities for this package. This is used to enable or disable specific bundler capabilities."
|
|
851
868
|
}
|
|
852
869
|
},
|
|
870
|
+
"required": [
|
|
871
|
+
"match"
|
|
872
|
+
],
|
|
853
873
|
"additionalProperties": false,
|
|
854
874
|
"description": "Settings overrides for bundling a package (or multiple packages, depending on `match`)."
|
|
855
875
|
},
|
|
@@ -959,6 +979,12 @@
|
|
|
959
979
|
},
|
|
960
980
|
"BundlerCapabilitiesOptions": {
|
|
961
981
|
"type": "object",
|
|
982
|
+
"additionalProperties": {
|
|
983
|
+
"type": [
|
|
984
|
+
"object",
|
|
985
|
+
"boolean"
|
|
986
|
+
]
|
|
987
|
+
},
|
|
962
988
|
"properties": {
|
|
963
989
|
"asset-inline": {
|
|
964
990
|
"anyOf": [
|
|
@@ -985,8 +1011,7 @@
|
|
|
985
1011
|
]
|
|
986
1012
|
}
|
|
987
1013
|
},
|
|
988
|
-
"
|
|
989
|
-
"description": "This is the type that's being used PackageSettings to enable/disable bundler capabilities. It's a partial of the InternalBundlerCapabilities with the value being the options object or false. If the value is false, the capability will be disabled for the package."
|
|
1014
|
+
"description": "This is the type that's being used `PackageSettings` to enable/disable bundler capabilities. It's a partial of the `InternalBundlerCapabilities` with the value being the options object or false. If the value is false, the capability will be disabled for the package."
|
|
990
1015
|
}
|
|
991
1016
|
}
|
|
992
1017
|
}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"packageSettings": {
|
|
6
6
|
"type": "array",
|
|
7
7
|
"items": {
|
|
8
|
-
"$ref": "#/definitions/
|
|
8
|
+
"$ref": "#/definitions/GeneratedPackageSettings"
|
|
9
9
|
},
|
|
10
|
-
"description": "
|
|
10
|
+
"description": "Generated settings to correct issues with packages or optimize their bundling process."
|
|
11
11
|
},
|
|
12
12
|
"$schema": {
|
|
13
13
|
"type": "string"
|
|
@@ -16,12 +16,32 @@
|
|
|
16
16
|
"additionalProperties": false,
|
|
17
17
|
"description": "Per-application generated configuration for Cloudpack.",
|
|
18
18
|
"definitions": {
|
|
19
|
-
"
|
|
19
|
+
"GeneratedPackageSettings": {
|
|
20
20
|
"type": "object",
|
|
21
|
+
"additionalProperties": false,
|
|
21
22
|
"properties": {
|
|
22
23
|
"match": {
|
|
23
|
-
"
|
|
24
|
-
|
|
24
|
+
"anyOf": [
|
|
25
|
+
{
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"name": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name."
|
|
34
|
+
},
|
|
35
|
+
"version": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "Version of the package. Unspecified matches any version.\n\nNote that if the package version is a prerelease, it will only match `*` or ranges that explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`."
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"description": "Make all properties in T required"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"description": "This will be a string (name) for internal packages, or match with name and version for external. The match in this case will NOT contain wildcards in the name."
|
|
25
45
|
},
|
|
26
46
|
"includedDependencies": {
|
|
27
47
|
"type": "array",
|
|
@@ -37,117 +57,22 @@
|
|
|
37
57
|
},
|
|
38
58
|
"description": "The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it. Accepts `$peerDependencies` as a special value to exclude all peerDependencies."
|
|
39
59
|
},
|
|
40
|
-
"
|
|
60
|
+
"dynamicImports": {
|
|
41
61
|
"type": "array",
|
|
42
62
|
"items": {
|
|
43
63
|
"type": "string"
|
|
44
64
|
},
|
|
45
|
-
"description": "
|
|
65
|
+
"description": "Only relevant for packages bundled with rollup: globs of files that include dynamic (async) imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to that plugin's [limitations](https://www.npmjs.com/package/\\@rollup/plugin-dynamic-import-vars#limitations)). Files matching `*.dynamic.*` are automatically included.\n\nThis is not needed for ori/esbuild and webpack because they should handle these types of imports automatically."
|
|
46
66
|
},
|
|
47
67
|
"exports": {
|
|
48
68
|
"$ref": "#/definitions/PackageJsonExports",
|
|
49
69
|
"description": "The exports map that should be used for this package, ignoring entries which are defined in the original package.json. This is useful for libraries which have a missing or broken exports map, or when we want to trim the exports to reduce the api surface we expose to the inner loop experience."
|
|
50
|
-
},
|
|
51
|
-
"bundler": {
|
|
52
|
-
"type": "string",
|
|
53
|
-
"description": "Forces the package to be bundled using a specific bundler."
|
|
54
|
-
},
|
|
55
|
-
"bundlerType": {
|
|
56
|
-
"type": "string",
|
|
57
|
-
"deprecated": "Use `bundler`.\n\nThis should be removed once repo configs are updated to use `bundler`."
|
|
58
|
-
},
|
|
59
|
-
"bundlerOptions": {
|
|
60
|
-
"type": "object",
|
|
61
|
-
"additionalProperties": {},
|
|
62
|
-
"description": "Any bundler-specific options to be merged with the calculated bundler options. `bundler` is also required if this is specified.\n\nThis is an escape hatch which is generally not recommended, since it locks the package to a specific bundler implementation."
|
|
63
|
-
},
|
|
64
|
-
"inputPaths": {
|
|
65
|
-
"type": "array",
|
|
66
|
-
"items": {
|
|
67
|
-
"type": "string"
|
|
68
|
-
},
|
|
69
|
-
"description": "Paths used for file monitoring and input hashing. Supports glob matching. Defaults to `[/src/**, *.json]` and excludes node_modules. Use `...` to include the default paths."
|
|
70
|
-
},
|
|
71
|
-
"ignoreMissingExports": {
|
|
72
|
-
"anyOf": [
|
|
73
|
-
{
|
|
74
|
-
"type": "boolean"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"type": "object",
|
|
78
|
-
"additionalProperties": {
|
|
79
|
-
"type": "array",
|
|
80
|
-
"items": {
|
|
81
|
-
"type": "string"
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"description": "Construct a type with a set of properties K of type T"
|
|
85
|
-
}
|
|
86
|
-
],
|
|
87
|
-
"description": "Controls the behavior of the `verifyExports` feature when checking consumed exports from this package:\n- If true, don't check this package's exports at all.\n- If an object, this is a mapping from package import paths to export names to ignore. Examples: - To ignore top-level exports: `{ \".\": [\"badName\"] }` - To ignore exports from another path: `{ \"./lib/foo\": [\"badName\"] }`"
|
|
88
|
-
},
|
|
89
|
-
"dynamicImports": {
|
|
90
|
-
"type": "array",
|
|
91
|
-
"items": {
|
|
92
|
-
"type": "string"
|
|
93
|
-
},
|
|
94
|
-
"description": "Only relevant for packages bundled with rollup: globs of files that include dynamic (async) imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to that plugin's [limitations](https://www.npmjs.com/package/\\@rollup/plugin-dynamic-import-vars#limitations)). Files matching `*.dynamic.*` are automatically included.\n\nThis is not needed for ori/esbuild and webpack because they should handle these types of imports automatically."
|
|
95
|
-
},
|
|
96
|
-
"ignoredBundlerWarnings": {
|
|
97
|
-
"type": "array",
|
|
98
|
-
"items": {
|
|
99
|
-
"type": "string"
|
|
100
|
-
},
|
|
101
|
-
"description": "Ignore these warning messages from the bundler (partial string matches). This is intended for non-actionable messages from external dependencies which can't easily be fixed, to avoid confusing users."
|
|
102
|
-
},
|
|
103
|
-
"link": {
|
|
104
|
-
"type": "object",
|
|
105
|
-
"properties": {
|
|
106
|
-
"duplicatedDependencyBehavior": {
|
|
107
|
-
"type": "string",
|
|
108
|
-
"enum": [
|
|
109
|
-
"force-host-version",
|
|
110
|
-
"allow-duplication",
|
|
111
|
-
"force-remote-version"
|
|
112
|
-
],
|
|
113
|
-
"description": "Controls the behavior of duplicated dependencies in the resolve map by link. By default, `allow-duplication` is used, which allows multiple versions of the same package to exist in the resolve map to satisfy the semver. If `force-host-version` is used, the package will be deduplicated to the version of the host package ignoring semver requirements. If `force-remote-version` is used, the package will be deduplicated to the version of the remote package ignoring semver requirements."
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
"additionalProperties": false,
|
|
117
|
-
"description": "Setting to control how the package is linked in the resolve map."
|
|
118
|
-
},
|
|
119
|
-
"bundlerCapabilities": {
|
|
120
|
-
"$ref": "#/definitions/BundlerCapabilitiesOptions",
|
|
121
|
-
"description": "Setting to control the bundler capabilities for this package. This is used to enable or disable specific bundler capabilities."
|
|
122
70
|
}
|
|
123
71
|
},
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
"PackageSettingsMatch": {
|
|
128
|
-
"anyOf": [
|
|
129
|
-
{
|
|
130
|
-
"type": "string"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
"type": "object",
|
|
134
|
-
"properties": {
|
|
135
|
-
"name": {
|
|
136
|
-
"type": "string",
|
|
137
|
-
"description": "Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name."
|
|
138
|
-
},
|
|
139
|
-
"version": {
|
|
140
|
-
"type": "string",
|
|
141
|
-
"description": "Version of the package. Unspecified matches any version.\n\nNote that if the package version is a prerelease, it will only match `*` or ranges that explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`."
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
"required": [
|
|
145
|
-
"name"
|
|
146
|
-
],
|
|
147
|
-
"additionalProperties": false
|
|
148
|
-
}
|
|
72
|
+
"required": [
|
|
73
|
+
"match"
|
|
149
74
|
],
|
|
150
|
-
"description": "
|
|
75
|
+
"description": "Subset of PackageSettings used in the generated config."
|
|
151
76
|
},
|
|
152
77
|
"PackageJsonExports": {
|
|
153
78
|
"anyOf": [
|
|
@@ -227,37 +152,6 @@
|
|
|
227
152
|
"$ref": "#/definitions/PackageJsonExportsValue"
|
|
228
153
|
},
|
|
229
154
|
"description": "Definition of the root exports object. Keys can be either conditions or import paths."
|
|
230
|
-
},
|
|
231
|
-
"BundlerCapabilitiesOptions": {
|
|
232
|
-
"type": "object",
|
|
233
|
-
"properties": {
|
|
234
|
-
"asset-inline": {
|
|
235
|
-
"anyOf": [
|
|
236
|
-
{
|
|
237
|
-
"type": "object",
|
|
238
|
-
"properties": {
|
|
239
|
-
"extensions": {
|
|
240
|
-
"type": "array",
|
|
241
|
-
"items": {
|
|
242
|
-
"type": "string"
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
"required": [
|
|
247
|
-
"extensions"
|
|
248
|
-
],
|
|
249
|
-
"additionalProperties": false,
|
|
250
|
-
"description": "Inlines assets into the bundle. Options: List of file extensions to inline. Do not include the leading dot."
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
"type": "boolean",
|
|
254
|
-
"const": false
|
|
255
|
-
}
|
|
256
|
-
]
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
"additionalProperties": false,
|
|
260
|
-
"description": "This is the type that's being used PackageSettings to enable/disable bundler capabilities. It's a partial of the InternalBundlerCapabilities with the value being the options object or false. If the value is false, the capability will be disabled for the package."
|
|
261
155
|
}
|
|
262
156
|
}
|
|
263
157
|
}
|
package/schema/UserConfig.json
CHANGED
|
@@ -104,6 +104,13 @@
|
|
|
104
104
|
"type": "string"
|
|
105
105
|
},
|
|
106
106
|
"description": "A list of package names that should never be excluded or included from the bundle."
|
|
107
|
+
},
|
|
108
|
+
"bundlerCapabilitiesRegistry": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"additionalProperties": {
|
|
111
|
+
"type": "string"
|
|
112
|
+
},
|
|
113
|
+
"description": "Key value pairs of external bundler capabilities that can be enabled in the package settings. Key is the name of the capability, which will be used in the package settings to enable the capability. Value is the import identifier for the capability module.\n\n(Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)"
|
|
107
114
|
}
|
|
108
115
|
},
|
|
109
116
|
"additionalProperties": false,
|
|
@@ -750,8 +757,18 @@
|
|
|
750
757
|
"type": "object",
|
|
751
758
|
"properties": {
|
|
752
759
|
"match": {
|
|
753
|
-
"
|
|
754
|
-
|
|
760
|
+
"anyOf": [
|
|
761
|
+
{
|
|
762
|
+
"$ref": "#/definitions/PackageSettingsMatch"
|
|
763
|
+
},
|
|
764
|
+
{
|
|
765
|
+
"type": "array",
|
|
766
|
+
"items": {
|
|
767
|
+
"$ref": "#/definitions/PackageSettingsMatch"
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
],
|
|
771
|
+
"description": "Which package(s) the settings should be applied to. A string is a shorthand for matching the name with any version (`*` to match any name). An array allows multiple matches to be specified."
|
|
755
772
|
},
|
|
756
773
|
"includedDependencies": {
|
|
757
774
|
"type": "array",
|
|
@@ -851,6 +868,9 @@
|
|
|
851
868
|
"description": "Setting to control the bundler capabilities for this package. This is used to enable or disable specific bundler capabilities."
|
|
852
869
|
}
|
|
853
870
|
},
|
|
871
|
+
"required": [
|
|
872
|
+
"match"
|
|
873
|
+
],
|
|
854
874
|
"additionalProperties": false,
|
|
855
875
|
"description": "Settings overrides for bundling a package (or multiple packages, depending on `match`)."
|
|
856
876
|
},
|
|
@@ -960,6 +980,12 @@
|
|
|
960
980
|
},
|
|
961
981
|
"BundlerCapabilitiesOptions": {
|
|
962
982
|
"type": "object",
|
|
983
|
+
"additionalProperties": {
|
|
984
|
+
"type": [
|
|
985
|
+
"object",
|
|
986
|
+
"boolean"
|
|
987
|
+
]
|
|
988
|
+
},
|
|
963
989
|
"properties": {
|
|
964
990
|
"asset-inline": {
|
|
965
991
|
"anyOf": [
|
|
@@ -986,8 +1012,7 @@
|
|
|
986
1012
|
]
|
|
987
1013
|
}
|
|
988
1014
|
},
|
|
989
|
-
"
|
|
990
|
-
"description": "This is the type that's being used PackageSettings to enable/disable bundler capabilities. It's a partial of the InternalBundlerCapabilities with the value being the options object or false. If the value is false, the capability will be disabled for the package."
|
|
1015
|
+
"description": "This is the type that's being used `PackageSettings` to enable/disable bundler capabilities. It's a partial of the `InternalBundlerCapabilities` with the value being the options object or false. If the value is false, the capability will be disabled for the package."
|
|
991
1016
|
}
|
|
992
1017
|
},
|
|
993
1018
|
"properties": {
|