@ms-cloudpack/common-types 0.18.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/BundlerCapability.d.ts +22 -13
- package/lib/BundlerCapability.d.ts.map +1 -1
- package/lib/BundlerCapability.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 +2 -1
- package/lib/PackageSettings.d.ts.map +1 -1
- package/lib/PackageSettings.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/schema/AppConfig.json +13 -3
- package/schema/UserConfig.json +13 -3
|
@@ -1,13 +1,17 @@
|
|
|
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
|
-
*
|
|
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)
|
|
6
8
|
*/
|
|
7
9
|
export type BundlerCapabilityFunction<TConfig, TOptions extends object> = (config: TConfig, options: TOptions) => TConfig;
|
|
8
10
|
/**
|
|
9
11
|
* A bundler capability is a feature that can be enabled for a package to modify the bundling process.
|
|
10
|
-
*
|
|
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)
|
|
11
15
|
*/
|
|
12
16
|
export type BundlerCapability<TOptions extends object> = {
|
|
13
17
|
description: string;
|
|
@@ -17,14 +21,17 @@ export type BundlerCapability<TOptions extends object> = {
|
|
|
17
21
|
};
|
|
18
22
|
/**
|
|
19
23
|
* The metadata for a bundler capability.
|
|
20
|
-
* It's the same as the BundlerCapability but without the implementations.
|
|
21
|
-
*
|
|
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)
|
|
22
29
|
*/
|
|
23
30
|
export type BundlerCapabilityMetaData<TOptions extends object> = Omit<BundlerCapability<TOptions>, 'implementations'>;
|
|
24
31
|
/**
|
|
25
32
|
* This is the list of the bundler capabilities that cloudpack provides.
|
|
26
|
-
* key: The name of the capability which will be used in the cloudpack config to enable the capability
|
|
27
|
-
* 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
|
|
28
35
|
*/
|
|
29
36
|
export type InternalBundlerCapabilities = {
|
|
30
37
|
/**
|
|
@@ -36,8 +43,8 @@ export type InternalBundlerCapabilities = {
|
|
|
36
43
|
};
|
|
37
44
|
};
|
|
38
45
|
/**
|
|
39
|
-
* This is the type that's being used PackageSettings to enable/disable bundler capabilities.
|
|
40
|
-
* 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.
|
|
41
48
|
* If the value is false, the capability will be disabled for the package.
|
|
42
49
|
*/
|
|
43
50
|
export type InternalBundlerCapabilitiesOptions = {
|
|
@@ -45,8 +52,8 @@ export type InternalBundlerCapabilitiesOptions = {
|
|
|
45
52
|
};
|
|
46
53
|
type ExternalBundlerCapabilitiesOptions = Record<string, object | false>;
|
|
47
54
|
/**
|
|
48
|
-
* This is the type that's being used PackageSettings to enable/disable bundler capabilities.
|
|
49
|
-
* It's a partial of the InternalBundlerCapabilities with the value being the options object or false.
|
|
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.
|
|
50
57
|
* If the value is false, the capability will be disabled for the package.
|
|
51
58
|
*/
|
|
52
59
|
export type BundlerCapabilitiesOptions = InternalBundlerCapabilitiesOptions & ExternalBundlerCapabilitiesOptions;
|
|
@@ -62,14 +69,16 @@ export type InternalBundlerCapabilitiesMetaData = {
|
|
|
62
69
|
/**
|
|
63
70
|
* This is a bundler specific implementation of the internal bundler capabilities.
|
|
64
71
|
* It's a mapping from the capability name to the capability function.
|
|
65
|
-
*
|
|
72
|
+
*
|
|
73
|
+
* `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)
|
|
66
74
|
*/
|
|
67
75
|
export type InternalBundlerCapabilityImplementations<TConfig> = {
|
|
68
76
|
[key in keyof InternalBundlerCapabilities]: BundlerCapabilityFunction<TConfig, InternalBundlerCapabilities[key]>;
|
|
69
77
|
};
|
|
70
78
|
/**
|
|
71
79
|
* This is the type of the external bundler capability module that's being imported.
|
|
72
|
-
*
|
|
80
|
+
*
|
|
81
|
+
* `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)
|
|
73
82
|
*/
|
|
74
83
|
export type ExternalBundlerCapabilityModule<TConfig extends object> = {
|
|
75
84
|
default: BundlerCapability<TConfig> & {
|
|
@@ -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;;;;;;;GAOG;AACH,MAAM,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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 * TConfig is the type of the bundler's config object. (ie: WebpackConfiguration
|
|
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"]}
|
|
@@ -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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CAAC,CAAC;IAEtF;;;OAGG;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,UA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AAC,uBAAuB,CAAC,CAAC;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
|
@@ -23,8 +23,9 @@ export interface PackageSettings {
|
|
|
23
23
|
/**
|
|
24
24
|
* Which package(s) the settings should be applied to.
|
|
25
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.
|
|
26
27
|
*/
|
|
27
|
-
match: PackageSettingsMatch;
|
|
28
|
+
match: PackageSettingsMatch | PackageSettingsMatch[];
|
|
28
29
|
/**
|
|
29
30
|
* The dependencies which should be included when computing the import map. This is primarily used when
|
|
30
31
|
* devDependencies are needed by the app. This often happens when a library has a demo app which relies
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageSettings.d.ts","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,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IAEzC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAE1D;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE;QACL;;;;;;WAMG;QACH,4BAA4B,CAAC,EAAE,oBAAoB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;KACpG,CAAC;IAEF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;CAClD;AAED;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,eAAe,EACf,sBAAsB,GAAG,sBAAsB,GAAG,gBAAgB,GAAG,SAAS,CAC/E,GAAG;IACF;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC,0BAA0B,CAAC,CAAC;CACtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundlerCapabilitiesOptions } from './BundlerCapability.js';\nimport type { PackageJsonExports } from './PackageJson.js';\n\ninterface PackageSettingsMatchObject {\n /** Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name. */\n name: string;\n\n /**\n * Version of the package. Unspecified matches any version.\n *\n * Note that if the package version is a prerelease, it will only match `*` or ranges that\n * explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`.\n */\n version?: string;\n}\n\n/**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n */\nexport type PackageSettingsMatch = string | PackageSettingsMatchObject;\n\n/**\n * Settings overrides for bundling a package (or multiple packages, depending on `match`).\n */\nexport interface PackageSettings {\n /**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n */\n match: PackageSettingsMatch;\n\n /**\n * The dependencies which should be included when computing the import map. This is primarily used when\n * devDependencies are needed by the app. This often happens when a library has a demo app which relies\n * on devDependencies. Accepts `$devDependencies` as a special value to include all devDependencies.\n */\n includedDependencies?: string[];\n\n /**\n * The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency\n * which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.\n * Accepts `$peerDependencies` as a special value to exclude all peerDependencies.\n */\n excludedDependencies?: string[];\n\n /**\n * Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which\n * are small and don't need to be loaded separately, or ones which have issues being resolved by the browser.\n */\n inlinedDependencies?: string[];\n\n /**\n * The exports map that should be used for this package, ignoring entries which are defined in the original\n * package.json. This is useful for libraries which have a missing or broken exports map, or when we want to\n * trim the exports to reduce the api surface we expose to the inner loop experience.\n */\n exports?: PackageJsonExports;\n\n /**\n * Forces the package to be bundled using a specific bundler.\n */\n bundler?: string;\n\n /**\n * @deprecated Use `bundler`.\n *\n * This should be removed once repo configs are updated to use `bundler`.\n */\n bundlerType?: string;\n\n /**\n * Any bundler-specific options to be merged with the calculated bundler options.\n * `bundler` is also required if this is specified.\n *\n * This is an escape hatch which is generally not recommended, since it locks the package to\n * a specific bundler implementation.\n */\n bundlerOptions?: Record<string, unknown>;\n\n /**\n * Paths used for file monitoring and input hashing. Supports glob matching.\n * Defaults to `[/src/**, *.json]` and excludes node_modules.\n * Use `...` to include the default paths.\n */\n inputPaths?: string[];\n\n /**\n * Controls the behavior of the `verifyExports` feature when checking consumed exports from this package:\n * - If true, don't check this package's exports at all.\n * - If an object, this is a mapping from package import paths to export names to ignore. Examples:\n * - To ignore top-level exports: `{ \".\": [\"badName\"] }`\n * - To ignore exports from another path: `{ \"./lib/foo\": [\"badName\"] }`\n */\n ignoreMissingExports?: boolean | Record<string, string[]>;\n\n /**\n * Only relevant for packages bundled with rollup: globs of files that include dynamic (async)\n * imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to\n * that plugin's [limitations](https://www.npmjs.com/package/\\@rollup/plugin-dynamic-import-vars#limitations)).\n * Files matching `*.dynamic.*` are automatically included.\n *\n * This is not needed for ori/esbuild and webpack because they should handle these types of imports automatically.\n */\n dynamicImports?: string[];\n\n /**\n * Ignore these warning messages from the bundler (partial string matches).\n * This is intended for non-actionable messages from external dependencies which can't easily\n * be fixed, to avoid confusing users.\n */\n ignoredBundlerWarnings?: string[];\n\n /**\n * Setting to control how the package is linked in the resolve map.\n */\n link?: {\n /**\n * Controls the behavior of duplicated dependencies in the resolve map by link. By default, `allow-duplication`\n * is used, which allows multiple versions of the same package to exist in the resolve map to satisfy the semver.\n * If `force-host-version` is used, the package will be deduplicated to the version of the host package ignoring\n * semver requirements. If `force-remote-version` is used, the package will be deduplicated to the version of the\n * remote package ignoring semver requirements.\n */\n duplicatedDependencyBehavior?: 'force-host-version' | 'allow-duplication' | 'force-remote-version';\n };\n\n /**\n * Setting to control the bundler capabilities for this package.\n * This is used to enable or disable specific bundler capabilities.\n */\n bundlerCapabilities?: BundlerCapabilitiesOptions;\n}\n\n/**\n * Subset of PackageSettings used in the generated config.\n */\nexport type GeneratedPackageSettings = Pick<\n PackageSettings,\n 'includedDependencies' | 'excludedDependencies' | 'dynamicImports' | 'exports'\n> & {\n /**\n * This will be a string (name) for internal packages, or match with name and version for external.\n * The match in this case will NOT contain wildcards in the name.\n */\n match: string | Required<PackageSettingsMatchObject>;\n};\n"]}
|
|
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';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,UAAU,EAA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,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
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
|
@@ -756,8 +756,18 @@
|
|
|
756
756
|
"type": "object",
|
|
757
757
|
"properties": {
|
|
758
758
|
"match": {
|
|
759
|
-
"
|
|
760
|
-
|
|
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."
|
|
761
771
|
},
|
|
762
772
|
"includedDependencies": {
|
|
763
773
|
"type": "array",
|
|
@@ -1001,7 +1011,7 @@
|
|
|
1001
1011
|
]
|
|
1002
1012
|
}
|
|
1003
1013
|
},
|
|
1004
|
-
"description": "This is the type that's being used PackageSettings to enable/disable bundler capabilities. It's a partial of the InternalBundlerCapabilities with the value being the options object or false. If the value is false, the capability will be disabled for the package."
|
|
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."
|
|
1005
1015
|
}
|
|
1006
1016
|
}
|
|
1007
1017
|
}
|
package/schema/UserConfig.json
CHANGED
|
@@ -757,8 +757,18 @@
|
|
|
757
757
|
"type": "object",
|
|
758
758
|
"properties": {
|
|
759
759
|
"match": {
|
|
760
|
-
"
|
|
761
|
-
|
|
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."
|
|
762
772
|
},
|
|
763
773
|
"includedDependencies": {
|
|
764
774
|
"type": "array",
|
|
@@ -1002,7 +1012,7 @@
|
|
|
1002
1012
|
]
|
|
1003
1013
|
}
|
|
1004
1014
|
},
|
|
1005
|
-
"description": "This is the type that's being used PackageSettings to enable/disable bundler capabilities. It's a partial of the InternalBundlerCapabilities with the value being the options object or false. If the value is false, the capability will be disabled for the package."
|
|
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."
|
|
1006
1016
|
}
|
|
1007
1017
|
},
|
|
1008
1018
|
"properties": {
|