@ms-cloudpack/common-types 0.14.0 → 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.
@@ -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"]}
@@ -12,10 +12,12 @@ export interface RenderFunctionOptions {
12
12
  baseUrl: string;
13
13
  definition: PackageJson;
14
14
  importMap: ImportMap;
15
- overlayScript: string | undefined;
16
- entryScript: string | undefined;
17
- inlineScripts: string[];
15
+ overlayScript?: string;
16
+ entryScripts?: string[];
17
+ inlineScripts?: string[];
18
18
  req: Request;
19
19
  res: Response;
20
+ /** @deprecated - use entryScripts. */
21
+ entryScript?: string;
20
22
  }
21
23
  //# sourceMappingURL=RenderFunctionOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderFunctionOptions.d.ts","sourceRoot":"","sources":["../src/RenderFunctionOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,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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"}
@@ -1 +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 | undefined;\n entryScript: string | undefined;\n inlineScripts: string[];\n req: Request;\n res: Response;\n}\n"]}
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"]}
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,IAAI,CAAC,sBAAsB,EAAE,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E"}
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"]}
package/lib/index.d.ts CHANGED
@@ -20,7 +20,7 @@ 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';
@@ -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,CAA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,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';\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"]}
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.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Common types for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -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": {