@ms-cloudpack/common-types 0.11.0 → 0.13.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/BundleMessage.d.ts +2 -0
- package/lib/BundleMessage.d.ts.map +1 -1
- package/lib/BundleMessage.js.map +1 -1
- package/lib/BundleMessageLocation.d.ts +1 -0
- package/lib/BundleMessageLocation.d.ts.map +1 -1
- package/lib/BundleMessageLocation.js.map +1 -1
- package/lib/BundleMessageNote.d.ts +2 -0
- package/lib/BundleMessageNote.d.ts.map +1 -1
- package/lib/BundleMessageNote.js.map +1 -1
- package/lib/BundleOptions.d.ts +5 -32
- package/lib/BundleOptions.d.ts.map +1 -1
- package/lib/BundleOptions.js.map +1 -1
- package/lib/BundleResult.d.ts +7 -0
- package/lib/BundleResult.d.ts.map +1 -1
- package/lib/BundleResult.js.map +1 -1
- package/lib/BundlerCapability.d.ts +59 -0
- package/lib/BundlerCapability.d.ts.map +1 -0
- package/lib/BundlerCapability.js +2 -0
- package/lib/BundlerCapability.js.map +1 -0
- package/lib/DevServer.d.ts +1 -1
- package/lib/DevServer.js.map +1 -1
- package/lib/PackageJson.d.ts +8 -1
- package/lib/PackageJson.d.ts.map +1 -1
- package/lib/PackageJson.js.map +1 -1
- package/lib/PackageSettings.d.ts +17 -1
- package/lib/PackageSettings.d.ts.map +1 -1
- package/lib/PackageSettings.js.map +1 -1
- package/lib/Route.d.ts +40 -10
- package/lib/Route.d.ts.map +1 -1
- package/lib/Route.js +12 -4
- package/lib/Route.js.map +1 -1
- package/lib/index.d.ts +3 -2
- 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 +126 -19
- package/schema/GeneratedConfig.json +52 -5
- package/schema/UserConfig.json +126 -19
package/lib/BundleMessage.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { BundleMessageNote } from './BundleMessageNote.js';
|
|
2
2
|
import type { BundleMessageLocation } from './BundleMessageLocation.js';
|
|
3
|
+
/** Error or warning message generated while bundling. */
|
|
3
4
|
export interface BundleMessage {
|
|
4
5
|
text: string;
|
|
5
6
|
/** Bundler or step that generated this message. */
|
|
6
7
|
source: string;
|
|
8
|
+
/** File location the issue originated from. */
|
|
7
9
|
location?: BundleMessageLocation;
|
|
8
10
|
notes?: BundleMessageNote[];
|
|
9
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleMessage.d.ts","sourceRoot":"","sources":["../src/BundleMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC7B"}
|
|
1
|
+
{"version":3,"file":"BundleMessage.d.ts","sourceRoot":"","sources":["../src/BundleMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC7B"}
|
package/lib/BundleMessage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleMessage.js","sourceRoot":"","sources":["../src/BundleMessage.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMessageNote } from './BundleMessageNote.js';\nimport type { BundleMessageLocation } from './BundleMessageLocation.js';\n\nexport interface BundleMessage {\n text: string;\n /** Bundler or step that generated this message. */\n source: string;\n location?: BundleMessageLocation;\n notes?: BundleMessageNote[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BundleMessage.js","sourceRoot":"","sources":["../src/BundleMessage.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMessageNote } from './BundleMessageNote.js';\nimport type { BundleMessageLocation } from './BundleMessageLocation.js';\n\n/** Error or warning message generated while bundling. */\nexport interface BundleMessage {\n text: string;\n /** Bundler or step that generated this message. */\n source: string;\n /** File location the issue originated from. */\n location?: BundleMessageLocation;\n notes?: BundleMessageNote[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleMessageLocation.d.ts","sourceRoot":"","sources":["../src/BundleMessageLocation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IAEb,cAAc;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
1
|
+
{"version":3,"file":"BundleMessageLocation.d.ts","sourceRoot":"","sources":["../src/BundleMessageLocation.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IAEb,cAAc;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleMessageLocation.js","sourceRoot":"","sources":["../src/BundleMessageLocation.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"BundleMessageLocation.js","sourceRoot":"","sources":["../src/BundleMessageLocation.ts"],"names":[],"mappings":"","sourcesContent":["/** File location a warning or error originated from. */\nexport interface BundleMessageLocation {\n /** Path to file, relative to package root */\n file: string;\n\n /** 1-based */\n line?: number;\n\n /** 0-based, in bytes */\n column?: number;\n}\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { BundleMessageLocation } from './BundleMessageLocation.js';
|
|
2
|
+
/** Additional information about a bundle warning or error. */
|
|
2
3
|
export interface BundleMessageNote {
|
|
3
4
|
text: string;
|
|
5
|
+
/** File location the issue originated from. */
|
|
4
6
|
location?: BundleMessageLocation;
|
|
5
7
|
}
|
|
6
8
|
//# sourceMappingURL=BundleMessageNote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleMessageNote.d.ts","sourceRoot":"","sources":["../src/BundleMessageNote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC"}
|
|
1
|
+
{"version":3,"file":"BundleMessageNote.d.ts","sourceRoot":"","sources":["../src/BundleMessageNote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,8DAA8D;AAC9D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleMessageNote.js","sourceRoot":"","sources":["../src/BundleMessageNote.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMessageLocation } from './BundleMessageLocation.js';\n\nexport interface BundleMessageNote {\n text: string;\n location?: BundleMessageLocation;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BundleMessageNote.js","sourceRoot":"","sources":["../src/BundleMessageNote.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMessageLocation } from './BundleMessageLocation.js';\n\n/** Additional information about a bundle warning or error. */\nexport interface BundleMessageNote {\n text: string;\n /** File location the issue originated from. */\n location?: BundleMessageLocation;\n}\n"]}
|
package/lib/BundleOptions.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { PackageSettings } from './PackageSettings.js';
|
|
1
2
|
/**
|
|
2
|
-
* Options
|
|
3
|
+
* Options for creating bundles with a bundler plugin.
|
|
3
4
|
*/
|
|
4
|
-
export interface BundleOptions {
|
|
5
|
+
export interface BundleOptions extends Pick<PackageSettings, 'bundler' | 'bundlerOptions' | 'dynamicImports' | 'ignoredBundlerWarnings' | 'bundlerCapabilities'> {
|
|
5
6
|
/**
|
|
6
7
|
* The absolute input path for the entry points.
|
|
7
8
|
*/
|
|
@@ -21,7 +22,7 @@ export interface BundleOptions {
|
|
|
21
22
|
*/
|
|
22
23
|
outputPath?: string;
|
|
23
24
|
/**
|
|
24
|
-
* List of dependencies which should be externalized.
|
|
25
|
+
* List of dependencies which should be externalized.
|
|
25
26
|
*/
|
|
26
27
|
external?: string[];
|
|
27
28
|
/**
|
|
@@ -35,7 +36,7 @@ export interface BundleOptions {
|
|
|
35
36
|
/**
|
|
36
37
|
* If true, will generate sourcemap files for the output. This has a tax on performance.
|
|
37
38
|
* Defaults to true unless the `disableSourceMaps` feature is enabled.
|
|
38
|
-
* (To set a bundler-specific sourcemap option, use `
|
|
39
|
+
* (To set a bundler-specific sourcemap option, use `bundlerOptions`.)
|
|
39
40
|
*/
|
|
40
41
|
sourcemap?: boolean;
|
|
41
42
|
/**
|
|
@@ -44,33 +45,5 @@ export interface BundleOptions {
|
|
|
44
45
|
* to `dispose` if returned.
|
|
45
46
|
*/
|
|
46
47
|
incremental?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* If specified, will use a specific bundler type. This is not recommended unless there is a clear reason to hardcode
|
|
49
|
-
* the bundler type.
|
|
50
|
-
*/
|
|
51
|
-
bundlerType?: string;
|
|
52
|
-
/**
|
|
53
|
-
* Only relevant for packages bundled with rollup: globs of files that include dynamic (async)
|
|
54
|
-
* imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to
|
|
55
|
-
* that plugin's [limitations](https://www.npmjs.com/package/\@rollup/plugin-dynamic-import-vars#limitations)).
|
|
56
|
-
* Files matching `*.dynamic.*` are automatically included.
|
|
57
|
-
*
|
|
58
|
-
* This is not needed for ori/esbuild and webpack because they should handle these types of imports automatically.
|
|
59
|
-
*/
|
|
60
|
-
dynamicImports?: string[];
|
|
61
|
-
/**
|
|
62
|
-
* Suppress these warning messages from the bundler (partial string matches).
|
|
63
|
-
* This is intended for non-actionable messages from external dependencies which can't easily
|
|
64
|
-
* be fixed, to avoid confusing users.
|
|
65
|
-
*/
|
|
66
|
-
ignoredBundlerWarnings?: string[];
|
|
67
|
-
/**
|
|
68
|
-
* Any bundler-specific options to be merged with the calculated bundler options.
|
|
69
|
-
* `bundlerType` is also required if this is specified.
|
|
70
|
-
*
|
|
71
|
-
* This is an escape hatch which is generally not recommended, since it locks the package to
|
|
72
|
-
* a specific bundler implementation.
|
|
73
|
-
*/
|
|
74
|
-
overrideOptions?: Readonly<Record<string, unknown>>;
|
|
75
48
|
}
|
|
76
49
|
//# sourceMappingURL=BundleOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleOptions.d.ts","sourceRoot":"","sources":["../src/BundleOptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"BundleOptions.d.ts","sourceRoot":"","sources":["../src/BundleOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,aACf,SAAQ,IAAI,CACV,eAAe,EACf,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,wBAAwB,GAAG,qBAAqB,CACnG;IACD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
package/lib/BundleOptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleOptions.js","sourceRoot":"","sources":["../src/BundleOptions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Options
|
|
1
|
+
{"version":3,"file":"BundleOptions.js","sourceRoot":"","sources":["../src/BundleOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageSettings } from './PackageSettings.js';\n\n/**\n * Options for creating bundles with a bundler plugin.\n */\nexport interface BundleOptions\n extends Pick<\n PackageSettings,\n 'bundler' | 'bundlerOptions' | 'dynamicImports' | 'ignoredBundlerWarnings' | 'bundlerCapabilities'\n > {\n /**\n * The absolute input path for the entry points.\n */\n inputPath: string;\n\n /**\n * The entry point paths map. Key is path to the output file, relative to `outputPath` and stripped of `.js`\n * extension. Value is the input entry path, relative to `inputPath` including the extension. For example:\n * `{ 'lib/index': 'src/index.js' }`\n *\n * Note: Non-javascript extensions, such as `.css` or `.scss`, will not be stripped from the key.\n * This is to ensure the bundler keeps the original extension intact and adds `.js` after it.\n */\n entries: Record<string, string>;\n\n /**\n * The output path for bundled files. This can be either relative to `inputPath`, or absolute.\n * Defaults to `inputPath`.\n */\n outputPath?: string;\n\n /**\n * List of dependencies which should be externalized.\n */\n external?: string[];\n\n /**\n * List of dependencies which should be inlined.\n */\n inlined?: string[];\n\n /**\n * If true, minify the output.\n */\n minify?: boolean;\n\n /**\n * If true, will generate sourcemap files for the output. This has a tax on performance.\n * Defaults to true unless the `disableSourceMaps` feature is enabled.\n * (To set a bundler-specific sourcemap option, use `bundlerOptions`.)\n */\n sourcemap?: boolean;\n\n /**\n * If true, the bundler is expected to stay alive and take requests to rebuild on demand. File watching is\n * managed at a higher layer. When we no longer care about incremental bundling, the bundler will receive a call\n * to `dispose` if returned.\n */\n incremental?: boolean;\n}\n"]}
|
package/lib/BundleResult.d.ts
CHANGED
|
@@ -6,6 +6,13 @@ export interface BundleResult extends Omit<BundlerPluginResult, 'rebuild' | 'raw
|
|
|
6
6
|
/**
|
|
7
7
|
* The name of the bundler used. Will be set unless there was an error with the options.
|
|
8
8
|
*/
|
|
9
|
+
bundler?: string;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Replaced by `bundler`.
|
|
12
|
+
*
|
|
13
|
+
* This and the translation code in `readResultFromCache` should be removed sometime when
|
|
14
|
+
* we have to bump the hash version.
|
|
15
|
+
*/
|
|
9
16
|
bundlerName?: string;
|
|
10
17
|
/**
|
|
11
18
|
* The absolute input path of the entries.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleResult.d.ts","sourceRoot":"","sources":["../src/BundleResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE;;GAEG;AAGH,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;IACnG;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;CACvC"}
|
|
1
|
+
{"version":3,"file":"BundleResult.d.ts","sourceRoot":"","sources":["../src/BundleResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE;;GAEG;AAGH,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;IACnG;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;CACvC"}
|
package/lib/BundleResult.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BundleResult.js","sourceRoot":"","sources":["../src/BundleResult.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundlerPluginResult } from './BundlerPluginResult.js';\n\n/**\n * Final bundle result as returned by `bundle()` in `@ms-cloudpack/bundler`.\n */\n// rawInput and rawOutput are intentionally removed.\n// rebuild is wrapped to return a full BundleResult.\nexport interface BundleResult extends Omit<BundlerPluginResult, 'rebuild' | 'rawInput' | 'rawOutput'> {\n /**\n * The name of the bundler used. Will be set unless there was an error with the options.\n */\n bundlerName?: string;\n\n /**\n * The absolute input path of the entries.\n */\n inputPath: string;\n\n /**\n * The entry file paths map used to create the bundle output. See `BundleOptions.entries`.\n */\n entries?: Record<string, string>;\n\n /**\n * If incremental bundling is specified, provide a way to rebuild the project.\n */\n rebuild?: () => Promise<BundleResult>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"BundleResult.js","sourceRoot":"","sources":["../src/BundleResult.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundlerPluginResult } from './BundlerPluginResult.js';\n\n/**\n * Final bundle result as returned by `bundle()` in `@ms-cloudpack/bundler`.\n */\n// rawInput and rawOutput are intentionally removed.\n// rebuild is wrapped to return a full BundleResult.\nexport interface BundleResult extends Omit<BundlerPluginResult, 'rebuild' | 'rawInput' | 'rawOutput'> {\n /**\n * The name of the bundler used. Will be set unless there was an error with the options.\n */\n bundler?: string;\n\n /**\n * @deprecated Replaced by `bundler`.\n *\n * This and the translation code in `readResultFromCache` should be removed sometime when\n * we have to bump the hash version.\n */\n bundlerName?: string;\n\n /**\n * The absolute input path of the entries.\n */\n inputPath: string;\n\n /**\n * The entry file paths map used to create the bundle output. See `BundleOptions.entries`.\n */\n entries?: Record<string, string>;\n\n /**\n * If incremental bundling is specified, provide a way to rebuild the project.\n */\n rebuild?: () => Promise<BundleResult>;\n}\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A function that takes a config object and options object and returns a new config object.
|
|
3
|
+
* This is used to implement a bundler capability.
|
|
4
|
+
*/
|
|
5
|
+
type BundlerCapabilityFn<TConfig, TOptions extends object> = (config: TConfig, options: TOptions) => TConfig;
|
|
6
|
+
/**
|
|
7
|
+
* A bundler capability is a feature that can be enabled for a package to modify the bundling process.
|
|
8
|
+
*/
|
|
9
|
+
export type BundlerCapability<TOptions extends object> = {
|
|
10
|
+
description: string;
|
|
11
|
+
implementations: {
|
|
12
|
+
[bundler: string]: BundlerCapabilityFn<unknown, TOptions>;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The metadata for a bundler capability.
|
|
17
|
+
* It's the same as the BundlerCapability but without the implementations. This is used to split the definition and the bundler specific implementations.
|
|
18
|
+
*/
|
|
19
|
+
export type BundlerCapabilityMetaData<TOptions extends object> = Omit<BundlerCapability<TOptions>, 'implementations'>;
|
|
20
|
+
/**
|
|
21
|
+
* This is the list of the bundler capabilities that cloudpack provides.
|
|
22
|
+
* key: The name of the capability which will be used in the cloudpack config to enable the capability
|
|
23
|
+
* value: Options object which will be passed to the capability function
|
|
24
|
+
*/
|
|
25
|
+
export type InternalBundlerCapabilities = {
|
|
26
|
+
/**
|
|
27
|
+
* Inlines assets into the bundle.
|
|
28
|
+
* Options: List of file extensions to inline. Do not include the leading dot.
|
|
29
|
+
*/
|
|
30
|
+
'asset-inline': {
|
|
31
|
+
extensions: string[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* This is the type that's being used PackageSettings to enable/disable bundler capabilities.
|
|
36
|
+
* It's a partial of the InternalBundlerCapabilities with the value being the options object or false.
|
|
37
|
+
* If the value is false, the capability will be disabled for the package.
|
|
38
|
+
*/
|
|
39
|
+
export type BundlerCapabilitiesOptions = {
|
|
40
|
+
[key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* This is the metadata for the bundler capabilities that cloudpack provides.
|
|
44
|
+
* It's a mapping from the capability name to the metadata object.
|
|
45
|
+
* The metadata object contains the description of the capability and the list of implementations for each bundler.
|
|
46
|
+
* This is used to generate the documentation for the bundler capabilities.
|
|
47
|
+
*/
|
|
48
|
+
export type InternalBundlerCapabilitiesMetaData = {
|
|
49
|
+
[key in keyof InternalBundlerCapabilities]: BundlerCapabilityMetaData<InternalBundlerCapabilities[key]>;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* This is a bundler specific implementation of the internal bundler capabilities.
|
|
53
|
+
* It's a mapping from the capability name to the capability function.
|
|
54
|
+
*/
|
|
55
|
+
export type InternalBundlerCapabilityImplementations<TConfig> = {
|
|
56
|
+
[key in keyof InternalBundlerCapabilities]: BundlerCapabilityFn<TConfig, InternalBundlerCapabilities[key]>;
|
|
57
|
+
};
|
|
58
|
+
export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AAC,GAAG,CAAC,CAAC;CAC3G,CAAC"}
|
|
@@ -0,0 +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 */\ntype BundlerCapabilityFn<TConfig, TOptions extends object> = (config: TConfig, options: TOptions) => TConfig;\n\n/**\n * A bundler capability is a feature that can be enabled for a package to modify the bundling process.\n */\nexport type BundlerCapability<TOptions extends object> = {\n description: string;\n implementations: {\n [bundler: string]: BundlerCapabilityFn<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. This is used to split the definition and the bundler specific implementations.\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 BundlerCapabilitiesOptions = {\n [key in keyof InternalBundlerCapabilities]?: InternalBundlerCapabilities[key] | false;\n};\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 */\nexport type InternalBundlerCapabilityImplementations<TConfig> = {\n [key in keyof InternalBundlerCapabilities]: BundlerCapabilityFn<TConfig, InternalBundlerCapabilities[key]>;\n};\n"]}
|
package/lib/DevServer.d.ts
CHANGED
package/lib/DevServer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevServer.js","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"","sourcesContent":["import type { HttpsConfig } from './HttpsConfig.js';\nimport type { ShorthandRoute } from './Route.js';\n\nexport interface DevServer {\n /**\n * The domain name of the server.\n */\n domain?: string;\n\n /**\n * An optional dictionary of header key/value pairs to be use with the server.\n * NOTE: The following header values from Cloudpack will \"win\" against by a user's config:\n * 'Cache-Control': 'no-cache'\n * 'Access-Control-Allow-Origin': '*'\n */\n requestHeaders?: Record<string, string>;\n\n /**\n * The ports to be used by the server.\n * It can be a number or an array of numbers.\n * If ports are provided, an error will be thrown if none are available.\n * If no ports are provided, the server will attempt to find an available port.\n */\n port?: number | number[];\n\n /**\n * The default path to use when opening the browser.\n */\n defaultPath?: string;\n\n /**\n * The config settings for the https server.\n * Paths to files are accepted for 'ca', 'cert', 'key', and 'pfx' settings.\n * Everything else is passed directly to the https.createServer() method.\n * If not provided, the server will use http.\n */\n https?: HttpsConfig;\n\n /**\n * @deprecated
|
|
1
|
+
{"version":3,"file":"DevServer.js","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"","sourcesContent":["import type { HttpsConfig } from './HttpsConfig.js';\nimport type { ShorthandRoute } from './Route.js';\n\nexport interface DevServer {\n /**\n * The domain name of the server.\n */\n domain?: string;\n\n /**\n * An optional dictionary of header key/value pairs to be use with the server.\n * NOTE: The following header values from Cloudpack will \"win\" against by a user's config:\n * 'Cache-Control': 'no-cache'\n * 'Access-Control-Allow-Origin': '*'\n */\n requestHeaders?: Record<string, string>;\n\n /**\n * The ports to be used by the server.\n * It can be a number or an array of numbers.\n * If ports are provided, an error will be thrown if none are available.\n * If no ports are provided, the server will attempt to find an available port.\n */\n port?: number | number[];\n\n /**\n * The default path to use when opening the browser.\n */\n defaultPath?: string;\n\n /**\n * The config settings for the https server.\n * Paths to files are accepted for 'ca', 'cert', 'key', and 'pfx' settings.\n * Everything else is passed directly to the https.createServer() method.\n * If not provided, the server will use http.\n */\n https?: HttpsConfig;\n\n /**\n * @deprecated Moved to the root of the config.\n */\n routes?: ShorthandRoute[];\n}\n"]}
|
package/lib/PackageJson.d.ts
CHANGED
|
@@ -95,7 +95,14 @@ export type PackageJson = {
|
|
|
95
95
|
/** Prevent hoisting of these dependencies within the workspace (yarn only). https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) */
|
|
96
96
|
nohoist?: string[];
|
|
97
97
|
};
|
|
98
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* Cached result of calling `getPackageSettings` for this package.
|
|
100
|
+
*
|
|
101
|
+
* This should NOT be used during init's analysis of the bundle result, since it might be
|
|
102
|
+
* out of date due to pending generated settings updates. (If a package is re-enqueued after
|
|
103
|
+
* analysis due to generated settings updates, we refresh the definition, which updates these
|
|
104
|
+
* cached setting. So it's safe to use again on the next bundle attempt.)
|
|
105
|
+
*/
|
|
99
106
|
cloudpack?: Omit<PackageSettings, 'match'> & {
|
|
100
107
|
mode: string | undefined;
|
|
101
108
|
};
|
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,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,yCAAyC;I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@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageJson.js","sourceRoot":"","sources":["../src/PackageJson.ts"],"names":[],"mappings":"","sourcesContent":["import 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 /** The name of the package. */\n name?: string;\n\n /** A description of the package. */\n description?: string;\n\n /** Package semantic version. */\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 /** Operating systems the package can run on. */\n os?: Array<\n LiteralOrString<\n | 'aix'\n | 'darwin'\n | 'freebsd'\n | 'linux'\n | 'openbsd'\n | 'sunos'\n | 'win32'\n | '!aix'\n | '!darwin'\n | '!freebsd'\n | '!linux'\n | '!openbsd'\n | '!sunos'\n | '!win32'\n >\n >;\n\n /** CPU architectures the package can run on. */\n cpu?: Array<\n LiteralOrString<\n | 'arm'\n | 'arm64'\n | 'ia32'\n | 'mips'\n | 'mipsel'\n | 'ppc'\n | 'ppc64'\n | 's390'\n | 's390x'\n | 'x32'\n | 'x64'\n | '!arm'\n | '!arm64'\n | '!ia32'\n | '!mips'\n | '!mipsel'\n | '!ppc'\n | '!ppc64'\n | '!s390'\n | '!s390x'\n | '!x32'\n | '!x64'\n >\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
|
|
1
|
+
{"version":3,"file":"PackageJson.js","sourceRoot":"","sources":["../src/PackageJson.ts"],"names":[],"mappings":"","sourcesContent":["import 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 /** The name of the package. */\n name?: string;\n\n /** A description of the package. */\n description?: string;\n\n /** Package semantic version. */\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 /** Operating systems the package can run on. */\n os?: Array<\n LiteralOrString<\n | 'aix'\n | 'darwin'\n | 'freebsd'\n | 'linux'\n | 'openbsd'\n | 'sunos'\n | 'win32'\n | '!aix'\n | '!darwin'\n | '!freebsd'\n | '!linux'\n | '!openbsd'\n | '!sunos'\n | '!win32'\n >\n >;\n\n /** CPU architectures the package can run on. */\n cpu?: Array<\n LiteralOrString<\n | 'arm'\n | 'arm64'\n | 'ia32'\n | 'mips'\n | 'mipsel'\n | 'ppc'\n | 'ppc64'\n | 's390'\n | 's390x'\n | 'x32'\n | 'x64'\n | '!arm'\n | '!arm64'\n | '!ia32'\n | '!mips'\n | '!mipsel'\n | '!ppc'\n | '!ppc64'\n | '!s390'\n | '!s390x'\n | '!x32'\n | '!x64'\n >\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 *\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'> & { mode: string | undefined };\n};\n\n/**\n * Union type which has intellisense for specific keys but also allows arbitrary strings.\n * This is a workaround for a [TypeScript issue](https://github.com/Microsoft/TypeScript/issues/29729)\n */\nexport type LiteralOrString<LiteralType extends string> = LiteralType | (string & Record<never, never>);\n\n/** Conditions which provide a way to resolve a package entry point based on the environment. */\nexport type PackageJsonExportCondition = LiteralOrString<\n | 'browser'\n | 'default'\n | 'deno'\n | 'electron'\n | 'import'\n | 'module'\n | 'node-addons'\n | 'node'\n | 'react-native'\n | 'require'\n>;\n\n/**\n * The value of an `PackageJson.exports` object key. Note at the root of the object, keys can be represented\n * either by a condition, or a `string` to provide import paths (such as \"./foo\"). At subsequent levels\n * within the object, only conditions (string which don't start with \".\") can be used as keys.\n */\nexport type PackageJsonExportsValue =\n | null\n | string\n | { [condition in PackageJsonExportCondition]?: PackageJsonExportsValue }\n | Array<PackageJsonExportsValue>;\n\n/**\n * Definition of the root exports object. Keys can be either conditions or import paths.\n */\nexport type PackageJsonExportsObject = {\n [pathOrCondition: string]: PackageJsonExportsValue;\n};\n/** Entry points of a package, optionally with conditions and subpath exports. Used as `PackageJson.exports`. */\nexport type PackageJsonExports = PackageJsonExportsValue | PackageJsonExportsObject | Array<PackageJsonExports>;\n\n/** Import map entries of a module, optionally with conditions. */\nexport type PackageJsonImports = {\n [key: `#${string}`]: string | { [key in PackageJsonExportCondition]: PackageJsonExports };\n};\n\n/** Mapping from dependency name to semver spec. */\nexport type PackageJsonDependencies = Partial<Record<string, string>>;\n"]}
|
package/lib/PackageSettings.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BundlerCapabilitiesOptions } from './BundlerCapability.js';
|
|
1
2
|
import type { PackageJsonExports } from './PackageJson.js';
|
|
2
3
|
/**
|
|
3
4
|
* Settings which apply to a single package (app or library) as it pertains to the Cloudpack start experience.
|
|
@@ -42,9 +43,19 @@ export interface PackageSettings {
|
|
|
42
43
|
/**
|
|
43
44
|
* Forces the package to be bundled using a specific bundler.
|
|
44
45
|
*/
|
|
46
|
+
bundler?: string;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated Use `bundler`.
|
|
49
|
+
*
|
|
50
|
+
* This should be removed once repo configs are updated to use `bundler`.
|
|
51
|
+
*/
|
|
45
52
|
bundlerType?: string;
|
|
46
53
|
/**
|
|
47
|
-
*
|
|
54
|
+
* Any bundler-specific options to be merged with the calculated bundler options.
|
|
55
|
+
* `bundler` is also required if this is specified.
|
|
56
|
+
*
|
|
57
|
+
* This is an escape hatch which is generally not recommended, since it locks the package to
|
|
58
|
+
* a specific bundler implementation.
|
|
48
59
|
*/
|
|
49
60
|
bundlerOptions?: Record<string, unknown>;
|
|
50
61
|
/**
|
|
@@ -88,5 +99,10 @@ export interface PackageSettings {
|
|
|
88
99
|
*/
|
|
89
100
|
duplicatedDependencyBehavior?: 'force-host-version' | 'allow-duplication';
|
|
90
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* Setting to control the bundler capabilities for this package.
|
|
104
|
+
* This is used to enable or disable specific bundler capabilities.
|
|
105
|
+
*/
|
|
106
|
+
bundlerCapabilities?: BundlerCapabilitiesOptions;
|
|
91
107
|
}
|
|
92
108
|
//# sourceMappingURL=PackageSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageSettings.d.ts","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,CAAC,EACF;QACE;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAED,MAAM,CAAC;IAEX;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;;;OAIG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB
|
|
1
|
+
{"version":3,"file":"PackageSettings.d.ts","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,CAAC,EACF;QACE;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAED,MAAM,CAAC;IAEX;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;;;OAIG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAE7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;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;;;;;WAKG;QACH,4BAA4B,CAAC,EAAE,oBAAoB,GAAG,mBAAmB,CAAC;KAC3E,CAAC;IAEF;;;OAGG;IACH,mBAAmB,CAAC,EAAE,0BAA0B,CAAC;CAClD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageJsonExports } from './PackageJson.js';\n\n/**\n * Settings which apply to a single package (app or library) as it pertains to the Cloudpack start experience.\n */\nexport interface PackageSettings {\n /**\n * A match to indicate the target for the settings to be applied to. Defaults to *.\n */\n match?:\n | {\n /**\n * Name of the package. Can use a trailing wildcard (e.g. \"\\@scope/*\").\n */\n name: string;\n\n /**\n * Version of the package. Unspecified matches any version.\n */\n version?: string;\n }\n // Match can be a string, which is a shortcut for the name.\n | string;\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
|
|
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\n/**\n * Settings which apply to a single package (app or library) as it pertains to the Cloudpack start experience.\n */\nexport interface PackageSettings {\n /**\n * A match to indicate the target for the settings to be applied to. Defaults to *.\n */\n match?:\n | {\n /**\n * Name of the package. Can use a trailing wildcard (e.g. \"\\@scope/*\").\n */\n name: string;\n\n /**\n * Version of the package. Unspecified matches any version.\n */\n version?: string;\n }\n // Match can be a string, which is a shortcut for the name.\n | string;\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.\n */\n duplicatedDependencyBehavior?: 'force-host-version' | 'allow-duplication';\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"]}
|
package/lib/Route.d.ts
CHANGED
|
@@ -3,11 +3,14 @@ export interface SharedRouteOptions {
|
|
|
3
3
|
/**
|
|
4
4
|
* The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also
|
|
5
5
|
* use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.
|
|
6
|
+
*
|
|
7
|
+
* Use an array to handle multiple paths with the same route handler.
|
|
6
8
|
*/
|
|
7
|
-
match: string;
|
|
9
|
+
match: string | string[];
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
|
-
* A server-rendered route
|
|
12
|
+
* A server-rendered route with optional shorthand `entry` info (as specified in `AppConfig`/`cloudpack.config.json`).
|
|
13
|
+
* The route is rendered by a custom server script in Cloudpack.
|
|
11
14
|
*/
|
|
12
15
|
export interface ShorthandRenderedRoute extends SharedRouteOptions {
|
|
13
16
|
/**
|
|
@@ -25,7 +28,14 @@ export interface ShorthandRenderedRoute extends SharedRouteOptions {
|
|
|
25
28
|
*/
|
|
26
29
|
entry?: (string | ExpandedSourcePath)[];
|
|
27
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* A server-rendered route with full `entry` info (used in the processed `CloudpackConfig`).
|
|
33
|
+
* The route is rendered by a custom server script in Cloudpack.
|
|
34
|
+
*/
|
|
28
35
|
export type RenderedRoute = Omit<ShorthandRenderedRoute, 'entry'> & {
|
|
36
|
+
/**
|
|
37
|
+
* To be implemented. The source entry or entries to be included on the page for this route.
|
|
38
|
+
*/
|
|
29
39
|
entry?: ExpandedSourcePath[];
|
|
30
40
|
};
|
|
31
41
|
/**
|
|
@@ -40,23 +50,43 @@ export interface StaticRoute extends SharedRouteOptions {
|
|
|
40
50
|
/**
|
|
41
51
|
* A route that serves a bootstrap script.
|
|
42
52
|
*/
|
|
43
|
-
export interface BootstrapRoute extends SharedRouteOptions {
|
|
53
|
+
export interface BootstrapRoute extends SharedRouteOptions, Pick<ShorthandRenderedRoute, 'exportEntry'> {
|
|
44
54
|
type: 'bootstrap';
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A route that redirects to another url.
|
|
58
|
+
*/
|
|
59
|
+
export interface RedirectRoute extends SharedRouteOptions {
|
|
45
60
|
/**
|
|
46
|
-
* The
|
|
47
|
-
* Default is '.', meaning the main package export key.
|
|
61
|
+
* The url to redirect to.
|
|
48
62
|
*/
|
|
49
|
-
|
|
63
|
+
redirectTo: string;
|
|
50
64
|
}
|
|
51
|
-
export type ShorthandRoute = ShorthandRenderedRoute | StaticRoute | BootstrapRoute;
|
|
52
|
-
export type Route = RenderedRoute | StaticRoute | BootstrapRoute;
|
|
53
65
|
/**
|
|
54
|
-
*
|
|
66
|
+
* Internal helper for all route types except `RenderedRoute`/`ShorthandRenderedRoute`
|
|
67
|
+
* (to ensure any new route types are included in both `Route` and `ShorthandRoute`).
|
|
68
|
+
*/
|
|
69
|
+
type OtherRoute = StaticRoute | BootstrapRoute | RedirectRoute;
|
|
70
|
+
/**
|
|
71
|
+
* Route as specified in `AppConfig` (`cloudpack.config.json`).
|
|
72
|
+
*/
|
|
73
|
+
export type ShorthandRoute = ShorthandRenderedRoute | OtherRoute;
|
|
74
|
+
/**
|
|
75
|
+
* Processed route as used in the processed `CloudpackConfig`.
|
|
76
|
+
*/
|
|
77
|
+
export type Route = RenderedRoute | OtherRoute;
|
|
78
|
+
/**
|
|
79
|
+
* Type guard to check if a route is a static route.
|
|
55
80
|
*/
|
|
56
81
|
export declare function isStaticRoute(route: Route): route is StaticRoute;
|
|
57
82
|
/**
|
|
58
|
-
*
|
|
83
|
+
* Type guard to check if a route is a bootstrap route.
|
|
59
84
|
*/
|
|
60
85
|
export declare function isBootstrapRoute(route: Route): route is BootstrapRoute;
|
|
61
86
|
export declare function isRenderedRoute(route: Route): route is RenderedRoute;
|
|
87
|
+
/**
|
|
88
|
+
* Type guard to check if a route is a redirect route.
|
|
89
|
+
*/
|
|
90
|
+
export declare function isRedirectRoute(route: Route): route is RedirectRoute;
|
|
91
|
+
export {};
|
|
62
92
|
//# 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,MAAM,WAAW,kBAAkB;IACjC
|
|
1
|
+
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,kBAAkB,CAAC,EAAE,CAAC;CACzC;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC,GAAG;IAClE;;OAEG;IACH,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,kBAAkB,EAAE,IAAI,CAAC,sBAAsB,EAAE,aAAa,CAAC;IACrG,IAAI,EAAE,WAAW,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,KAAK,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,sBAAsB,GAAG,UAAU,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,aAAa,GAAG,UAAU,CAAC;AAE/C;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,WAAW,CAEhE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,cAAc,CAEtE;AAKD,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,aAAa,CAMpE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,aAAa,CAEpE"}
|
package/lib/Route.js
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Type guard to check if a route is a static route.
|
|
3
3
|
*/
|
|
4
4
|
export function isStaticRoute(route) {
|
|
5
5
|
return 'staticPath' in route;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Type guard to check if a route is a bootstrap route.
|
|
9
9
|
*/
|
|
10
10
|
export function isBootstrapRoute(route) {
|
|
11
11
|
return 'type' in route && route.type === 'bootstrap';
|
|
12
12
|
}
|
|
13
13
|
/*
|
|
14
|
-
*
|
|
14
|
+
* Type guard to check if a route is a rendered route.
|
|
15
15
|
*/
|
|
16
16
|
export function isRenderedRoute(route) {
|
|
17
|
-
|
|
17
|
+
const maybeRenderedRoute = route;
|
|
18
|
+
return (!isBootstrapRoute(route) &&
|
|
19
|
+
!!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry || maybeRenderedRoute.exportEntry));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Type guard to check if a route is a redirect route.
|
|
23
|
+
*/
|
|
24
|
+
export function isRedirectRoute(route) {
|
|
25
|
+
return 'redirectTo' in route;
|
|
18
26
|
}
|
|
19
27
|
//# 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":"AAyFA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAY;IACxC,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,eAAe,CAAC,KAAY;IAC1C,MAAM,kBAAkB,GAAG,KAAsB,CAAC;IAClD,OAAO,CACL,CAAC,gBAAgB,CAAC,KAAK,CAAC;QACxB,CAAC,CAAC,CAAC,kBAAkB,CAAC,YAAY,IAAI,kBAAkB,CAAC,KAAK,IAAI,kBAAkB,CAAC,WAAW,CAAC,CAClG,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC","sourcesContent":["import type { ExpandedSourcePath } from './ExpandedSourcePath.js';\n\nexport interface SharedRouteOptions {\n /**\n * The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also\n * use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n *\n * Use an array to handle multiple paths with the same route handler.\n */\n match: string | string[];\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 used for rendering the route. If a script is provided, it must\n * export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/app-server`.\n */\n renderScript?: string;\n\n /**\n * The key in the exports map which represents the entry point app script for this route.\n * Default is '.', meaning the main package export key.\n */\n exportEntry?: string;\n\n /**\n * To be implemented. The source entry or entries to be included on the page for this route.\n */\n entry?: (string | ExpandedSourcePath)[];\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, 'entry'> & {\n /**\n * To be implemented. 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 BootstrapRoute extends SharedRouteOptions, Pick<ShorthandRenderedRoute, 'exportEntry'> {\n type: 'bootstrap';\n}\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 * Internal helper for all route types except `RenderedRoute`/`ShorthandRenderedRoute`\n * (to ensure any new route types are included in both `Route` and `ShorthandRoute`).\n */\ntype OtherRoute = StaticRoute | BootstrapRoute | RedirectRoute;\n\n/**\n * Route as specified in `AppConfig` (`cloudpack.config.json`).\n */\nexport type ShorthandRoute = ShorthandRenderedRoute | OtherRoute;\n\n/**\n * Processed route as used in the processed `CloudpackConfig`.\n */\nexport type Route = RenderedRoute | OtherRoute;\n\n/**\n * Type guard to check if a route is a static route.\n */\nexport function isStaticRoute(route: Route): 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 rendered route.\n */\nexport function isRenderedRoute(route: Route): route is RenderedRoute {\n const maybeRenderedRoute = route as RenderedRoute;\n return (\n !isBootstrapRoute(route) &&\n !!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry || maybeRenderedRoute.exportEntry)\n );\n}\n\n/**\n * Type guard to check if a route is a redirect route.\n */\nexport function isRedirectRoute(route: Route): route is RedirectRoute {\n return 'redirectTo' in route;\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -20,8 +20,9 @@ export type { HttpsConfig } from './HttpsConfig.js';
|
|
|
20
20
|
export type { ModuleType } from './ModuleType.js';
|
|
21
21
|
export type { PackageOverride } from './PackageOverride.js';
|
|
22
22
|
export type { PackageSettings } from './PackageSettings.js';
|
|
23
|
-
export type { Route, RenderedRoute, BootstrapRoute, StaticRoute } from './Route.js';
|
|
24
|
-
export { isBootstrapRoute, isRenderedRoute, isStaticRoute } from './Route.js';
|
|
23
|
+
export type { Route, RenderedRoute, BootstrapRoute, StaticRoute, RedirectRoute } from './Route.js';
|
|
24
|
+
export { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } from './Route.js';
|
|
25
25
|
export type { TelemetryConfig } from './TelemetryConfig.js';
|
|
26
26
|
export type { AppConfig } from './AppConfig.js';
|
|
27
|
+
export type { InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, } from './BundlerCapability.js';
|
|
27
28
|
//# sourceMappingURL=index.d.ts.map
|
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,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,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB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C;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/F,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EACV,wCAAwC,EACxC,mCAAmC,EACnC,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC"}
|
package/lib/index.js
CHANGED
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;AAqC/C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { allFeatures } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\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 { PackageOverride } from './PackageOverride.js';\nexport type { PackageSettings } from './PackageSettings.js';\nexport type { Route, RenderedRoute, BootstrapRoute, StaticRoute } from './Route.js';\nexport { isBootstrapRoute, isRenderedRoute, isStaticRoute } from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAqC/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 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 { PackageOverride } from './PackageOverride.js';\nexport type { PackageSettings } from './PackageSettings.js';\nexport type { Route, RenderedRoute, BootstrapRoute, StaticRoute, RedirectRoute } 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} from './BundlerCapability.js';\n"]}
|
package/package.json
CHANGED
package/schema/AppConfig.json
CHANGED
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"items": {
|
|
150
150
|
"$ref": "#/definitions/ShorthandRoute"
|
|
151
151
|
},
|
|
152
|
-
"deprecated": "
|
|
152
|
+
"deprecated": "Moved to the root of the config."
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
155
|
"additionalProperties": false
|
|
@@ -443,19 +443,38 @@
|
|
|
443
443
|
"$ref": "#/definitions/ShorthandRenderedRoute"
|
|
444
444
|
},
|
|
445
445
|
{
|
|
446
|
-
"
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
446
|
+
"anyOf": [
|
|
447
|
+
{
|
|
448
|
+
"$ref": "#/definitions/StaticRoute"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"$ref": "#/definitions/BootstrapRoute"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"$ref": "#/definitions/RedirectRoute"
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
"description": "Internal helper for all route types except `RenderedRoute`/`ShorthandRenderedRoute` (to ensure any new route types are included in both `Route` and `ShorthandRoute`)."
|
|
450
458
|
}
|
|
451
|
-
]
|
|
459
|
+
],
|
|
460
|
+
"description": "Route as specified in `AppConfig` (`cloudpack.config.json`)."
|
|
452
461
|
},
|
|
453
462
|
"ShorthandRenderedRoute": {
|
|
454
463
|
"type": "object",
|
|
455
464
|
"properties": {
|
|
456
465
|
"match": {
|
|
457
|
-
"
|
|
458
|
-
|
|
466
|
+
"anyOf": [
|
|
467
|
+
{
|
|
468
|
+
"type": "string"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"type": "array",
|
|
472
|
+
"items": {
|
|
473
|
+
"type": "string"
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
],
|
|
477
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n\nUse an array to handle multiple paths with the same route handler."
|
|
459
478
|
},
|
|
460
479
|
"renderScript": {
|
|
461
480
|
"type": "string",
|
|
@@ -484,7 +503,7 @@
|
|
|
484
503
|
"required": [
|
|
485
504
|
"match"
|
|
486
505
|
],
|
|
487
|
-
"description": "A server-rendered route. The route is rendered by a custom server script in Cloudpack."
|
|
506
|
+
"description": "A server-rendered route with optional shorthand `entry` info (as specified in `AppConfig`/`cloudpack.config.json`). The route is rendered by a custom server script in Cloudpack."
|
|
488
507
|
},
|
|
489
508
|
"ExpandedSourcePath": {
|
|
490
509
|
"type": "object",
|
|
@@ -513,8 +532,18 @@
|
|
|
513
532
|
"type": "object",
|
|
514
533
|
"properties": {
|
|
515
534
|
"match": {
|
|
516
|
-
"
|
|
517
|
-
|
|
535
|
+
"anyOf": [
|
|
536
|
+
{
|
|
537
|
+
"type": "string"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"type": "array",
|
|
541
|
+
"items": {
|
|
542
|
+
"type": "string"
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n\nUse an array to handle multiple paths with the same route handler."
|
|
518
547
|
},
|
|
519
548
|
"staticPath": {
|
|
520
549
|
"type": "string",
|
|
@@ -531,17 +560,27 @@
|
|
|
531
560
|
"BootstrapRoute": {
|
|
532
561
|
"type": "object",
|
|
533
562
|
"properties": {
|
|
534
|
-
"
|
|
563
|
+
"exportEntry": {
|
|
535
564
|
"type": "string",
|
|
536
|
-
"description": "The
|
|
565
|
+
"description": "The key in the exports map which represents the entry point app script for this route. Default is '.', meaning the main package export key."
|
|
566
|
+
},
|
|
567
|
+
"match": {
|
|
568
|
+
"anyOf": [
|
|
569
|
+
{
|
|
570
|
+
"type": "string"
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
"type": "array",
|
|
574
|
+
"items": {
|
|
575
|
+
"type": "string"
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
],
|
|
579
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n\nUse an array to handle multiple paths with the same route handler."
|
|
537
580
|
},
|
|
538
581
|
"type": {
|
|
539
582
|
"type": "string",
|
|
540
583
|
"const": "bootstrap"
|
|
541
|
-
},
|
|
542
|
-
"exportEntry": {
|
|
543
|
-
"type": "string",
|
|
544
|
-
"description": "The key in the exports map which represents the entry point app script for this route. Default is '.', meaning the main package export key."
|
|
545
584
|
}
|
|
546
585
|
},
|
|
547
586
|
"required": [
|
|
@@ -551,6 +590,35 @@
|
|
|
551
590
|
"additionalProperties": false,
|
|
552
591
|
"description": "A route that serves a bootstrap script."
|
|
553
592
|
},
|
|
593
|
+
"RedirectRoute": {
|
|
594
|
+
"type": "object",
|
|
595
|
+
"properties": {
|
|
596
|
+
"match": {
|
|
597
|
+
"anyOf": [
|
|
598
|
+
{
|
|
599
|
+
"type": "string"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"type": "array",
|
|
603
|
+
"items": {
|
|
604
|
+
"type": "string"
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
],
|
|
608
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n\nUse an array to handle multiple paths with the same route handler."
|
|
609
|
+
},
|
|
610
|
+
"redirectTo": {
|
|
611
|
+
"type": "string",
|
|
612
|
+
"description": "The url to redirect to."
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
"required": [
|
|
616
|
+
"match",
|
|
617
|
+
"redirectTo"
|
|
618
|
+
],
|
|
619
|
+
"additionalProperties": false,
|
|
620
|
+
"description": "A route that redirects to another url."
|
|
621
|
+
},
|
|
554
622
|
"TelemetryConfig": {
|
|
555
623
|
"type": "object",
|
|
556
624
|
"properties": {
|
|
@@ -657,14 +725,18 @@
|
|
|
657
725
|
"$ref": "#/definitions/PackageJsonExports",
|
|
658
726
|
"description": "The exports map that should be used for this package, ignoring entries which are defined in the original package.json. This is useful for libraries which have a missing or broken exports map, or when we want to trim the exports to reduce the api surface we expose to the inner loop experience."
|
|
659
727
|
},
|
|
660
|
-
"
|
|
728
|
+
"bundler": {
|
|
661
729
|
"type": "string",
|
|
662
730
|
"description": "Forces the package to be bundled using a specific bundler."
|
|
663
731
|
},
|
|
732
|
+
"bundlerType": {
|
|
733
|
+
"type": "string",
|
|
734
|
+
"deprecated": "Use `bundler`.\n\nThis should be removed once repo configs are updated to use `bundler`."
|
|
735
|
+
},
|
|
664
736
|
"bundlerOptions": {
|
|
665
737
|
"type": "object",
|
|
666
738
|
"additionalProperties": {},
|
|
667
|
-
"description": "
|
|
739
|
+
"description": "Any bundler-specific options to be merged with the calculated bundler options. `bundler` is also required if this is specified.\n\nThis is an escape hatch which is generally not recommended, since it locks the package to a specific bundler implementation."
|
|
668
740
|
},
|
|
669
741
|
"inputPaths": {
|
|
670
742
|
"type": "array",
|
|
@@ -719,6 +791,10 @@
|
|
|
719
791
|
},
|
|
720
792
|
"additionalProperties": false,
|
|
721
793
|
"description": "Setting to control how the package is linked in the resolve map."
|
|
794
|
+
},
|
|
795
|
+
"bundlerCapabilities": {
|
|
796
|
+
"$ref": "#/definitions/BundlerCapabilitiesOptions",
|
|
797
|
+
"description": "Setting to control the bundler capabilities for this package. This is used to enable or disable specific bundler capabilities."
|
|
722
798
|
}
|
|
723
799
|
},
|
|
724
800
|
"additionalProperties": false,
|
|
@@ -802,6 +878,37 @@
|
|
|
802
878
|
"$ref": "#/definitions/PackageJsonExportsValue"
|
|
803
879
|
},
|
|
804
880
|
"description": "Definition of the root exports object. Keys can be either conditions or import paths."
|
|
881
|
+
},
|
|
882
|
+
"BundlerCapabilitiesOptions": {
|
|
883
|
+
"type": "object",
|
|
884
|
+
"properties": {
|
|
885
|
+
"asset-inline": {
|
|
886
|
+
"anyOf": [
|
|
887
|
+
{
|
|
888
|
+
"type": "object",
|
|
889
|
+
"properties": {
|
|
890
|
+
"extensions": {
|
|
891
|
+
"type": "array",
|
|
892
|
+
"items": {
|
|
893
|
+
"type": "string"
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
"required": [
|
|
898
|
+
"extensions"
|
|
899
|
+
],
|
|
900
|
+
"additionalProperties": false,
|
|
901
|
+
"description": "Inlines assets into the bundle. Options: List of file extensions to inline. Do not include the leading dot."
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"type": "boolean",
|
|
905
|
+
"const": false
|
|
906
|
+
}
|
|
907
|
+
]
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
"additionalProperties": false,
|
|
911
|
+
"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."
|
|
805
912
|
}
|
|
806
913
|
}
|
|
807
914
|
}
|
|
@@ -76,14 +76,18 @@
|
|
|
76
76
|
"$ref": "#/definitions/PackageJsonExports",
|
|
77
77
|
"description": "The exports map that should be used for this package, ignoring entries which are defined in the original package.json. This is useful for libraries which have a missing or broken exports map, or when we want to trim the exports to reduce the api surface we expose to the inner loop experience."
|
|
78
78
|
},
|
|
79
|
-
"
|
|
79
|
+
"bundler": {
|
|
80
80
|
"type": "string",
|
|
81
81
|
"description": "Forces the package to be bundled using a specific bundler."
|
|
82
82
|
},
|
|
83
|
+
"bundlerType": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"deprecated": "Use `bundler`.\n\nThis should be removed once repo configs are updated to use `bundler`."
|
|
86
|
+
},
|
|
83
87
|
"bundlerOptions": {
|
|
84
88
|
"type": "object",
|
|
85
89
|
"additionalProperties": {},
|
|
86
|
-
"description": "
|
|
90
|
+
"description": "Any bundler-specific options to be merged with the calculated bundler options. `bundler` is also required if this is specified.\n\nThis is an escape hatch which is generally not recommended, since it locks the package to a specific bundler implementation."
|
|
87
91
|
},
|
|
88
92
|
"inputPaths": {
|
|
89
93
|
"type": "array",
|
|
@@ -138,6 +142,10 @@
|
|
|
138
142
|
},
|
|
139
143
|
"additionalProperties": false,
|
|
140
144
|
"description": "Setting to control how the package is linked in the resolve map."
|
|
145
|
+
},
|
|
146
|
+
"bundlerCapabilities": {
|
|
147
|
+
"$ref": "#/definitions/BundlerCapabilitiesOptions",
|
|
148
|
+
"description": "Setting to control the bundler capabilities for this package. This is used to enable or disable specific bundler capabilities."
|
|
141
149
|
}
|
|
142
150
|
},
|
|
143
151
|
"additionalProperties": false,
|
|
@@ -222,6 +230,37 @@
|
|
|
222
230
|
},
|
|
223
231
|
"description": "Definition of the root exports object. Keys can be either conditions or import paths."
|
|
224
232
|
},
|
|
233
|
+
"BundlerCapabilitiesOptions": {
|
|
234
|
+
"type": "object",
|
|
235
|
+
"properties": {
|
|
236
|
+
"asset-inline": {
|
|
237
|
+
"anyOf": [
|
|
238
|
+
{
|
|
239
|
+
"type": "object",
|
|
240
|
+
"properties": {
|
|
241
|
+
"extensions": {
|
|
242
|
+
"type": "array",
|
|
243
|
+
"items": {
|
|
244
|
+
"type": "string"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"required": [
|
|
249
|
+
"extensions"
|
|
250
|
+
],
|
|
251
|
+
"additionalProperties": false,
|
|
252
|
+
"description": "Inlines assets into the bundle. Options: List of file extensions to inline. Do not include the leading dot."
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"type": "boolean",
|
|
256
|
+
"const": false
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"additionalProperties": false,
|
|
262
|
+
"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."
|
|
263
|
+
},
|
|
225
264
|
"PackageOverride": {
|
|
226
265
|
"type": "object",
|
|
227
266
|
"properties": {
|
|
@@ -592,14 +631,18 @@
|
|
|
592
631
|
"$ref": "#/definitions/PackageJsonExports",
|
|
593
632
|
"description": "The exports map that should be used for this package, ignoring entries which are defined in the original package.json. This is useful for libraries which have a missing or broken exports map, or when we want to trim the exports to reduce the api surface we expose to the inner loop experience."
|
|
594
633
|
},
|
|
595
|
-
"
|
|
634
|
+
"bundler": {
|
|
596
635
|
"type": "string",
|
|
597
636
|
"description": "Forces the package to be bundled using a specific bundler."
|
|
598
637
|
},
|
|
638
|
+
"bundlerType": {
|
|
639
|
+
"type": "string",
|
|
640
|
+
"deprecated": "Use `bundler`.\n\nThis should be removed once repo configs are updated to use `bundler`."
|
|
641
|
+
},
|
|
599
642
|
"bundlerOptions": {
|
|
600
643
|
"type": "object",
|
|
601
644
|
"additionalProperties": {},
|
|
602
|
-
"description": "
|
|
645
|
+
"description": "Any bundler-specific options to be merged with the calculated bundler options. `bundler` is also required if this is specified.\n\nThis is an escape hatch which is generally not recommended, since it locks the package to a specific bundler implementation."
|
|
603
646
|
},
|
|
604
647
|
"inputPaths": {
|
|
605
648
|
"type": "array",
|
|
@@ -654,9 +697,13 @@
|
|
|
654
697
|
},
|
|
655
698
|
"additionalProperties": false,
|
|
656
699
|
"description": "Setting to control how the package is linked in the resolve map."
|
|
700
|
+
},
|
|
701
|
+
"bundlerCapabilities": {
|
|
702
|
+
"$ref": "#/definitions/BundlerCapabilitiesOptions",
|
|
703
|
+
"description": "Setting to control the bundler capabilities for this package. This is used to enable or disable specific bundler capabilities."
|
|
657
704
|
}
|
|
658
705
|
},
|
|
659
|
-
"description": "
|
|
706
|
+
"description": "Cached result of calling `getPackageSettings` for this package.\n\nThis should NOT be used during init's analysis of the bundle result, since it might be out of date due to pending generated settings updates. (If a package is re-enqueued after analysis due to generated settings updates, we refresh the definition, which updates these cached setting. So it's safe to use again on the next bundle attempt.)"
|
|
660
707
|
}
|
|
661
708
|
},
|
|
662
709
|
"additionalProperties": false,
|
package/schema/UserConfig.json
CHANGED
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
"items": {
|
|
151
151
|
"$ref": "#/definitions/ShorthandRoute"
|
|
152
152
|
},
|
|
153
|
-
"deprecated": "
|
|
153
|
+
"deprecated": "Moved to the root of the config."
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
156
|
"additionalProperties": false
|
|
@@ -444,19 +444,38 @@
|
|
|
444
444
|
"$ref": "#/definitions/ShorthandRenderedRoute"
|
|
445
445
|
},
|
|
446
446
|
{
|
|
447
|
-
"
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
447
|
+
"anyOf": [
|
|
448
|
+
{
|
|
449
|
+
"$ref": "#/definitions/StaticRoute"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"$ref": "#/definitions/BootstrapRoute"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"$ref": "#/definitions/RedirectRoute"
|
|
456
|
+
}
|
|
457
|
+
],
|
|
458
|
+
"description": "Internal helper for all route types except `RenderedRoute`/`ShorthandRenderedRoute` (to ensure any new route types are included in both `Route` and `ShorthandRoute`)."
|
|
451
459
|
}
|
|
452
|
-
]
|
|
460
|
+
],
|
|
461
|
+
"description": "Route as specified in `AppConfig` (`cloudpack.config.json`)."
|
|
453
462
|
},
|
|
454
463
|
"ShorthandRenderedRoute": {
|
|
455
464
|
"type": "object",
|
|
456
465
|
"properties": {
|
|
457
466
|
"match": {
|
|
458
|
-
"
|
|
459
|
-
|
|
467
|
+
"anyOf": [
|
|
468
|
+
{
|
|
469
|
+
"type": "string"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"type": "array",
|
|
473
|
+
"items": {
|
|
474
|
+
"type": "string"
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
],
|
|
478
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n\nUse an array to handle multiple paths with the same route handler."
|
|
460
479
|
},
|
|
461
480
|
"renderScript": {
|
|
462
481
|
"type": "string",
|
|
@@ -485,7 +504,7 @@
|
|
|
485
504
|
"required": [
|
|
486
505
|
"match"
|
|
487
506
|
],
|
|
488
|
-
"description": "A server-rendered route. The route is rendered by a custom server script in Cloudpack."
|
|
507
|
+
"description": "A server-rendered route with optional shorthand `entry` info (as specified in `AppConfig`/`cloudpack.config.json`). The route is rendered by a custom server script in Cloudpack."
|
|
489
508
|
},
|
|
490
509
|
"ExpandedSourcePath": {
|
|
491
510
|
"type": "object",
|
|
@@ -514,8 +533,18 @@
|
|
|
514
533
|
"type": "object",
|
|
515
534
|
"properties": {
|
|
516
535
|
"match": {
|
|
517
|
-
"
|
|
518
|
-
|
|
536
|
+
"anyOf": [
|
|
537
|
+
{
|
|
538
|
+
"type": "string"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"type": "array",
|
|
542
|
+
"items": {
|
|
543
|
+
"type": "string"
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
],
|
|
547
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n\nUse an array to handle multiple paths with the same route handler."
|
|
519
548
|
},
|
|
520
549
|
"staticPath": {
|
|
521
550
|
"type": "string",
|
|
@@ -532,17 +561,27 @@
|
|
|
532
561
|
"BootstrapRoute": {
|
|
533
562
|
"type": "object",
|
|
534
563
|
"properties": {
|
|
535
|
-
"
|
|
564
|
+
"exportEntry": {
|
|
536
565
|
"type": "string",
|
|
537
|
-
"description": "The
|
|
566
|
+
"description": "The key in the exports map which represents the entry point app script for this route. Default is '.', meaning the main package export key."
|
|
567
|
+
},
|
|
568
|
+
"match": {
|
|
569
|
+
"anyOf": [
|
|
570
|
+
{
|
|
571
|
+
"type": "string"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"type": "array",
|
|
575
|
+
"items": {
|
|
576
|
+
"type": "string"
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
],
|
|
580
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n\nUse an array to handle multiple paths with the same route handler."
|
|
538
581
|
},
|
|
539
582
|
"type": {
|
|
540
583
|
"type": "string",
|
|
541
584
|
"const": "bootstrap"
|
|
542
|
-
},
|
|
543
|
-
"exportEntry": {
|
|
544
|
-
"type": "string",
|
|
545
|
-
"description": "The key in the exports map which represents the entry point app script for this route. Default is '.', meaning the main package export key."
|
|
546
585
|
}
|
|
547
586
|
},
|
|
548
587
|
"required": [
|
|
@@ -552,6 +591,35 @@
|
|
|
552
591
|
"additionalProperties": false,
|
|
553
592
|
"description": "A route that serves a bootstrap script."
|
|
554
593
|
},
|
|
594
|
+
"RedirectRoute": {
|
|
595
|
+
"type": "object",
|
|
596
|
+
"properties": {
|
|
597
|
+
"match": {
|
|
598
|
+
"anyOf": [
|
|
599
|
+
{
|
|
600
|
+
"type": "string"
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
"type": "array",
|
|
604
|
+
"items": {
|
|
605
|
+
"type": "string"
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
],
|
|
609
|
+
"description": "The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n\nUse an array to handle multiple paths with the same route handler."
|
|
610
|
+
},
|
|
611
|
+
"redirectTo": {
|
|
612
|
+
"type": "string",
|
|
613
|
+
"description": "The url to redirect to."
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
"required": [
|
|
617
|
+
"match",
|
|
618
|
+
"redirectTo"
|
|
619
|
+
],
|
|
620
|
+
"additionalProperties": false,
|
|
621
|
+
"description": "A route that redirects to another url."
|
|
622
|
+
},
|
|
555
623
|
"TelemetryConfig": {
|
|
556
624
|
"type": "object",
|
|
557
625
|
"properties": {
|
|
@@ -658,14 +726,18 @@
|
|
|
658
726
|
"$ref": "#/definitions/PackageJsonExports",
|
|
659
727
|
"description": "The exports map that should be used for this package, ignoring entries which are defined in the original package.json. This is useful for libraries which have a missing or broken exports map, or when we want to trim the exports to reduce the api surface we expose to the inner loop experience."
|
|
660
728
|
},
|
|
661
|
-
"
|
|
729
|
+
"bundler": {
|
|
662
730
|
"type": "string",
|
|
663
731
|
"description": "Forces the package to be bundled using a specific bundler."
|
|
664
732
|
},
|
|
733
|
+
"bundlerType": {
|
|
734
|
+
"type": "string",
|
|
735
|
+
"deprecated": "Use `bundler`.\n\nThis should be removed once repo configs are updated to use `bundler`."
|
|
736
|
+
},
|
|
665
737
|
"bundlerOptions": {
|
|
666
738
|
"type": "object",
|
|
667
739
|
"additionalProperties": {},
|
|
668
|
-
"description": "
|
|
740
|
+
"description": "Any bundler-specific options to be merged with the calculated bundler options. `bundler` is also required if this is specified.\n\nThis is an escape hatch which is generally not recommended, since it locks the package to a specific bundler implementation."
|
|
669
741
|
},
|
|
670
742
|
"inputPaths": {
|
|
671
743
|
"type": "array",
|
|
@@ -720,6 +792,10 @@
|
|
|
720
792
|
},
|
|
721
793
|
"additionalProperties": false,
|
|
722
794
|
"description": "Setting to control how the package is linked in the resolve map."
|
|
795
|
+
},
|
|
796
|
+
"bundlerCapabilities": {
|
|
797
|
+
"$ref": "#/definitions/BundlerCapabilitiesOptions",
|
|
798
|
+
"description": "Setting to control the bundler capabilities for this package. This is used to enable or disable specific bundler capabilities."
|
|
723
799
|
}
|
|
724
800
|
},
|
|
725
801
|
"additionalProperties": false,
|
|
@@ -803,6 +879,37 @@
|
|
|
803
879
|
"$ref": "#/definitions/PackageJsonExportsValue"
|
|
804
880
|
},
|
|
805
881
|
"description": "Definition of the root exports object. Keys can be either conditions or import paths."
|
|
882
|
+
},
|
|
883
|
+
"BundlerCapabilitiesOptions": {
|
|
884
|
+
"type": "object",
|
|
885
|
+
"properties": {
|
|
886
|
+
"asset-inline": {
|
|
887
|
+
"anyOf": [
|
|
888
|
+
{
|
|
889
|
+
"type": "object",
|
|
890
|
+
"properties": {
|
|
891
|
+
"extensions": {
|
|
892
|
+
"type": "array",
|
|
893
|
+
"items": {
|
|
894
|
+
"type": "string"
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
"required": [
|
|
899
|
+
"extensions"
|
|
900
|
+
],
|
|
901
|
+
"additionalProperties": false,
|
|
902
|
+
"description": "Inlines assets into the bundle. Options: List of file extensions to inline. Do not include the leading dot."
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"type": "boolean",
|
|
906
|
+
"const": false
|
|
907
|
+
}
|
|
908
|
+
]
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
"additionalProperties": false,
|
|
912
|
+
"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."
|
|
806
913
|
}
|
|
807
914
|
},
|
|
808
915
|
"properties": {
|