@ms-cloudpack/common-types 0.19.7 → 0.21.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 (40) hide show
  1. package/lib/AppConfig.d.ts +16 -10
  2. package/lib/AppConfig.d.ts.map +1 -1
  3. package/lib/AppConfig.js.map +1 -1
  4. package/lib/BundleMode.d.ts +4 -5
  5. package/lib/BundleMode.d.ts.map +1 -1
  6. package/lib/BundleMode.js.map +1 -1
  7. package/lib/CloudpackConfig.d.ts +3 -3
  8. package/lib/CloudpackConfig.d.ts.map +1 -1
  9. package/lib/CloudpackConfig.js.map +1 -1
  10. package/lib/LinkOptions.d.ts +8 -5
  11. package/lib/LinkOptions.d.ts.map +1 -1
  12. package/lib/LinkOptions.js.map +1 -1
  13. package/lib/PackageSettings.d.ts +10 -6
  14. package/lib/PackageSettings.d.ts.map +1 -1
  15. package/lib/PackageSettings.js.map +1 -1
  16. package/lib/RenderFunction.d.ts +11 -3
  17. package/lib/RenderFunction.d.ts.map +1 -1
  18. package/lib/RenderFunction.js.map +1 -1
  19. package/lib/Route.d.ts +5 -4
  20. package/lib/Route.d.ts.map +1 -1
  21. package/lib/Route.js.map +1 -1
  22. package/lib/{DevServer.d.ts → ServerConfig.d.ts} +9 -8
  23. package/lib/ServerConfig.d.ts.map +1 -0
  24. package/lib/ServerConfig.js +2 -0
  25. package/lib/ServerConfig.js.map +1 -0
  26. package/lib/allFeatures.d.ts +8 -5
  27. package/lib/allFeatures.d.ts.map +1 -1
  28. package/lib/allFeatures.js +19 -11
  29. package/lib/allFeatures.js.map +1 -1
  30. package/lib/index.d.ts +1 -1
  31. package/lib/index.d.ts.map +1 -1
  32. package/lib/index.js.map +1 -1
  33. package/lib/tsdoc-metadata.json +1 -1
  34. package/package.json +1 -1
  35. package/schema/AppConfig.json +36 -29
  36. package/schema/GeneratedConfig.json +3 -3
  37. package/schema/UserConfig.json +36 -29
  38. package/lib/DevServer.d.ts.map +0 -1
  39. package/lib/DevServer.js +0 -2
  40. package/lib/DevServer.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import type { DevServer } from './DevServer.js';
1
+ import type { ServerConfig } from './ServerConfig.js';
2
2
  import type { Features } from './Features.js';
3
3
  import type { PackageSettings } from './PackageSettings.js';
4
4
  import type { RemoteCacheConfig } from './RemoteCacheConfig.js';
@@ -22,16 +22,19 @@ export interface AppConfig {
22
22
  */
23
23
  extends?: string | string[];
24
24
  /**
25
- * A set of options for configuring how the dev server works.
25
+ * @deprecated - use "server" instead.
26
26
  */
27
- devServer?: DevServer;
27
+ devServer?: ServerConfig;
28
28
  /**
29
- * A set of options for configuring telemetry
29
+ * Configuration for the dev server.
30
+ */
31
+ server?: ServerConfig;
32
+ /**
33
+ * Configuration for telemetry.
30
34
  */
31
35
  telemetry?: TelemetryConfig;
32
36
  /**
33
- * A set of options for configuring the experience. Features can be set to true to change the default
34
- * behavior.
37
+ * Enable additional Cloudpack features.
35
38
  */
36
39
  features?: Features;
37
40
  /**
@@ -39,12 +42,12 @@ export interface AppConfig {
39
42
  */
40
43
  helpMessage?: string;
41
44
  /**
42
- * An array of PackageSettings objects, used to provide settings for how we bundle packages.
45
+ * Settings to customize how packages are bundled.
43
46
  */
44
47
  packageSettings?: PackageSettings[];
45
48
  /**
46
- * An optional list of commands (followed by a string array of args for that command)
47
- * to be executed prior to Cloudpack bundle
49
+ * Commands to execute prior to Cloudpack bundling.
50
+ * Each entry has a command and an array of arguments: `['command', ['arg1', 'arg2']]`.
48
51
  */
49
52
  dependsOn?: [string, string[]][];
50
53
  /**
@@ -64,7 +67,10 @@ export interface AppConfig {
64
67
  */
65
68
  routes?: ShorthandRoute[];
66
69
  /**
67
- * A list of package names that should never be excluded or included from the bundle.
70
+ * Ignore these package names when calculating included and excluded dependencies.
71
+ * This is mainly intended for helper packages such as `tslib`.
72
+ *
73
+ * Include `...` to merge with the default list (`tslib` and `@babel/runtime` as of writing).
68
74
  */
69
75
  neverExcludeDependencies?: string[];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
1
- {"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { DevServer } from './DevServer.js';\nimport type { Features } from './Features.js';\nimport type { PackageSettings } from './PackageSettings.js';\nimport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nimport type { ShorthandRoute } from './Route.js';\nimport type { TelemetryConfig } from './TelemetryConfig.js';\n\n/**\n * Per-application user-provided configuration for Cloudpack.\n */\nexport interface AppConfig {\n /**\n * Extend the configuration from another file: either an import path or a relative path\n * (resolved from the config file's location).\n *\n * If an array, later files will take precedence when merging.\n * (The user config always takes precedence over any extended config.)\n *\n * Config merging approach:\n * - Objects will be deeply merged.\n * - Primitive values will be overwritten.\n * - Arrays will be overwritten, EXCEPT for `packageSettings`, which will be concatenated.\n */\n extends?: string | string[];\n\n /**\n * A set of options for configuring how the dev server works.\n */\n devServer?: DevServer;\n\n /**\n * A set of options for configuring telemetry\n */\n telemetry?: TelemetryConfig;\n\n /**\n * A set of options for configuring the experience. Features can be set to true to change the default\n * behavior.\n */\n features?: Features;\n\n /**\n * Help message to display when Cloudpack starts up.\n */\n helpMessage?: string;\n\n /**\n * An array of PackageSettings objects, used to provide settings for how we bundle packages.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * An optional list of commands (followed by a string array of args for that command)\n * to be executed prior to Cloudpack bundle\n */\n dependsOn?: [string, string[]][];\n\n /**\n * Glob pattern to match `patch-package` patch files, relative to the project root\n * (usually the same as the repository root).\n * @default \"patches/*.patch\"\n */\n patchFilesGlobPattern?: string;\n\n /**\n * Azure Blob Storage configuration for remote cache - uploading and downloading packages\n * via `cloudpack sync`. If this is not provided, the remote cache will not be used.\n */\n remoteCache?: RemoteCacheConfig;\n\n /**\n * Defines what routes to support from the app server, and which scripts will be loaded\n * for each.\n */\n routes?: ShorthandRoute[];\n\n /**\n * A list of package names that should never be excluded or included from the bundle.\n */\n neverExcludeDependencies?: string[];\n\n /**\n * Key value pairs of external bundler capabilities that can be enabled in the package settings.\n * Key is the name of the capability, which will be used in the package settings to enable the capability.\n * Value is the import identifier for the capability module.\n *\n * (Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)\n */\n bundlerCapabilitiesRegistry?: Record<string, string>;\n}\n"]}
1
+ {"version":3,"file":"AppConfig.js","sourceRoot":"","sources":["../src/AppConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { ServerConfig } from './ServerConfig.js';\nimport type { Features } from './Features.js';\nimport type { PackageSettings } from './PackageSettings.js';\nimport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nimport type { ShorthandRoute } from './Route.js';\nimport type { TelemetryConfig } from './TelemetryConfig.js';\n\n/**\n * Per-application user-provided configuration for Cloudpack.\n */\nexport interface AppConfig {\n /**\n * Extend the configuration from another file: either an import path or a relative path\n * (resolved from the config file's location).\n *\n * If an array, later files will take precedence when merging.\n * (The user config always takes precedence over any extended config.)\n *\n * Config merging approach:\n * - Objects will be deeply merged.\n * - Primitive values will be overwritten.\n * - Arrays will be overwritten, EXCEPT for `packageSettings`, which will be concatenated.\n */\n extends?: string | string[];\n\n /**\n * @deprecated - use \"server\" instead.\n */\n devServer?: ServerConfig;\n\n /**\n * Configuration for the dev server.\n */\n server?: ServerConfig;\n\n /**\n * Configuration for telemetry.\n */\n telemetry?: TelemetryConfig;\n\n /**\n * Enable additional Cloudpack features.\n */\n features?: Features;\n\n /**\n * Help message to display when Cloudpack starts up.\n */\n helpMessage?: string;\n\n /**\n * Settings to customize how packages are bundled.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * Commands to execute prior to Cloudpack bundling.\n * Each entry has a command and an array of arguments: `['command', ['arg1', 'arg2']]`.\n */\n dependsOn?: [string, string[]][];\n\n /**\n * Glob pattern to match `patch-package` patch files, relative to the project root\n * (usually the same as the repository root).\n * @default \"patches/*.patch\"\n */\n patchFilesGlobPattern?: string;\n\n /**\n * Azure Blob Storage configuration for remote cache - uploading and downloading packages\n * via `cloudpack sync`. If this is not provided, the remote cache will not be used.\n */\n remoteCache?: RemoteCacheConfig;\n\n /**\n * Defines what routes to support from the app server, and which scripts will be loaded\n * for each.\n */\n routes?: ShorthandRoute[];\n\n /**\n * Ignore these package names when calculating included and excluded dependencies.\n * This is mainly intended for helper packages such as `tslib`.\n *\n * Include `...` to merge with the default list (`tslib` and `@babel/runtime` as of writing).\n */\n neverExcludeDependencies?: string[];\n\n /**\n * Key value pairs of external bundler capabilities that can be enabled in the package settings.\n * Key is the name of the capability, which will be used in the package settings to enable the capability.\n * Value is the import identifier for the capability module.\n *\n * (Within Cloudpack code, `readAppConfig` resolves the values to absolute file URLs.)\n */\n bundlerCapabilitiesRegistry?: Record<string, string>;\n}\n"]}
@@ -1,9 +1,8 @@
1
1
  /**
2
- * The mode of the session controls how the code is bundled. Library
3
- * mode bundles each package in isolation, while development and
4
- * production modes bundle the full app graph together. Library
5
- * mode is fastest but packages must be complaint for loading in
6
- * the browser.
2
+ * Controls how the code is bundled. Library mode bundles each package in isolation, while
3
+ * production mode (and development mode once implemented) bundle the full app graph together.
4
+ *
5
+ * Library mode is fastest, but packages must be compliant for loading in the browser.
7
6
  */
8
7
  export type BundleMode = 'library' | 'development' | 'production';
9
8
  //# sourceMappingURL=BundleMode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BundleMode.d.ts","sourceRoot":"","sources":["../src/BundleMode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,YAAY,CAAC"}
1
+ {"version":3,"file":"BundleMode.d.ts","sourceRoot":"","sources":["../src/BundleMode.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BundleMode.js","sourceRoot":"","sources":["../src/BundleMode.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The mode of the session controls how the code is bundled. Library\n * mode bundles each package in isolation, while development and\n * production modes bundle the full app graph together. Library\n * mode is fastest but packages must be complaint for loading in\n * the browser.\n */\nexport type BundleMode = 'library' | 'development' | 'production';\n"]}
1
+ {"version":3,"file":"BundleMode.js","sourceRoot":"","sources":["../src/BundleMode.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Controls how the code is bundled. Library mode bundles each package in isolation, while\n * production mode (and development mode once implemented) bundle the full app graph together.\n *\n * Library mode is fastest, but packages must be compliant for loading in the browser.\n */\nexport type BundleMode = 'library' | 'development' | 'production';\n"]}
@@ -2,11 +2,11 @@ import type { GeneratedConfig } from './GeneratedConfig.js';
2
2
  import type { AppConfig } from './AppConfig.js';
3
3
  import type { BundleMode } from './BundleMode.js';
4
4
  import type { Route } from './Route.js';
5
- import type { DevServer } from './DevServer.js';
5
+ import type { ServerConfig } from './ServerConfig.js';
6
6
  /**
7
7
  * The merged result of user-provided and generated configuration for Cloudpack.
8
8
  */
9
- export type CloudpackConfig = Omit<AppConfig, 'routes' | 'devServer'> & {
9
+ export type CloudpackConfig = Omit<AppConfig, 'routes' | 'server'> & {
10
10
  /**
11
11
  * The path to the app's package.
12
12
  */
@@ -14,7 +14,7 @@ export type CloudpackConfig = Omit<AppConfig, 'routes' | 'devServer'> & {
14
14
  /**
15
15
  * Dev server settings.
16
16
  */
17
- devServer?: Omit<DevServer, 'routes'>;
17
+ server?: Omit<ServerConfig, 'routes'>;
18
18
  /**
19
19
  * Mode to run the app in.
20
20
  */
@@ -1 +1 @@
1
- {"version":3,"file":"CloudpackConfig.d.ts","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CA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AAC,eAAe,CAAC,CAAC;IAE9C;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CloudpackConfig.js","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { GeneratedConfig } from './GeneratedConfig.js';\nimport type { AppConfig } from './AppConfig.js';\nimport type { BundleMode } from './BundleMode.js';\nimport type { Route } from './Route.js';\nimport type { DevServer } from './DevServer.js';\n\n/**\n * The merged result of user-provided and generated configuration for Cloudpack.\n */\n\nexport type CloudpackConfig = Omit<AppConfig, 'routes' | 'devServer'> & {\n /**\n * The path to the app's package.\n */\n appPath: string;\n\n /**\n * Dev server settings.\n */\n devServer?: Omit<DevServer, 'routes'>;\n\n /**\n * Mode to run the app in.\n */\n mode: BundleMode;\n\n /**\n * Generated config settings.\n */\n generated: GeneratedConfig;\n\n /**\n * An immutable snapshot of the generated config as it is when start or init commands first begin\n */\n generatedSnapshot?: Readonly<GeneratedConfig>;\n\n /**\n * Routes which have been expanded from shorthand entries.\n */\n routes?: Route[];\n};\n"]}
1
+ {"version":3,"file":"CloudpackConfig.js","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { GeneratedConfig } from './GeneratedConfig.js';\nimport type { AppConfig } from './AppConfig.js';\nimport type { BundleMode } from './BundleMode.js';\nimport type { Route } from './Route.js';\nimport type { ServerConfig } from './ServerConfig.js';\n\n/**\n * The merged result of user-provided and generated configuration for Cloudpack.\n */\n\nexport type CloudpackConfig = Omit<AppConfig, 'routes' | 'server'> & {\n /**\n * The path to the app's package.\n */\n appPath: string;\n\n /**\n * Dev server settings.\n */\n server?: Omit<ServerConfig, 'routes'>;\n\n /**\n * Mode to run the app in.\n */\n mode: BundleMode;\n\n /**\n * Generated config settings.\n */\n generated: GeneratedConfig;\n\n /**\n * An immutable snapshot of the generated config as it is when start or init commands first begin\n */\n generatedSnapshot?: Readonly<GeneratedConfig>;\n\n /**\n * Routes which have been expanded from shorthand entries.\n */\n routes?: Route[];\n};\n"]}
@@ -3,11 +3,14 @@
3
3
  */
4
4
  export type LinkOptions = {
5
5
  /**
6
- * Controls the behavior of duplicated dependencies in the resolve map by link. By default, `allow-duplication`
7
- * is used, which allows multiple versions of the same package to exist in the resolve map to satisfy the semver.
8
- * If `force-host-version` is used, the package will be deduplicated to the version of the host package ignoring
9
- * semver requirements. If `force-remote-version` is used, the package will be deduplicated to the version of the
10
- * remote package ignoring semver requirements.
6
+ * Controls the behavior of duplicated dependencies in the resolve map when running `cloudpack link`.
7
+ *
8
+ * - `allow-duplication` (default): allow multiple versions of the same package to exist in the
9
+ * resolve map to satisfy semver.
10
+ * - `force-host-version`: the package will be deduplicated to the version of the host package,
11
+ * ignoring semver requirements.
12
+ * - `force-remote-version`: the package will be deduplicated to the version of the remote package,
13
+ * ignoring semver requirements.
11
14
  *
12
15
  * Note: These settings only apply when the resolve strategy is set to the default `dedupe`.
13
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"LinkOptions.d.ts","sourceRoot":"","sources":["../src/LinkOptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;;;;OAQG;IACH,4BAA4B,CAAC,EAAE,oBAAoB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;CACpG,CAAC"}
1
+ {"version":3,"file":"LinkOptions.d.ts","sourceRoot":"","sources":["../src/LinkOptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;;;;;;;OAWG;IACH,4BAA4B,CAAC,EAAE,oBAAoB,GAAG,mBAAmB,GAAG,sBAAsB,CAAC;CACpG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkOptions.js","sourceRoot":"","sources":["../src/LinkOptions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Options for when a package is linked in the resolve map.\n */\nexport type LinkOptions = {\n /**\n * Controls the behavior of duplicated dependencies in the resolve map by link. By default, `allow-duplication`\n * is used, which allows multiple versions of the same package to exist in the resolve map to satisfy the semver.\n * If `force-host-version` is used, the package will be deduplicated to the version of the host package ignoring\n * semver requirements. If `force-remote-version` is used, the package will be deduplicated to the version of the\n * remote package ignoring semver requirements.\n *\n * Note: These settings only apply when the resolve strategy is set to the default `dedupe`.\n */\n duplicatedDependencyBehavior?: 'force-host-version' | 'allow-duplication' | 'force-remote-version';\n};\n"]}
1
+ {"version":3,"file":"LinkOptions.js","sourceRoot":"","sources":["../src/LinkOptions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Options for when a package is linked in the resolve map.\n */\nexport type LinkOptions = {\n /**\n * Controls the behavior of duplicated dependencies in the resolve map when running `cloudpack link`.\n *\n * - `allow-duplication` (default): allow multiple versions of the same package to exist in the\n * resolve map to satisfy semver.\n * - `force-host-version`: the package will be deduplicated to the version of the host package,\n * ignoring semver requirements.\n * - `force-remote-version`: the package will be deduplicated to the version of the remote package,\n * ignoring semver requirements.\n *\n * Note: These settings only apply when the resolve strategy is set to the default `dedupe`.\n */\n duplicatedDependencyBehavior?: 'force-host-version' | 'allow-duplication' | 'force-remote-version';\n};\n"]}
@@ -30,24 +30,28 @@ export interface PackageSettings {
30
30
  /**
31
31
  * The dependencies which should be included when computing the import map. This is primarily used when
32
32
  * devDependencies are needed by the app. This often happens when a library has a demo app which relies
33
- * on devDependencies. Accepts `$devDependencies` as a special value to include all devDependencies.
33
+ * on devDependencies.
34
+ *
35
+ * Accepts `$devDependencies` as a special value to include all devDependencies.
34
36
  */
35
37
  includedDependencies?: string[];
36
38
  /**
37
39
  * The dependencies which should be ignored by Cloudpack verbs. For example, if "react-native" is a dependency
38
40
  * which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.
41
+ *
39
42
  * Accepts `$peerDependencies` as a special value to exclude all peerDependencies.
40
43
  */
41
44
  excludedDependencies?: string[];
42
45
  /**
43
- * Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which
44
- * are small and don't need to be loaded separately, or ones which have issues being resolved by the browser.
46
+ * Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for
47
+ * libraries which are small and don't need to be loaded separately, have issues being resolved
48
+ * by the browser, or provide reusable scss files.
45
49
  */
46
50
  inlinedDependencies?: string[];
47
51
  /**
48
- * The exports map that should be used for this package, ignoring entries which are defined in the original
49
- * package.json. This is useful for libraries which have a missing or broken exports map, or when we want to
50
- * trim the exports to reduce the api surface we expose to the inner loop experience.
52
+ * Use this exports map instead of the original entry points from package.json. (Any Cloudpack-
53
+ * generated exports will be merged.) This is useful if a library's exports map is missing
54
+ * or broken, or to skip bundling entries which aren't needed at runtime.
51
55
  */
52
56
  exports?: PackageJsonExports;
53
57
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"PackageSettings.d.ts","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,UAAU,0BAA0B;IAClC,iGAAiG;IACjG,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,0BAA0B,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,KAAK,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,CAAC;IAErD;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;I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"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { LinkOptions } from './LinkOptions.js';\nimport type { BundlerCapabilitiesOptions } from './BundlerCapability.js';\nimport type { PackageJsonExports } from './PackageJson.js';\n\ninterface PackageSettingsMatchObject {\n /** Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name. */\n name: string;\n\n /**\n * Version of the package. Unspecified matches any version.\n *\n * Note that if the package version is a prerelease, it will only match `*` or ranges that\n * explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`.\n */\n version?: string;\n}\n\n/**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n */\nexport type PackageSettingsMatch = string | PackageSettingsMatchObject;\n\n/**\n * Settings overrides for bundling a package (or multiple packages, depending on `match`).\n */\nexport interface PackageSettings {\n /**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n * An array allows multiple matches to be specified.\n */\n match: PackageSettingsMatch | PackageSettingsMatch[];\n\n /**\n * The dependencies which should be included when computing the import map. This is primarily used when\n * devDependencies are needed by the app. This often happens when a library has a demo app which relies\n * on devDependencies. Accepts `$devDependencies` as a special value to include all devDependencies.\n */\n includedDependencies?: string[];\n\n /**\n * The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency\n * which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.\n * Accepts `$peerDependencies` as a special value to exclude all peerDependencies.\n */\n excludedDependencies?: string[];\n\n /**\n * Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which\n * are small and don't need to be loaded separately, or ones which have issues being resolved by the browser.\n */\n inlinedDependencies?: string[];\n\n /**\n * The exports map that should be used for this package, ignoring entries which are defined in the original\n * package.json. This is useful for libraries which have a missing or broken exports map, or when we want to\n * trim the exports to reduce the api surface we expose to the inner loop experience.\n */\n exports?: PackageJsonExports;\n\n /**\n * Forces the package to be bundled using a specific bundler.\n */\n bundler?: string;\n\n /**\n * @deprecated Use `bundler`.\n *\n * This should be removed once repo configs are updated to use `bundler`.\n */\n bundlerType?: string;\n\n /**\n * Any bundler-specific options to be merged with the calculated bundler options.\n * `bundler` is also required if this is specified.\n *\n * This is an escape hatch which is generally not recommended, since it locks the package to\n * a specific bundler implementation.\n */\n bundlerOptions?: Record<string, unknown>;\n\n /**\n * Paths used for file monitoring and input hashing. Supports glob matching.\n * Defaults to `[/src/**, *.json]` and excludes node_modules.\n * Use `...` to include the default paths.\n */\n inputPaths?: string[];\n\n /**\n * Controls the behavior of the `verifyExports` feature when checking consumed exports from this package:\n * - If true, don't check this package's exports at all.\n * - If an object, this is a mapping from package import paths to export names to ignore. Examples:\n * - To ignore top-level exports: `{ \".\": [\"badName\"] }`\n * - To ignore exports from another path: `{ \"./lib/foo\": [\"badName\"] }`\n */\n ignoreMissingExports?: boolean | Record<string, string[]>;\n\n /**\n * Only relevant for packages bundled with rollup: globs of files that include dynamic (async)\n * imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to\n * that plugin's [limitations](https://www.npmjs.com/package/\\@rollup/plugin-dynamic-import-vars#limitations)).\n * Files matching `*.dynamic.*` are automatically included.\n *\n * This is not needed for ori/esbuild and webpack because they should handle these types of imports automatically.\n */\n dynamicImports?: string[];\n\n /**\n * Ignore these warning messages from the bundler (partial string matches).\n * This is intended for non-actionable messages from external dependencies which can't easily\n * be fixed, to avoid confusing users.\n */\n ignoredBundlerWarnings?: string[];\n\n /**\n * Settings to control how the package is linked in the resolve map.\n */\n link?: LinkOptions;\n\n /**\n * Setting to control the bundler capabilities for this package.\n * This is used to enable or disable specific bundler capabilities.\n */\n bundlerCapabilities?: BundlerCapabilitiesOptions;\n}\n\n/**\n * Subset of PackageSettings used in the generated config.\n */\nexport type GeneratedPackageSettings = Pick<\n PackageSettings,\n 'includedDependencies' | 'excludedDependencies' | 'dynamicImports' | 'exports'\n> & {\n /**\n * This will be a string (name) for internal packages, or match with name and version for external.\n * The match in this case will NOT contain wildcards in the name.\n */\n match: string | Required<PackageSettingsMatchObject>;\n};\n"]}
1
+ {"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { LinkOptions } from './LinkOptions.js';\nimport type { BundlerCapabilitiesOptions } from './BundlerCapability.js';\nimport type { PackageJsonExports } from './PackageJson.js';\n\ninterface PackageSettingsMatchObject {\n /** Name of the package. Can use a trailing wildcard (e.g. `@scope/*`). `*` to match any name. */\n name: string;\n\n /**\n * Version of the package. Unspecified matches any version.\n *\n * Note that if the package version is a prerelease, it will only match `*` or ranges that\n * explicitly include prereleases. For example, `^1.0.0` will not match `1.0.1-beta.0`.\n */\n version?: string;\n}\n\n/**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n */\nexport type PackageSettingsMatch = string | PackageSettingsMatchObject;\n\n/**\n * Settings overrides for bundling a package (or multiple packages, depending on `match`).\n */\nexport interface PackageSettings {\n /**\n * Which package(s) the settings should be applied to.\n * A string is a shorthand for matching the name with any version (`*` to match any name).\n * An array allows multiple matches to be specified.\n */\n match: PackageSettingsMatch | PackageSettingsMatch[];\n\n /**\n * The dependencies which should be included when computing the import map. This is primarily used when\n * devDependencies are needed by the app. This often happens when a library has a demo app which relies\n * on devDependencies.\n *\n * Accepts `$devDependencies` as a special value to include all devDependencies.\n */\n includedDependencies?: string[];\n\n /**\n * The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency\n * which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.\n *\n * Accepts `$peerDependencies` as a special value to exclude all peerDependencies.\n */\n excludedDependencies?: string[];\n\n /**\n * Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for\n * libraries which are small and don't need to be loaded separately, have issues being resolved\n * by the browser, or provide reusable scss files.\n */\n inlinedDependencies?: string[];\n\n /**\n * Use this exports map instead of the original entry points from package.json. (Any Cloudpack-\n * generated exports will be merged.) This is useful if a library's exports map is missing\n * or broken, or to skip bundling entries which aren't needed at runtime.\n */\n exports?: PackageJsonExports;\n\n /**\n * Forces the package to be bundled using a specific bundler.\n */\n bundler?: string;\n\n /**\n * @deprecated Use `bundler`.\n *\n * This should be removed once repo configs are updated to use `bundler`.\n */\n bundlerType?: string;\n\n /**\n * Any bundler-specific options to be merged with the calculated bundler options.\n * `bundler` is also required if this is specified.\n *\n * This is an escape hatch which is generally not recommended, since it locks the package to\n * a specific bundler implementation.\n */\n bundlerOptions?: Record<string, unknown>;\n\n /**\n * Paths used for file monitoring and input hashing. Supports glob matching.\n * Defaults to `[/src/**, *.json]` and excludes node_modules.\n * Use `...` to include the default paths.\n */\n inputPaths?: string[];\n\n /**\n * Controls the behavior of the `verifyExports` feature when checking consumed exports from this package:\n * - If true, don't check this package's exports at all.\n * - If an object, this is a mapping from package import paths to export names to ignore. Examples:\n * - To ignore top-level exports: `{ \".\": [\"badName\"] }`\n * - To ignore exports from another path: `{ \"./lib/foo\": [\"badName\"] }`\n */\n ignoreMissingExports?: boolean | Record<string, string[]>;\n\n /**\n * Only relevant for packages bundled with rollup: globs of files that include dynamic (async)\n * imports with non-literal paths, to be processed by `@rollup/plugin-dynamic-import-vars` (subject to\n * that plugin's [limitations](https://www.npmjs.com/package/\\@rollup/plugin-dynamic-import-vars#limitations)).\n * Files matching `*.dynamic.*` are automatically included.\n *\n * This is not needed for ori/esbuild and webpack because they should handle these types of imports automatically.\n */\n dynamicImports?: string[];\n\n /**\n * Ignore these warning messages from the bundler (partial string matches).\n * This is intended for non-actionable messages from external dependencies which can't easily\n * be fixed, to avoid confusing users.\n */\n ignoredBundlerWarnings?: string[];\n\n /**\n * Settings to control how the package is linked in the resolve map.\n */\n link?: LinkOptions;\n\n /**\n * Setting to control the bundler capabilities for this package.\n * This is used to enable or disable specific bundler capabilities.\n */\n bundlerCapabilities?: BundlerCapabilitiesOptions;\n}\n\n/**\n * Subset of PackageSettings used in the generated config.\n */\nexport type GeneratedPackageSettings = Pick<\n PackageSettings,\n 'includedDependencies' | 'excludedDependencies' | 'dynamicImports' | 'exports'\n> & {\n /**\n * This will be a string (name) for internal packages, or match with name and version for external.\n * The match in this case will NOT contain wildcards in the name.\n */\n match: string | Required<PackageSettingsMatchObject>;\n};\n"]}
@@ -8,21 +8,29 @@ import type { Session } from './Session.js';
8
8
  */
9
9
  export type RenderFunction = (options: RenderFunctionOptions) => Promise<RenderFunctionResult> | RenderFunctionResult;
10
10
  /**
11
- * The input options for a `renderScript` custom server render function.
11
+ * Input for a `renderScript` custom server render function.
12
12
  */
13
13
  export interface RenderFunctionOptions {
14
+ /** Info about the current app session */
14
15
  session: Session;
16
+ /** Processed route being rendered */
15
17
  route: RenderedRoute;
18
+ /** Base URL of the app server, including port */
16
19
  baseUrl: string;
20
+ /** `package.json` for the app */
17
21
  definition: PackageJson;
22
+ /** Import map that will be used by the app at runtime (will be injected into a returned HTML response) */
18
23
  importMap: ImportMap;
24
+ /** URL for the Cloudpack overlay script bundle (will be injected into a returned HTML response) */
19
25
  overlayScript?: string;
26
+ /** Additional script bundle URLs from `route.entry` (will be injected into a returned HTML response) */
20
27
  entryScripts?: string[];
28
+ /** Inline script tag contents used for Cloudpack initialization (will be injected into a returned HTML response) */
21
29
  inlineScripts?: string[];
30
+ /** Current request */
22
31
  req: Request;
32
+ /** Current response */
23
33
  res: Response;
24
- /** @deprecated use entryScripts. */
25
- entryScript?: string;
26
34
  }
27
35
  /**
28
36
  * The complete expected result of the `renderScript` custom server render function.
@@ -1 +1 @@
1
- {"version":3,"file":"RenderFunction.d.ts","sourceRoot":"","sources":["../src/RenderFunction.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,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G;IAAE,OAAO,EAAE,cAAc,CAAA;CAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RenderFunction.js","sourceRoot":"","sources":["../src/RenderFunction.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 * 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\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\n/**\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 a string, it's assumed to be the HTML content.\n * - If an object and the `content` is non-HTML, `contentType` must be set.\n * - If null, this means the function fully handled the request (sent a response using\n * `options.res.send('...')` or other methods).\n */\nexport type RenderFunctionResult = string | null | ({ content: string } & Partial<ExpandedRenderFunctionResult>);\n\n/**\n * The expected shape of the `renderScript` custom server render function JS file.\n */\nexport type RenderFunctionScript = { default: RenderFunction };\n"]}
1
+ {"version":3,"file":"RenderFunction.js","sourceRoot":"","sources":["../src/RenderFunction.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 * 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\n/**\n * Input for a `renderScript` custom server render function.\n */\nexport interface RenderFunctionOptions {\n /** Info about the current app session */\n session: Session;\n /** Processed route being rendered */\n route: RenderedRoute;\n /** Base URL of the app server, including port */\n baseUrl: string;\n /** `package.json` for the app */\n definition: PackageJson;\n /** Import map that will be used by the app at runtime (will be injected into a returned HTML response) */\n importMap: ImportMap;\n /** URL for the Cloudpack overlay script bundle (will be injected into a returned HTML response) */\n overlayScript?: string;\n /** Additional script bundle URLs from `route.entry` (will be injected into a returned HTML response) */\n entryScripts?: string[];\n /** Inline script tag contents used for Cloudpack initialization (will be injected into a returned HTML response) */\n inlineScripts?: string[];\n /** Current request */\n req: Request;\n /** Current response */\n res: Response;\n}\n\n/**\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 a string, it's assumed to be the HTML content.\n * - If an object and the `content` is non-HTML, `contentType` must be set.\n * - If null, this means the function fully handled the request (sent a response using\n * `options.res.send('...')` or other methods).\n */\nexport type RenderFunctionResult = string | null | ({ content: string } & Partial<ExpandedRenderFunctionResult>);\n\n/**\n * The expected shape of the `renderScript` custom server render function JS file.\n */\nexport type RenderFunctionScript = { default: RenderFunction };\n"]}
package/lib/Route.d.ts CHANGED
@@ -17,18 +17,19 @@ export interface SharedRouteOptions {
17
17
  */
18
18
  export interface ShorthandRenderedRoute extends SharedRouteOptions {
19
19
  /**
20
- * Path to a .js or .html file used for rendering the route. If a script is provided, it must
21
- * export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/common-types`.
20
+ * Path to a .js or .html file (relative to the app path) for rendering the route.
21
+ *
22
+ * If a .js file, it must export a default function implementing `RenderFunction` from `@ms-cloudpack/common-types`.
22
23
  */
23
24
  renderScript?: string;
24
25
  /**
25
26
  * The key in the exports map which represents the entry point app script for this route.
26
- * Default is '.', meaning the main package export key.
27
27
  * @deprecated Use `entry` instead.
28
28
  */
29
29
  exportEntry?: string;
30
30
  /**
31
- * The source entry or entries to be included on the page for this route.
31
+ * Additional source file path(s) to bundle and include in the HTML.
32
+ * This **overwrites** any original exports map for the package.
32
33
  *
33
34
  * Usually this should be an actual source path, though it could also be an exports map key if necessary.
34
35
  */
@@ -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;;;;;;;;OAQG;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;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG;IAClF;;OAEG;IACH,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,M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,IAAI,KAAK,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAA6B;IAC3D,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC","sourcesContent":["import type { ExpandedSourcePath } from './ExpandedSourcePath.js';\n\nexport interface SharedRouteOptions {\n /**\n * The URL path to match. Paths should usually start with a slash, e.g. `'/my-route'`.\n * You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n *\n * See the [Express docs](https://expressjs.com/en/guide/routing.html#route-paths) for the full\n * supported routing syntax.\n *\n * 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/common-types`.\n */\n renderScript?: string;\n\n /**\n * The key in the exports map which represents the entry point app script for this route.\n * Default is '.', meaning the main package export key.\n * @deprecated Use `entry` instead.\n */\n exportEntry?: string;\n\n /**\n * The source entry or entries to be included on the page for this route.\n *\n * Usually this should be an actual source path, though it could also be an exports map key if necessary.\n */\n entry?: string | string[];\n}\n\n/**\n * A server-rendered route with full `entry` info (used in the processed `CloudpackConfig`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport type RenderedRoute = Omit<ShorthandRenderedRoute, 'exportEntry' | 'entry'> & {\n /**\n * The source entry or entries to be included on the page for this route.\n */\n entry?: ExpandedSourcePath[];\n};\n\n/**\n * A route with a staticPath property serves static files from the specified path.\n */\nexport interface StaticRoute extends SharedRouteOptions {\n /**\n * The path relative to the app root to static assets.\n */\n staticPath: string;\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface ShorthandBootstrapRoute\n extends SharedRouteOptions,\n Pick<ShorthandRenderedRoute, 'entry' | 'exportEntry'> {\n type: 'bootstrap';\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface BootstrapRoute extends Omit<ShorthandBootstrapRoute, 'entry'>, Pick<RenderedRoute, 'entry'> {}\n\n/**\n * A route that redirects to another url.\n */\nexport interface RedirectRoute extends SharedRouteOptions {\n /**\n * The url to redirect to.\n */\n redirectTo: string;\n}\n\n/**\n * Route as specified in `AppConfig` (`cloudpack.config.json`).\n */\n// WARNING: Be sure to add new route types to Route as well!\nexport type ShorthandRoute = ShorthandRenderedRoute | ShorthandBootstrapRoute | StaticRoute | RedirectRoute;\n\n/**\n * Processed route as used in the processed `CloudpackConfig`.\n */\n// WARNING: Be sure to add new route types to ShorthandRoute as well!\nexport type Route = RenderedRoute | BootstrapRoute | StaticRoute | RedirectRoute;\n\n/**\n * Type guard to check if a route is a static route.\n */\nexport function isStaticRoute(route: Route | ShorthandRoute): route is StaticRoute {\n return 'staticPath' in route;\n}\n\n/**\n * Type guard to check if a route is a bootstrap route.\n */\nexport function isBootstrapRoute(route: Route): route is BootstrapRoute {\n return 'type' in route && route.type === 'bootstrap';\n}\n\n/**\n * Type guard to check if a route is a shorthand bootstrap route.\n */\nexport function isShorthandBootstrapRoute(route: ShorthandRoute): route is ShorthandBootstrapRoute {\n return isBootstrapRoute(route as Route);\n}\n\n/*\n * Type guard to check if a route is a rendered route.\n */\nexport function isRenderedRoute(route: Route): route is RenderedRoute {\n const maybeRenderedRoute = route as RenderedRoute;\n return !isBootstrapRoute(route) && !!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry);\n}\n\n/**\n * Type guard to check if a route is a shorthand rendered route.\n */\nexport function isShorthandRenderedRoute(route: ShorthandRoute): route is ShorthandRenderedRoute {\n return isRenderedRoute(route as Route) || 'exportEntry' in route;\n}\n\n/**\n * Type guard to check if a route is a redirect route.\n */\nexport function isRedirectRoute(route: Route | ShorthandRoute): route is RedirectRoute {\n return 'redirectTo' in route;\n}\n"]}
1
+ {"version":3,"file":"Route.js","sourceRoot":"","sources":["../src/Route.ts"],"names":[],"mappings":"AAmGA;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAA6B;IACzD,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAY;IAC3C,OAAO,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAqB;IAC7D,OAAO,gBAAgB,CAAC,KAAc,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAAY;IAC1C,MAAM,kBAAkB,GAAG,KAAsB,CAAC;IAClD,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,YAAY,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACrG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAqB;IAC5D,OAAO,eAAe,CAAC,KAAc,CAAC,IAAI,aAAa,IAAI,KAAK,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,KAA6B;IAC3D,OAAO,YAAY,IAAI,KAAK,CAAC;AAC/B,CAAC","sourcesContent":["import type { ExpandedSourcePath } from './ExpandedSourcePath.js';\n\nexport interface SharedRouteOptions {\n /**\n * The URL path to match. Paths should usually start with a slash, e.g. `'/my-route'`.\n * You can also use wildcards (`*`), e.g. `'/my-route/*'` to match all paths starting with `'/my-route'`.\n *\n * See the [Express docs](https://expressjs.com/en/guide/routing.html#route-paths) for the full\n * supported routing syntax.\n *\n * 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 (relative to the app path) for rendering the route.\n *\n * If a .js file, it must export a default function implementing `RenderFunction` from `@ms-cloudpack/common-types`.\n */\n renderScript?: string;\n\n /**\n * The key in the exports map which represents the entry point app script for this route.\n * @deprecated Use `entry` instead.\n */\n exportEntry?: string;\n\n /**\n * Additional source file path(s) to bundle and include in the HTML.\n * This **overwrites** any original exports map for the package.\n *\n * Usually this should be an actual source path, though it could also be an exports map key if necessary.\n */\n entry?: string | string[];\n}\n\n/**\n * A server-rendered route with full `entry` info (used in the processed `CloudpackConfig`).\n * The route is rendered by a custom server script in Cloudpack.\n */\nexport type RenderedRoute = Omit<ShorthandRenderedRoute, 'exportEntry' | 'entry'> & {\n /**\n * The source entry or entries to be included on the page for this route.\n */\n entry?: ExpandedSourcePath[];\n};\n\n/**\n * A route with a staticPath property serves static files from the specified path.\n */\nexport interface StaticRoute extends SharedRouteOptions {\n /**\n * The path relative to the app root to static assets.\n */\n staticPath: string;\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface ShorthandBootstrapRoute\n extends SharedRouteOptions,\n Pick<ShorthandRenderedRoute, 'entry' | 'exportEntry'> {\n type: 'bootstrap';\n}\n\n/**\n * A route that serves a bootstrap script.\n */\nexport interface BootstrapRoute extends Omit<ShorthandBootstrapRoute, 'entry'>, Pick<RenderedRoute, 'entry'> {}\n\n/**\n * A route that redirects to another url.\n */\nexport interface RedirectRoute extends SharedRouteOptions {\n /**\n * The url to redirect to.\n */\n redirectTo: string;\n}\n\n/**\n * Route as specified in `AppConfig` (`cloudpack.config.json`).\n */\n// WARNING: Be sure to add new route types to Route as well!\nexport type ShorthandRoute = ShorthandRenderedRoute | ShorthandBootstrapRoute | StaticRoute | RedirectRoute;\n\n/**\n * Processed route as used in the processed `CloudpackConfig`.\n */\n// WARNING: Be sure to add new route types to ShorthandRoute as well!\nexport type Route = RenderedRoute | BootstrapRoute | StaticRoute | RedirectRoute;\n\n/**\n * Type guard to check if a route is a static route.\n */\nexport function isStaticRoute(route: Route | ShorthandRoute): route is StaticRoute {\n return 'staticPath' in route;\n}\n\n/**\n * Type guard to check if a route is a bootstrap route.\n */\nexport function isBootstrapRoute(route: Route): route is BootstrapRoute {\n return 'type' in route && route.type === 'bootstrap';\n}\n\n/**\n * Type guard to check if a route is a shorthand bootstrap route.\n */\nexport function isShorthandBootstrapRoute(route: ShorthandRoute): route is ShorthandBootstrapRoute {\n return isBootstrapRoute(route as Route);\n}\n\n/*\n * Type guard to check if a route is a rendered route.\n */\nexport function isRenderedRoute(route: Route): route is RenderedRoute {\n const maybeRenderedRoute = route as RenderedRoute;\n return !isBootstrapRoute(route) && !!(maybeRenderedRoute.renderScript || maybeRenderedRoute.entry);\n}\n\n/**\n * Type guard to check if a route is a shorthand rendered route.\n */\nexport function isShorthandRenderedRoute(route: ShorthandRoute): route is ShorthandRenderedRoute {\n return isRenderedRoute(route as Route) || 'exportEntry' in route;\n}\n\n/**\n * Type guard to check if a route is a redirect route.\n */\nexport function isRedirectRoute(route: Route | ShorthandRoute): route is RedirectRoute {\n return 'redirectTo' in route;\n}\n"]}
@@ -1,22 +1,23 @@
1
1
  import type { HttpsConfig } from './HttpsConfig.js';
2
2
  import type { ShorthandRoute } from './Route.js';
3
- export interface DevServer {
3
+ export interface ServerConfig {
4
4
  /**
5
5
  * The domain name of the server. If multiple domains are specified, the first one will be
6
6
  * used as the primary domain used when opening the browser.
7
7
  */
8
8
  domain?: string | string[];
9
9
  /**
10
- * An optional dictionary of header key/value pairs to be use with the server.
10
+ * Additional header key/value pairs to be added to every response.
11
+ *
11
12
  * NOTE: The following header values from Cloudpack will "win" against by a user's config:
12
- * 'Cache-Control': 'no-cache'
13
- * 'Access-Control-Allow-Origin': '*'
13
+ * - `'Cache-Control': 'no-cache'`
14
+ * - `'Access-Control-Allow-Origin': '*'`
14
15
  */
15
16
  requestHeaders?: Record<string, string>;
16
17
  /**
17
- * The ports to be used by the server.
18
- * It can be a number or an array of numbers.
19
- * If ports are provided, an error will be thrown if none are available.
18
+ * Port(s) to try when starting the server. If provided, an error will be thrown if none of
19
+ * the ports are available.
20
+ *
20
21
  * If no ports are provided, the server will attempt to find an available port.
21
22
  */
22
23
  port?: number | number[];
@@ -36,4 +37,4 @@ export interface DevServer {
36
37
  */
37
38
  routes?: ShorthandRoute[];
38
39
  }
39
- //# sourceMappingURL=DevServer.d.ts.map
40
+ //# sourceMappingURL=ServerConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerConfig.d.ts","sourceRoot":"","sources":["../src/ServerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAExC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ServerConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerConfig.js","sourceRoot":"","sources":["../src/ServerConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { HttpsConfig } from './HttpsConfig.js';\nimport type { ShorthandRoute } from './Route.js';\n\nexport interface ServerConfig {\n /**\n * The domain name of the server. If multiple domains are specified, the first one will be\n * used as the primary domain used when opening the browser.\n */\n domain?: string | string[];\n\n /**\n * Additional header key/value pairs to be added to every response.\n *\n * NOTE: The following header values from Cloudpack will \"win\" against by a user's config:\n * - `'Cache-Control': 'no-cache'`\n * - `'Access-Control-Allow-Origin': '*'`\n */\n requestHeaders?: Record<string, string>;\n\n /**\n * Port(s) to try when starting the server. If provided, an error will be thrown if none of\n * the ports are available.\n *\n * If no ports are provided, the server will attempt to find an available port.\n */\n port?: number | number[];\n\n /**\n * The default path to use when opening the browser.\n */\n defaultPath?: string;\n\n /**\n * The config settings for the https server.\n * Paths to files are accepted for 'ca', 'cert', 'key', and 'pfx' settings.\n * Everything else is passed directly to the https.createServer() method.\n * If not provided, the server will use http.\n */\n https?: true | HttpsConfig;\n\n /**\n * @deprecated Moved to the root of the config.\n */\n routes?: ShorthandRoute[];\n}\n"]}
@@ -4,10 +4,14 @@ import type { Feature } from './Feature.js';
4
4
  * Features can be set to true to change the default behavior.
5
5
  */
6
6
  export declare const allFeatures: {
7
+ /** Automatically updates the generated config when an unknown import path is used during start. */
8
+ autoUpdateEntries: Feature;
7
9
  /** Disables the generation of source-maps during build. */
8
10
  disableSourceMaps: Feature;
9
11
  /** Enables support of import maps for workers. */
10
12
  enableModuleWorkers: Feature;
13
+ /** Enables relative resource paths to be used in import map paths when useSingleWebServer is true. */
14
+ relativeImportMapPaths: Feature;
11
15
  /** Enables the preemptive enqueueing of dependencies during build. */
12
16
  enqueueDependencies: Feature;
13
17
  /** Check for dynamic (async) imports with non-literal paths in bundle output during init. */
@@ -17,18 +21,17 @@ export declare const allFeatures: {
17
21
  * This helps trim the dependency graph, reduce the import map, and speed up performance.
18
22
  */
19
23
  optimizeDependencies: Feature;
24
+ /** Creates null entries for unused exports in generated config so that they are not included when bundling. */
25
+ removeUnusedExports: Feature;
20
26
  /** Enables React Native type resolution of .web.ts extensions. */
21
27
  resolveWebExtensions: Feature;
22
28
  /** Enables the syncing of bundles. */
23
29
  syncBundles: Feature;
30
+ /** Enables the syncing of internal packages. */
31
+ syncInternalPackages: Feature;
24
32
  /** Use a single server for both bundles and app assets. */
25
33
  useSingleWebServer: Feature;
26
34
  /** Enables the verification of exports during init. */
27
35
  verifyExports: Feature;
28
- removeUnusedExports: Feature;
29
- /** Automatically updates the generated config when an unknown import path is used during start. */
30
- autoUpdateEntries: Feature;
31
- /** Enables the syncing of internal packages. */
32
- syncInternalPackages: Feature;
33
36
  };
34
37
  //# sourceMappingURL=allFeatures.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"allFeatures.d.ts","sourceRoot":"","sources":["../src/allFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,WAAW;IAGtB,2DAA2D;uBACmC,OAAO;IAErG,kDAAkD;yBACqC,OAAO;IAE9F,sEAAsE;yBACqC,OAAO;IAElH,6FAA6F;4BAGxF,OAAO;IAEZ;;;OAGG;0BAIE,OAAO;IAEZ,kEAAkE;0BACsC,OAAO;IAE/G,sCAAsC;iBAC6B,OAAO;IAE1E,2DAA2D;wBACoC,OAAO;IAEtG,uDAAuD;mBAC+B,OAAO;yBAMxF,OAAO;IAEZ,mGAAmG;uBAG9F,OAAO;IAEZ,gDAAgD;0BACsC,OAAO;CAC9F,CAAC"}
1
+ {"version":3,"file":"allFeatures.d.ts","sourceRoot":"","sources":["../src/allFeatures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,WAAW;IAGtB,mGAAmG;uBAG9F,OAAO;IAEZ,2DAA2D;uBACmC,OAAO;IAErG,kDAAkD;yBACqC,OAAO;IAE9F,sGAAsG;4BAGjG,OAAO;IAEZ,sEAAsE;yBACqC,OAAO;IAElH,6FAA6F;4BAGxF,OAAO;IAEZ;;;OAGG;0BAKE,OAAO;IAEZ,+GAA+G;yBAI1G,OAAO;IAEZ,kEAAkE;0BACsC,OAAO;IAE/G,sCAAsC;iBAC6B,OAAO;IAE1E,gDAAgD;0BACsC,OAAO;IAE7F,2DAA2D;wBACoC,OAAO;IAEtG,uDAAuD;mBAC+B,OAAO;CAI9F,CAAC"}
@@ -4,10 +4,18 @@
4
4
  */
5
5
  export const allFeatures = {
6
6
  // The comments provide intellisense, and the description strings are used in the help output.
7
+ /** Automatically updates the generated config when an unknown import path is used during start. */
8
+ autoUpdateEntries: {
9
+ description: 'Automatically updates the generated config when an unknown import path is used during start.',
10
+ },
7
11
  /** Disables the generation of source-maps during build. */
8
12
  disableSourceMaps: { description: 'Disables the generation of source-maps during build.' },
9
13
  /** Enables support of import maps for workers. */
10
14
  enableModuleWorkers: { description: 'Enables support of import maps for workers.' },
15
+ /** Enables relative resource paths to be used in import map paths when useSingleWebServer is true. */
16
+ relativeImportMapPaths: {
17
+ description: 'Enables relative resource paths to be used in import map paths when useSingleWebServer is true.',
18
+ },
11
19
  /** Enables the preemptive enqueueing of dependencies during build. */
12
20
  enqueueDependencies: { description: 'Enables the preemptive enqueueing of dependencies during build.' },
13
21
  /** Check for dynamic (async) imports with non-literal paths in bundle output during init. */
@@ -19,25 +27,25 @@ export const allFeatures = {
19
27
  * This helps trim the dependency graph, reduce the import map, and speed up performance.
20
28
  */
21
29
  optimizeDependencies: {
22
- description: 'Excludes unused dependencies in the generated config during an init run. This helps trim the dependency graph, reduce the import map, and speed up performance.',
30
+ description:
31
+ // breaking up this string causes an exception in ts-json-schema-generator
32
+ 'Excludes unused dependencies in the generated config during an init run. This helps trim the dependency graph, reduce the import map, and speed up performance.',
33
+ },
34
+ /** Creates null entries for unused exports in generated config so that they are not included when bundling. */
35
+ removeUnusedExports: {
36
+ description: 'Creates null entries for unused exports in generated config so that they are not included when bundling.',
23
37
  },
24
38
  /** Enables React Native type resolution of .web.ts extensions. */
25
39
  resolveWebExtensions: { description: 'Enables React Native type resolution of .web.ts extensions.' },
26
40
  /** Enables the syncing of bundles. */
27
41
  syncBundles: { description: 'Enables the syncing of bundles.' },
42
+ /** Enables the syncing of internal packages. */
43
+ syncInternalPackages: { description: 'Enables the syncing of internal packages.' },
28
44
  /** Use a single server for both bundles and app assets. */
29
45
  useSingleWebServer: { description: 'Use a single server for both bundles and app assets.' },
30
46
  /** Enables the verification of exports during init. */
31
47
  verifyExports: { description: 'Enables the verification of exports during init.' },
32
- /* When enabled, adds null entries in generated config for unused exports. */
33
- removeUnusedExports: {
34
- description: 'Creates null entries for unused exports in generated config so that they are not included when bundling.',
35
- },
36
- /** Automatically updates the generated config when an unknown import path is used during start. */
37
- autoUpdateEntries: {
38
- description: 'Automatically updates the generated config when an unknown import path is used during start.',
39
- },
40
- /** Enables the syncing of internal packages. */
41
- syncInternalPackages: { description: 'Enables the syncing of internal packages.' },
48
+ // Please add new features in alphabetical order!
49
+ // Don't forget to add them to the doc site as well!
42
50
  };
43
51
  //# sourceMappingURL=allFeatures.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"allFeatures.js","sourceRoot":"","sources":["../src/allFeatures.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,8FAA8F;IAE9F,2DAA2D;IAC3D,iBAAiB,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAa;IAErG,kDAAkD;IAClD,mBAAmB,EAAE,EAAE,WAAW,EAAE,6CAA6C,EAAa;IAE9F,sEAAsE;IACtE,mBAAmB,EAAE,EAAE,WAAW,EAAE,iEAAiE,EAAa;IAElH,6FAA6F;IAC7F,sBAAsB,EAAE;QACtB,WAAW,EAAE,wFAAwF;KAC3F;IAEZ;;;OAGG;IACH,oBAAoB,EAAE;QACpB,WAAW,EACT,iKAAiK;KACzJ;IAEZ,kEAAkE;IAClE,oBAAoB,EAAE,EAAE,WAAW,EAAE,6DAA6D,EAAa;IAE/G,sCAAsC;IACtC,WAAW,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAa;IAE1E,2DAA2D;IAC3D,kBAAkB,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAa;IAEtG,uDAAuD;IACvD,aAAa,EAAE,EAAE,WAAW,EAAE,kDAAkD,EAAa;IAE7F,6EAA6E;IAC7E,mBAAmB,EAAE;QACnB,WAAW,EACT,0GAA0G;KAClG;IAEZ,mGAAmG;IACnG,iBAAiB,EAAE;QACjB,WAAW,EAAE,8FAA8F;KACjG;IAEZ,gDAAgD;IAChD,oBAAoB,EAAE,EAAE,WAAW,EAAE,2CAA2C,EAAa;CAC9F,CAAC","sourcesContent":["import type { Feature } from './Feature.js';\n\n/**\n * A set of options for configuring the experience.\n * Features can be set to true to change the default behavior.\n */\nexport const allFeatures = {\n // The comments provide intellisense, and the description strings are used in the help output.\n\n /** Disables the generation of source-maps during build. */\n disableSourceMaps: { description: 'Disables the generation of source-maps during build.' } as Feature,\n\n /** Enables support of import maps for workers. */\n enableModuleWorkers: { description: 'Enables support of import maps for workers.' } as Feature,\n\n /** Enables the preemptive enqueueing of dependencies during build. */\n enqueueDependencies: { description: 'Enables the preemptive enqueueing of dependencies during build.' } as Feature,\n\n /** Check for dynamic (async) imports with non-literal paths in bundle output during init. */\n evaluateDynamicImports: {\n description: 'Check for dynamic (async) imports with non-literal paths in bundle output during init.',\n } as Feature,\n\n /**\n * Excludes unused dependencies in the generated config during an init run.\n * This helps trim the dependency graph, reduce the import map, and speed up performance.\n */\n optimizeDependencies: {\n description:\n 'Excludes unused dependencies in the generated config during an init run. This helps trim the dependency graph, reduce the import map, and speed up performance.',\n } as Feature,\n\n /** Enables React Native type resolution of .web.ts extensions. */\n resolveWebExtensions: { description: 'Enables React Native type resolution of .web.ts extensions.' } as Feature,\n\n /** Enables the syncing of bundles. */\n syncBundles: { description: 'Enables the syncing of bundles.' } as Feature,\n\n /** Use a single server for both bundles and app assets. */\n useSingleWebServer: { description: 'Use a single server for both bundles and app assets.' } as Feature,\n\n /** Enables the verification of exports during init. */\n verifyExports: { description: 'Enables the verification of exports during init.' } as Feature,\n\n /* When enabled, adds null entries in generated config for unused exports. */\n removeUnusedExports: {\n description:\n 'Creates null entries for unused exports in generated config so that they are not included when bundling.',\n } as Feature,\n\n /** Automatically updates the generated config when an unknown import path is used during start. */\n autoUpdateEntries: {\n description: 'Automatically updates the generated config when an unknown import path is used during start.',\n } as Feature,\n\n /** Enables the syncing of internal packages. */\n syncInternalPackages: { description: 'Enables the syncing of internal packages.' } as Feature,\n};\n"]}
1
+ {"version":3,"file":"allFeatures.js","sourceRoot":"","sources":["../src/allFeatures.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,8FAA8F;IAE9F,mGAAmG;IACnG,iBAAiB,EAAE;QACjB,WAAW,EAAE,8FAA8F;KACjG;IAEZ,2DAA2D;IAC3D,iBAAiB,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAa;IAErG,kDAAkD;IAClD,mBAAmB,EAAE,EAAE,WAAW,EAAE,6CAA6C,EAAa;IAE9F,sGAAsG;IACtG,sBAAsB,EAAE;QACtB,WAAW,EAAE,iGAAiG;KACpG;IAEZ,sEAAsE;IACtE,mBAAmB,EAAE,EAAE,WAAW,EAAE,iEAAiE,EAAa;IAElH,6FAA6F;IAC7F,sBAAsB,EAAE;QACtB,WAAW,EAAE,wFAAwF;KAC3F;IAEZ;;;OAGG;IACH,oBAAoB,EAAE;QACpB,WAAW;QACT,0EAA0E;QAC1E,iKAAiK;KACzJ;IAEZ,+GAA+G;IAC/G,mBAAmB,EAAE;QACnB,WAAW,EACT,0GAA0G;KAClG;IAEZ,kEAAkE;IAClE,oBAAoB,EAAE,EAAE,WAAW,EAAE,6DAA6D,EAAa;IAE/G,sCAAsC;IACtC,WAAW,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAa;IAE1E,gDAAgD;IAChD,oBAAoB,EAAE,EAAE,WAAW,EAAE,2CAA2C,EAAa;IAE7F,2DAA2D;IAC3D,kBAAkB,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAa;IAEtG,uDAAuD;IACvD,aAAa,EAAE,EAAE,WAAW,EAAE,kDAAkD,EAAa;IAE7F,iDAAiD;IACjD,oDAAoD;CACrD,CAAC","sourcesContent":["import type { Feature } from './Feature.js';\n\n/**\n * A set of options for configuring the experience.\n * Features can be set to true to change the default behavior.\n */\nexport const allFeatures = {\n // The comments provide intellisense, and the description strings are used in the help output.\n\n /** Automatically updates the generated config when an unknown import path is used during start. */\n autoUpdateEntries: {\n description: 'Automatically updates the generated config when an unknown import path is used during start.',\n } as Feature,\n\n /** Disables the generation of source-maps during build. */\n disableSourceMaps: { description: 'Disables the generation of source-maps during build.' } as Feature,\n\n /** Enables support of import maps for workers. */\n enableModuleWorkers: { description: 'Enables support of import maps for workers.' } as Feature,\n\n /** Enables relative resource paths to be used in import map paths when useSingleWebServer is true. */\n relativeImportMapPaths: {\n description: 'Enables relative resource paths to be used in import map paths when useSingleWebServer is true.',\n } as Feature,\n\n /** Enables the preemptive enqueueing of dependencies during build. */\n enqueueDependencies: { description: 'Enables the preemptive enqueueing of dependencies during build.' } as Feature,\n\n /** Check for dynamic (async) imports with non-literal paths in bundle output during init. */\n evaluateDynamicImports: {\n description: 'Check for dynamic (async) imports with non-literal paths in bundle output during init.',\n } as Feature,\n\n /**\n * Excludes unused dependencies in the generated config during an init run.\n * This helps trim the dependency graph, reduce the import map, and speed up performance.\n */\n optimizeDependencies: {\n description:\n // breaking up this string causes an exception in ts-json-schema-generator\n 'Excludes unused dependencies in the generated config during an init run. This helps trim the dependency graph, reduce the import map, and speed up performance.',\n } as Feature,\n\n /** Creates null entries for unused exports in generated config so that they are not included when bundling. */\n removeUnusedExports: {\n description:\n 'Creates null entries for unused exports in generated config so that they are not included when bundling.',\n } as Feature,\n\n /** Enables React Native type resolution of .web.ts extensions. */\n resolveWebExtensions: { description: 'Enables React Native type resolution of .web.ts extensions.' } as Feature,\n\n /** Enables the syncing of bundles. */\n syncBundles: { description: 'Enables the syncing of bundles.' } as Feature,\n\n /** Enables the syncing of internal packages. */\n syncInternalPackages: { description: 'Enables the syncing of internal packages.' } as Feature,\n\n /** Use a single server for both bundles and app assets. */\n useSingleWebServer: { description: 'Use a single server for both bundles and app assets.' } as Feature,\n\n /** Enables the verification of exports during init. */\n verifyExports: { description: 'Enables the verification of exports during init.' } as Feature,\n\n // Please add new features in alphabetical order!\n // Don't forget to add them to the doc site as well!\n};\n"]}
package/lib/index.d.ts CHANGED
@@ -12,7 +12,7 @@ export type { BundleResult } from './BundleResult.js';
12
12
  export type { BundlerPluginResult } from './BundlerPluginResult.js';
13
13
  export type { BundlerPlugin } from './BundlerPlugin.js';
14
14
  export type { CloudpackConfig } from './CloudpackConfig.js';
15
- export type { DevServer } from './DevServer.js';
15
+ export type { ServerConfig } from './ServerConfig.js';
16
16
  export type { ExpandedSourcePath } from './ExpandedSourcePath.js';
17
17
  export type { Feature } from './Feature.js';
18
18
  export type { Features } from './Features.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,iCAAiC,EACjC,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACx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;AAChE,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,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;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,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;AAiD/C,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,eAAe,EACf,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,YAAY,CAAC","sourcesContent":["export { allFeatures } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\n PackageDefinitionTransformFactory,\n PackageDefinitionsCache,\n PackageImporterContext,\n} from './PackageDefinitionsCache.js';\nexport type {\n LiteralOrString,\n PackageJson,\n PackageJsonDependencies,\n PackageJsonExportCondition,\n PackageJsonExports,\n PackageJsonExportsObject,\n PackageJsonExportsValue,\n PackageJsonImports,\n} from './PackageJson.js';\nexport type { BundleContext } from './BundleContext.js';\nexport type { BundleMessage } from './BundleMessage.js';\nexport type { BundleMessageLocation } from './BundleMessageLocation.js';\nexport type { BundleMessageNote } from './BundleMessageNote.js';\nexport type { BundleMode } from './BundleMode.js';\nexport type { BundleOptions } from './BundleOptions.js';\nexport type { BundleOutputFile } from './BundleOutputFile.js';\nexport type { BundleResult } from './BundleResult.js';\nexport type { BundlerPluginResult } from './BundlerPluginResult.js';\nexport type { BundlerPlugin } from './BundlerPlugin.js';\nexport type { CloudpackConfig } from './CloudpackConfig.js';\nexport type { DevServer } from './DevServer.js';\nexport type { ExpandedSourcePath } from './ExpandedSourcePath.js';\nexport type { Feature } from './Feature.js';\nexport type { Features } from './Features.js';\nexport type { GeneratedConfig } from './GeneratedConfig.js';\nexport type { HttpsConfig } from './HttpsConfig.js';\nexport type { LinkOptions } from './LinkOptions.js';\nexport type { ModuleType } from './ModuleType.js';\nexport type { PackageSettings, PackageSettingsMatch, GeneratedPackageSettings } from './PackageSettings.js';\nexport type {\n BootstrapRoute,\n RedirectRoute,\n RenderedRoute,\n Route,\n SharedRouteOptions,\n ShorthandRenderedRoute,\n ShorthandBootstrapRoute,\n ShorthandRoute,\n StaticRoute,\n} from './Route.js';\nexport {\n isBootstrapRoute,\n isRenderedRoute,\n isStaticRoute,\n isRedirectRoute,\n isShorthandBootstrapRoute,\n isShorthandRenderedRoute,\n} from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n InternalBundlerCapabilityImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n ExternalBundlerCapabilityModule,\n BundlerCapabilityFunction,\n} from './BundlerCapability.js';\nexport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nexport type {\n RenderFunction,\n RenderFunctionOptions,\n RenderFunctionResult,\n ExpandedRenderFunctionResult,\n RenderFunctionScript,\n} from './RenderFunction.js';\nexport type { Request, Response } from 'express';\nexport type { Session } from './Session.js';\nexport type { ResolveMap } from './ResolveMap.js';\nexport type { ResolveMapEntry } from './ResolveMapEntry.js';\nexport type { LinkedPath } from './LinkedPath.js';\nexport type { ImportMap } from './ImportMap.js';\nexport type { UserPreferences } from './UserPreferences.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAiD/C,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,eAAe,EACf,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,YAAY,CAAC","sourcesContent":["export { allFeatures } from './allFeatures.js';\nexport type {\n GetPackageDefinitionOptions,\n PackageDefinitionTransform,\n PackageDefinitionTransformFactory,\n PackageDefinitionsCache,\n PackageImporterContext,\n} from './PackageDefinitionsCache.js';\nexport type {\n LiteralOrString,\n PackageJson,\n PackageJsonDependencies,\n PackageJsonExportCondition,\n PackageJsonExports,\n PackageJsonExportsObject,\n PackageJsonExportsValue,\n PackageJsonImports,\n} from './PackageJson.js';\nexport type { BundleContext } from './BundleContext.js';\nexport type { BundleMessage } from './BundleMessage.js';\nexport type { BundleMessageLocation } from './BundleMessageLocation.js';\nexport type { BundleMessageNote } from './BundleMessageNote.js';\nexport type { BundleMode } from './BundleMode.js';\nexport type { BundleOptions } from './BundleOptions.js';\nexport type { BundleOutputFile } from './BundleOutputFile.js';\nexport type { BundleResult } from './BundleResult.js';\nexport type { BundlerPluginResult } from './BundlerPluginResult.js';\nexport type { BundlerPlugin } from './BundlerPlugin.js';\nexport type { CloudpackConfig } from './CloudpackConfig.js';\nexport type { ServerConfig } from './ServerConfig.js';\nexport type { ExpandedSourcePath } from './ExpandedSourcePath.js';\nexport type { Feature } from './Feature.js';\nexport type { Features } from './Features.js';\nexport type { GeneratedConfig } from './GeneratedConfig.js';\nexport type { HttpsConfig } from './HttpsConfig.js';\nexport type { LinkOptions } from './LinkOptions.js';\nexport type { ModuleType } from './ModuleType.js';\nexport type { PackageSettings, PackageSettingsMatch, GeneratedPackageSettings } from './PackageSettings.js';\nexport type {\n BootstrapRoute,\n RedirectRoute,\n RenderedRoute,\n Route,\n SharedRouteOptions,\n ShorthandRenderedRoute,\n ShorthandBootstrapRoute,\n ShorthandRoute,\n StaticRoute,\n} from './Route.js';\nexport {\n isBootstrapRoute,\n isRenderedRoute,\n isStaticRoute,\n isRedirectRoute,\n isShorthandBootstrapRoute,\n isShorthandRenderedRoute,\n} from './Route.js';\nexport type { TelemetryConfig } from './TelemetryConfig.js';\nexport type { AppConfig } from './AppConfig.js';\nexport type {\n InternalBundlerCapabilityImplementations,\n InternalBundlerCapabilitiesMetaData,\n BundlerCapabilitiesOptions,\n ExternalBundlerCapabilityModule,\n BundlerCapabilityFunction,\n} from './BundlerCapability.js';\nexport type { RemoteCacheConfig } from './RemoteCacheConfig.js';\nexport type {\n RenderFunction,\n RenderFunctionOptions,\n RenderFunctionResult,\n ExpandedRenderFunctionResult,\n RenderFunctionScript,\n} from './RenderFunction.js';\nexport type { Request, Response } from 'express';\nexport type { Session } from './Session.js';\nexport type { ResolveMap } from './ResolveMap.js';\nexport type { ResolveMapEntry } from './ResolveMapEntry.js';\nexport type { LinkedPath } from './LinkedPath.js';\nexport type { ImportMap } from './ImportMap.js';\nexport type { UserPreferences } from './UserPreferences.js';\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.47.7"
8
+ "packageVersion": "7.47.9"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/common-types",
3
- "version": "0.19.7",
3
+ "version": "0.21.0",
4
4
  "description": "Common types for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,16 +17,20 @@
17
17
  "description": "Extend the configuration from another file: either an import path or a relative path (resolved from the config file's location).\n\nIf an array, later files will take precedence when merging. (The user config always takes precedence over any extended config.)\n\nConfig merging approach:\n- Objects will be deeply merged.\n- Primitive values will be overwritten.\n- Arrays will be overwritten, EXCEPT for `packageSettings`, which will be concatenated."
18
18
  },
19
19
  "devServer": {
20
- "$ref": "#/definitions/DevServer",
21
- "description": "A set of options for configuring how the dev server works."
20
+ "$ref": "#/definitions/ServerConfig",
21
+ "deprecated": "- use \"server\" instead."
22
+ },
23
+ "server": {
24
+ "$ref": "#/definitions/ServerConfig",
25
+ "description": "Configuration for the dev server."
22
26
  },
23
27
  "telemetry": {
24
28
  "$ref": "#/definitions/TelemetryConfig",
25
- "description": "A set of options for configuring telemetry"
29
+ "description": "Configuration for telemetry."
26
30
  },
27
31
  "features": {
28
32
  "$ref": "#/definitions/Features",
29
- "description": "A set of options for configuring the experience. Features can be set to true to change the default behavior."
33
+ "description": "Enable additional Cloudpack features."
30
34
  },
31
35
  "helpMessage": {
32
36
  "type": "string",
@@ -37,7 +41,7 @@
37
41
  "items": {
38
42
  "$ref": "#/definitions/PackageSettings"
39
43
  },
40
- "description": "An array of PackageSettings objects, used to provide settings for how we bundle packages."
44
+ "description": "Settings to customize how packages are bundled."
41
45
  },
42
46
  "dependsOn": {
43
47
  "type": "array",
@@ -57,7 +61,7 @@
57
61
  ],
58
62
  "maxItems": 2
59
63
  },
60
- "description": "An optional list of commands (followed by a string array of args for that command) to be executed prior to Cloudpack bundle"
64
+ "description": "Commands to execute prior to Cloudpack bundling. Each entry has a command and an array of arguments: `['command', ['arg1', 'arg2']]`."
61
65
  },
62
66
  "patchFilesGlobPattern": {
63
67
  "type": "string",
@@ -80,7 +84,7 @@
80
84
  "items": {
81
85
  "type": "string"
82
86
  },
83
- "description": "A list of package names that should never be excluded or included from the bundle."
87
+ "description": "Ignore these package names when calculating included and excluded dependencies. This is mainly intended for helper packages such as `tslib`.\n\nInclude `...` to merge with the default list (`tslib` and `@babel/runtime` as of writing)."
84
88
  },
85
89
  "bundlerCapabilitiesRegistry": {
86
90
  "type": "object",
@@ -96,7 +100,7 @@
96
100
  "additionalProperties": false,
97
101
  "description": "Per-application user-provided configuration for Cloudpack.",
98
102
  "definitions": {
99
- "DevServer": {
103
+ "ServerConfig": {
100
104
  "type": "object",
101
105
  "properties": {
102
106
  "domain": {
@@ -118,7 +122,7 @@
118
122
  "additionalProperties": {
119
123
  "type": "string"
120
124
  },
121
- "description": "An optional dictionary of header key/value pairs to be use with the server. NOTE: The following header values from Cloudpack will \"win\" against by a user's config: 'Cache-Control': 'no-cache' 'Access-Control-Allow-Origin': '*'"
125
+ "description": "Additional header key/value pairs to be added to every response.\n\nNOTE: The following header values from Cloudpack will \"win\" against by a user's config:\n- `'Cache-Control': 'no-cache'`\n- `'Access-Control-Allow-Origin': '*'`"
122
126
  },
123
127
  "port": {
124
128
  "anyOf": [
@@ -132,7 +136,7 @@
132
136
  }
133
137
  }
134
138
  ],
135
- "description": "The ports to be used by the server. It can be a number or an array of numbers. If ports are provided, an error will be thrown if none are available. If no ports are provided, the server will attempt to find an available port."
139
+ "description": "Port(s) to try when starting the server. If provided, an error will be thrown if none of the ports are available.\n\nIf no ports are provided, the server will attempt to find an available port."
136
140
  },
137
141
  "defaultPath": {
138
142
  "type": "string",
@@ -531,11 +535,11 @@
531
535
  },
532
536
  "renderScript": {
533
537
  "type": "string",
534
- "description": "Path to a .js or .html file used for rendering the route. If a script is provided, it must export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/common-types`."
538
+ "description": "Path to a .js or .html file (relative to the app path) for rendering the route.\n\nIf a .js file, it must export a default function implementing `RenderFunction` from `@ms-cloudpack/common-types`."
535
539
  },
536
540
  "exportEntry": {
537
541
  "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.",
542
+ "description": "The key in the exports map which represents the entry point app script for this route.",
539
543
  "deprecated": "Use `entry` instead."
540
544
  },
541
545
  "entry": {
@@ -550,7 +554,7 @@
550
554
  }
551
555
  }
552
556
  ],
553
- "description": "The source entry or entries to be included on the page for this route.\n\nUsually this should be an actual source path, though it could also be an exports map key if necessary."
557
+ "description": "Additional source file path(s) to bundle and include in the HTML. This **overwrites** any original exports map for the package.\n\nUsually this should be an actual source path, though it could also be an exports map key if necessary."
554
558
  }
555
559
  },
556
560
  "additionalProperties": false,
@@ -574,11 +578,11 @@
574
578
  }
575
579
  }
576
580
  ],
577
- "description": "The source entry or entries to be included on the page for this route.\n\nUsually this should be an actual source path, though it could also be an exports map key if necessary."
581
+ "description": "Additional source file path(s) to bundle and include in the HTML. This **overwrites** any original exports map for the package.\n\nUsually this should be an actual source path, though it could also be an exports map key if necessary."
578
582
  },
579
583
  "exportEntry": {
580
584
  "type": "string",
581
- "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.",
585
+ "description": "The key in the exports map which represents the entry point app script for this route.",
582
586
  "deprecated": "Use `entry` instead."
583
587
  },
584
588
  "match": {
@@ -681,12 +685,18 @@
681
685
  "Features": {
682
686
  "type": "object",
683
687
  "properties": {
688
+ "autoUpdateEntries": {
689
+ "type": "boolean"
690
+ },
684
691
  "disableSourceMaps": {
685
692
  "type": "boolean"
686
693
  },
687
694
  "enableModuleWorkers": {
688
695
  "type": "boolean"
689
696
  },
697
+ "relativeImportMapPaths": {
698
+ "type": "boolean"
699
+ },
690
700
  "enqueueDependencies": {
691
701
  "type": "boolean"
692
702
  },
@@ -696,25 +706,22 @@
696
706
  "optimizeDependencies": {
697
707
  "type": "boolean"
698
708
  },
699
- "resolveWebExtensions": {
700
- "type": "boolean"
701
- },
702
- "syncBundles": {
709
+ "removeUnusedExports": {
703
710
  "type": "boolean"
704
711
  },
705
- "useSingleWebServer": {
712
+ "resolveWebExtensions": {
706
713
  "type": "boolean"
707
714
  },
708
- "verifyExports": {
715
+ "syncBundles": {
709
716
  "type": "boolean"
710
717
  },
711
- "removeUnusedExports": {
718
+ "syncInternalPackages": {
712
719
  "type": "boolean"
713
720
  },
714
- "autoUpdateEntries": {
721
+ "useSingleWebServer": {
715
722
  "type": "boolean"
716
723
  },
717
- "syncInternalPackages": {
724
+ "verifyExports": {
718
725
  "type": "boolean"
719
726
  }
720
727
  },
@@ -743,25 +750,25 @@
743
750
  "items": {
744
751
  "type": "string"
745
752
  },
746
- "description": "The dependencies which should be included when computing the import map. This is primarily used when devDependencies are needed by the app. This often happens when a library has a demo app which relies on devDependencies. Accepts `$devDependencies` as a special value to include all devDependencies."
753
+ "description": "The dependencies which should be included when computing the import map. This is primarily used when devDependencies are needed by the app. This often happens when a library has a demo app which relies on devDependencies.\n\nAccepts `$devDependencies` as a special value to include all devDependencies."
747
754
  },
748
755
  "excludedDependencies": {
749
756
  "type": "array",
750
757
  "items": {
751
758
  "type": "string"
752
759
  },
753
- "description": "The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it. Accepts `$peerDependencies` as a special value to exclude all peerDependencies."
760
+ "description": "The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.\n\nAccepts `$peerDependencies` as a special value to exclude all peerDependencies."
754
761
  },
755
762
  "inlinedDependencies": {
756
763
  "type": "array",
757
764
  "items": {
758
765
  "type": "string"
759
766
  },
760
- "description": "Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which are small and don't need to be loaded separately, or ones which have issues being resolved by the browser."
767
+ "description": "Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which are small and don't need to be loaded separately, have issues being resolved by the browser, or provide reusable scss files."
761
768
  },
762
769
  "exports": {
763
770
  "$ref": "#/definitions/PackageJsonExports",
764
- "description": "The exports map that should be used for this package, ignoring entries which are defined in the original package.json. This is useful for libraries which have a missing or broken exports map, or when we want to trim the exports to reduce the api surface we expose to the inner loop experience."
771
+ "description": "Use this exports map instead of the original entry points from package.json. (Any Cloudpack- generated exports will be merged.) This is useful if a library's exports map is missing or broken, or to skip bundling entries which aren't needed at runtime."
765
772
  },
766
773
  "bundler": {
767
774
  "type": "string",
@@ -944,7 +951,7 @@
944
951
  "allow-duplication",
945
952
  "force-remote-version"
946
953
  ],
947
- "description": "Controls the behavior of duplicated dependencies in the resolve map by link. By default, `allow-duplication` is used, which allows multiple versions of the same package to exist in the resolve map to satisfy the semver. If `force-host-version` is used, the package will be deduplicated to the version of the host package ignoring semver requirements. If `force-remote-version` is used, the package will be deduplicated to the version of the remote package ignoring semver requirements.\n\nNote: These settings only apply when the resolve strategy is set to the default `dedupe`."
954
+ "description": "Controls the behavior of duplicated dependencies in the resolve map when running `cloudpack link`.\n\n- `allow-duplication` (default): allow multiple versions of the same package to exist in the resolve map to satisfy semver.\n- `force-host-version`: the package will be deduplicated to the version of the host package, ignoring semver requirements.\n- `force-remote-version`: the package will be deduplicated to the version of the remote package, ignoring semver requirements.\n\nNote: These settings only apply when the resolve strategy is set to the default `dedupe`."
948
955
  }
949
956
  },
950
957
  "additionalProperties": false,
@@ -48,14 +48,14 @@
48
48
  "items": {
49
49
  "type": "string"
50
50
  },
51
- "description": "The dependencies which should be included when computing the import map. This is primarily used when devDependencies are needed by the app. This often happens when a library has a demo app which relies on devDependencies. Accepts `$devDependencies` as a special value to include all devDependencies."
51
+ "description": "The dependencies which should be included when computing the import map. This is primarily used when devDependencies are needed by the app. This often happens when a library has a demo app which relies on devDependencies.\n\nAccepts `$devDependencies` as a special value to include all devDependencies."
52
52
  },
53
53
  "excludedDependencies": {
54
54
  "type": "array",
55
55
  "items": {
56
56
  "type": "string"
57
57
  },
58
- "description": "The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it. Accepts `$peerDependencies` as a special value to exclude all peerDependencies."
58
+ "description": "The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.\n\nAccepts `$peerDependencies` as a special value to exclude all peerDependencies."
59
59
  },
60
60
  "dynamicImports": {
61
61
  "type": "array",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "exports": {
68
68
  "$ref": "#/definitions/PackageJsonExports",
69
- "description": "The exports map that should be used for this package, ignoring entries which are defined in the original package.json. This is useful for libraries which have a missing or broken exports map, or when we want to trim the exports to reduce the api surface we expose to the inner loop experience."
69
+ "description": "Use this exports map instead of the original entry points from package.json. (Any Cloudpack- generated exports will be merged.) This is useful if a library's exports map is missing or broken, or to skip bundling entries which aren't needed at runtime."
70
70
  }
71
71
  },
72
72
  "required": [
@@ -21,16 +21,20 @@
21
21
  "description": "Extend the configuration from another file: either an import path or a relative path (resolved from the config file's location).\n\nIf an array, later files will take precedence when merging. (The user config always takes precedence over any extended config.)\n\nConfig merging approach:\n- Objects will be deeply merged.\n- Primitive values will be overwritten.\n- Arrays will be overwritten, EXCEPT for `packageSettings`, which will be concatenated."
22
22
  },
23
23
  "devServer": {
24
- "$ref": "#/definitions/DevServer",
25
- "description": "A set of options for configuring how the dev server works."
24
+ "$ref": "#/definitions/ServerConfig",
25
+ "deprecated": "- use \"server\" instead."
26
+ },
27
+ "server": {
28
+ "$ref": "#/definitions/ServerConfig",
29
+ "description": "Configuration for the dev server."
26
30
  },
27
31
  "telemetry": {
28
32
  "$ref": "#/definitions/TelemetryConfig",
29
- "description": "A set of options for configuring telemetry"
33
+ "description": "Configuration for telemetry."
30
34
  },
31
35
  "features": {
32
36
  "$ref": "#/definitions/Features",
33
- "description": "A set of options for configuring the experience. Features can be set to true to change the default behavior."
37
+ "description": "Enable additional Cloudpack features."
34
38
  },
35
39
  "helpMessage": {
36
40
  "type": "string",
@@ -41,7 +45,7 @@
41
45
  "items": {
42
46
  "$ref": "#/definitions/PackageSettings"
43
47
  },
44
- "description": "An array of PackageSettings objects, used to provide settings for how we bundle packages."
48
+ "description": "Settings to customize how packages are bundled."
45
49
  },
46
50
  "dependsOn": {
47
51
  "type": "array",
@@ -61,7 +65,7 @@
61
65
  ],
62
66
  "maxItems": 2
63
67
  },
64
- "description": "An optional list of commands (followed by a string array of args for that command) to be executed prior to Cloudpack bundle"
68
+ "description": "Commands to execute prior to Cloudpack bundling. Each entry has a command and an array of arguments: `['command', ['arg1', 'arg2']]`."
65
69
  },
66
70
  "patchFilesGlobPattern": {
67
71
  "type": "string",
@@ -84,7 +88,7 @@
84
88
  "items": {
85
89
  "type": "string"
86
90
  },
87
- "description": "A list of package names that should never be excluded or included from the bundle."
91
+ "description": "Ignore these package names when calculating included and excluded dependencies. This is mainly intended for helper packages such as `tslib`.\n\nInclude `...` to merge with the default list (`tslib` and `@babel/runtime` as of writing)."
88
92
  },
89
93
  "bundlerCapabilitiesRegistry": {
90
94
  "type": "object",
@@ -97,7 +101,7 @@
97
101
  "additionalProperties": false,
98
102
  "description": "Per-application user-provided configuration for Cloudpack."
99
103
  },
100
- "DevServer": {
104
+ "ServerConfig": {
101
105
  "type": "object",
102
106
  "properties": {
103
107
  "domain": {
@@ -119,7 +123,7 @@
119
123
  "additionalProperties": {
120
124
  "type": "string"
121
125
  },
122
- "description": "An optional dictionary of header key/value pairs to be use with the server. NOTE: The following header values from Cloudpack will \"win\" against by a user's config: 'Cache-Control': 'no-cache' 'Access-Control-Allow-Origin': '*'"
126
+ "description": "Additional header key/value pairs to be added to every response.\n\nNOTE: The following header values from Cloudpack will \"win\" against by a user's config:\n- `'Cache-Control': 'no-cache'`\n- `'Access-Control-Allow-Origin': '*'`"
123
127
  },
124
128
  "port": {
125
129
  "anyOf": [
@@ -133,7 +137,7 @@
133
137
  }
134
138
  }
135
139
  ],
136
- "description": "The ports to be used by the server. It can be a number or an array of numbers. If ports are provided, an error will be thrown if none are available. If no ports are provided, the server will attempt to find an available port."
140
+ "description": "Port(s) to try when starting the server. If provided, an error will be thrown if none of the ports are available.\n\nIf no ports are provided, the server will attempt to find an available port."
137
141
  },
138
142
  "defaultPath": {
139
143
  "type": "string",
@@ -532,11 +536,11 @@
532
536
  },
533
537
  "renderScript": {
534
538
  "type": "string",
535
- "description": "Path to a .js or .html file used for rendering the route. If a script is provided, it must export a default function implementing `RenderRouteFunction` defined in `@ms-cloudpack/common-types`."
539
+ "description": "Path to a .js or .html file (relative to the app path) for rendering the route.\n\nIf a .js file, it must export a default function implementing `RenderFunction` from `@ms-cloudpack/common-types`."
536
540
  },
537
541
  "exportEntry": {
538
542
  "type": "string",
539
- "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.",
543
+ "description": "The key in the exports map which represents the entry point app script for this route.",
540
544
  "deprecated": "Use `entry` instead."
541
545
  },
542
546
  "entry": {
@@ -551,7 +555,7 @@
551
555
  }
552
556
  }
553
557
  ],
554
- "description": "The source entry or entries to be included on the page for this route.\n\nUsually this should be an actual source path, though it could also be an exports map key if necessary."
558
+ "description": "Additional source file path(s) to bundle and include in the HTML. This **overwrites** any original exports map for the package.\n\nUsually this should be an actual source path, though it could also be an exports map key if necessary."
555
559
  }
556
560
  },
557
561
  "additionalProperties": false,
@@ -575,11 +579,11 @@
575
579
  }
576
580
  }
577
581
  ],
578
- "description": "The source entry or entries to be included on the page for this route.\n\nUsually this should be an actual source path, though it could also be an exports map key if necessary."
582
+ "description": "Additional source file path(s) to bundle and include in the HTML. This **overwrites** any original exports map for the package.\n\nUsually this should be an actual source path, though it could also be an exports map key if necessary."
579
583
  },
580
584
  "exportEntry": {
581
585
  "type": "string",
582
- "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.",
586
+ "description": "The key in the exports map which represents the entry point app script for this route.",
583
587
  "deprecated": "Use `entry` instead."
584
588
  },
585
589
  "match": {
@@ -682,12 +686,18 @@
682
686
  "Features": {
683
687
  "type": "object",
684
688
  "properties": {
689
+ "autoUpdateEntries": {
690
+ "type": "boolean"
691
+ },
685
692
  "disableSourceMaps": {
686
693
  "type": "boolean"
687
694
  },
688
695
  "enableModuleWorkers": {
689
696
  "type": "boolean"
690
697
  },
698
+ "relativeImportMapPaths": {
699
+ "type": "boolean"
700
+ },
691
701
  "enqueueDependencies": {
692
702
  "type": "boolean"
693
703
  },
@@ -697,25 +707,22 @@
697
707
  "optimizeDependencies": {
698
708
  "type": "boolean"
699
709
  },
700
- "resolveWebExtensions": {
701
- "type": "boolean"
702
- },
703
- "syncBundles": {
710
+ "removeUnusedExports": {
704
711
  "type": "boolean"
705
712
  },
706
- "useSingleWebServer": {
713
+ "resolveWebExtensions": {
707
714
  "type": "boolean"
708
715
  },
709
- "verifyExports": {
716
+ "syncBundles": {
710
717
  "type": "boolean"
711
718
  },
712
- "removeUnusedExports": {
719
+ "syncInternalPackages": {
713
720
  "type": "boolean"
714
721
  },
715
- "autoUpdateEntries": {
722
+ "useSingleWebServer": {
716
723
  "type": "boolean"
717
724
  },
718
- "syncInternalPackages": {
725
+ "verifyExports": {
719
726
  "type": "boolean"
720
727
  }
721
728
  },
@@ -744,25 +751,25 @@
744
751
  "items": {
745
752
  "type": "string"
746
753
  },
747
- "description": "The dependencies which should be included when computing the import map. This is primarily used when devDependencies are needed by the app. This often happens when a library has a demo app which relies on devDependencies. Accepts `$devDependencies` as a special value to include all devDependencies."
754
+ "description": "The dependencies which should be included when computing the import map. This is primarily used when devDependencies are needed by the app. This often happens when a library has a demo app which relies on devDependencies.\n\nAccepts `$devDependencies` as a special value to include all devDependencies."
748
755
  },
749
756
  "excludedDependencies": {
750
757
  "type": "array",
751
758
  "items": {
752
759
  "type": "string"
753
760
  },
754
- "description": "The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it. Accepts `$peerDependencies` as a special value to exclude all peerDependencies."
761
+ "description": "The dependencies which should be ignored by Cloudpack verbs. For example, if \"react-native\" is a dependency which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.\n\nAccepts `$peerDependencies` as a special value to exclude all peerDependencies."
755
762
  },
756
763
  "inlinedDependencies": {
757
764
  "type": "array",
758
765
  "items": {
759
766
  "type": "string"
760
767
  },
761
- "description": "Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which are small and don't need to be loaded separately, or ones which have issues being resolved by the browser."
768
+ "description": "Dependencies which should be inlined in the library bundled by Cloudpack. This is useful for libraries which are small and don't need to be loaded separately, have issues being resolved by the browser, or provide reusable scss files."
762
769
  },
763
770
  "exports": {
764
771
  "$ref": "#/definitions/PackageJsonExports",
765
- "description": "The exports map that should be used for this package, ignoring entries which are defined in the original package.json. This is useful for libraries which have a missing or broken exports map, or when we want to trim the exports to reduce the api surface we expose to the inner loop experience."
772
+ "description": "Use this exports map instead of the original entry points from package.json. (Any Cloudpack- generated exports will be merged.) This is useful if a library's exports map is missing or broken, or to skip bundling entries which aren't needed at runtime."
766
773
  },
767
774
  "bundler": {
768
775
  "type": "string",
@@ -945,7 +952,7 @@
945
952
  "allow-duplication",
946
953
  "force-remote-version"
947
954
  ],
948
- "description": "Controls the behavior of duplicated dependencies in the resolve map by link. By default, `allow-duplication` is used, which allows multiple versions of the same package to exist in the resolve map to satisfy the semver. If `force-host-version` is used, the package will be deduplicated to the version of the host package ignoring semver requirements. If `force-remote-version` is used, the package will be deduplicated to the version of the remote package ignoring semver requirements.\n\nNote: These settings only apply when the resolve strategy is set to the default `dedupe`."
955
+ "description": "Controls the behavior of duplicated dependencies in the resolve map when running `cloudpack link`.\n\n- `allow-duplication` (default): allow multiple versions of the same package to exist in the resolve map to satisfy semver.\n- `force-host-version`: the package will be deduplicated to the version of the host package, ignoring semver requirements.\n- `force-remote-version`: the package will be deduplicated to the version of the remote package, ignoring semver requirements.\n\nNote: These settings only apply when the resolve strategy is set to the default `dedupe`."
949
956
  }
950
957
  },
951
958
  "additionalProperties": false,
@@ -1 +0,0 @@
1
- {"version":3,"file":"DevServer.d.ts","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAExC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEzB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;CAC3B"}
package/lib/DevServer.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=DevServer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DevServer.js","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"","sourcesContent":["import type { HttpsConfig } from './HttpsConfig.js';\nimport type { ShorthandRoute } from './Route.js';\n\nexport interface DevServer {\n /**\n * The domain name of the server. If multiple domains are specified, the first one will be\n * used as the primary domain used when opening the browser.\n */\n domain?: string | string[];\n\n /**\n * An optional dictionary of header key/value pairs to be use with the server.\n * NOTE: The following header values from Cloudpack will \"win\" against by a user's config:\n * 'Cache-Control': 'no-cache'\n * 'Access-Control-Allow-Origin': '*'\n */\n requestHeaders?: Record<string, string>;\n\n /**\n * The ports to be used by the server.\n * It can be a number or an array of numbers.\n * If ports are provided, an error will be thrown if none are available.\n * If no ports are provided, the server will attempt to find an available port.\n */\n port?: number | number[];\n\n /**\n * The default path to use when opening the browser.\n */\n defaultPath?: string;\n\n /**\n * The config settings for the https server.\n * Paths to files are accepted for 'ca', 'cert', 'key', and 'pfx' settings.\n * Everything else is passed directly to the https.createServer() method.\n * If not provided, the server will use http.\n */\n https?: true | HttpsConfig;\n\n /**\n * @deprecated Moved to the root of the config.\n */\n routes?: ShorthandRoute[];\n}\n"]}