@ms-cloudpack/common-types 0.5.3 → 0.6.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/Route.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- export interface Route {
1
+ export interface SharedRouteOptions {
2
2
  /**
3
3
  * The url path part to match. Start paths with a leading slash, e.g. `'/my-route'`. You can also
4
4
  * use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.
5
5
  */
6
6
  match: string;
7
- /**
8
- * The path relative to the app root to static assets. If this is provided, renderScript/exportEntry
9
- * will be ignored.
10
- */
11
- staticPath?: string;
7
+ }
8
+ /**
9
+ * A server-rendered route. The route is rendered by a custom server script in Cloudpack.
10
+ */
11
+ export interface RenderedRoute extends SharedRouteOptions {
12
12
  /**
13
13
  * Path to a .js or .html file used for rendering the route. If a script is provided, it must
14
14
  * export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/app-server`.
@@ -20,4 +20,34 @@ export interface Route {
20
20
  */
21
21
  exportEntry?: string;
22
22
  }
23
+ /**
24
+ * A route with a staticPath property serves static files from the specified path.
25
+ */
26
+ export interface StaticRoute extends SharedRouteOptions {
27
+ /**
28
+ * The path relative to the app root to static assets.
29
+ */
30
+ staticPath: string;
31
+ }
32
+ /**
33
+ * A route that serves a bootstrap script.
34
+ */
35
+ export interface BootstrapRoute extends SharedRouteOptions {
36
+ type: 'bootstrap';
37
+ /**
38
+ * The key in the exports map which represents the entry point app script for this route.
39
+ * Default is '.', meaning the main package export key.
40
+ */
41
+ exportEntry?: string;
42
+ }
43
+ export type Route = RenderedRoute | StaticRoute | BootstrapRoute;
44
+ /**
45
+ * User defined type guard to check if a route is a static route.
46
+ */
47
+ export declare function isStaticRoute(route: Route): route is StaticRoute;
48
+ /**
49
+ * User defined type guard to check if a route is a bootstrap route.
50
+ */
51
+ export declare function isBootstrapRoute(route: Route): route is BootstrapRoute;
52
+ export declare function isRenderedRoute(route: Route): route is RenderedRoute;
23
53
  //# sourceMappingURL=Route.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,KAAK;IACpB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD,IAAI,EAAE,WAAW,CAAC;IAClB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,KAAK,GAAG,aAAa,GAAG,WAAW,GAAG,cAAc,CAAC;AAEjE;;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,CAEpE"}
package/lib/Route.js CHANGED
@@ -1,2 +1,19 @@
1
- export {};
1
+ /**
2
+ * User defined type guard to check if a route is a static route.
3
+ */
4
+ export function isStaticRoute(route) {
5
+ return 'staticPath' in route;
6
+ }
7
+ /**
8
+ * User defined type guard to check if a route is a bootstrap route.
9
+ */
10
+ export function isBootstrapRoute(route) {
11
+ return 'type' in route && route.type === 'bootstrap';
12
+ }
13
+ /*
14
+ * User defined type guard to check if a route is a rendered route.
15
+ */
16
+ export function isRenderedRoute(route) {
17
+ return !isStaticRoute(route) && !isBootstrapRoute(route);
18
+ }
2
19
  //# 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":"","sourcesContent":["export interface Route {\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 match: string;\n\n /**\n * The path relative to the app root to static assets. If this is provided, renderScript/exportEntry\n * will be ignored.\n */\n staticPath?: string;\n\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"]}
1
+ {"version":3,"file":"Route.js","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAiDA;;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,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["export 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 match: string;\n}\n\n/**\n * A server-rendered route. The route is rendered by a custom server script in Cloudpack.\n */\nexport interface RenderedRoute 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/**\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 {\n type: 'bootstrap';\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\nexport type Route = RenderedRoute | StaticRoute | BootstrapRoute;\n\n/**\n * User defined 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 * User defined 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 * User defined type guard to check if a route is a rendered route.\n */\nexport function isRenderedRoute(route: Route): route is RenderedRoute {\n return !isStaticRoute(route) && !isBootstrapRoute(route);\n}\n"]}
@@ -23,5 +23,7 @@ export declare const allFeatures: {
23
23
  useSingleWebServer: Feature;
24
24
  /** Enables the verification of exports during init. */
25
25
  verifyExports: Feature;
26
+ /** Automatically updates the generated config when an unknown import path is used during start. */
27
+ autoUpdateEntries: Feature;
26
28
  };
27
29
  //# sourceMappingURL=allFeatures.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"allFeatures.d.ts","sourceRoot":"","sources":["../src/allFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,WAAW;IAGtB,kDAAkD;;IAGlD,2DAA2D;;IAG3D,sEAAsE;;IAGtE;;;OAGG;;IAMH,kEAAkE;;IAGlE,sCAAsC;;IAGtC,2DAA2D;;IAG3D,uDAAuD;;CAExD,CAAC"}
1
+ {"version":3,"file":"allFeatures.d.ts","sourceRoot":"","sources":["../src/allFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,WAAW;IAGtB,kDAAkD;;IAGlD,2DAA2D;;IAG3D,sEAAsE;;IAGtE;;;OAGG;;IAMH,kEAAkE;;IAGlE,sCAAsC;;IAGtC,2DAA2D;;IAG3D,uDAAuD;;IAGvD,mGAAmG;;CAIpG,CAAC"}
@@ -25,5 +25,9 @@ export const allFeatures = {
25
25
  useSingleWebServer: { description: 'Use a single server for both bundles and app assets.' },
26
26
  /** Enables the verification of exports during init. */
27
27
  verifyExports: { description: 'Enables the verification of exports during init.' },
28
+ /** Automatically updates the generated config when an unknown import path is used during start. */
29
+ autoUpdateEntries: {
30
+ description: 'Automatically updates the generated config when an unknown import path is used during start.',
31
+ },
28
32
  };
29
33
  //# sourceMappingURL=allFeatures.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"allFeatures.js","sourceRoot":"","sources":["../src/allFeatures.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,8FAA8F;IAE9F,kDAAkD;IAClD,sBAAsB,EAAE,EAAE,WAAW,EAAE,6CAA6C,EAAa;IAEjG,2DAA2D;IAC3D,iBAAiB,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAa;IAErG,sEAAsE;IACtE,mBAAmB,EAAE,EAAE,WAAW,EAAE,iEAAiE,EAAa;IAElH;;;OAGG;IACH,oBAAoB,EAAE;QACpB,WAAW,EACT,iKAAiK;KACzJ;IAEZ,kEAAkE;IAClE,oBAAoB,EAAE,EAAE,WAAW,EAAE,6DAA6D,EAAa;IAE/G,sCAAsC;IACtC,WAAW,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAa;IAE1E,2DAA2D;IAC3D,kBAAkB,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAa;IAEtG,uDAAuD;IACvD,aAAa,EAAE,EAAE,WAAW,EAAE,kDAAkD,EAAa;CAC9F,CAAC","sourcesContent":["import type { Feature } from './Feature.js';\n\n/**\n * A set of options for configuring the experience.\n * Features can be set to true to change the default behavior.\n */\nexport const allFeatures = {\n // The comments provide intellisense, and the description strings are used in the help output.\n\n /** Enables the use of builtin dynamic imports. */\n evaluateDynamicImports: { description: 'Enables the use of builtin dynamic imports.' } as Feature,\n\n /** Disables the generation of source-maps during build. */\n disableSourceMaps: { description: 'Disables the generation of source-maps during build.' } as Feature,\n\n /** Enables the preemptive enqueueing of dependencies during build. */\n enqueueDependencies: { description: 'Enables the preemptive enqueueing of dependencies during build.' } as Feature,\n\n /**\n * Excludes unused dependencies in the generated config during an init run.\n * This helps trim the dependency graph, reduce the import map, and speed up performance.\n */\n optimizeDependencies: {\n description:\n 'Excludes unused dependencies in the generated config during an init run. This helps trim the dependency graph, reduce the import map, and speed up performance.',\n } as Feature,\n\n /** Enables React Native type resolution of .web.ts extensions. */\n resolveWebExtensions: { description: 'Enables React Native type resolution of .web.ts extensions.' } as Feature,\n\n /** Enables the syncing of bundles. */\n syncBundles: { description: 'Enables the syncing of bundles.' } as Feature,\n\n /** Use a single server for both bundles and app assets. */\n useSingleWebServer: { description: 'Use a single server for both bundles and app assets.' } as Feature,\n\n /** Enables the verification of exports during init. */\n verifyExports: { description: 'Enables the verification of exports during init.' } as Feature,\n};\n"]}
1
+ {"version":3,"file":"allFeatures.js","sourceRoot":"","sources":["../src/allFeatures.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,8FAA8F;IAE9F,kDAAkD;IAClD,sBAAsB,EAAE,EAAE,WAAW,EAAE,6CAA6C,EAAa;IAEjG,2DAA2D;IAC3D,iBAAiB,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAa;IAErG,sEAAsE;IACtE,mBAAmB,EAAE,EAAE,WAAW,EAAE,iEAAiE,EAAa;IAElH;;;OAGG;IACH,oBAAoB,EAAE;QACpB,WAAW,EACT,iKAAiK;KACzJ;IAEZ,kEAAkE;IAClE,oBAAoB,EAAE,EAAE,WAAW,EAAE,6DAA6D,EAAa;IAE/G,sCAAsC;IACtC,WAAW,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAa;IAE1E,2DAA2D;IAC3D,kBAAkB,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAa;IAEtG,uDAAuD;IACvD,aAAa,EAAE,EAAE,WAAW,EAAE,kDAAkD,EAAa;IAE7F,mGAAmG;IACnG,iBAAiB,EAAE;QACjB,WAAW,EAAE,8FAA8F;KACjG;CACb,CAAC","sourcesContent":["import type { Feature } from './Feature.js';\n\n/**\n * A set of options for configuring the experience.\n * Features can be set to true to change the default behavior.\n */\nexport const allFeatures = {\n // The comments provide intellisense, and the description strings are used in the help output.\n\n /** Enables the use of builtin dynamic imports. */\n evaluateDynamicImports: { description: 'Enables the use of builtin dynamic imports.' } as Feature,\n\n /** Disables the generation of source-maps during build. */\n disableSourceMaps: { description: 'Disables the generation of source-maps during build.' } as Feature,\n\n /** Enables the preemptive enqueueing of dependencies during build. */\n enqueueDependencies: { description: 'Enables the preemptive enqueueing of dependencies during build.' } as Feature,\n\n /**\n * Excludes unused dependencies in the generated config during an init run.\n * This helps trim the dependency graph, reduce the import map, and speed up performance.\n */\n optimizeDependencies: {\n description:\n 'Excludes unused dependencies in the generated config during an init run. This helps trim the dependency graph, reduce the import map, and speed up performance.',\n } as Feature,\n\n /** Enables React Native type resolution of .web.ts extensions. */\n resolveWebExtensions: { description: 'Enables React Native type resolution of .web.ts extensions.' } as Feature,\n\n /** Enables the syncing of bundles. */\n syncBundles: { description: 'Enables the syncing of bundles.' } as Feature,\n\n /** Use a single server for both bundles and app assets. */\n useSingleWebServer: { description: 'Use a single server for both bundles and app assets.' } as Feature,\n\n /** Enables the verification of exports during init. */\n verifyExports: { description: 'Enables the verification of exports during init.' } as Feature,\n\n /** Automatically updates the generated config when an unknown import path is used during start. */\n autoUpdateEntries: {\n description: 'Automatically updates the generated config when an unknown import path is used during start.',\n } as Feature,\n};\n"]}
package/lib/index.d.ts CHANGED
@@ -18,7 +18,8 @@ export type { GeneratedConfig } from './GeneratedConfig.js';
18
18
  export type { HttpsConfig } from './HttpsConfig.js';
19
19
  export type { PackageOverride } from './PackageOverride.js';
20
20
  export type { PackageSettings } from './PackageSettings.js';
21
- export type { Route } from './Route.js';
21
+ export type { Route, RenderedRoute, BootstrapRoute, StaticRoute } from './Route.js';
22
+ export { isBootstrapRoute, isRenderedRoute, isStaticRoute } from './Route.js';
22
23
  export type { TelemetryConfig } from './TelemetryConfig.js';
23
24
  export type { AppConfig } from './AppConfig.js';
24
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,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;AAC1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AAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
package/lib/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { allFeatures } from './allFeatures.js';
2
+ export { isBootstrapRoute, isRenderedRoute, isStaticRoute } from './Route.js';
2
3
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC","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 { 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 { PackageOverride } from './PackageOverride.js';\nexport type { PackageSettings } from './PackageSettings.js';\nexport type { Route } 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;AAmC/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 { 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 { 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/common-types",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "description": "Common types for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -431,16 +431,25 @@
431
431
  "additionalProperties": false
432
432
  },
433
433
  "Route": {
434
+ "anyOf": [
435
+ {
436
+ "$ref": "#/definitions/RenderedRoute"
437
+ },
438
+ {
439
+ "$ref": "#/definitions/StaticRoute"
440
+ },
441
+ {
442
+ "$ref": "#/definitions/BootstrapRoute"
443
+ }
444
+ ]
445
+ },
446
+ "RenderedRoute": {
434
447
  "type": "object",
435
448
  "properties": {
436
449
  "match": {
437
450
  "type": "string",
438
451
  "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'`."
439
452
  },
440
- "staticPath": {
441
- "type": "string",
442
- "description": "The path relative to the app root to static assets. If this is provided, renderScript/exportEntry will be ignored."
443
- },
444
453
  "renderScript": {
445
454
  "type": "string",
446
455
  "description": "Path to a .js or .html file used for rendering the route. If a script is provided, it must export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/app-server`."
@@ -450,10 +459,53 @@
450
459
  "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."
451
460
  }
452
461
  },
462
+ "additionalProperties": false,
453
463
  "required": [
454
464
  "match"
455
465
  ],
456
- "additionalProperties": false
466
+ "description": "A server-rendered route. The route is rendered by a custom server script in Cloudpack."
467
+ },
468
+ "StaticRoute": {
469
+ "type": "object",
470
+ "properties": {
471
+ "match": {
472
+ "type": "string",
473
+ "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'`."
474
+ },
475
+ "staticPath": {
476
+ "type": "string",
477
+ "description": "The path relative to the app root to static assets."
478
+ }
479
+ },
480
+ "required": [
481
+ "match",
482
+ "staticPath"
483
+ ],
484
+ "additionalProperties": false,
485
+ "description": "A route with a staticPath property serves static files from the specified path."
486
+ },
487
+ "BootstrapRoute": {
488
+ "type": "object",
489
+ "properties": {
490
+ "match": {
491
+ "type": "string",
492
+ "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'`."
493
+ },
494
+ "type": {
495
+ "type": "string",
496
+ "const": "bootstrap"
497
+ },
498
+ "exportEntry": {
499
+ "type": "string",
500
+ "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."
501
+ }
502
+ },
503
+ "required": [
504
+ "match",
505
+ "type"
506
+ ],
507
+ "additionalProperties": false,
508
+ "description": "A route that serves a bootstrap script."
457
509
  },
458
510
  "TelemetryConfig": {
459
511
  "type": "object",
@@ -494,6 +546,9 @@
494
546
  },
495
547
  "verifyExports": {
496
548
  "type": "boolean"
549
+ },
550
+ "autoUpdateEntries": {
551
+ "type": "boolean"
497
552
  }
498
553
  },
499
554
  "additionalProperties": false,
@@ -432,16 +432,25 @@
432
432
  "additionalProperties": false
433
433
  },
434
434
  "Route": {
435
+ "anyOf": [
436
+ {
437
+ "$ref": "#/definitions/RenderedRoute"
438
+ },
439
+ {
440
+ "$ref": "#/definitions/StaticRoute"
441
+ },
442
+ {
443
+ "$ref": "#/definitions/BootstrapRoute"
444
+ }
445
+ ]
446
+ },
447
+ "RenderedRoute": {
435
448
  "type": "object",
436
449
  "properties": {
437
450
  "match": {
438
451
  "type": "string",
439
452
  "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'`."
440
453
  },
441
- "staticPath": {
442
- "type": "string",
443
- "description": "The path relative to the app root to static assets. If this is provided, renderScript/exportEntry will be ignored."
444
- },
445
454
  "renderScript": {
446
455
  "type": "string",
447
456
  "description": "Path to a .js or .html file used for rendering the route. If a script is provided, it must export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/app-server`."
@@ -451,10 +460,53 @@
451
460
  "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."
452
461
  }
453
462
  },
463
+ "additionalProperties": false,
454
464
  "required": [
455
465
  "match"
456
466
  ],
457
- "additionalProperties": false
467
+ "description": "A server-rendered route. The route is rendered by a custom server script in Cloudpack."
468
+ },
469
+ "StaticRoute": {
470
+ "type": "object",
471
+ "properties": {
472
+ "match": {
473
+ "type": "string",
474
+ "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'`."
475
+ },
476
+ "staticPath": {
477
+ "type": "string",
478
+ "description": "The path relative to the app root to static assets."
479
+ }
480
+ },
481
+ "required": [
482
+ "match",
483
+ "staticPath"
484
+ ],
485
+ "additionalProperties": false,
486
+ "description": "A route with a staticPath property serves static files from the specified path."
487
+ },
488
+ "BootstrapRoute": {
489
+ "type": "object",
490
+ "properties": {
491
+ "match": {
492
+ "type": "string",
493
+ "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'`."
494
+ },
495
+ "type": {
496
+ "type": "string",
497
+ "const": "bootstrap"
498
+ },
499
+ "exportEntry": {
500
+ "type": "string",
501
+ "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."
502
+ }
503
+ },
504
+ "required": [
505
+ "match",
506
+ "type"
507
+ ],
508
+ "additionalProperties": false,
509
+ "description": "A route that serves a bootstrap script."
458
510
  },
459
511
  "TelemetryConfig": {
460
512
  "type": "object",
@@ -495,6 +547,9 @@
495
547
  },
496
548
  "verifyExports": {
497
549
  "type": "boolean"
550
+ },
551
+ "autoUpdateEntries": {
552
+ "type": "boolean"
498
553
  }
499
554
  },
500
555
  "additionalProperties": false,