@ms-cloudpack/common-types 0.5.2 → 0.5.3

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.
@@ -42,6 +42,10 @@ export interface PackageDefinitionsCache {
42
42
  reset(options?: {
43
43
  newConfig?: unknown;
44
44
  }): void;
45
+ /**
46
+ * This is a helper function for testing, to get all package definitions in the cache.
47
+ */
48
+ _getAll(options?: Pick<GetPackageDefinitionOptions, 'disableTransforms'>): Record<string, PackageJson>;
45
49
  /**
46
50
  * Remove one package from the cache.
47
51
  * @deprecated Not used.
@@ -1 +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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C,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;;OAEG;IACH,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,2BAA2B,EAAE,mBAAmB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAEvG;;;OAGG;IACH,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC"}
@@ -1 +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"]}
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 * This is a helper function for testing, to get all package definitions in the cache.\n */\n _getAll(options?: Pick<GetPackageDefinitionOptions, 'disableTransforms'>): Record<string, PackageJson>;\n\n /**\n * Remove one package from the cache.\n * @deprecated Not used.\n */\n resetPackage(packagePath: string): void;\n}\n"]}
@@ -19,12 +19,13 @@ export interface PackageSettings {
19
19
  /**
20
20
  * The dependencies which should be included when computing the import map. This is primarily used when
21
21
  * devDependencies are needed by the app. This often happens when a library has a demo app which relies
22
- * on devDependencies.
22
+ * on devDependencies. Accepts `devDependencies` as a special value to include all devDependencies.
23
23
  */
24
24
  includedDependencies?: string[];
25
25
  /**
26
26
  * The dependencies which should be ignored by Cloudpack verbs. For example, if "react-native" is a dependency
27
27
  * which should not be included in the import map or evaluated during `init`, it can be listed here to ignore it.
28
+ * Accepts `peerDependencies` as a special value to exclude all peerDependencies.
28
29
  */
29
30
  excludedDependencies?: string[];
30
31
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"PackageSettings.d.ts","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,KAAK,EACD;QACE;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,GAED,MAAM,CAAC;IAEX;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhC;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MA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AMG;IACH,oBAAoB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAE1D;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageJsonExports } from './PackageJson.js';\n\n/**\n * Settings which apply to a single package (app or library) as it pertains to the Cloudpack start experience.\n */\nexport interface PackageSettings {\n /**\n * A match to indicate the target for the settings to be applied to.\n */\n match:\n | {\n /**\n * Name of the package. Can use a trailing wildcard (e.g. \"\\@scope/*\").\n */\n name: string;\n\n /**\n * Version of the package. Unspecified matches any version.\n */\n version?: string;\n }\n // Match can be a string, which is a shortcut for the name.\n | string;\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 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 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 bundlerType?: string;\n\n /**\n * Options to pass to the bundler.\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 * Paths to files that include dynamic imports. These are used by ori to determine which files should be\n * processed by the dynamic-imports plugin.\n */\n dynamicImports?: string[];\n}\n"]}
1
+ {"version":3,"file":"PackageSettings.js","sourceRoot":"","sources":["../src/PackageSettings.ts"],"names":[],"mappings":"","sourcesContent":["import type { PackageJsonExports } from './PackageJson.js';\n\n/**\n * Settings which apply to a single package (app or library) as it pertains to the Cloudpack start experience.\n */\nexport interface PackageSettings {\n /**\n * A match to indicate the target for the settings to be applied to.\n */\n match:\n | {\n /**\n * Name of the package. Can use a trailing wildcard (e.g. \"\\@scope/*\").\n */\n name: string;\n\n /**\n * Version of the package. Unspecified matches any version.\n */\n version?: string;\n }\n // Match can be a string, which is a shortcut for the name.\n | string;\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 bundlerType?: string;\n\n /**\n * Options to pass to the bundler.\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 * Paths to files that include dynamic imports. These are used by ori to determine which files should be\n * processed by the dynamic-imports plugin.\n */\n dynamicImports?: string[];\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/common-types",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Common types for Cloudpack.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -532,14 +532,14 @@
532
532
  "items": {
533
533
  "type": "string"
534
534
  },
535
- "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."
535
+ "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."
536
536
  },
537
537
  "excludedDependencies": {
538
538
  "type": "array",
539
539
  "items": {
540
540
  "type": "string"
541
541
  },
542
- "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."
542
+ "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."
543
543
  },
544
544
  "inlinedDependencies": {
545
545
  "type": "array",
@@ -56,14 +56,14 @@
56
56
  "items": {
57
57
  "type": "string"
58
58
  },
59
- "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."
59
+ "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."
60
60
  },
61
61
  "excludedDependencies": {
62
62
  "type": "array",
63
63
  "items": {
64
64
  "type": "string"
65
65
  },
66
- "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."
66
+ "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."
67
67
  },
68
68
  "inlinedDependencies": {
69
69
  "type": "array",
@@ -533,14 +533,14 @@
533
533
  "items": {
534
534
  "type": "string"
535
535
  },
536
- "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."
536
+ "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."
537
537
  },
538
538
  "excludedDependencies": {
539
539
  "type": "array",
540
540
  "items": {
541
541
  "type": "string"
542
542
  },
543
- "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."
543
+ "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."
544
544
  },
545
545
  "inlinedDependencies": {
546
546
  "type": "array",