@ms-cloudpack/common-types 0.23.2 → 0.23.3
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 +3 -4
- package/lib/AppConfig.d.ts.map +1 -1
- package/lib/AppConfig.js.map +1 -1
- package/lib/BundlerCapability.d.ts +12 -22
- package/lib/BundlerCapability.d.ts.map +1 -1
- package/lib/BundlerCapability.js.map +1 -1
- package/lib/CloudpackConfig.d.ts +7 -1
- package/lib/CloudpackConfig.d.ts.map +1 -1
- package/lib/CloudpackConfig.js.map +1 -1
- package/lib/Route.d.ts +24 -2
- package/lib/Route.d.ts.map +1 -1
- package/lib/Route.js +6 -0
- package/lib/Route.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/schema/AppConfig.json +46 -3
- package/schema/UserConfig.json +46 -3
package/lib/AppConfig.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export interface AppConfig {
|
|
|
43
43
|
helpMessage?: string;
|
|
44
44
|
/**
|
|
45
45
|
* Settings to customize how packages are bundled.
|
|
46
|
+
* Later settings in the array take precedence over earlier ones.
|
|
46
47
|
*/
|
|
47
48
|
packageSettings?: PackageSettings[];
|
|
48
49
|
/**
|
|
@@ -75,10 +76,8 @@ export interface AppConfig {
|
|
|
75
76
|
neverExcludeDependencies?: string[];
|
|
76
77
|
/**
|
|
77
78
|
* Key value pairs of external bundler capabilities that can be enabled in the package settings.
|
|
78
|
-
* Key is the name of the capability, which will be used in
|
|
79
|
-
* Value is the import
|
|
80
|
-
*
|
|
81
|
-
* (Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)
|
|
79
|
+
* - Key is the name of the capability, which will be used in `PackageSettings.bundlerCapabilities`.
|
|
80
|
+
* - Value is the import specifier (local path or package name) for the capability module.
|
|
82
81
|
*/
|
|
83
82
|
bundlerCapabilitiesRegistry?: Record<string, string>;
|
|
84
83
|
}
|
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,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB
|
|
1
|
+
{"version":3,"file":"AppConfig.d.ts","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;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,iBAAiB,CAAC;IAEhC;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAE1B;;;;;OAKG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpC;;;;OAIG;IACH,2BAA2B,CAAC,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 { ServerConfig } from './ServerConfig.js';\nimport type { Features } from './Features.js';\nimport type { PackageSettings } from './PackageSettings.js';\nimport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nimport type { ShorthandRoute } from './Route.js';\nimport type { TelemetryConfig } from './TelemetryConfig.js';\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 * @deprecated - use \"server\" instead.\n */\n devServer?: ServerConfig;\n\n /**\n * Configuration for the dev server.\n */\n server?: ServerConfig;\n\n /**\n * Configuration for telemetry.\n */\n telemetry?: TelemetryConfig;\n\n /**\n * Enable additional Cloudpack features.\n */\n features?: Features;\n\n /**\n * Help message to display when Cloudpack starts up.\n */\n helpMessage?: string;\n\n /**\n * Settings to customize how packages are bundled.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * Commands to execute prior to Cloudpack bundling.\n * Each entry has a command and an array of arguments: `['command', ['arg1', 'arg2']]`.\n */\n dependsOn?: [string, string[]][];\n\n /**\n * Glob pattern to match `patch-package` patch files, relative to the project root\n * (usually the same as the repository root).\n * @default \"patches/*.patch\"\n */\n patchFilesGlobPattern?: string;\n\n /**\n * Azure Blob Storage configuration for remote cache - uploading and downloading packages\n * via `cloudpack sync`. If this is not provided, the remote cache will not be used.\n */\n remoteCache?: RemoteCacheConfig;\n\n /**\n * Defines what routes to support from the app server, and which scripts will be loaded\n * for each.\n */\n routes?: ShorthandRoute[];\n\n /**\n * Ignore these package names when calculating included and excluded dependencies.\n * This is mainly intended for helper packages such as `tslib`.\n *\n * Include `...` to merge with the default list (`tslib` and `@babel/runtime` as of writing).\n */\n neverExcludeDependencies?: string[];\n\n /**\n * Key value pairs of external bundler capabilities that can be enabled in the package settings.\n * Key is the name of the capability, which will be used in
|
|
1
|
+
{"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { ServerConfig } from './ServerConfig.js';\nimport type { Features } from './Features.js';\nimport type { PackageSettings } from './PackageSettings.js';\nimport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nimport type { ShorthandRoute } from './Route.js';\nimport type { TelemetryConfig } from './TelemetryConfig.js';\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 * @deprecated - use \"server\" instead.\n */\n devServer?: ServerConfig;\n\n /**\n * Configuration for the dev server.\n */\n server?: ServerConfig;\n\n /**\n * Configuration for telemetry.\n */\n telemetry?: TelemetryConfig;\n\n /**\n * Enable additional Cloudpack features.\n */\n features?: Features;\n\n /**\n * Help message to display when Cloudpack starts up.\n */\n helpMessage?: string;\n\n /**\n * Settings to customize how packages are bundled.\n * Later settings in the array take precedence over earlier ones.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * Commands to execute prior to Cloudpack bundling.\n * Each entry has a command and an array of arguments: `['command', ['arg1', 'arg2']]`.\n */\n dependsOn?: [string, string[]][];\n\n /**\n * Glob pattern to match `patch-package` patch files, relative to the project root\n * (usually the same as the repository root).\n * @default \"patches/*.patch\"\n */\n patchFilesGlobPattern?: string;\n\n /**\n * Azure Blob Storage configuration for remote cache - uploading and downloading packages\n * via `cloudpack sync`. If this is not provided, the remote cache will not be used.\n */\n remoteCache?: RemoteCacheConfig;\n\n /**\n * Defines what routes to support from the app server, and which scripts will be loaded\n * for each.\n */\n routes?: ShorthandRoute[];\n\n /**\n * Ignore these package names when calculating included and excluded dependencies.\n * This is mainly intended for helper packages such as `tslib`.\n *\n * Include `...` to merge with the default list (`tslib` and `@babel/runtime` as of writing).\n */\n neverExcludeDependencies?: string[];\n\n /**\n * Key value pairs of external bundler capabilities that can be enabled in the package settings.\n * - Key is the name of the capability, which will be used in `PackageSettings.bundlerCapabilities`.\n * - Value is the import specifier (local path or package name) for the capability module.\n */\n bundlerCapabilitiesRegistry?: Record<string, string>;\n}\n"]}
|
|
@@ -14,20 +14,12 @@ export type BundlerCapabilityFunction<TConfig, TOptions extends object> = (confi
|
|
|
14
14
|
* or any other type that the capability needs when enabled)
|
|
15
15
|
*/
|
|
16
16
|
export type BundlerCapability<TOptions extends object> = {
|
|
17
|
+
name: string;
|
|
17
18
|
description: string;
|
|
18
19
|
implementations: {
|
|
19
20
|
[bundler: string]: BundlerCapabilityFunction<unknown, TOptions>;
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
|
-
/**
|
|
23
|
-
* The metadata for a bundler capability.
|
|
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)
|
|
29
|
-
*/
|
|
30
|
-
export type BundlerCapabilityMetaData<TOptions extends object> = Omit<BundlerCapability<TOptions>, 'implementations'>;
|
|
31
23
|
/**
|
|
32
24
|
* This is the list of the bundler capabilities that cloudpack provides.
|
|
33
25
|
* - key: The name of the capability which will be used in the cloudpack config to enable the capability
|
|
@@ -50,27 +42,27 @@ export type InternalBundlerCapabilities = {
|
|
|
50
42
|
};
|
|
51
43
|
/**
|
|
52
44
|
* This is the type that's being used `PackageSettings` to enable/disable bundler capabilities.
|
|
53
|
-
*
|
|
54
|
-
*
|
|
45
|
+
* - Key: internal capability name
|
|
46
|
+
* - Value: options object to configure the capability, or false to disable it
|
|
55
47
|
*/
|
|
56
48
|
export type InternalBundlerCapabilitiesOptions = {
|
|
57
49
|
[key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;
|
|
58
50
|
};
|
|
59
51
|
type ExternalBundlerCapabilitiesOptions = Record<string, object | false>;
|
|
60
52
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
53
|
+
* Options used in `PackageSettings` to configure or disable bundler capabilities.
|
|
54
|
+
* - Key: capability name, either internal (Cloudpack-provided) or external (as specified in
|
|
55
|
+
* `AppConfig.bundlerCapabilitiesRegistry`)
|
|
56
|
+
* - Value: options object to configure the capability, or false to disable it.
|
|
64
57
|
*/
|
|
65
58
|
export type BundlerCapabilitiesOptions = InternalBundlerCapabilitiesOptions & ExternalBundlerCapabilitiesOptions;
|
|
66
59
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* This is used to generate the documentation for the bundler capabilities.
|
|
60
|
+
* Metadata for the bundler capabilities that cloudpack provides.
|
|
61
|
+
* - Key: capability name
|
|
62
|
+
* - Value: metadata object with description
|
|
71
63
|
*/
|
|
72
64
|
export type InternalBundlerCapabilitiesMetaData = {
|
|
73
|
-
[key in keyof InternalBundlerCapabilities]:
|
|
65
|
+
[key in keyof InternalBundlerCapabilities]: Pick<BundlerCapability<object>, 'description'>;
|
|
74
66
|
};
|
|
75
67
|
/**
|
|
76
68
|
* This is a bundler specific implementation of the internal bundler capabilities.
|
|
@@ -87,9 +79,7 @@ export type InternalBundlerCapabilityImplementations<TConfig> = {
|
|
|
87
79
|
* `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)
|
|
88
80
|
*/
|
|
89
81
|
export type ExternalBundlerCapabilityModule<TConfig extends object> = {
|
|
90
|
-
default: BundlerCapability<TConfig
|
|
91
|
-
name: string;
|
|
92
|
-
};
|
|
82
|
+
default: BundlerCapability<TConfig>;
|
|
93
83
|
};
|
|
94
84
|
export {};
|
|
95
85
|
//# sourceMappingURL=BundlerCapability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundlerCapability.d.ts","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"AAAA;;;;;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ACtF,CAAC;AAEF,KAAK,kCAAkC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,0BAA0B,GAAG,kCAAkC,GAAG,kCAAkC,CAAC;AAEjH;;;;GAIG;AACH,MAAM,MAAM,mCAAmC,GAAG;KAC/C,GAAG,IAAI,MAAM,2BAA2B,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;CAC3F,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,wCAAwC,CAAC,OAAO,IAAI;KAC7D,GAAG,IAAI,MAAM,2BAA2B,GAAG,yBAAyB,CAAC,OAAO,EAAE,2BAA2B,CAAC,GAAG,CAAC,CAAC;CACjH,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,+BAA+B,CAAC,OAAO,SAAS,MAAM,IAAI;IACpE,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;CACrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundlerCapability.js","sourceRoot":"","sources":["../src/BundlerCapability.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A function that takes a config object and options object and returns a new config object.\n * This is used to implement a bundler capability.\n *\n * - `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)\n * - `TOptions` is the type of the options object that's passed to the capability. (ie: `{ banner: string }`\n * or any other type that the capability needs when enabled)\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 *
|
|
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 name: string;\n description: string;\n implementations: {\n [bundler: string]: BundlerCapabilityFunction<unknown, TOptions>;\n };\n};\n\n/**\n * This is the list of the bundler capabilities that cloudpack provides.\n * - key: The name of the capability which will be used in the cloudpack config to enable the capability\n * - value: Options object which will be passed to the capability function\n */\nexport type InternalBundlerCapabilities = {\n /**\n * Inlines assets into the bundle.\n * Options: List of file extensions to inline. Do not include the leading dot.\n */\n 'asset-inline': { extensions: string[] };\n\n /**\n * Adds aliases to externalized packages.\n */\n alias: {\n [key: string]: string;\n };\n};\n\n/**\n * This is the type that's being used `PackageSettings` to enable/disable bundler capabilities.\n * - Key: internal capability name\n * - Value: options object to configure the capability, or false to disable it\n */\nexport type InternalBundlerCapabilitiesOptions = {\n [key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;\n};\n\ntype ExternalBundlerCapabilitiesOptions = Record<string, object | false>;\n\n/**\n * Options used in `PackageSettings` to configure or disable bundler capabilities.\n * - Key: capability name, either internal (Cloudpack-provided) or external (as specified in\n * `AppConfig.bundlerCapabilitiesRegistry`)\n * - Value: options object to configure the capability, or false to disable it.\n */\nexport type BundlerCapabilitiesOptions = InternalBundlerCapabilitiesOptions & ExternalBundlerCapabilitiesOptions;\n\n/**\n * Metadata for the bundler capabilities that cloudpack provides.\n * - Key: capability name\n * - Value: metadata object with description\n */\nexport type InternalBundlerCapabilitiesMetaData = {\n [key in keyof InternalBundlerCapabilities]: Pick<BundlerCapability<object>, 'description'>;\n};\n\n/**\n * This is a bundler specific implementation of the internal bundler capabilities.\n * It's a mapping from the capability name to the capability function.\n *\n * `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)\n */\nexport type InternalBundlerCapabilityImplementations<TConfig> = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityFunction<TConfig, InternalBundlerCapabilities[key]>;\n};\n\n/**\n * This is the type of the external bundler capability module that's being imported.\n *\n * `TConfig` is the type of the bundler's config object. (ie: `WebpackConfiguration`, `OriBuildOptions`, etc)\n */\nexport type ExternalBundlerCapabilityModule<TConfig extends object> = {\n default: BundlerCapability<TConfig>;\n};\n"]}
|
package/lib/CloudpackConfig.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { ServerConfig } from './ServerConfig.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* The merged result of user-provided and generated configuration for Cloudpack.
|
|
8
8
|
*/
|
|
9
|
-
export type CloudpackConfig = Omit<AppConfig, 'routes' | 'server'> & {
|
|
9
|
+
export type CloudpackConfig = Omit<AppConfig, 'routes' | 'server' | 'bundlerCapabilitiesRegistry'> & {
|
|
10
10
|
/**
|
|
11
11
|
* The path to the app's package.
|
|
12
12
|
*/
|
|
@@ -31,5 +31,11 @@ export type CloudpackConfig = Omit<AppConfig, 'routes' | 'server'> & {
|
|
|
31
31
|
* Routes which have been expanded from shorthand entries.
|
|
32
32
|
*/
|
|
33
33
|
routes?: Route[];
|
|
34
|
+
/**
|
|
35
|
+
* Key value pairs of external bundler capabilities that can be enabled in the package settings.
|
|
36
|
+
* - Key is the name of the capability, which will be used in `PackageSettings.bundlerCapabilities`.
|
|
37
|
+
* - Value is the absolute file URL of the capability implementation (resolved by `readAppConfig`).
|
|
38
|
+
*/
|
|
39
|
+
bundlerCapabilitiesRegistry?: Record<string, string>;
|
|
34
40
|
};
|
|
35
41
|
//# sourceMappingURL=CloudpackConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudpackConfig.d.ts","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;GAEG;AAEH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"CloudpackConfig.d.ts","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;GAEG;AAEH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,6BAA6B,CAAC,GAAG;IACnG;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAEtC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,SAAS,EAAE,eAAe,CAAC;IAE3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAE9C;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IAEjB;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudpackConfig.js","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { GeneratedConfig } from './GeneratedConfig.js';\nimport type { AppConfig } from './AppConfig.js';\nimport type { BundleMode } from './BundleMode.js';\nimport type { Route } from './Route.js';\nimport type { ServerConfig } from './ServerConfig.js';\n\n/**\n * The merged result of user-provided and generated configuration for Cloudpack.\n */\n\nexport type CloudpackConfig = Omit<AppConfig, 'routes' | 'server'> & {\n /**\n * The path to the app's package.\n */\n appPath: string;\n\n /**\n * Dev server settings.\n */\n server?: Omit<ServerConfig, 'routes'>;\n\n /**\n * Mode to run the app in.\n */\n mode: BundleMode;\n\n /**\n * Generated config settings.\n */\n generated: GeneratedConfig;\n\n /**\n * An immutable snapshot of the generated config as it is when start or init commands first begin\n */\n generatedSnapshot?: Readonly<GeneratedConfig>;\n\n /**\n * Routes which have been expanded from shorthand entries.\n */\n routes?: Route[];\n};\n"]}
|
|
1
|
+
{"version":3,"file":"CloudpackConfig.js","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { GeneratedConfig } from './GeneratedConfig.js';\nimport type { AppConfig } from './AppConfig.js';\nimport type { BundleMode } from './BundleMode.js';\nimport type { Route } from './Route.js';\nimport type { ServerConfig } from './ServerConfig.js';\n\n/**\n * The merged result of user-provided and generated configuration for Cloudpack.\n */\n\nexport type CloudpackConfig = Omit<AppConfig, 'routes' | 'server' | 'bundlerCapabilitiesRegistry'> & {\n /**\n * The path to the app's package.\n */\n appPath: string;\n\n /**\n * Dev server settings.\n */\n server?: Omit<ServerConfig, 'routes'>;\n\n /**\n * Mode to run the app in.\n */\n mode: BundleMode;\n\n /**\n * Generated config settings.\n */\n generated: GeneratedConfig;\n\n /**\n * An immutable snapshot of the generated config as it is when start or init commands first begin\n */\n generatedSnapshot?: Readonly<GeneratedConfig>;\n\n /**\n * Routes which have been expanded from shorthand entries.\n */\n routes?: Route[];\n\n /**\n * Key value pairs of external bundler capabilities that can be enabled in the package settings.\n * - Key is the name of the capability, which will be used in `PackageSettings.bundlerCapabilities`.\n * - Value is the absolute file URL of the capability implementation (resolved by `readAppConfig`).\n */\n bundlerCapabilitiesRegistry?: Record<string, string>;\n};\n"]}
|
package/lib/Route.d.ts
CHANGED
|
@@ -84,14 +84,32 @@ export interface RedirectRoute extends SharedRouteOptions {
|
|
|
84
84
|
*/
|
|
85
85
|
redirectTo: string;
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* A route that proxies requests to another server.
|
|
89
|
+
* This is handled by https://github.com/chimurai/http-proxy-middleware.
|
|
90
|
+
*/
|
|
91
|
+
export interface ProxyRoute extends SharedRouteOptions {
|
|
92
|
+
/**
|
|
93
|
+
* The target host to proxy to. (protocol + host).
|
|
94
|
+
*/
|
|
95
|
+
proxyTo: string;
|
|
96
|
+
/**
|
|
97
|
+
* For virtual hosted sites.
|
|
98
|
+
*/
|
|
99
|
+
changeOrigin?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Rewrite target's url path. Object-keys will be used as RegExp to match paths.
|
|
102
|
+
*/
|
|
103
|
+
pathRewrite?: Record<string, string>;
|
|
104
|
+
}
|
|
87
105
|
/**
|
|
88
106
|
* Route as specified in `AppConfig` (`cloudpack.config.json`).
|
|
89
107
|
*/
|
|
90
|
-
export type ShorthandRoute = ShorthandRenderedRoute | ShorthandBootstrapRoute | StaticRoute | RedirectRoute;
|
|
108
|
+
export type ShorthandRoute = ShorthandRenderedRoute | ShorthandBootstrapRoute | StaticRoute | RedirectRoute | ProxyRoute;
|
|
91
109
|
/**
|
|
92
110
|
* Processed route as used in the processed `CloudpackConfig`.
|
|
93
111
|
*/
|
|
94
|
-
export type Route = RenderedRoute | BootstrapRoute | StaticRoute | RedirectRoute;
|
|
112
|
+
export type Route = RenderedRoute | BootstrapRoute | StaticRoute | RedirectRoute | ProxyRoute;
|
|
95
113
|
/**
|
|
96
114
|
* Type guard to check if a route is a static route.
|
|
97
115
|
*/
|
|
@@ -113,4 +131,8 @@ export declare function isShorthandRenderedRoute(route: ShorthandRoute): route i
|
|
|
113
131
|
* Type guard to check if a route is a redirect route.
|
|
114
132
|
*/
|
|
115
133
|
export declare function isRedirectRoute(route: Route | ShorthandRoute): route is RedirectRoute;
|
|
134
|
+
/**
|
|
135
|
+
* Type guard to check if a route is a proxy route.
|
|
136
|
+
*/
|
|
137
|
+
export declare function isProxyRoute(route: Route | ShorthandRoute): route is ProxyRoute;
|
|
116
138
|
//# sourceMappingURL=Route.d.ts.map
|
package/lib/Route.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;;;OAWG;IACH,KAAK,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;CAClC;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WA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AE9F;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,GAAG,KAAK,IAAI,WAAW,CAEjF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,cAAc,CAEtE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,cAAc,GAAG,KAAK,IAAI,uBAAuB,CAEjG;AAKD,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,aAAa,CAGpE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,cAAc,GAAG,KAAK,IAAI,sBAAsB,CAE/F;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,GAAG,KAAK,IAAI,aAAa,CAErF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,cAAc,GAAG,KAAK,IAAI,UAAU,CAE/E"}
|
package/lib/Route.js
CHANGED
|
@@ -35,4 +35,10 @@ export function isShorthandRenderedRoute(route) {
|
|
|
35
35
|
export function isRedirectRoute(route) {
|
|
36
36
|
return 'redirectTo' in route;
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Type guard to check if a route is a proxy route.
|
|
40
|
+
*/
|
|
41
|
+
export function isProxyRoute(route) {
|
|
42
|
+
return 'proxyTo' in route;
|
|
43
|
+
}
|
|
38
44
|
//# sourceMappingURL=Route.js.map
|
package/lib/Route.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Route.js","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Route.js","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAoIA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAA6B;IACzD,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAY;IAC3C,OAAO,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAqB;IAC7D,OAAO,gBAAgB,CAAC,KAAc,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,MAAM,kBAAkB,GAAG,KAAsB,CAAC;IAClD,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,YAAY,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACrG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAqB;IAC5D,OAAO,eAAe,CAAC,KAAc,CAAC,IAAI,aAAa,IAAI,KAAK,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAA6B;IAC3D,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAA6B;IACxD,OAAO,SAAS,IAAI,KAAK,CAAC;AAC5B,CAAC","sourcesContent":["import type { ExpandedSourcePath } from './ExpandedSourcePath.js';\n\n/**\n * A route match can be a string path or an object with a path and domain.\n */\nexport type RouteMatch = string | { path: string; domain?: string };\n\nexport interface SharedRouteOptions {\n /**\n * The URL path to match. Paths should usually start with a slash, e.g. `'/my-route'`.\n * You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n *\n * See the [Express docs](https://expressjs.com/en/guide/routing.html#route-paths) for the full\n * supported routing syntax.\n *\n * If you need a route to match on a specific domain, you can pass an object (path, domain) in where\n * the domain is a string which can have wildcards (`*`). e.g. `'word.*'` will match `word.com`, `word.net`, etc.\n *\n * Use an array to handle multiple paths with the same route handler.\n */\n match: RouteMatch | RouteMatch[];\n}\n\n/**\n * A server-rendered route with optional shorthand `entry` info (as specified in `AppConfig`/`cloudpack.config.json`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport interface ShorthandRenderedRoute extends SharedRouteOptions {\n /**\n * Path to a .js or .html file (relative to the app path) for rendering the route.\n *\n * If a .js file, it must export a default function implementing `RenderFunction` from `@ms-cloudpack/common-types`.\n */\n renderScript?: string;\n\n /**\n * The key in the exports map which represents the entry point app script for this route.\n * @deprecated Use `entry` instead.\n */\n exportEntry?: string;\n\n /**\n * Additional source file path(s) to bundle and include in the HTML.\n * This **overwrites** any original exports map for the package.\n *\n * Usually this should be an actual source path, though it could also be an exports map key if necessary.\n */\n entry?: string | string[];\n}\n\n/**\n * A server-rendered route with full `entry` info (used in the processed `CloudpackConfig`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport type RenderedRoute = Omit<ShorthandRenderedRoute, 'exportEntry' | 'entry'> & {\n /**\n * The source entry or entries to be included on the page for this route.\n */\n entry?: ExpandedSourcePath[];\n};\n\n/**\n * A route with a staticPath property serves static files from the specified path.\n */\nexport interface StaticRoute extends SharedRouteOptions {\n /**\n * The path relative to the app root to static assets.\n */\n staticPath: string;\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface ShorthandBootstrapRoute\n extends SharedRouteOptions,\n Pick<ShorthandRenderedRoute, 'entry' | 'exportEntry'> {\n type: 'bootstrap';\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface BootstrapRoute extends Omit<ShorthandBootstrapRoute, 'entry'>, Pick<RenderedRoute, 'entry'> {}\n\n/**\n * A route that redirects to another url.\n */\nexport interface RedirectRoute extends SharedRouteOptions {\n /**\n * The url to redirect to.\n */\n redirectTo: string;\n}\n\n/**\n * A route that proxies requests to another server.\n * This is handled by https://github.com/chimurai/http-proxy-middleware.\n */\nexport interface ProxyRoute extends SharedRouteOptions {\n /**\n * The target host to proxy to. (protocol + host).\n */\n proxyTo: string;\n\n /**\n * For virtual hosted sites.\n */\n changeOrigin?: boolean;\n /**\n * Rewrite target's url path. Object-keys will be used as RegExp to match paths.\n */\n pathRewrite?: Record<string, string>;\n}\n\n/**\n * Route as specified in `AppConfig` (`cloudpack.config.json`).\n */\n// WARNING: Be sure to add new route types to Route as well!\nexport type ShorthandRoute =\n | ShorthandRenderedRoute\n | ShorthandBootstrapRoute\n | StaticRoute\n | RedirectRoute\n | ProxyRoute;\n\n/**\n * Processed route as used in the processed `CloudpackConfig`.\n */\n// WARNING: Be sure to add new route types to ShorthandRoute as well!\nexport type Route = RenderedRoute | BootstrapRoute | StaticRoute | RedirectRoute | ProxyRoute;\n\n/**\n * Type guard to check if a route is a static route.\n */\nexport function isStaticRoute(route: Route | ShorthandRoute): route is StaticRoute {\n return 'staticPath' in route;\n}\n\n/**\n * Type guard to check if a route is a bootstrap route.\n */\nexport function isBootstrapRoute(route: Route): route is BootstrapRoute {\n return 'type' in route && route.type === 'bootstrap';\n}\n\n/**\n * Type guard to check if a route is a shorthand bootstrap route.\n */\nexport function isShorthandBootstrapRoute(route: ShorthandRoute): route is ShorthandBootstrapRoute {\n return isBootstrapRoute(route as Route);\n}\n\n/*\n * Type guard to check if a route is a rendered route.\n */\nexport function isRenderedRoute(route: Route): route is RenderedRoute {\n const maybeRenderedRoute = route as RenderedRoute;\n return !isBootstrapRoute(route) && !!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry);\n}\n\n/**\n * Type guard to check if a route is a shorthand rendered route.\n */\nexport function isShorthandRenderedRoute(route: ShorthandRoute): route is ShorthandRenderedRoute {\n return isRenderedRoute(route as Route) || 'exportEntry' in route;\n}\n\n/**\n * Type guard to check if a route is a redirect route.\n */\nexport function isRedirectRoute(route: Route | ShorthandRoute): route is RedirectRoute {\n return 'redirectTo' in route;\n}\n\n/**\n * Type guard to check if a route is a proxy route.\n */\nexport function isProxyRoute(route: Route | ShorthandRoute): route is ProxyRoute {\n return 'proxyTo' in route;\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -22,11 +22,11 @@ export type { LinkOptions } from './LinkOptions.js';
|
|
|
22
22
|
export type { ModuleType } from './ModuleType.js';
|
|
23
23
|
export type { PackageHashesCache, PackageHashOptions } from './PackageHashesCache.js';
|
|
24
24
|
export type { PackageSettings, PackageSettingsMatch, PackageSettingsMatchObject, GeneratedPackageSettings, } from './PackageSettings.js';
|
|
25
|
-
export type { BootstrapRoute, RedirectRoute, RenderedRoute, Route, RouteMatch, SharedRouteOptions, ShorthandRenderedRoute, ShorthandBootstrapRoute, ShorthandRoute, StaticRoute, } from './Route.js';
|
|
26
|
-
export { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute, isShorthandBootstrapRoute, isShorthandRenderedRoute, } from './Route.js';
|
|
25
|
+
export type { BootstrapRoute, ProxyRoute, RedirectRoute, RenderedRoute, Route, RouteMatch, SharedRouteOptions, ShorthandRenderedRoute, ShorthandBootstrapRoute, ShorthandRoute, StaticRoute, } from './Route.js';
|
|
26
|
+
export { isBootstrapRoute, isProxyRoute, isRenderedRoute, isStaticRoute, isRedirectRoute, isShorthandBootstrapRoute, isShorthandRenderedRoute, } from './Route.js';
|
|
27
27
|
export type { TelemetryConfig } from './TelemetryConfig.js';
|
|
28
28
|
export type { AppConfig } from './AppConfig.js';
|
|
29
|
-
export type { InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, ExternalBundlerCapabilityModule, BundlerCapabilityFunction, } from './BundlerCapability.js';
|
|
29
|
+
export type { BundlerCapability, InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, ExternalBundlerCapabilityModule, BundlerCapabilityFunction, } from './BundlerCapability.js';
|
|
30
30
|
export type { RemoteCacheConfig } from './RemoteCacheConfig.js';
|
|
31
31
|
export type { RenderFunction, RenderFunctionOptions, RenderFunctionResult, ExpandedRenderFunctionResult, RenderFunctionScript, } from './RenderFunction.js';
|
|
32
32
|
export type { Request, Response, RequestHandler } from 'express';
|
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,iCAAiC,EACjC,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,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,YAA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C5C,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { allFeatures } from './allFeatures.js';
|
|
2
|
-
export { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute, isShorthandBootstrapRoute, isShorthandRenderedRoute, } from './Route.js';
|
|
2
|
+
export { isBootstrapRoute, isProxyRoute, isRenderedRoute, isStaticRoute, isRedirectRoute, isShorthandBootstrapRoute, isShorthandRenderedRoute, } from './Route.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
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;AAyD/C,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,eAAe,EACf,yBAAyB,EACzB,wBAAwB,GACzB,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 { BundlerResult } from './BundlerResult.js';\nexport type { Bundler } from './Bundler.js';\nexport type { CloudpackConfig } from './CloudpackConfig.js';\nexport type { ServerConfig } from './ServerConfig.js';\nexport type { ExpandedSourcePath } from './ExpandedSourcePath.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 { LinkOptions } from './LinkOptions.js';\nexport type { ModuleType } from './ModuleType.js';\nexport type { PackageHashesCache, PackageHashOptions } from './PackageHashesCache.js';\nexport type {\n PackageSettings,\n PackageSettingsMatch,\n PackageSettingsMatchObject,\n GeneratedPackageSettings,\n} from './PackageSettings.js';\nexport type {\n BootstrapRoute,\n ProxyRoute,\n RedirectRoute,\n RenderedRoute,\n Route,\n RouteMatch,\n SharedRouteOptions,\n ShorthandRenderedRoute,\n ShorthandBootstrapRoute,\n ShorthandRoute,\n StaticRoute,\n} from './Route.js';\nexport {\n isBootstrapRoute,\n isProxyRoute,\n isRenderedRoute,\n isStaticRoute,\n isRedirectRoute,\n isShorthandBootstrapRoute,\n isShorthandRenderedRoute,\n} from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n BundlerCapability,\n InternalBundlerCapabilityImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n ExternalBundlerCapabilityModule,\n BundlerCapabilityFunction,\n} from './BundlerCapability.js';\nexport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nexport type {\n RenderFunction,\n RenderFunctionOptions,\n RenderFunctionResult,\n ExpandedRenderFunctionResult,\n RenderFunctionScript,\n} from './RenderFunction.js';\nexport type { Request, Response, RequestHandler } from 'express';\nexport type { Session } from './Session.js';\nexport type { ResolveMap } from './ResolveMap.js';\nexport type { ResolveMapEntry } from './ResolveMapEntry.js';\nexport type { LinkedPath } from './LinkedPath.js';\nexport type { ImportMap } from './ImportMap.js';\nexport type { UserPreferences } from './UserPreferences.js';\n"]}
|
package/package.json
CHANGED
package/schema/AppConfig.json
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"items": {
|
|
42
42
|
"$ref": "#/definitions/PackageSettings"
|
|
43
43
|
},
|
|
44
|
-
"description": "Settings to customize how packages are bundled."
|
|
44
|
+
"description": "Settings to customize how packages are bundled. Later settings in the array take precedence over earlier ones."
|
|
45
45
|
},
|
|
46
46
|
"dependsOn": {
|
|
47
47
|
"type": "array",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"additionalProperties": {
|
|
92
92
|
"type": "string"
|
|
93
93
|
},
|
|
94
|
-
"description": "Key value pairs of external bundler capabilities that can be enabled in the package settings
|
|
94
|
+
"description": "Key value pairs of external bundler capabilities that can be enabled in the package settings.\n- Key is the name of the capability, which will be used in `PackageSettings.bundlerCapabilities`.\n- Value is the import specifier (local path or package name) for the capability module."
|
|
95
95
|
},
|
|
96
96
|
"$schema": {
|
|
97
97
|
"type": "string"
|
|
@@ -513,6 +513,9 @@
|
|
|
513
513
|
},
|
|
514
514
|
{
|
|
515
515
|
"$ref": "#/definitions/RedirectRoute"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"$ref": "#/definitions/ProxyRoute"
|
|
516
519
|
}
|
|
517
520
|
],
|
|
518
521
|
"description": "Route as specified in `AppConfig` (`cloudpack.config.json`)."
|
|
@@ -693,6 +696,46 @@
|
|
|
693
696
|
"additionalProperties": false,
|
|
694
697
|
"description": "A route that redirects to another url."
|
|
695
698
|
},
|
|
699
|
+
"ProxyRoute": {
|
|
700
|
+
"type": "object",
|
|
701
|
+
"properties": {
|
|
702
|
+
"match": {
|
|
703
|
+
"anyOf": [
|
|
704
|
+
{
|
|
705
|
+
"$ref": "#/definitions/RouteMatch"
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
"type": "array",
|
|
709
|
+
"items": {
|
|
710
|
+
"$ref": "#/definitions/RouteMatch"
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
],
|
|
714
|
+
"description": "The URL path to match. Paths should usually start with a slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n\nSee the [Express docs](https://expressjs.com/en/guide/routing.html#route-paths) for the full supported routing syntax.\n\nIf you need a route to match on a specific domain, you can pass an object (path, domain) in where the domain is a string which can have wildcards (`*`). e.g. `'word.*'` will match `word.com`, `word.net`, etc.\n\nUse an array to handle multiple paths with the same route handler."
|
|
715
|
+
},
|
|
716
|
+
"proxyTo": {
|
|
717
|
+
"type": "string",
|
|
718
|
+
"description": "The target host to proxy to. (protocol + host)."
|
|
719
|
+
},
|
|
720
|
+
"changeOrigin": {
|
|
721
|
+
"type": "boolean",
|
|
722
|
+
"description": "For virtual hosted sites."
|
|
723
|
+
},
|
|
724
|
+
"pathRewrite": {
|
|
725
|
+
"type": "object",
|
|
726
|
+
"additionalProperties": {
|
|
727
|
+
"type": "string"
|
|
728
|
+
},
|
|
729
|
+
"description": "Rewrite target's url path. Object-keys will be used as RegExp to match paths."
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
"required": [
|
|
733
|
+
"match",
|
|
734
|
+
"proxyTo"
|
|
735
|
+
],
|
|
736
|
+
"additionalProperties": false,
|
|
737
|
+
"description": "A route that proxies requests to another server. This is handled by https://github.com/chimurai/http-proxy-middleware."
|
|
738
|
+
},
|
|
696
739
|
"TelemetryConfig": {
|
|
697
740
|
"type": "object",
|
|
698
741
|
"properties": {
|
|
@@ -1033,7 +1076,7 @@
|
|
|
1033
1076
|
]
|
|
1034
1077
|
}
|
|
1035
1078
|
},
|
|
1036
|
-
"description": "
|
|
1079
|
+
"description": "Options used in `PackageSettings` to configure or disable bundler capabilities.\n- Key: capability name, either internal (Cloudpack-provided) or external (as specified in `AppConfig.bundlerCapabilitiesRegistry`)\n- Value: options object to configure the capability, or false to disable it."
|
|
1037
1080
|
},
|
|
1038
1081
|
"RemoteCacheConfig": {
|
|
1039
1082
|
"type": "object",
|
package/schema/UserConfig.json
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"items": {
|
|
46
46
|
"$ref": "#/definitions/PackageSettings"
|
|
47
47
|
},
|
|
48
|
-
"description": "Settings to customize how packages are bundled."
|
|
48
|
+
"description": "Settings to customize how packages are bundled. Later settings in the array take precedence over earlier ones."
|
|
49
49
|
},
|
|
50
50
|
"dependsOn": {
|
|
51
51
|
"type": "array",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"additionalProperties": {
|
|
96
96
|
"type": "string"
|
|
97
97
|
},
|
|
98
|
-
"description": "Key value pairs of external bundler capabilities that can be enabled in the package settings
|
|
98
|
+
"description": "Key value pairs of external bundler capabilities that can be enabled in the package settings.\n- Key is the name of the capability, which will be used in `PackageSettings.bundlerCapabilities`.\n- Value is the import specifier (local path or package name) for the capability module."
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
"additionalProperties": false,
|
|
@@ -514,6 +514,9 @@
|
|
|
514
514
|
},
|
|
515
515
|
{
|
|
516
516
|
"$ref": "#/definitions/RedirectRoute"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"$ref": "#/definitions/ProxyRoute"
|
|
517
520
|
}
|
|
518
521
|
],
|
|
519
522
|
"description": "Route as specified in `AppConfig` (`cloudpack.config.json`)."
|
|
@@ -694,6 +697,46 @@
|
|
|
694
697
|
"additionalProperties": false,
|
|
695
698
|
"description": "A route that redirects to another url."
|
|
696
699
|
},
|
|
700
|
+
"ProxyRoute": {
|
|
701
|
+
"type": "object",
|
|
702
|
+
"properties": {
|
|
703
|
+
"match": {
|
|
704
|
+
"anyOf": [
|
|
705
|
+
{
|
|
706
|
+
"$ref": "#/definitions/RouteMatch"
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
"type": "array",
|
|
710
|
+
"items": {
|
|
711
|
+
"$ref": "#/definitions/RouteMatch"
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
],
|
|
715
|
+
"description": "The URL path to match. Paths should usually start with a slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n\nSee the [Express docs](https://expressjs.com/en/guide/routing.html#route-paths) for the full supported routing syntax.\n\nIf you need a route to match on a specific domain, you can pass an object (path, domain) in where the domain is a string which can have wildcards (`*`). e.g. `'word.*'` will match `word.com`, `word.net`, etc.\n\nUse an array to handle multiple paths with the same route handler."
|
|
716
|
+
},
|
|
717
|
+
"proxyTo": {
|
|
718
|
+
"type": "string",
|
|
719
|
+
"description": "The target host to proxy to. (protocol + host)."
|
|
720
|
+
},
|
|
721
|
+
"changeOrigin": {
|
|
722
|
+
"type": "boolean",
|
|
723
|
+
"description": "For virtual hosted sites."
|
|
724
|
+
},
|
|
725
|
+
"pathRewrite": {
|
|
726
|
+
"type": "object",
|
|
727
|
+
"additionalProperties": {
|
|
728
|
+
"type": "string"
|
|
729
|
+
},
|
|
730
|
+
"description": "Rewrite target's url path. Object-keys will be used as RegExp to match paths."
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
"required": [
|
|
734
|
+
"match",
|
|
735
|
+
"proxyTo"
|
|
736
|
+
],
|
|
737
|
+
"additionalProperties": false,
|
|
738
|
+
"description": "A route that proxies requests to another server. This is handled by https://github.com/chimurai/http-proxy-middleware."
|
|
739
|
+
},
|
|
697
740
|
"TelemetryConfig": {
|
|
698
741
|
"type": "object",
|
|
699
742
|
"properties": {
|
|
@@ -1034,7 +1077,7 @@
|
|
|
1034
1077
|
]
|
|
1035
1078
|
}
|
|
1036
1079
|
},
|
|
1037
|
-
"description": "
|
|
1080
|
+
"description": "Options used in `PackageSettings` to configure or disable bundler capabilities.\n- Key: capability name, either internal (Cloudpack-provided) or external (as specified in `AppConfig.bundlerCapabilitiesRegistry`)\n- Value: options object to configure the capability, or false to disable it."
|
|
1038
1081
|
},
|
|
1039
1082
|
"RemoteCacheConfig": {
|
|
1040
1083
|
"type": "object",
|