@ms-cloudpack/common-types 0.13.4 → 0.15.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.
Files changed (52) hide show
  1. package/lib/BundleOptions.d.ts +8 -3
  2. package/lib/BundleOptions.d.ts.map +1 -1
  3. package/lib/BundleOptions.js.map +1 -1
  4. package/lib/BundleOutputFile.d.ts +5 -2
  5. package/lib/BundleOutputFile.d.ts.map +1 -1
  6. package/lib/BundleOutputFile.js.map +1 -1
  7. package/lib/ImportMap.d.ts +8 -0
  8. package/lib/ImportMap.d.ts.map +1 -0
  9. package/lib/ImportMap.js +2 -0
  10. package/lib/ImportMap.js.map +1 -0
  11. package/lib/LinkedPath.d.ts +28 -0
  12. package/lib/LinkedPath.d.ts.map +1 -0
  13. package/lib/LinkedPath.js +2 -0
  14. package/lib/LinkedPath.js.map +1 -0
  15. package/lib/RenderFunction.d.ts +7 -0
  16. package/lib/RenderFunction.d.ts.map +1 -0
  17. package/lib/RenderFunction.js +2 -0
  18. package/lib/RenderFunction.js.map +1 -0
  19. package/lib/RenderFunctionOptions.d.ts +23 -0
  20. package/lib/RenderFunctionOptions.d.ts.map +1 -0
  21. package/lib/RenderFunctionOptions.js +2 -0
  22. package/lib/RenderFunctionOptions.js.map +1 -0
  23. package/lib/RenderFunctionResult.d.ts +22 -0
  24. package/lib/RenderFunctionResult.d.ts.map +1 -0
  25. package/lib/RenderFunctionResult.js +2 -0
  26. package/lib/RenderFunctionResult.js.map +1 -0
  27. package/lib/RenderFunctionScript.d.ts +8 -0
  28. package/lib/RenderFunctionScript.d.ts.map +1 -0
  29. package/lib/RenderFunctionScript.js +2 -0
  30. package/lib/RenderFunctionScript.js.map +1 -0
  31. package/lib/ResolveMap.d.ts +6 -0
  32. package/lib/ResolveMap.d.ts.map +1 -0
  33. package/lib/ResolveMap.js +2 -0
  34. package/lib/ResolveMap.js.map +1 -0
  35. package/lib/ResolveMapEntry.d.ts +59 -0
  36. package/lib/ResolveMapEntry.d.ts.map +1 -0
  37. package/lib/ResolveMapEntry.js +2 -0
  38. package/lib/ResolveMapEntry.js.map +1 -0
  39. package/lib/Route.d.ts +5 -5
  40. package/lib/Route.d.ts.map +1 -1
  41. package/lib/Route.js +1 -2
  42. package/lib/Route.js.map +1 -1
  43. package/lib/Session.d.ts +77 -0
  44. package/lib/Session.d.ts.map +1 -0
  45. package/lib/Session.js +2 -0
  46. package/lib/Session.js.map +1 -0
  47. package/lib/index.d.ts +11 -1
  48. package/lib/index.d.ts.map +1 -1
  49. package/lib/index.js.map +1 -1
  50. package/package.json +4 -1
  51. package/schema/AppConfig.json +40 -37
  52. package/schema/UserConfig.json +40 -37
@@ -8,9 +8,14 @@ export interface BundleOptions extends Pick<PackageSettings, 'bundler' | 'bundle
8
8
  */
9
9
  inputPath: string;
10
10
  /**
11
- * The entry point paths map. Key is path to the output file, relative to `outputPath` and stripped of `.js`
12
- * extension. Value is the input entry path, relative to `inputPath` including the extension. For example:
13
- * `{ 'lib/index': 'src/index.js' }`
11
+ * Mapping from output file to source file paths.
12
+ * - Key is the output file path, relative to `outputPath` (with forward slashes and leading `./`)
13
+ * and *without* the extension (unless it's non-JS).
14
+ * - Value is the input file path, relative to `inputPath` (with forward slashes and leading `./`)
15
+ * including the extension.
16
+ *
17
+ * For example:
18
+ * `{ './lib/index': './src/index.js' }`
14
19
  *
15
20
  * Note: Non-javascript extensions, such as `.css` or `.scss`, will not be stripped from the key.
16
21
  * This is to ensure the bundler keeps the original extension intact and adds `.js` after it.
@@ -1 +1 @@
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"}
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;;;;;;;;;;;;OAYG;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"}
@@ -1 +1 @@
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"]}
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 * Mapping from output file to source file paths.\n * - Key is the output file path, relative to `outputPath` (with forward slashes and leading `./`)\n * and *without* the extension (unless it's non-JS).\n * - Value is the input file path, relative to `inputPath` (with forward slashes and leading `./`)\n * including the extension.\n *\n * 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"]}
@@ -1,16 +1,19 @@
1
1
  export interface BundleOutputFile {
2
2
  /**
3
3
  * The relative path to the output file (starting from `BundleResult#outputPath`),
4
- * with forward slashes.
4
+ * with forward slashes and an extension.
5
5
  */
6
6
  outputPath: string;
7
7
  /**
8
8
  * The relative path to the entry file (starting from `BundleResult#inputPath`),
9
- * with forward slashes.
9
+ * with forward slashes and an extension. This will only be set for files that were
10
+ * listed in `entries`.
10
11
  */
11
12
  entryPoint?: string;
12
13
  /**
13
14
  * The list of export names coming from the output file.
15
+ *
16
+ * WARNING: This is not set by all bundlers!
14
17
  */
15
18
  exports?: string[];
16
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"BundleOutputFile.d.ts","sourceRoot":"","sources":["../src/BundleOutputFile.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB"}
1
+ {"version":3,"file":"BundleOutputFile.d.ts","sourceRoot":"","sources":["../src/BundleOutputFile.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"BundleOutputFile.js","sourceRoot":"","sources":["../src/BundleOutputFile.ts"],"names":[],"mappings":"","sourcesContent":["export interface BundleOutputFile {\n /**\n * The relative path to the output file (starting from `BundleResult#outputPath`),\n * with forward slashes.\n */\n outputPath: string;\n\n /**\n * The relative path to the entry file (starting from `BundleResult#inputPath`),\n * with forward slashes.\n */\n entryPoint?: string;\n\n /**\n * The list of export names coming from the output file.\n */\n exports?: string[];\n}\n"]}
1
+ {"version":3,"file":"BundleOutputFile.js","sourceRoot":"","sources":["../src/BundleOutputFile.ts"],"names":[],"mappings":"","sourcesContent":["export interface BundleOutputFile {\n /**\n * The relative path to the output file (starting from `BundleResult#outputPath`),\n * with forward slashes and an extension.\n */\n outputPath: string;\n\n /**\n * The relative path to the entry file (starting from `BundleResult#inputPath`),\n * with forward slashes and an extension. This will only be set for files that were\n * listed in `entries`.\n */\n entryPoint?: string;\n\n /**\n * The list of export names coming from the output file.\n *\n * WARNING: This is not set by all bundlers!\n */\n exports?: string[];\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * ImportMap is a JSON object that describes the mapping of bare module specifiers to URLs.
3
+ */
4
+ export interface ImportMap {
5
+ imports: Record<string, string>;
6
+ scopes?: Record<string, Record<string, string>>;
7
+ }
8
+ //# sourceMappingURL=ImportMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImportMap.d.ts","sourceRoot":"","sources":["../src/ImportMap.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ImportMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImportMap.js","sourceRoot":"","sources":["../src/ImportMap.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * ImportMap is a JSON object that describes the mapping of bare module specifiers to URLs.\n */\nexport interface ImportMap {\n imports: Record<string, string>;\n scopes?: Record<string, Record<string, string>>;\n}\n"]}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Represents a path linked to the resolve map.
3
+ */
4
+ export interface LinkedPath {
5
+ /**
6
+ * Path to where the link originates.
7
+ */
8
+ path: string;
9
+ /**
10
+ * Optional git root to limit package resolution discovery.
11
+ */
12
+ rootPath?: string;
13
+ /**
14
+ * If true, transitive internal packages will be linked rather than only the matched packages.
15
+ */
16
+ includeAll?: boolean;
17
+ /**
18
+ * Package matches to ignore when linking.
19
+ */
20
+ ignoredPackages?: string[];
21
+ /**
22
+ * If true, ignores resolutions from the host repo definition to the linked packages.
23
+ */
24
+ ignoreResolutions?: boolean;
25
+ /** The strategy to use when resolving linked packages. Defaults to "dedupe". */
26
+ resolveStrategy?: 'dedupe' | 'duplicate';
27
+ }
28
+ //# sourceMappingURL=LinkedPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkedPath.d.ts","sourceRoot":"","sources":["../src/LinkedPath.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAE3B;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,gFAAgF;IAChF,eAAe,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;CAC1C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=LinkedPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkedPath.js","sourceRoot":"","sources":["../src/LinkedPath.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Represents a path linked to the resolve map.\n */\nexport interface LinkedPath {\n /**\n * Path to where the link originates.\n */\n path: string;\n\n /**\n * Optional git root to limit package resolution discovery.\n */\n rootPath?: string;\n\n /**\n * If true, transitive internal packages will be linked rather than only the matched packages.\n */\n includeAll?: boolean;\n\n /**\n * Package matches to ignore when linking.\n */\n ignoredPackages?: string[];\n\n /**\n * If true, ignores resolutions from the host repo definition to the linked packages.\n */\n ignoreResolutions?: boolean;\n\n /** The strategy to use when resolving linked packages. Defaults to \"dedupe\". */\n resolveStrategy?: 'dedupe' | 'duplicate';\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { RenderFunctionOptions } from './RenderFunctionOptions.js';
2
+ import type { RenderFunctionResult } from './RenderFunctionResult.js';
3
+ /**
4
+ * A custom server render function that can be used to override the default HTML response.
5
+ */
6
+ export type RenderFunction = (options: RenderFunctionOptions) => Promise<RenderFunctionResult> | RenderFunctionResult;
7
+ //# sourceMappingURL=RenderFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunction.d.ts","sourceRoot":"","sources":["../src/RenderFunction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,qBAAqB,KAAK,OAAO,CAAC,oBAAoB,CAAC,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RenderFunction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunction.js","sourceRoot":"","sources":["../src/RenderFunction.ts"],"names":[],"mappings":"","sourcesContent":["import type { RenderFunctionOptions } from './RenderFunctionOptions.js';\nimport type { RenderFunctionResult } from './RenderFunctionResult.js';\n\n/**\n * A custom server render function that can be used to override the default HTML response.\n */\nexport type RenderFunction = (options: RenderFunctionOptions) => Promise<RenderFunctionResult> | RenderFunctionResult;\n"]}
@@ -0,0 +1,23 @@
1
+ import type { Request, Response } from 'express';
2
+ import type { ImportMap } from './ImportMap.js';
3
+ import type { PackageJson } from './PackageJson.js';
4
+ import type { RenderedRoute } from './Route.js';
5
+ import type { Session } from './Session.js';
6
+ /**
7
+ * The input options for a `renderScript` custom server render function.
8
+ */
9
+ export interface RenderFunctionOptions {
10
+ session: Session;
11
+ route: RenderedRoute;
12
+ baseUrl: string;
13
+ definition: PackageJson;
14
+ importMap: ImportMap;
15
+ overlayScript?: string;
16
+ entryScripts?: string[];
17
+ inlineScripts?: string[];
18
+ req: Request;
19
+ res: Response;
20
+ /** @deprecated - use entryScripts. */
21
+ entryScript?: string;
22
+ }
23
+ //# sourceMappingURL=RenderFunctionOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionOptions.d.ts","sourceRoot":"","sources":["../src/RenderFunctionOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,QAAQ,CAAC;IAEd,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RenderFunctionOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionOptions.js","sourceRoot":"","sources":["../src/RenderFunctionOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { Request, Response } from 'express';\nimport type { ImportMap } from './ImportMap.js';\nimport type { PackageJson } from './PackageJson.js';\nimport type { RenderedRoute } from './Route.js';\nimport type { Session } from './Session.js';\n\n/**\n * The input options for a `renderScript` custom server render function.\n */\nexport interface RenderFunctionOptions {\n session: Session;\n route: RenderedRoute;\n baseUrl: string;\n definition: PackageJson;\n importMap: ImportMap;\n overlayScript?: string;\n entryScripts?: string[];\n inlineScripts?: string[];\n req: Request;\n res: Response;\n\n /** @deprecated - use entryScripts. */\n entryScript?: string;\n}\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The complete expected result of the `renderScript` custom server render function.
3
+ */
4
+ export interface ExpandedRenderFunctionResult {
5
+ /** Response body */
6
+ content: string;
7
+ /** Standard HTTP status code - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status */
8
+ statusCode: number;
9
+ /** MIME type for the response - https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types */
10
+ contentType: string;
11
+ }
12
+ /**
13
+ * The expected result of the `renderScript` custom server render function.
14
+ *
15
+ * If the result is a string, it's assumed to be the HTML content.
16
+ *
17
+ * If an object and the `content` is non-HTML, `contentType` must be set.
18
+ */
19
+ export type RenderFunctionResult = string | ({
20
+ content: string;
21
+ } & Partial<ExpandedRenderFunctionResult>);
22
+ //# sourceMappingURL=RenderFunctionResult.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionResult.d.ts","sourceRoot":"","sources":["../src/RenderFunctionResult.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,UAAU,EAAE,MAAM,CAAC;IACnB,4HAA4H;IAC5H,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RenderFunctionResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionResult.js","sourceRoot":"","sources":["../src/RenderFunctionResult.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The complete expected result of the `renderScript` custom server render function.\n */\nexport interface ExpandedRenderFunctionResult {\n /** Response body */\n content: string;\n /** Standard HTTP status code - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status */\n statusCode: number;\n /** MIME type for the response - https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types */\n contentType: string;\n}\n\n/**\n * The expected result of the `renderScript` custom server render function.\n *\n * If the result is a string, it's assumed to be the HTML content.\n *\n * If an object and the `content` is non-HTML, `contentType` must be set.\n */\nexport type RenderFunctionResult = string | ({ content: string } & Partial<ExpandedRenderFunctionResult>);\n"]}
@@ -0,0 +1,8 @@
1
+ import type { RenderFunction } from './RenderFunction.js';
2
+ /**
3
+ * The expected shape of the `renderScript` custom server render function script.
4
+ */
5
+ export type RenderFunctionScript = {
6
+ default: RenderFunction;
7
+ };
8
+ //# sourceMappingURL=RenderFunctionScript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionScript.d.ts","sourceRoot":"","sources":["../src/RenderFunctionScript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=RenderFunctionScript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RenderFunctionScript.js","sourceRoot":"","sources":["../src/RenderFunctionScript.ts"],"names":[],"mappings":"","sourcesContent":["import type { RenderFunction } from './RenderFunction.js';\n\n/**\n * The expected shape of the `renderScript` custom server render function script.\n */\nexport type RenderFunctionScript = { default: RenderFunction };\n"]}
@@ -0,0 +1,6 @@
1
+ import type { ResolveMapEntry } from './ResolveMapEntry.js';
2
+ /**
3
+ * A map of package names to ResolveMapEntry objects.
4
+ */
5
+ export type ResolveMap = Record<string, ResolveMapEntry>;
6
+ //# sourceMappingURL=ResolveMap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResolveMap.d.ts","sourceRoot":"","sources":["../src/ResolveMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ResolveMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResolveMap.js","sourceRoot":"","sources":["../src/ResolveMap.ts"],"names":[],"mappings":"","sourcesContent":["import type { ResolveMapEntry } from './ResolveMapEntry.js';\n\n/**\n * A map of package names to ResolveMapEntry objects.\n */\nexport type ResolveMap = Record<string, ResolveMapEntry>;\n"]}
@@ -0,0 +1,59 @@
1
+ export type ResolveMapEntry = {
2
+ /**
3
+ * Package name.
4
+ *
5
+ * If the package was pulled in as a renamed non-semver dep, this will be the name specified in
6
+ * the parent's dependencies (not the actual name).
7
+ */
8
+ name: string;
9
+ /**
10
+ * Resolved/installed package version. For a linked internal package, this will end in `-linked`.
11
+ * (The docs for `isExternal` explain what "internal" means.)
12
+ *
13
+ * If the package was pulled in as a non-semver dep, this will be the transformed version
14
+ * (e.g. `0.0.0-npm-foo-1-0-0`) based on the parent's dependencies.
15
+ */
16
+ version: string;
17
+ /** Path to the resolved/installed package. */
18
+ path: string;
19
+ /**
20
+ * Map from dependency name to resolved/installed version.
21
+ *
22
+ * For any non-semver deps, the key (name) is as specified in package.json dependencies,
23
+ * mapped to the transformed version (e.g. `0.0.0-npm-foo-1-0-0`).
24
+ */
25
+ dependencies: Record<string, string>;
26
+ /**
27
+ * Map from requesting/parent package name `@` the actual version of that package to
28
+ * the original semver range of this package that it requested.
29
+ *
30
+ * Example: if this entry is for package `bar`, and `foo@1.0.0` depends on `"bar": "^2.0.0"`,
31
+ * this will be `{ "foo@1.0.0": "^2.0.0" }`.
32
+ *
33
+ * If the parent package was pulled in by its parent (the grandparent) as a non-semver dep,
34
+ * the key will use the name as specified by the grandparent and the transformed version.
35
+ */
36
+ requiredBy: Record<`${string}@${string}`, string>;
37
+ /**
38
+ * A package is considered "external" if it was installed from a package manager (its realpath
39
+ * contains `node_modules`). This is the opposite of "internal", which means that the package
40
+ * is defined in a local folder/repo.
41
+ */
42
+ isExternal?: boolean;
43
+ /**
44
+ * Whether this package is linked **AND** is internal to its actual folder/repo.
45
+ * (The docs for `isExternal` explain what "internal" means.)
46
+ */
47
+ isLinked?: boolean;
48
+ /**
49
+ * Additional installed versions of this package, which are required per semver by some other
50
+ * package in the map.
51
+ *
52
+ * For any version that was pulled in as a non-semver dep, the key will be the transformed
53
+ * version (e.g. `0.0.0-npm-foo-1-0-0`).
54
+ */
55
+ scopedVersions?: {
56
+ [version: string]: ResolveMapEntry;
57
+ };
58
+ };
59
+ //# sourceMappingURL=ResolveMapEntry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResolveMapEntry.d.ts","sourceRoot":"","sources":["../src/ResolveMapEntry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC;;;;;;;;;OASG;IACH,UAAU,EAAE,MAAM,CAAC,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC;IAElD;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE;QACf,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAAC;KACpC,CAAC;CACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ResolveMapEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResolveMapEntry.js","sourceRoot":"","sources":["../src/ResolveMapEntry.ts"],"names":[],"mappings":"","sourcesContent":["export type ResolveMapEntry = {\n /**\n * Package name.\n *\n * If the package was pulled in as a renamed non-semver dep, this will be the name specified in\n * the parent's dependencies (not the actual name).\n */\n name: string;\n\n /**\n * Resolved/installed package version. For a linked internal package, this will end in `-linked`.\n * (The docs for `isExternal` explain what \"internal\" means.)\n *\n * If the package was pulled in as a non-semver dep, this will be the transformed version\n * (e.g. `0.0.0-npm-foo-1-0-0`) based on the parent's dependencies.\n */\n version: string;\n\n /** Path to the resolved/installed package. */\n path: string;\n\n /**\n * Map from dependency name to resolved/installed version.\n *\n * For any non-semver deps, the key (name) is as specified in package.json dependencies,\n * mapped to the transformed version (e.g. `0.0.0-npm-foo-1-0-0`).\n */\n dependencies: Record<string, string>;\n\n /**\n * Map from requesting/parent package name `@` the actual version of that package to\n * the original semver range of this package that it requested.\n *\n * Example: if this entry is for package `bar`, and `foo@1.0.0` depends on `\"bar\": \"^2.0.0\"`,\n * this will be `{ \"foo@1.0.0\": \"^2.0.0\" }`.\n *\n * If the parent package was pulled in by its parent (the grandparent) as a non-semver dep,\n * the key will use the name as specified by the grandparent and the transformed version.\n */\n requiredBy: Record<`${string}@${string}`, string>;\n\n /**\n * A package is considered \"external\" if it was installed from a package manager (its realpath\n * contains `node_modules`). This is the opposite of \"internal\", which means that the package\n * is defined in a local folder/repo.\n */\n isExternal?: boolean;\n\n /**\n * Whether this package is linked **AND** is internal to its actual folder/repo.\n * (The docs for `isExternal` explain what \"internal\" means.)\n */\n isLinked?: boolean;\n\n /**\n * Additional installed versions of this package, which are required per semver by some other\n * package in the map.\n *\n * For any version that was pulled in as a non-semver dep, the key will be the transformed\n * version (e.g. `0.0.0-npm-foo-1-0-0`).\n */\n scopedVersions?: {\n [version: string]: ResolveMapEntry;\n };\n};\n"]}
package/lib/Route.d.ts CHANGED
@@ -19,20 +19,20 @@ export interface ShorthandRenderedRoute extends SharedRouteOptions {
19
19
  */
20
20
  renderScript?: string;
21
21
  /**
22
- * The key in the exports map which represents the entry point app script for this route.
22
+ * @deprecated - The key in the exports map which represents the entry point app script for this route.
23
23
  * Default is '.', meaning the main package export key.
24
24
  */
25
25
  exportEntry?: string;
26
26
  /**
27
- * To be implemented. The source entry or entries to be included on the page for this route.
27
+ * The source entry or entries to be included on the page for this route.
28
28
  */
29
- entry?: (string | ExpandedSourcePath)[];
29
+ entry?: string | string[];
30
30
  }
31
31
  /**
32
32
  * A server-rendered route with full `entry` info (used in the processed `CloudpackConfig`).
33
33
  * The route is rendered by a custom server script in Cloudpack.
34
34
  */
35
- export type RenderedRoute = Omit<ShorthandRenderedRoute, 'entry'> & {
35
+ export type RenderedRoute = Omit<ShorthandRenderedRoute, 'exportEntry' | 'entry'> & {
36
36
  /**
37
37
  * To be implemented. The source entry or entries to be included on the page for this route.
38
38
  */
@@ -50,7 +50,7 @@ export interface StaticRoute extends SharedRouteOptions {
50
50
  /**
51
51
  * A route that serves a bootstrap script.
52
52
  */
53
- export interface BootstrapRoute extends SharedRouteOptions, Pick<ShorthandRenderedRoute, 'exportEntry'> {
53
+ export interface BootstrapRoute extends SharedRouteOptions, Pick<RenderedRoute, 'entry'> {
54
54
  type: 'bootstrap';
55
55
  }
56
56
  /**
@@ -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;;;;;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,I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G,KAAK,IAAI,aAAa,CAEpE"}
package/lib/Route.js CHANGED
@@ -15,8 +15,7 @@ export function isBootstrapRoute(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));
18
+ return !isBootstrapRoute(route) && !!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry);
20
19
  }
21
20
  /**
22
21
  * Type guard to check if a route is a redirect route.
package/lib/Route.js.map CHANGED
@@ -1 +1 @@
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"]}
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,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,YAAY,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACrG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,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 * @deprecated - 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 * The source entry or entries to be included on the page for this route.\n */\n entry?: string | string[];\n}\n\n/**\n * A server-rendered route with full `entry` info (used in the processed `CloudpackConfig`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport type RenderedRoute = Omit<ShorthandRenderedRoute, 'exportEntry' | 'entry'> & {\n /**\n * 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<RenderedRoute, 'entry'> {\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 !isBootstrapRoute(route) && !!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry);\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"]}
@@ -0,0 +1,77 @@
1
+ import type { ImportMap } from './ImportMap.js';
2
+ import type { LinkedPath } from './LinkedPath.js';
3
+ import type { ResolveMap } from './ResolveMap.js';
4
+ import type { CloudpackConfig } from './CloudpackConfig.js';
5
+ export interface Session {
6
+ /**
7
+ * The session id, used for identifying
8
+ */
9
+ id: string;
10
+ /**
11
+ * The config used by the session.
12
+ */
13
+ config: CloudpackConfig;
14
+ /**
15
+ * Used to resolve packages in the dependency graph.
16
+ */
17
+ resolveMap: ResolveMap;
18
+ /**
19
+ * Reload sequence to ensure that the client is always up to date with the latest changes.
20
+ */
21
+ sequence: number;
22
+ /**
23
+ * URLs of the active servers hosting this session.
24
+ * Each URL will only be set after the server is started.
25
+ */
26
+ urls: {
27
+ appServer?: string;
28
+ /** If `useSingleWebServer` is enabled, this will be a URL for bundles under the app server. */
29
+ bundleServer?: string;
30
+ apiServer?: string;
31
+ };
32
+ /**
33
+ * Used to force a hard refresh on the client.
34
+ */
35
+ sessionVersion: number;
36
+ /**
37
+ * Used to increment the session version by 1.
38
+ */
39
+ incrementSessionVersion: () => void;
40
+ /**
41
+ * The name of the project folder.
42
+ * Used to differentiate between multiple projects.
43
+ */
44
+ projectName: string;
45
+ /**
46
+ * The version of each target.
47
+ * Used to force a client cache refresh on a single target.
48
+ */
49
+ targetVersions: Record<string, number>;
50
+ /**
51
+ * Increments the version for the given target.
52
+ */
53
+ incrementTargetVersion: (inputPath: string) => void;
54
+ /**
55
+ * The import map for the session.
56
+ */
57
+ importMap: ImportMap | undefined;
58
+ /**
59
+ * Linked paths that are used to resolve packages from other repos.
60
+ */
61
+ linkedPaths: LinkedPath[];
62
+ /**
63
+ * Add the linked path and regenerates the resolve map.
64
+ */
65
+ addLinkedPath: (linkedPath: LinkedPath) => Promise<{
66
+ resolveMap: ResolveMap;
67
+ linkedPaths: LinkedPath[];
68
+ }>;
69
+ /**
70
+ * Remove the linked path and regenerates the resolve map.
71
+ */
72
+ removeLinkedPath: (linkedPath: LinkedPath) => Promise<{
73
+ resolveMap: ResolveMap;
74
+ linkedPaths: LinkedPath[];
75
+ }>;
76
+ }
77
+ //# sourceMappingURL=Session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Session.d.ts","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,MAAM,EAAE,eAAe,CAAC;IAExB;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,IAAI,EAAE;QACJ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,+FAA+F;QAC/F,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,uBAAuB,EAAE,MAAM,IAAI,CAAC;IAEpC;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEvC;;OAEG;IACH,sBAAsB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpD;;OAEG;IACH,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IAEjC;;OAEG;IACH,WAAW,EAAE,UAAU,EAAE,CAAC;IAE1B;;OAEG;IACH,aAAa,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC;QAAE,UAAU,EAAE,UAAU,CAAC;QAAC,WAAW,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC,CAAC;IAE1G;;OAEG;IACH,gBAAgB,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC;QAAE,UAAU,EAAE,UAAU,CAAC;QAAC,WAAW,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC,CAAC;CAC9G"}
package/lib/Session.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Session.js","sourceRoot":"","sources":["../src/Session.ts"],"names":[],"mappings":"","sourcesContent":["import type { ImportMap } from './ImportMap.js';\nimport type { LinkedPath } from './LinkedPath.js';\nimport type { ResolveMap } from './ResolveMap.js';\nimport type { CloudpackConfig } from './CloudpackConfig.js';\n\nexport interface Session {\n /**\n * The session id, used for identifying\n */\n id: string;\n\n /**\n * The config used by the session.\n */\n config: CloudpackConfig;\n\n /**\n * Used to resolve packages in the dependency graph.\n */\n resolveMap: ResolveMap;\n\n /**\n * Reload sequence to ensure that the client is always up to date with the latest changes.\n */\n sequence: number;\n\n /**\n * URLs of the active servers hosting this session.\n * Each URL will only be set after the server is started.\n */\n urls: {\n appServer?: string;\n /** If `useSingleWebServer` is enabled, this will be a URL for bundles under the app server. */\n bundleServer?: string;\n apiServer?: string;\n };\n\n /**\n * Used to force a hard refresh on the client.\n */\n sessionVersion: number;\n\n /**\n * Used to increment the session version by 1.\n */\n incrementSessionVersion: () => void;\n\n /**\n * The name of the project folder.\n * Used to differentiate between multiple projects.\n */\n projectName: string;\n\n /**\n * The version of each target.\n * Used to force a client cache refresh on a single target.\n */\n targetVersions: Record<string, number>;\n\n /**\n * Increments the version for the given target.\n */\n incrementTargetVersion: (inputPath: string) => void;\n\n /**\n * The import map for the session.\n */\n importMap: ImportMap | undefined;\n\n /**\n * Linked paths that are used to resolve packages from other repos.\n */\n linkedPaths: LinkedPath[];\n\n /**\n * Add the linked path and regenerates the resolve map.\n */\n addLinkedPath: (linkedPath: LinkedPath) => Promise<{ resolveMap: ResolveMap; linkedPaths: LinkedPath[] }>;\n\n /**\n * Remove the linked path and regenerates the resolve map.\n */\n removeLinkedPath: (linkedPath: LinkedPath) => Promise<{ resolveMap: ResolveMap; linkedPaths: LinkedPath[] }>;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -20,9 +20,19 @@ 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, PackageSettingsMatch } from './PackageSettings.js';
23
- export type { Route, RenderedRoute, BootstrapRoute, StaticRoute, RedirectRoute } from './Route.js';
23
+ export type { BootstrapRoute, RedirectRoute, RenderedRoute, Route, SharedRouteOptions, ShorthandRenderedRoute, ShorthandRoute, StaticRoute, } from './Route.js';
24
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
27
  export type { InternalBundlerCapabilityImplementations, InternalBundlerCapabilitiesMetaData, BundlerCapabilitiesOptions, } from './BundlerCapability.js';
28
+ export type { RenderFunction } from './RenderFunction.js';
29
+ export type { RenderFunctionOptions } from './RenderFunctionOptions.js';
30
+ export type { RenderFunctionResult, ExpandedRenderFunctionResult } from './RenderFunctionResult.js';
31
+ export type { RenderFunctionScript } from './RenderFunctionScript.js';
32
+ export type { Request, Response } from 'express';
33
+ export type { Session } from './Session.js';
34
+ export type { ResolveMap } from './ResolveMap.js';
35
+ export type { ResolveMapEntry } from './ResolveMapEntry.js';
36
+ export type { LinkedPath } from './LinkedPath.js';
37
+ export type { ImportMap } from './ImportMap.js';
28
38
  //# 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;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,oBAA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CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,YAAY,EACV,wCAAwC,EACxC,mCAAmC,EACnC,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,YAAY,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACpG,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;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, PackageSettingsMatch } 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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA8C/C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { allFeatures } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\n 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, PackageSettingsMatch } from './PackageSettings.js';\nexport type {\n BootstrapRoute,\n RedirectRoute,\n RenderedRoute,\n Route,\n SharedRouteOptions,\n ShorthandRenderedRoute,\n ShorthandRoute,\n StaticRoute,\n} from './Route.js';\nexport { isBootstrapRoute, isRenderedRoute, isStaticRoute, isRedirectRoute } from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n InternalBundlerCapabilityImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n} from './BundlerCapability.js';\nexport type { RenderFunction } from './RenderFunction.js';\nexport type { RenderFunctionOptions } from './RenderFunctionOptions.js';\nexport type { RenderFunctionResult, ExpandedRenderFunctionResult } from './RenderFunctionResult.js';\nexport type { RenderFunctionScript } from './RenderFunctionScript.js';\nexport type { Request, Response } from 'express';\nexport type { Session } from './Session.js';\nexport type { ResolveMap } from './ResolveMap.js';\nexport type { ResolveMapEntry } from './ResolveMapEntry.js';\nexport type { LinkedPath } from './LinkedPath.js';\nexport type { ImportMap } from './ImportMap.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/common-types",
3
- "version": "0.13.4",
3
+ "version": "0.15.0",
4
4
  "description": "Common types for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,6 +13,9 @@
13
13
  "import": "./lib/index.js"
14
14
  }
15
15
  },
16
+ "dependencies": {
17
+ "@types/express": "^4.17.16"
18
+ },
16
19
  "devDependencies": {
17
20
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
18
21
  "@ms-cloudpack/scripts": "^0.0.1"
@@ -534,21 +534,21 @@
534
534
  },
535
535
  "exportEntry": {
536
536
  "type": "string",
537
- "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."
537
+ "deprecated": "- The key in the exports map which represents the entry point app script for this route.\nDefault is '.', meaning the main package export key."
538
538
  },
539
539
  "entry": {
540
- "type": "array",
541
- "items": {
542
- "anyOf": [
543
- {
540
+ "anyOf": [
541
+ {
542
+ "type": "string"
543
+ },
544
+ {
545
+ "type": "array",
546
+ "items": {
544
547
  "type": "string"
545
- },
546
- {
547
- "$ref": "#/definitions/ExpandedSourcePath"
548
548
  }
549
- ]
550
- },
551
- "description": "To be implemented. The source entry or entries to be included on the page for this route."
549
+ }
550
+ ],
551
+ "description": "The source entry or entries to be included on the page for this route."
552
552
  }
553
553
  },
554
554
  "additionalProperties": false,
@@ -557,29 +557,6 @@
557
557
  ],
558
558
  "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."
559
559
  },
560
- "ExpandedSourcePath": {
561
- "type": "object",
562
- "properties": {
563
- "sourcePath": {
564
- "type": "string",
565
- "description": "The relative path to the source file. (e.g. `./src/index.ts`)"
566
- },
567
- "importPath": {
568
- "type": "string",
569
- "description": "The path to import the resulting bundled output from. This would represent the key in the import map entry to be imported. (e.g. `.` represents the default package export.)"
570
- },
571
- "requestPath": {
572
- "type": "string",
573
- "description": "The path to be requested by the browser. This would present the value in the import map entry to be requested. (e.g. `./lib/index.js`)"
574
- }
575
- },
576
- "required": [
577
- "sourcePath",
578
- "importPath",
579
- "requestPath"
580
- ],
581
- "additionalProperties": false
582
- },
583
560
  "StaticRoute": {
584
561
  "type": "object",
585
562
  "properties": {
@@ -612,9 +589,12 @@
612
589
  "BootstrapRoute": {
613
590
  "type": "object",
614
591
  "properties": {
615
- "exportEntry": {
616
- "type": "string",
617
- "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."
592
+ "entry": {
593
+ "type": "array",
594
+ "items": {
595
+ "$ref": "#/definitions/ExpandedSourcePath"
596
+ },
597
+ "description": "To be implemented. The source entry or entries to be included on the page for this route."
618
598
  },
619
599
  "match": {
620
600
  "anyOf": [
@@ -642,6 +622,29 @@
642
622
  "additionalProperties": false,
643
623
  "description": "A route that serves a bootstrap script."
644
624
  },
625
+ "ExpandedSourcePath": {
626
+ "type": "object",
627
+ "properties": {
628
+ "sourcePath": {
629
+ "type": "string",
630
+ "description": "The relative path to the source file. (e.g. `./src/index.ts`)"
631
+ },
632
+ "importPath": {
633
+ "type": "string",
634
+ "description": "The path to import the resulting bundled output from. This would represent the key in the import map entry to be imported. (e.g. `.` represents the default package export.)"
635
+ },
636
+ "requestPath": {
637
+ "type": "string",
638
+ "description": "The path to be requested by the browser. This would present the value in the import map entry to be requested. (e.g. `./lib/index.js`)"
639
+ }
640
+ },
641
+ "required": [
642
+ "sourcePath",
643
+ "importPath",
644
+ "requestPath"
645
+ ],
646
+ "additionalProperties": false
647
+ },
645
648
  "RedirectRoute": {
646
649
  "type": "object",
647
650
  "properties": {
@@ -535,21 +535,21 @@
535
535
  },
536
536
  "exportEntry": {
537
537
  "type": "string",
538
- "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."
538
+ "deprecated": "- The key in the exports map which represents the entry point app script for this route.\nDefault is '.', meaning the main package export key."
539
539
  },
540
540
  "entry": {
541
- "type": "array",
542
- "items": {
543
- "anyOf": [
544
- {
541
+ "anyOf": [
542
+ {
543
+ "type": "string"
544
+ },
545
+ {
546
+ "type": "array",
547
+ "items": {
545
548
  "type": "string"
546
- },
547
- {
548
- "$ref": "#/definitions/ExpandedSourcePath"
549
549
  }
550
- ]
551
- },
552
- "description": "To be implemented. The source entry or entries to be included on the page for this route."
550
+ }
551
+ ],
552
+ "description": "The source entry or entries to be included on the page for this route."
553
553
  }
554
554
  },
555
555
  "additionalProperties": false,
@@ -558,29 +558,6 @@
558
558
  ],
559
559
  "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."
560
560
  },
561
- "ExpandedSourcePath": {
562
- "type": "object",
563
- "properties": {
564
- "sourcePath": {
565
- "type": "string",
566
- "description": "The relative path to the source file. (e.g. `./src/index.ts`)"
567
- },
568
- "importPath": {
569
- "type": "string",
570
- "description": "The path to import the resulting bundled output from. This would represent the key in the import map entry to be imported. (e.g. `.` represents the default package export.)"
571
- },
572
- "requestPath": {
573
- "type": "string",
574
- "description": "The path to be requested by the browser. This would present the value in the import map entry to be requested. (e.g. `./lib/index.js`)"
575
- }
576
- },
577
- "required": [
578
- "sourcePath",
579
- "importPath",
580
- "requestPath"
581
- ],
582
- "additionalProperties": false
583
- },
584
561
  "StaticRoute": {
585
562
  "type": "object",
586
563
  "properties": {
@@ -613,9 +590,12 @@
613
590
  "BootstrapRoute": {
614
591
  "type": "object",
615
592
  "properties": {
616
- "exportEntry": {
617
- "type": "string",
618
- "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."
593
+ "entry": {
594
+ "type": "array",
595
+ "items": {
596
+ "$ref": "#/definitions/ExpandedSourcePath"
597
+ },
598
+ "description": "To be implemented. The source entry or entries to be included on the page for this route."
619
599
  },
620
600
  "match": {
621
601
  "anyOf": [
@@ -643,6 +623,29 @@
643
623
  "additionalProperties": false,
644
624
  "description": "A route that serves a bootstrap script."
645
625
  },
626
+ "ExpandedSourcePath": {
627
+ "type": "object",
628
+ "properties": {
629
+ "sourcePath": {
630
+ "type": "string",
631
+ "description": "The relative path to the source file. (e.g. `./src/index.ts`)"
632
+ },
633
+ "importPath": {
634
+ "type": "string",
635
+ "description": "The path to import the resulting bundled output from. This would represent the key in the import map entry to be imported. (e.g. `.` represents the default package export.)"
636
+ },
637
+ "requestPath": {
638
+ "type": "string",
639
+ "description": "The path to be requested by the browser. This would present the value in the import map entry to be requested. (e.g. `./lib/index.js`)"
640
+ }
641
+ },
642
+ "required": [
643
+ "sourcePath",
644
+ "importPath",
645
+ "requestPath"
646
+ ],
647
+ "additionalProperties": false
648
+ },
646
649
  "RedirectRoute": {
647
650
  "type": "object",
648
651
  "properties": {