@ms-cloudpack/common-types 0.1.1

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 (101) hide show
  1. package/README.md +3 -0
  2. package/lib/BundleContext.d.ts +6 -0
  3. package/lib/BundleContext.d.ts.map +1 -0
  4. package/lib/BundleContext.js +2 -0
  5. package/lib/BundleContext.js.map +1 -0
  6. package/lib/BundleMessage.d.ts +10 -0
  7. package/lib/BundleMessage.d.ts.map +1 -0
  8. package/lib/BundleMessage.js +2 -0
  9. package/lib/BundleMessage.js.map +1 -0
  10. package/lib/BundleMessageLocation.d.ts +12 -0
  11. package/lib/BundleMessageLocation.d.ts.map +1 -0
  12. package/lib/BundleMessageLocation.js +2 -0
  13. package/lib/BundleMessageLocation.js.map +1 -0
  14. package/lib/BundleMessageNote.d.ts +6 -0
  15. package/lib/BundleMessageNote.d.ts.map +1 -0
  16. package/lib/BundleMessageNote.js +2 -0
  17. package/lib/BundleMessageNote.js.map +1 -0
  18. package/lib/BundleOptions.d.ts +57 -0
  19. package/lib/BundleOptions.d.ts.map +1 -0
  20. package/lib/BundleOptions.js +2 -0
  21. package/lib/BundleOptions.js.map +1 -0
  22. package/lib/BundleOutputFile.d.ts +17 -0
  23. package/lib/BundleOutputFile.d.ts.map +1 -0
  24. package/lib/BundleOutputFile.js +2 -0
  25. package/lib/BundleOutputFile.js.map +1 -0
  26. package/lib/BundleResult.d.ts +23 -0
  27. package/lib/BundleResult.d.ts.map +1 -0
  28. package/lib/BundleResult.js +2 -0
  29. package/lib/BundleResult.js.map +1 -0
  30. package/lib/BundlerPlugin.d.ts +8 -0
  31. package/lib/BundlerPlugin.d.ts.map +1 -0
  32. package/lib/BundlerPlugin.js +2 -0
  33. package/lib/BundlerPlugin.js.map +1 -0
  34. package/lib/BundlerPluginResult.d.ts +43 -0
  35. package/lib/BundlerPluginResult.d.ts.map +1 -0
  36. package/lib/BundlerPluginResult.js +2 -0
  37. package/lib/BundlerPluginResult.js.map +1 -0
  38. package/lib/CloudpackConfig.d.ts +9 -0
  39. package/lib/CloudpackConfig.d.ts.map +1 -0
  40. package/lib/CloudpackConfig.js +2 -0
  41. package/lib/CloudpackConfig.js.map +1 -0
  42. package/lib/DevServer.d.ts +44 -0
  43. package/lib/DevServer.d.ts.map +1 -0
  44. package/lib/DevServer.js +2 -0
  45. package/lib/DevServer.js.map +1 -0
  46. package/lib/Feature.d.ts +4 -0
  47. package/lib/Feature.d.ts.map +1 -0
  48. package/lib/Feature.js +2 -0
  49. package/lib/Feature.js.map +1 -0
  50. package/lib/Features.d.ts +8 -0
  51. package/lib/Features.d.ts.map +1 -0
  52. package/lib/Features.js +2 -0
  53. package/lib/Features.js.map +1 -0
  54. package/lib/GeneratedConfig.d.ts +17 -0
  55. package/lib/GeneratedConfig.d.ts.map +1 -0
  56. package/lib/GeneratedConfig.js +2 -0
  57. package/lib/GeneratedConfig.js.map +1 -0
  58. package/lib/HttpsConfig.d.ts +9 -0
  59. package/lib/HttpsConfig.d.ts.map +1 -0
  60. package/lib/HttpsConfig.js +2 -0
  61. package/lib/HttpsConfig.js.map +1 -0
  62. package/lib/PackageDefinitionsCache.d.ts +51 -0
  63. package/lib/PackageDefinitionsCache.d.ts.map +1 -0
  64. package/lib/PackageDefinitionsCache.js +2 -0
  65. package/lib/PackageDefinitionsCache.js.map +1 -0
  66. package/lib/PackageJson.d.ts +134 -0
  67. package/lib/PackageJson.d.ts.map +1 -0
  68. package/lib/PackageJson.js +2 -0
  69. package/lib/PackageJson.js.map +1 -0
  70. package/lib/PackageOverride.d.ts +8 -0
  71. package/lib/PackageOverride.d.ts.map +1 -0
  72. package/lib/PackageOverride.js +2 -0
  73. package/lib/PackageOverride.js.map +1 -0
  74. package/lib/PackageSettings.d.ts +56 -0
  75. package/lib/PackageSettings.d.ts.map +1 -0
  76. package/lib/PackageSettings.js +2 -0
  77. package/lib/PackageSettings.js.map +1 -0
  78. package/lib/Route.d.ts +23 -0
  79. package/lib/Route.d.ts.map +1 -0
  80. package/lib/Route.js +2 -0
  81. package/lib/Route.js.map +1 -0
  82. package/lib/TelemetryConfig.d.ts +7 -0
  83. package/lib/TelemetryConfig.d.ts.map +1 -0
  84. package/lib/TelemetryConfig.js +2 -0
  85. package/lib/TelemetryConfig.js.map +1 -0
  86. package/lib/UserConfig.d.ts +73 -0
  87. package/lib/UserConfig.d.ts.map +1 -0
  88. package/lib/UserConfig.js +2 -0
  89. package/lib/UserConfig.js.map +1 -0
  90. package/lib/allFeatures.d.ts +15 -0
  91. package/lib/allFeatures.d.ts.map +1 -0
  92. package/lib/allFeatures.js +16 -0
  93. package/lib/allFeatures.js.map +1 -0
  94. package/lib/index.d.ts +24 -0
  95. package/lib/index.d.ts.map +1 -0
  96. package/lib/index.js +2 -0
  97. package/lib/index.js.map +1 -0
  98. package/lib/tsdoc-metadata.json +11 -0
  99. package/package.json +32 -0
  100. package/schema/GeneratedConfig.json +622 -0
  101. package/schema/UserConfig.json +655 -0
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @ms-cloudpack/common-types
2
+
3
+ This library provides common typings for Cloudpack and Cloudpack bundler plugins. We keep typings in a separate package to avoid circular dependencies in our dependency graph.
@@ -0,0 +1,6 @@
1
+ import { type CloudpackConfig } from './CloudpackConfig.js';
2
+ export interface BundleContext {
3
+ config: CloudpackConfig;
4
+ moduleType: 'cjs' | 'esm' | undefined;
5
+ }
6
+ //# sourceMappingURL=BundleContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleContext.d.ts","sourceRoot":"","sources":["../src/BundleContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,eAAe,CAAC;IACxB,UAAU,EAAE,KAAK,GAAG,KAAK,GAAG,SAAS,CAAC;CACvC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BundleContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleContext.js","sourceRoot":"","sources":["../src/BundleContext.ts"],"names":[],"mappings":"","sourcesContent":["import { type CloudpackConfig } from './CloudpackConfig.js';\n\nexport interface BundleContext {\n config: CloudpackConfig;\n moduleType: 'cjs' | 'esm' | undefined;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { BundleMessageNote } from './BundleMessageNote.js';
2
+ import type { BundleMessageLocation } from './BundleMessageLocation.js';
3
+ export interface BundleMessage {
4
+ pluginName?: string;
5
+ type?: string;
6
+ text: string;
7
+ location?: BundleMessageLocation;
8
+ notes?: BundleMessageNote[];
9
+ }
10
+ //# sourceMappingURL=BundleMessage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleMessage.d.ts","sourceRoot":"","sources":["../src/BundleMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC7B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BundleMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleMessage.js","sourceRoot":"","sources":["../src/BundleMessage.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMessageNote } from './BundleMessageNote.js';\nimport type { BundleMessageLocation } from './BundleMessageLocation.js';\n\nexport interface BundleMessage {\n pluginName?: string;\n type?: string;\n text: string;\n location?: BundleMessageLocation;\n notes?: BundleMessageNote[];\n}\n"]}
@@ -0,0 +1,12 @@
1
+ export interface BundleMessageLocation {
2
+ file: string;
3
+ /** 1-based */
4
+ line: number;
5
+ /** 0-based, in bytes */
6
+ column: number;
7
+ /** in bytes */
8
+ length?: number;
9
+ lineText?: string;
10
+ suggestion?: string;
11
+ }
12
+ //# sourceMappingURL=BundleMessageLocation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleMessageLocation.d.ts","sourceRoot":"","sources":["../src/BundleMessageLocation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IAEb,cAAc;IACd,IAAI,EAAE,MAAM,CAAC;IAEb,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC;IAEf,eAAe;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BundleMessageLocation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleMessageLocation.js","sourceRoot":"","sources":["../src/BundleMessageLocation.ts"],"names":[],"mappings":"","sourcesContent":["export interface BundleMessageLocation {\n file: string;\n\n /** 1-based */\n line: number;\n\n /** 0-based, in bytes */\n column: number;\n\n /** in bytes */\n length?: number;\n\n lineText?: string;\n\n suggestion?: string;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { BundleMessageLocation } from './BundleMessageLocation.js';
2
+ export interface BundleMessageNote {
3
+ text: string;
4
+ location?: BundleMessageLocation;
5
+ }
6
+ //# sourceMappingURL=BundleMessageNote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleMessageNote.d.ts","sourceRoot":"","sources":["../src/BundleMessageNote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,qBAAqB,CAAC;CAClC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BundleMessageNote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleMessageNote.js","sourceRoot":"","sources":["../src/BundleMessageNote.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMessageLocation } from './BundleMessageLocation.js';\n\nexport interface BundleMessageNote {\n text: string;\n location?: BundleMessageLocation;\n}\n"]}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Options to create bundles from the bundler plugin.
3
+ */
4
+ export interface BundleOptions {
5
+ /**
6
+ * The absolute input path for the entry points.
7
+ */
8
+ inputPath: string;
9
+ /**
10
+ * The entry point paths map. Key is path to the output file, relative to `outputPath` and stripped of `.js`
11
+ * extension. Value is the input entry path, relative to `inputPath` including the extension. For example:
12
+ * `{ 'lib/index': 'src/index.js' }`
13
+ *
14
+ * Note: Non-javascript extensions, such as `.css` or `.scss`, will not be stripped from the key.
15
+ * This is to ensure the bundler keeps the original extension intact and adds `.js` after it.
16
+ */
17
+ entries: Record<string, string>;
18
+ /**
19
+ * The output path for bundled files. This can be either relative to `inputPath`, or absolute.
20
+ * Defaults to `inputPath`.
21
+ */
22
+ outputPath?: string;
23
+ /**
24
+ * List of dependencies which should be externalized. Only applicable for ESM output.
25
+ */
26
+ external?: string[];
27
+ /**
28
+ * List of dependencies which should be inlined.
29
+ */
30
+ inlined?: string[];
31
+ /**
32
+ * If true, minify the output.
33
+ */
34
+ minify?: boolean;
35
+ /**
36
+ * If specified, will generate sourcemaps for the output. This may have a tax on performance.
37
+ */
38
+ sourcemap?: 'none' | 'linked' | 'inline' | 'external' | 'inline-and-external';
39
+ /**
40
+ * If true, the bundler is expected to stay alive and take requests to rebuild on demand. File watching is
41
+ * managed at a higher layer. When we no longer care about incremental bundling, the bundler will receive a call
42
+ * to `dispose` if returned.
43
+ */
44
+ incremental?: boolean;
45
+ /**
46
+ * If specified, will use a specific bundler type. This is not recommended unless there is a clear reason to hardcode
47
+ * the bundler type.
48
+ */
49
+ bundlerType?: string;
50
+ /**
51
+ * If specific settings are required to pass through to the specific bundler, they can be specified here are are
52
+ * expected to be merged in by the plugin. Specifying bundler-specific overrides is not recommended, as it locks
53
+ * us into a specific bundler implementation.
54
+ */
55
+ overrideOptions?: Record<string, unknown>;
56
+ }
57
+ //# sourceMappingURL=BundleOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleOptions.d.ts","sourceRoot":"","sources":["../src/BundleOptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,qBAAqB,CAAC;IAE9E;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IAEH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BundleOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleOptions.js","sourceRoot":"","sources":["../src/BundleOptions.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Options to create bundles from the bundler plugin.\n */\nexport interface BundleOptions {\n /**\n * The absolute input path for the entry points.\n */\n inputPath: string;\n\n /**\n * The entry point paths map. Key is path to the output file, relative to `outputPath` and stripped of `.js`\n * extension. Value is the input entry path, relative to `inputPath` including the extension. For example:\n * `{ 'lib/index': 'src/index.js' }`\n *\n * Note: Non-javascript extensions, such as `.css` or `.scss`, will not be stripped from the key.\n * This is to ensure the bundler keeps the original extension intact and adds `.js` after it.\n */\n entries: Record<string, string>;\n\n /**\n * The output path for bundled files. This can be either relative to `inputPath`, or absolute.\n * Defaults to `inputPath`.\n */\n outputPath?: string;\n\n /**\n * List of dependencies which should be externalized. Only applicable for ESM output.\n */\n external?: string[];\n\n /**\n * List of dependencies which should be inlined.\n */\n inlined?: string[];\n\n /**\n * If true, minify the output.\n */\n minify?: boolean;\n\n /**\n * If specified, will generate sourcemaps for the output. This may have a tax on performance.\n */\n sourcemap?: 'none' | 'linked' | 'inline' | 'external' | 'inline-and-external';\n\n /**\n * If true, the bundler is expected to stay alive and take requests to rebuild on demand. File watching is\n * managed at a higher layer. When we no longer care about incremental bundling, the bundler will receive a call\n * to `dispose` if returned.\n */\n incremental?: boolean;\n\n /**\n * If specified, will use a specific bundler type. This is not recommended unless there is a clear reason to hardcode\n * the bundler type.\n */\n // TODO: rename either this or BundleResult.bundlerName for consistency\n bundlerType?: string;\n\n /**\n * If specific settings are required to pass through to the specific bundler, they can be specified here are are\n * expected to be merged in by the plugin. Specifying bundler-specific overrides is not recommended, as it locks\n * us into a specific bundler implementation.\n */\n overrideOptions?: Record<string, unknown>;\n}\n"]}
@@ -0,0 +1,17 @@
1
+ export interface BundleOutputFile {
2
+ /**
3
+ * The relative path to the output file (starting from `BundleResult#outputPath`),
4
+ * with forward slashes.
5
+ */
6
+ outputPath: string;
7
+ /**
8
+ * The relative path to the entry file (starting from `BundleResult#inputPath`),
9
+ * with forward slashes.
10
+ */
11
+ entryPoint?: string;
12
+ /**
13
+ * The list of export names coming from the output file.
14
+ */
15
+ exports?: string[];
16
+ }
17
+ //# sourceMappingURL=BundleOutputFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleOutputFile.d.ts","sourceRoot":"","sources":["../src/BundleOutputFile.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BundleOutputFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleOutputFile.js","sourceRoot":"","sources":["../src/BundleOutputFile.ts"],"names":[],"mappings":"","sourcesContent":["export interface BundleOutputFile {\n /**\n * The relative path to the output file (starting from `BundleResult#outputPath`),\n * with forward slashes.\n */\n outputPath: string;\n\n /**\n * The relative path to the entry file (starting from `BundleResult#inputPath`),\n * with forward slashes.\n */\n entryPoint?: string;\n\n /**\n * The list of export names coming from the output file.\n */\n exports?: string[];\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import type { BundlerPluginResult } from './BundlerPluginResult.js';
2
+ /**
3
+ * Final bundle result as returned by `bundle()` in `@ms-cloudpack/bundler`.
4
+ */
5
+ export interface BundleResult extends Omit<BundlerPluginResult, 'rebuild' | 'rawInput' | 'rawOutput'> {
6
+ /**
7
+ * The name of the bundler used. Will be set unless there was an error with the options.
8
+ */
9
+ bundlerName?: string;
10
+ /**
11
+ * The absolute input path of the entries.
12
+ */
13
+ inputPath: string;
14
+ /**
15
+ * The entry file paths map used to create the bundle output. See `BundleOptions.entries`.
16
+ */
17
+ entries?: Record<string, string>;
18
+ /**
19
+ * If incremental bundling is specified, provide a way to rebuild the project.
20
+ */
21
+ rebuild?: () => Promise<BundleResult>;
22
+ }
23
+ //# sourceMappingURL=BundleResult.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleResult.d.ts","sourceRoot":"","sources":["../src/BundleResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE;;GAEG;AAGH,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;IACnG;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;CACvC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BundleResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundleResult.js","sourceRoot":"","sources":["../src/BundleResult.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundlerPluginResult } from './BundlerPluginResult.js';\n\n/**\n * Final bundle result as returned by `bundle()` in `@ms-cloudpack/bundler`.\n */\n// rawInput and rawOutput are intentionally removed.\n// rebuild is wrapped to return a full BundleResult.\nexport interface BundleResult extends Omit<BundlerPluginResult, 'rebuild' | 'rawInput' | 'rawOutput'> {\n /**\n * The name of the bundler used. Will be set unless there was an error with the options.\n */\n bundlerName?: string;\n\n /**\n * The absolute input path of the entries.\n */\n inputPath: string;\n\n /**\n * The entry file paths map used to create the bundle output. See `BundleOptions.entries`.\n */\n entries?: Record<string, string>;\n\n /**\n * If incremental bundling is specified, provide a way to rebuild the project.\n */\n rebuild?: () => Promise<BundleResult>;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import type { BundleContext } from './BundleContext.js';
2
+ import type { BundleOptions } from './BundleOptions.js';
3
+ import type { BundlerPluginResult } from './BundlerPluginResult.js';
4
+ export interface BundlerPlugin {
5
+ name: string;
6
+ bundle: (options: BundleOptions, context: BundleContext) => Promise<BundlerPluginResult>;
7
+ }
8
+ //# sourceMappingURL=BundlerPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundlerPlugin.d.ts","sourceRoot":"","sources":["../src/BundlerPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC1F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BundlerPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundlerPlugin.js","sourceRoot":"","sources":["../src/BundlerPlugin.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleContext } from './BundleContext.js';\nimport type { BundleOptions } from './BundleOptions.js';\nimport type { BundlerPluginResult } from './BundlerPluginResult.js';\n\nexport interface BundlerPlugin {\n name: string;\n bundle: (options: BundleOptions, context: BundleContext) => Promise<BundlerPluginResult>;\n}\n"]}
@@ -0,0 +1,43 @@
1
+ import type { BundleMessage } from './BundleMessage.js';
2
+ import type { BundleOutputFile } from './BundleOutputFile.js';
3
+ /**
4
+ * Result returned by a bundler plugin (`BundlerPlugin#bundle()`).
5
+ * Excludes properties that can be filled in automatically.
6
+ */
7
+ export interface BundlerPluginResult {
8
+ /**
9
+ * The absolute output path of the bundle.
10
+ */
11
+ outputPath?: string;
12
+ /**
13
+ * The output files produced by bundling.
14
+ */
15
+ outputFiles?: BundleOutputFile[];
16
+ /**
17
+ * Errors encountered during bundling.
18
+ */
19
+ errors?: BundleMessage[];
20
+ /**
21
+ * Warnings encountered during bundling.
22
+ */
23
+ warnings?: BundleMessage[];
24
+ /**
25
+ * The raw input options passed along into the bundler, for debugging purposes.
26
+ * May be missing if something prevented executing the bundler.
27
+ */
28
+ rawInput?: Record<string, unknown>;
29
+ /**
30
+ * The raw output emitted from the bundler, for debugging purposes.
31
+ * May be missing if something prevented the bundler from returning output.
32
+ */
33
+ rawOutput?: Record<string, unknown>;
34
+ /**
35
+ * If incremental bundling is specified, provide a way to rebuild the project.
36
+ */
37
+ rebuild?: () => Promise<BundlerPluginResult>;
38
+ /**
39
+ * If incremental bundling is specified, provide a way to shut down the incremental build job.
40
+ */
41
+ dispose?: () => void;
42
+ }
43
+ //# sourceMappingURL=BundlerPluginResult.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundlerPluginResult.d.ts","sourceRoot":"","sources":["../src/BundlerPluginResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;GAGG;AAEH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAEjC;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;IAEzB;;OAEG;IACH,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEnC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEpC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE7C;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BundlerPluginResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BundlerPluginResult.js","sourceRoot":"","sources":["../src/BundlerPluginResult.ts"],"names":[],"mappings":"","sourcesContent":["import type { BundleMessage } from './BundleMessage.js';\nimport type { BundleOutputFile } from './BundleOutputFile.js';\n\n/**\n * Result returned by a bundler plugin (`BundlerPlugin#bundle()`).\n * Excludes properties that can be filled in automatically.\n */\n\nexport interface BundlerPluginResult {\n /**\n * The absolute output path of the bundle.\n */\n outputPath?: string;\n\n /**\n * The output files produced by bundling.\n */\n outputFiles?: BundleOutputFile[];\n\n /**\n * Errors encountered during bundling.\n */\n errors?: BundleMessage[];\n\n /**\n * Warnings encountered during bundling.\n */\n warnings?: BundleMessage[];\n\n /**\n * The raw input options passed along into the bundler, for debugging purposes.\n * May be missing if something prevented executing the bundler.\n */\n rawInput?: Record<string, unknown>;\n\n /**\n * The raw output emitted from the bundler, for debugging purposes.\n * May be missing if something prevented the bundler from returning output.\n */\n rawOutput?: Record<string, unknown>;\n\n /**\n * If incremental bundling is specified, provide a way to rebuild the project.\n */\n rebuild?: () => Promise<BundlerPluginResult>;\n\n /**\n * If incremental bundling is specified, provide a way to shut down the incremental build job.\n */\n dispose?: () => void;\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { GeneratedConfig } from './GeneratedConfig.js';
2
+ import type { UserConfig } from './UserConfig.js';
3
+ /**
4
+ * The merged result of user-provided and generated configuration for Cloudpack.
5
+ */
6
+ export type CloudpackConfig = UserConfig & {
7
+ generated: GeneratedConfig;
8
+ };
9
+ //# sourceMappingURL=CloudpackConfig.d.ts.map
@@ -0,0 +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,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AAEH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG;IACzC,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=CloudpackConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CloudpackConfig.js","sourceRoot":"","sources":["../src/CloudpackConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { GeneratedConfig } from './GeneratedConfig.js';\nimport type { UserConfig } from './UserConfig.js';\n\n/**\n * The merged result of user-provided and generated configuration for Cloudpack.\n */\n\nexport type CloudpackConfig = UserConfig & {\n generated: GeneratedConfig;\n};\n"]}
@@ -0,0 +1,44 @@
1
+ import type { HttpsConfig } from './HttpsConfig.js';
2
+ import type { Route } from './Route.js';
3
+ export interface DevServer {
4
+ /**
5
+ * The domain name of the server.
6
+ */
7
+ domain?: string;
8
+ /**
9
+ * An optional dictionary of header key/value pairs to be use with the server.
10
+ * NOTE: The following header values from Cloudpack will "win" against by a user's config:
11
+ * 'Cache-Control': 'no-cache'
12
+ * 'Access-Control-Allow-Origin': '*'
13
+ */
14
+ requestHeaders?: Record<string, string>;
15
+ /**
16
+ * The ports to be used by the server.
17
+ * It can be a number or an array of numbers.
18
+ * If ports are provided, an error will be thrown if none are available.
19
+ * If no ports are provided, the server will attempt to find an available port.
20
+ */
21
+ port?: number | number[];
22
+ /**
23
+ * The default path to use when opening the browser.
24
+ */
25
+ defaultPath?: string;
26
+ /**
27
+ * The config settings for the https server.
28
+ * Paths to files are accepted for 'ca', 'cert', 'key', and 'pfx' settings.
29
+ * Everything else is passed directly to the https.createServer() method.
30
+ * If not provided, the server will use http.
31
+ */
32
+ https?: HttpsConfig;
33
+ /**
34
+ * If provided, will override where the publicDir is located, relative to the app package folder.
35
+ * Defaults to `./public`. The same thing can be achieved with `routes`, using route: '*' and
36
+ * staticPath: './public', so the `publicPath` setting may be removed in the future.
37
+ */
38
+ publicPath?: string;
39
+ /**
40
+ * If provided, will register routes with the dev server to host various pages.
41
+ */
42
+ routes?: Route[];
43
+ }
44
+ //# sourceMappingURL=DevServer.d.ts.map
@@ -0,0 +1 @@
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,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;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,WAAW,CAAC;IAEpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DevServer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DevServer.js","sourceRoot":"","sources":["../src/DevServer.ts"],"names":[],"mappings":"","sourcesContent":["import type { HttpsConfig } from './HttpsConfig.js';\nimport type { Route } from './Route.js';\n\nexport interface DevServer {\n /**\n * The domain name of the server.\n */\n domain?: string;\n\n /**\n * An optional dictionary of header key/value pairs to be use with the server.\n * NOTE: The following header values from Cloudpack will \"win\" against by a user's config:\n * 'Cache-Control': 'no-cache'\n * 'Access-Control-Allow-Origin': '*'\n */\n requestHeaders?: Record<string, string>;\n\n /**\n * The ports to be used by the server.\n * It can be a number or an array of numbers.\n * If ports are provided, an error will be thrown if none are available.\n * If no ports are provided, the server will attempt to find an available port.\n */\n port?: number | number[];\n\n /**\n * The default path to use when opening the browser.\n */\n defaultPath?: string;\n\n /**\n * The config settings for the https server.\n * Paths to files are accepted for 'ca', 'cert', 'key', and 'pfx' settings.\n * Everything else is passed directly to the https.createServer() method.\n * If not provided, the server will use http.\n */\n https?: HttpsConfig;\n\n /**\n * If provided, will override where the publicDir is located, relative to the app package folder.\n * Defaults to `./public`. The same thing can be achieved with `routes`, using route: '*' and\n * staticPath: './public', so the `publicPath` setting may be removed in the future.\n */\n publicPath?: string;\n\n /**\n * If provided, will register routes with the dev server to host various pages.\n */\n routes?: Route[];\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export interface Feature {
2
+ description: string;
3
+ }
4
+ //# sourceMappingURL=Feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Feature.d.ts","sourceRoot":"","sources":["../src/Feature.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB"}
package/lib/Feature.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Feature.js","sourceRoot":"","sources":["../src/Feature.ts"],"names":[],"mappings":"","sourcesContent":["export interface Feature {\n description: string;\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import type { allFeatures } from './allFeatures.js';
2
+ /**
3
+ * Represents all features that can be enabled or disabled for Cloudpack.
4
+ */
5
+ export type Features = {
6
+ [key in keyof typeof allFeatures]?: boolean;
7
+ };
8
+ //# sourceMappingURL=Features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Features.d.ts","sourceRoot":"","sources":["../src/Features.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;KAAG,GAAG,IAAI,MAAM,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO;CAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Features.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Features.js","sourceRoot":"","sources":["../src/Features.ts"],"names":[],"mappings":"","sourcesContent":["import type { allFeatures } from './allFeatures.js';\n\n/**\n * Represents all features that can be enabled or disabled for Cloudpack.\n */\nexport type Features = { [key in keyof typeof allFeatures]?: boolean };\n"]}
@@ -0,0 +1,17 @@
1
+ import type { PackageOverride } from './PackageOverride.js';
2
+ import type { PackageSettings } from './PackageSettings.js';
3
+ /**
4
+ * Per-application generated configuration for Cloudpack.
5
+ */
6
+ export interface GeneratedConfig {
7
+ /**
8
+ * Settings to customize how packages are bundled.
9
+ * For the generated config, these should just contain generated exports maps.
10
+ */
11
+ packageSettings?: PackageSettings[];
12
+ /**
13
+ * @deprecated Use `packageSettings` instead.
14
+ */
15
+ packageOverrides?: PackageOverride[];
16
+ }
17
+ //# sourceMappingURL=GeneratedConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeneratedConfig.d.ts","sourceRoot":"","sources":["../src/GeneratedConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,eAAe,CAAC,EAAE,eAAe,EAAE,CAAC;IAEpC;;OAEG;IACH,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;CACtC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=GeneratedConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeneratedConfig.js","sourceRoot":"","sources":["../src/GeneratedConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageOverride } from './PackageOverride.js';\nimport type { PackageSettings } from './PackageSettings.js';\n\n/**\n * Per-application generated configuration for Cloudpack.\n */\nexport interface GeneratedConfig {\n /**\n * Settings to customize how packages are bundled.\n * For the generated config, these should just contain generated exports maps.\n */\n packageSettings?: PackageSettings[];\n\n /**\n * @deprecated Use `packageSettings` instead.\n */\n packageOverrides?: PackageOverride[];\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /// <reference types="node" resolution-mode="require"/>
3
+ import type { ServerOptions } from 'https';
4
+ import type { IncomingMessage, ServerResponse } from 'http';
5
+ /**
6
+ * HTTPS server configuration settings.
7
+ */
8
+ export type HttpsConfig = Omit<ServerOptions<typeof IncomingMessage, typeof ServerResponse>, 'IncomingMessage' | 'ServerResponse'>;
9
+ //# sourceMappingURL=HttpsConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpsConfig.d.ts","sourceRoot":"","sources":["../src/HttpsConfig.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,aAAa,CAAC,OAAO,eAAe,EAAE,OAAO,cAAc,CAAC,EAE5D,iBAAiB,GAAG,gBAAgB,CACrC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=HttpsConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpsConfig.js","sourceRoot":"","sources":["../src/HttpsConfig.ts"],"names":[],"mappings":"","sourcesContent":["import type { ServerOptions } from 'https';\nimport type { IncomingMessage, ServerResponse } from 'http';\n\n/**\n * HTTPS server configuration settings.\n */\nexport type HttpsConfig = Omit<\n ServerOptions<typeof IncomingMessage, typeof ServerResponse>,\n // These are irrelevant for usage and cause problems for schema generation.\n 'IncomingMessage' | 'ServerResponse'\n>;\n"]}
@@ -0,0 +1,51 @@
1
+ import type { PackageJson } from './PackageJson.js';
2
+ /** Provides context about how a parent package imports/depends on another package. */
3
+ export interface PackageImporterContext {
4
+ /** Actual name of the package that requested this package. */
5
+ parentName: string;
6
+ /** Actual version of the package that requested this package. */
7
+ parentVersion: string;
8
+ /** Name under which this package is imported by the parent. */
9
+ importedName: string;
10
+ /** Version spec the parent requested for this package. */
11
+ versionRequirement: string;
12
+ }
13
+ /** Transform applied to a `package.json` file after it's read. */
14
+ export type PackageDefinitionTransform = (params: {
15
+ definition: PackageJson;
16
+ packagePath: string;
17
+ packages: PackageDefinitionsCache;
18
+ importerContext?: PackageImporterContext;
19
+ }) => PackageJson | undefined | Promise<PackageJson | undefined>;
20
+ export interface GetPackageDefinitionOptions {
21
+ /** If true, the package definition will be re-read from disk. */
22
+ refresh?: boolean;
23
+ /** If true, transforms will not be applied. */
24
+ disableTransforms?: boolean;
25
+ /** Info about the package that is importing this package, if known. */
26
+ importerContext?: PackageImporterContext;
27
+ }
28
+ /**
29
+ * Utility class for reading and caching package definition (`package.json`) objects,
30
+ * and optionally applying transforms.
31
+ */
32
+ export interface PackageDefinitionsCache {
33
+ /** Get a package definition (either from cache or disk) and apply transforms. */
34
+ get(packagePath: string, options?: GetPackageDefinitionOptions): Promise<PackageJson | undefined>;
35
+ /** Register a new transform. */
36
+ registerTransform(factory: (config?: unknown) => PackageDefinitionTransform): void;
37
+ /**
38
+ * Resets the cache. If a `newConfig` value is provided, the transform factories will be called with the new value
39
+ * to give them an opportunity to reflect changes to the config. It is `unknown` because the config type is
40
+ * application-specific.
41
+ */
42
+ reset(options?: {
43
+ newConfig?: unknown;
44
+ }): void;
45
+ /**
46
+ * Remove one package from the cache.
47
+ * @deprecated Not used.
48
+ */
49
+ resetPackage(packagePath: string): void;
50
+ }
51
+ //# sourceMappingURL=PackageDefinitionsCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PackageDefinitionsCache.d.ts","sourceRoot":"","sources":["../src/PackageDefinitionsCache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,sFAAsF;AACtF,MAAM,WAAW,sBAAsB;IACrC,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,YAAY,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,kEAAkE;AAClE,MAAM,MAAM,0BAA0B,GAAG,CAAC,MAAM,EAAE;IAChD,UAAU,EAAE,WAAW,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,uBAAuB,CAAC;IAClC,eAAe,CAAC,EAAE,sBAAsB,CAAC;CAC1C,KAAK,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;AAEjE,MAAM,WAAW,2BAA2B;IAC1C,iEAAiE;IACjE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,uEAAuE;IACvE,eAAe,CAAC,EAAE,sBAAsB,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,iFAAiF;IACjF,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAElG,gCAAgC;IAChC,iBAAiB,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,0BAA0B,GAAG,IAAI,CAAC;IAEnF;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAE/C;;;OAGG;IACH,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PackageDefinitionsCache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PackageDefinitionsCache.js","sourceRoot":"","sources":["../src/PackageDefinitionsCache.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageJson } from './PackageJson.js';\n\n/** Provides context about how a parent package imports/depends on another package. */\nexport interface PackageImporterContext {\n /** Actual name of the package that requested this package. */\n parentName: string;\n /** Actual version of the package that requested this package. */\n parentVersion: string;\n /** Name under which this package is imported by the parent. */\n importedName: string;\n /** Version spec the parent requested for this package. */\n versionRequirement: string;\n}\n\n/** Transform applied to a `package.json` file after it's read. */\nexport type PackageDefinitionTransform = (params: {\n definition: PackageJson;\n packagePath: string;\n packages: PackageDefinitionsCache;\n importerContext?: PackageImporterContext;\n}) => PackageJson | undefined | Promise<PackageJson | undefined>;\n\nexport interface GetPackageDefinitionOptions {\n /** If true, the package definition will be re-read from disk. */\n refresh?: boolean;\n /** If true, transforms will not be applied. */\n disableTransforms?: boolean;\n /** Info about the package that is importing this package, if known. */\n importerContext?: PackageImporterContext;\n}\n\n/**\n * Utility class for reading and caching package definition (`package.json`) objects,\n * and optionally applying transforms.\n */\nexport interface PackageDefinitionsCache {\n /** Get a package definition (either from cache or disk) and apply transforms. */\n get(packagePath: string, options?: GetPackageDefinitionOptions): Promise<PackageJson | undefined>;\n\n /** Register a new transform. */\n registerTransform(factory: (config?: unknown) => PackageDefinitionTransform): void;\n\n /**\n * Resets the cache. If a `newConfig` value is provided, the transform factories will be called with the new value\n * to give them an opportunity to reflect changes to the config. It is `unknown` because the config type is\n * application-specific.\n */\n reset(options?: { newConfig?: unknown }): void;\n\n /**\n * Remove one package from the cache.\n * @deprecated Not used.\n */\n resetPackage(packagePath: string): void;\n}\n"]}