@ms-cloudpack/api-server 0.17.1 → 0.18.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 (64) hide show
  1. package/lib/apis/ensurePackageBundled.d.ts +23 -0
  2. package/lib/apis/ensurePackageBundled.d.ts.map +1 -1
  3. package/lib/apis/ensurePackageBundled.js +8 -11
  4. package/lib/apis/ensurePackageBundled.js.map +1 -1
  5. package/lib/apis/index.d.ts +1 -0
  6. package/lib/apis/index.d.ts.map +1 -1
  7. package/lib/apis/index.js.map +1 -1
  8. package/lib/apis.d.ts +1 -0
  9. package/lib/apis.d.ts.map +1 -1
  10. package/lib/apis.js.map +1 -1
  11. package/lib/trpc/createAppRouter.d.ts +6 -0
  12. package/lib/trpc/createAppRouter.d.ts.map +1 -1
  13. package/lib/trpc/createCloudpackServer.d.ts +3 -0
  14. package/lib/trpc/createCloudpackServer.d.ts.map +1 -1
  15. package/lib/types/BundleRequest.d.ts +1 -1
  16. package/lib/types/BundleRequest.d.ts.map +1 -1
  17. package/lib/types/BundleRequest.js.map +1 -1
  18. package/lib/utilities/bundleTask.d.ts +0 -2
  19. package/lib/utilities/bundleTask.d.ts.map +1 -1
  20. package/lib/utilities/bundleTask.js +25 -13
  21. package/lib/utilities/bundleTask.js.map +1 -1
  22. package/lib/utilities/createBundleRequestForPackage.d.ts +1 -2
  23. package/lib/utilities/createBundleRequestForPackage.d.ts.map +1 -1
  24. package/lib/utilities/createBundleRequestForPackage.js +2 -3
  25. package/lib/utilities/createBundleRequestForPackage.js.map +1 -1
  26. package/lib/utilities/createBundleTask.d.ts +1 -7
  27. package/lib/utilities/createBundleTask.d.ts.map +1 -1
  28. package/lib/utilities/createBundleTask.js +2 -3
  29. package/lib/utilities/createBundleTask.js.map +1 -1
  30. package/lib/utilities/findImports.d.ts +2 -2
  31. package/lib/utilities/findImports.d.ts.map +1 -1
  32. package/lib/utilities/findImports.js +6 -6
  33. package/lib/utilities/findImports.js.map +1 -1
  34. package/lib/utilities/getBundleDetails.d.ts +0 -2
  35. package/lib/utilities/getBundleDetails.d.ts.map +1 -1
  36. package/lib/utilities/getBundleDetails.js +7 -3
  37. package/lib/utilities/getBundleDetails.js.map +1 -1
  38. package/lib/utilities/getPackagesToSync.js +1 -1
  39. package/lib/utilities/getPackagesToSync.js.map +1 -1
  40. package/lib/utilities/hashPackage.d.ts +4 -6
  41. package/lib/utilities/hashPackage.d.ts.map +1 -1
  42. package/lib/utilities/hashPackage.js +15 -21
  43. package/lib/utilities/hashPackage.js.map +1 -1
  44. package/lib/utilities/validateBundleRequestResult.d.ts +1 -1
  45. package/lib/utilities/validateBundleRequestResult.d.ts.map +1 -1
  46. package/lib/utilities/validateBundleRequestResult.js +2 -7
  47. package/lib/utilities/validateBundleRequestResult.js.map +1 -1
  48. package/package.json +7 -7
  49. package/lib/utilities/calculateHashOfInlinedDependencies.d.ts +0 -9
  50. package/lib/utilities/calculateHashOfInlinedDependencies.d.ts.map +0 -1
  51. package/lib/utilities/calculateHashOfInlinedDependencies.js +0 -18
  52. package/lib/utilities/calculateHashOfInlinedDependencies.js.map +0 -1
  53. package/lib/utilities/getPackageHashEntries.d.ts +0 -69
  54. package/lib/utilities/getPackageHashEntries.d.ts.map +0 -1
  55. package/lib/utilities/getPackageHashEntries.js +0 -29
  56. package/lib/utilities/getPackageHashEntries.js.map +0 -1
  57. package/lib/utilities/getPackagePath.d.ts +0 -16
  58. package/lib/utilities/getPackagePath.d.ts.map +0 -1
  59. package/lib/utilities/getPackagePath.js +0 -19
  60. package/lib/utilities/getPackagePath.js.map +0 -1
  61. package/lib/utilities/getSourceHash.d.ts +0 -9
  62. package/lib/utilities/getSourceHash.d.ts.map +0 -1
  63. package/lib/utilities/getSourceHash.js +0 -21
  64. package/lib/utilities/getSourceHash.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import type { CloudpackConfig } from '@ms-cloudpack/config';
2
- import type { ResolveMap, ResolveMapEntry } from '@ms-cloudpack/package-utilities';
2
+ import type { ResolveMapEntry } from '@ms-cloudpack/package-utilities';
3
3
  import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';
4
4
  import type { BundleRequest } from '../types/BundleRequest.js';
5
5
  export declare function createBundleRequestForPackage(options: {
@@ -11,6 +11,5 @@ export declare function createBundleRequestForPackage(options: {
11
11
  }, context: {
12
12
  config: CloudpackConfig;
13
13
  packages: PackageDefinitionsCache;
14
- resolveMap: ResolveMap;
15
14
  }): Promise<BundleRequest>;
16
15
  //# sourceMappingURL=createBundleRequestForPackage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleRequestForPackage.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleRequestForPackage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,wBAAsB,6BAA6B,CACjD,OAAO,EAAE;IACP,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,EACD,OAAO,EAAE;IACP,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,uBAAuB,CAAC;IAClC,UAAU,EAAE,UAAU,CAAC;CACxB,GACA,OAAO,CAAC,aAAa,CAAC,CAqBxB"}
1
+ {"version":3,"file":"createBundleRequestForPackage.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleRequestForPackage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,wBAAsB,6BAA6B,CACjD,OAAO,EAAE;IACP,YAAY,EAAE,eAAe,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,EACD,OAAO,EAAE;IACP,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,uBAAuB,CAAC;CACnC,GACA,OAAO,CAAC,aAAa,CAAC,CAoBxB"}
@@ -1,7 +1,7 @@
1
1
  import { getBundleDetails } from '../utilities/getBundleDetails.js';
2
2
  export async function createBundleRequestForPackage(options, context) {
3
3
  const { packageEntry } = options;
4
- const { config, packages } = context;
4
+ const { config } = context;
5
5
  const { features = {} } = config;
6
6
  const { path, version, name } = packageEntry;
7
7
  const { bundleId, isExternal, outputLocation } = await getBundleDetails({ packagePath: path }, context);
@@ -16,8 +16,7 @@ export async function createBundleRequestForPackage(options, context) {
16
16
  enableFindImports: options.enableFindImports ?? features.enqueueDependencies,
17
17
  enableCacheInternalPackages: features.cacheInternalPackages,
18
18
  bundlerType: options.bundlerType,
19
- config,
20
- packages,
19
+ ...context,
21
20
  };
22
21
  }
23
22
  //# sourceMappingURL=createBundleRequestForPackage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleRequestForPackage.js","sourceRoot":"","sources":["../../src/utilities/createBundleRequestForPackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAMC,EACD,OAIC;IAED,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IACjC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IACrC,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACjC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC;IAC7C,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,MAAM,gBAAgB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAExG,OAAO;QACL,EAAE,EAAE,QAAQ;QACZ,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,IAAI;QACjB,UAAU;QACV,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,cAAc,CAAC,IAAI;QACrD,OAAO;QACP,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,QAAQ,CAAC,iBAAiB;QAC1E,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,QAAQ,CAAC,mBAAmB;QAC5E,2BAA2B,EAAE,QAAQ,CAAC,qBAAqB;QAC3D,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC","sourcesContent":["import type { CloudpackConfig } from '@ms-cloudpack/config';\nimport type { ResolveMap, ResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport { getBundleDetails } from '../utilities/getBundleDetails.js';\nimport type { BundleRequest } from '../types/BundleRequest.js';\n\nexport async function createBundleRequestForPackage(\n options: {\n packageEntry: ResolveMapEntry;\n outputPath?: string;\n bundlerType?: string;\n disableSourceMaps?: boolean;\n enableFindImports?: boolean;\n },\n context: {\n config: CloudpackConfig;\n packages: PackageDefinitionsCache;\n resolveMap: ResolveMap;\n },\n): Promise<BundleRequest> {\n const { packageEntry } = options;\n const { config, packages } = context;\n const { features = {} } = config;\n const { path, version, name } = packageEntry;\n const { bundleId, isExternal, outputLocation } = await getBundleDetails({ packagePath: path }, context);\n\n return {\n id: bundleId,\n packagePath: path,\n packageName: name,\n isExternal,\n outputPath: options.outputPath ?? outputLocation.path,\n version,\n disableSourceMaps: options.disableSourceMaps ?? features.disableSourceMaps,\n enableFindImports: options.enableFindImports ?? features.enqueueDependencies,\n enableCacheInternalPackages: features.cacheInternalPackages,\n bundlerType: options.bundlerType,\n config,\n packages,\n };\n}\n"]}
1
+ {"version":3,"file":"createBundleRequestForPackage.js","sourceRoot":"","sources":["../../src/utilities/createBundleRequestForPackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGpE,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAMC,EACD,OAGC;IAED,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC;IACjC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACjC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC;IAC7C,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,MAAM,gBAAgB,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAExG,OAAO;QACL,EAAE,EAAE,QAAQ;QACZ,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,IAAI;QACjB,UAAU;QACV,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,cAAc,CAAC,IAAI;QACrD,OAAO;QACP,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,QAAQ,CAAC,iBAAiB;QAC1E,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,QAAQ,CAAC,mBAAmB;QAC5E,2BAA2B,EAAE,QAAQ,CAAC,qBAAqB;QAC3D,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,GAAG,OAAO;KACX,CAAC;AACJ,CAAC","sourcesContent":["import type { CloudpackConfig } from '@ms-cloudpack/config';\nimport type { ResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport { getBundleDetails } from '../utilities/getBundleDetails.js';\nimport type { BundleRequest } from '../types/BundleRequest.js';\n\nexport async function createBundleRequestForPackage(\n options: {\n packageEntry: ResolveMapEntry;\n outputPath?: string;\n bundlerType?: string;\n disableSourceMaps?: boolean;\n enableFindImports?: boolean;\n },\n context: {\n config: CloudpackConfig;\n packages: PackageDefinitionsCache;\n },\n): Promise<BundleRequest> {\n const { packageEntry } = options;\n const { config } = context;\n const { features = {} } = config;\n const { path, version, name } = packageEntry;\n const { bundleId, isExternal, outputLocation } = await getBundleDetails({ packagePath: path }, context);\n\n return {\n id: bundleId,\n packagePath: path,\n packageName: name,\n isExternal,\n outputPath: options.outputPath ?? outputLocation.path,\n version,\n disableSourceMaps: options.disableSourceMaps ?? features.disableSourceMaps,\n enableFindImports: options.enableFindImports ?? features.enqueueDependencies,\n enableCacheInternalPackages: features.cacheInternalPackages,\n bundlerType: options.bundlerType,\n ...context,\n };\n}\n"]}
@@ -2,15 +2,9 @@ import type { BundleTaskOptions } from '../types/BundleTaskOptions.js';
2
2
  import type { BundleRequest } from '../types/BundleRequest.js';
3
3
  import type { Task } from '../types/Task.js';
4
4
  import type { TaskReporter } from '@ms-cloudpack/task-reporter';
5
- import type { ResolveMap } from '@ms-cloudpack/package-utilities';
6
5
  /**
7
6
  * Creates a bundle task tracked in the task runner of the api server. This allows active tasks to be tracked
8
7
  * remotely (e.g. in the browser) and allows the user to cancel tasks.
9
8
  */
10
- export declare function createBundleTask(params: {
11
- bundleRequest: BundleRequest;
12
- resolveMap: ResolveMap;
13
- options?: BundleTaskOptions;
14
- reporter?: TaskReporter;
15
- }): Task<BundleRequest>;
9
+ export declare function createBundleTask(bundleRequest: BundleRequest, options?: BundleTaskOptions, reporter?: TaskReporter): Task<BundleRequest>;
16
10
  //# sourceMappingURL=createBundleTask.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleTask.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAK7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,GAAG,IAAI,CAAC,aAAa,CAAC,CAqCtB"}
1
+ {"version":3,"file":"createBundleTask.d.ts","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAK7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,EAAE,aAAa,EAC5B,OAAO,CAAC,EAAE,iBAAiB,EAC3B,QAAQ,CAAC,EAAE,YAAY,GACtB,IAAI,CAAC,aAAa,CAAC,CAoCrB"}
@@ -5,8 +5,7 @@ import { bundleTask } from './bundleTask.js';
5
5
  * Creates a bundle task tracked in the task runner of the api server. This allows active tasks to be tracked
6
6
  * remotely (e.g. in the browser) and allows the user to cancel tasks.
7
7
  */
8
- export function createBundleTask(params) {
9
- const { bundleRequest, resolveMap, options, reporter } = params;
8
+ export function createBundleTask(bundleRequest, options, reporter) {
10
9
  const { id, packageName, version, outputPath, packagePath, isExternal } = bundleRequest;
11
10
  return {
12
11
  name: `Bundle ${packageName}@${version}`,
@@ -14,7 +13,7 @@ export function createBundleTask(params) {
14
13
  dir: `${path.join(packagePath, 'src')}`,
15
14
  watch: !isExternal,
16
15
  async execute() {
17
- await bundleTask({ bundleRequest, options, reporter, resolveMap });
16
+ await bundleTask({ bundleRequest, options, reporter });
18
17
  return bundleRequest;
19
18
  },
20
19
  clear: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAIA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAKhC;IACC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAChE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IAExF,OAAO;QACL,IAAI,EAAE,UAAU,WAAW,IAAI,OAAO,EAAE;QACxC,EAAE;QACF,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;QACvC,KAAK,EAAE,CAAC,UAAU;QAClB,KAAK,CAAC,OAAO;YACX,MAAM,UAAU,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;YAEnE,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACV,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;YAClC,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;YACjC,gFAAgF;YAChF,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,SAAS,EAAE,GAAG,EAAE;YACd,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;QACpC,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM;QAC7C,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC1B,EAAE;YACF,IAAI,EAAE,UAAU,WAAW,IAAI,OAAO,EAAE;YACxC,SAAS,EAAE,WAAW,IAAI,EAAE;YAC5B,UAAU;SACX,CAAC;QACF,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAChC,CAAC;YACC,EAAE;YACF,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM;YAClC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ;SACvC,CAAuB;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["import type { BundleTaskOptions } from '../types/BundleTaskOptions.js';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport type { TaskEndDescription } from '../types/TaskEndDescription.js';\nimport path from 'path';\nimport fs from 'fs';\nimport { bundleTask } from './bundleTask.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\nimport type { ResolveMap } from '@ms-cloudpack/package-utilities';\n\n/**\n * Creates a bundle task tracked in the task runner of the api server. This allows active tasks to be tracked\n * remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(params: {\n bundleRequest: BundleRequest;\n resolveMap: ResolveMap;\n options?: BundleTaskOptions;\n reporter?: TaskReporter;\n}): Task<BundleRequest> {\n const { bundleRequest, resolveMap, options, reporter } = params;\n const { id, packageName, version, outputPath, packagePath, isExternal } = bundleRequest;\n\n return {\n name: `Bundle ${packageName}@${version}`,\n id,\n dir: `${path.join(packagePath, 'src')}`,\n watch: !isExternal,\n async execute(): Promise<BundleRequest> {\n await bundleTask({ bundleRequest, options, reporter, resolveMap });\n\n return bundleRequest;\n },\n clear: () => {\n bundleRequest.result?.dispose?.();\n bundleRequest.result = undefined;\n // eslint-disable-next-line no-restricted-syntax -- this function can't be async\n fs.rmSync(outputPath, { recursive: true, force: true });\n },\n onDispose: () => {\n bundleRequest.result?.dispose?.();\n },\n getErrors: () => bundleRequest.result?.errors,\n getStartDescription: () => ({\n id,\n name: `Bundle ${packageName}@${version}`,\n inputPath: packagePath || '',\n outputPath,\n }),\n getEndDescription: (taskResult) =>\n ({\n id,\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n }) as TaskEndDescription,\n };\n}\n"]}
1
+ {"version":3,"file":"createBundleTask.js","sourceRoot":"","sources":["../../src/utilities/createBundleTask.ts"],"names":[],"mappings":"AAIA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,aAA4B,EAC5B,OAA2B,EAC3B,QAAuB;IAEvB,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC;IAExF,OAAO;QACL,IAAI,EAAE,UAAU,WAAW,IAAI,OAAO,EAAE;QACxC,EAAE;QACF,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;QACvC,KAAK,EAAE,CAAC,UAAU;QAClB,KAAK,CAAC,OAAO;YACX,MAAM,UAAU,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;YAEvD,OAAO,aAAa,CAAC;QACvB,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACV,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;YAClC,aAAa,CAAC,MAAM,GAAG,SAAS,CAAC;YACjC,gFAAgF;YAChF,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,SAAS,EAAE,GAAG,EAAE;YACd,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC;QACpC,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM;QAC7C,mBAAmB,EAAE,GAAG,EAAE,CAAC,CAAC;YAC1B,EAAE;YACF,IAAI,EAAE,UAAU,WAAW,IAAI,OAAO,EAAE;YACxC,SAAS,EAAE,WAAW,IAAI,EAAE;YAC5B,UAAU;SACX,CAAC;QACF,iBAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAChC,CAAC;YACC,EAAE;YACF,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM;YAClC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ;SACvC,CAAuB;KAC3B,CAAC;AACJ,CAAC","sourcesContent":["import type { BundleTaskOptions } from '../types/BundleTaskOptions.js';\nimport type { BundleRequest } from '../types/BundleRequest.js';\nimport type { Task } from '../types/Task.js';\nimport type { TaskEndDescription } from '../types/TaskEndDescription.js';\nimport path from 'path';\nimport fs from 'fs';\nimport { bundleTask } from './bundleTask.js';\nimport type { TaskReporter } from '@ms-cloudpack/task-reporter';\n\n/**\n * Creates a bundle task tracked in the task runner of the api server. This allows active tasks to be tracked\n * remotely (e.g. in the browser) and allows the user to cancel tasks.\n */\nexport function createBundleTask(\n bundleRequest: BundleRequest,\n options?: BundleTaskOptions,\n reporter?: TaskReporter,\n): Task<BundleRequest> {\n const { id, packageName, version, outputPath, packagePath, isExternal } = bundleRequest;\n\n return {\n name: `Bundle ${packageName}@${version}`,\n id,\n dir: `${path.join(packagePath, 'src')}`,\n watch: !isExternal,\n async execute(): Promise<BundleRequest> {\n await bundleTask({ bundleRequest, options, reporter });\n\n return bundleRequest;\n },\n clear: () => {\n bundleRequest.result?.dispose?.();\n bundleRequest.result = undefined;\n // eslint-disable-next-line no-restricted-syntax -- this function can't be async\n fs.rmSync(outputPath, { recursive: true, force: true });\n },\n onDispose: () => {\n bundleRequest.result?.dispose?.();\n },\n getErrors: () => bundleRequest.result?.errors,\n getStartDescription: () => ({\n id,\n name: `Bundle ${packageName}@${version}`,\n inputPath: packagePath || '',\n outputPath,\n }),\n getEndDescription: (taskResult) =>\n ({\n id,\n errors: taskResult?.result?.errors,\n warnings: taskResult?.result?.warnings,\n }) as TaskEndDescription,\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Returns a dictionary where key is the package name and value is a set of required paths.
3
- * Eg. `{ '@fluentui/react': new Set([ '.', './lib/Button' ]) }`
3
+ * Eg. `{ '@fluentui/react': [ '.', './lib/Button' ] }`
4
4
  */
5
- export declare function findImports(filePaths: string[]): Promise<Record<string, Set<string>>>;
5
+ export declare function findImports(filePaths: string[]): Promise<Record<string, string[]>>;
6
6
  //# sourceMappingURL=findImports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"findImports.d.ts","sourceRoot":"","sources":["../../src/utilities/findImports.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAsB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAuE3F"}
1
+ {"version":3,"file":"findImports.d.ts","sourceRoot":"","sources":["../../src/utilities/findImports.ts"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wBAAsB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CA6ExF"}
@@ -2,13 +2,10 @@ import { parse } from 'es-module-lexer';
2
2
  import fsPromises from 'fs/promises';
3
3
  import path from 'path';
4
4
  import { parseImportString } from '@ms-cloudpack/path-string-parsing';
5
- import { sourceExtensions } from '@ms-cloudpack/path-utilities';
6
5
  import { builtinModules } from 'module';
7
- /** Treat files with no extension as JS for purposes below */
8
- const allSourceExtensions = [...sourceExtensions, ''];
9
6
  /**
10
7
  * Returns a dictionary where key is the package name and value is a set of required paths.
11
- * Eg. `{ '@fluentui/react': new Set([ '.', './lib/Button' ]) }`
8
+ * Eg. `{ '@fluentui/react': [ '.', './lib/Button' ] }`
12
9
  */
13
10
  export async function findImports(filePaths) {
14
11
  const requiredExports = {};
@@ -17,7 +14,7 @@ export async function findImports(filePaths) {
17
14
  while (pathsToParse.length) {
18
15
  const filePath = pathsToParse.shift();
19
16
  // Ignore any non-JS/TS files such as SVGs and sourcemaps
20
- if (!filePath || !allSourceExtensions.includes(path.extname(filePath))) {
17
+ if (!filePath || path.extname(filePath) !== '.js') {
21
18
  continue;
22
19
  }
23
20
  const source = await fsPromises.readFile(filePath, 'utf-8');
@@ -71,6 +68,9 @@ export async function findImports(filePaths) {
71
68
  }
72
69
  }
73
70
  }
74
- return requiredExports;
71
+ return Object.entries(requiredExports).reduce((acc, [packageName, importPaths]) => {
72
+ acc[packageName] = Array.from(importPaths);
73
+ return acc;
74
+ }, {});
75
75
  }
76
76
  //# sourceMappingURL=findImports.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"findImports.js","sourceRoot":"","sources":["../../src/utilities/findImports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAA2B,MAAM,mCAAmC,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,6DAA6D;AAC7D,MAAM,mBAAmB,GAAG,CAAC,GAAG,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAEtD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,SAAmB;IACnD,MAAM,eAAe,GAAgC,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,YAAY,GAAa,CAAC,GAAG,SAAS,CAAC,CAAC;IAE9C,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC;QACtC,yDAAyD;QACzD,IAAI,CAAC,QAAQ,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE;YACtE,SAAS;SACV;QAED,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC5D,IAAI,UAAuC,CAAC;QAC5C,IAAI;YACF,8DAA8D;YAC9D,qDAAqD;YACrD,2DAA2D;YAC3D,CAAC,UAAU,CAAC,GAAG,MAAO,KAAK,CAAC,MAAM,CAAkD,CAAC;SACtF;QAAC,OAAO,GAAG,EAAE;YACZ,sDAAsD;YACtD,8EAA8E;YAC9E,OAAO,CAAC,IAAI,CAAC,mBAAmB,QAAQ,GAAG,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;YAC5E,SAAS;SACV;QACD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;aAC5C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YACT,uFAAuF;YACvF,sEAAsE;YACtE,EAAE;YACF,yDAAyD;YACzD,EAAE;YACF,0DAA0D;YAC1D,4EAA4E;YAC5E,0EAA0E;YAC1E,2EAA2E;YAC3E,gEAAgE;YAChE,EAAE;YACF,0EAA0E;YAC1E,6EAA6E;YAC7E,yEAAyE;YACzE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;gBACR,OAAO,CAAC,KAAK,CACX,4DAA4D,QAAQ,gBAAgB,MAAM,CAAC,KAAK,CAC9F,CAAC,CAAC,CAAC,EACH,CAAC,CAAC,CAAC,CACJ,EAAE,CACJ,CAAC;gBACF,OAAO,SAAS,CAAC;aAClB;YAED,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChC,CAAC,CAAC;aACD,MAAM,CAAC,OAAO,CAAyB,CAAC;QAE3C,KAAK,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,OAAO,EAAE;YACjD,IAAI,WAAW,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE;gBAChC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC;gBAEtF,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;oBAChC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;oBAC5B,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBAC9B;aACF;iBAAM,IAAI,WAAW,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;gBACnG,eAAe,CAAC,WAAW,CAAC,KAAK,IAAI,GAAG,EAAE,CAAC;gBAC3C,eAAe,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC;aACrD;SACF;KACF;IAED,OAAO,eAAe,CAAC;AACzB,CAAC","sourcesContent":["import { parse } from 'es-module-lexer';\nimport fsPromises from 'fs/promises';\nimport path from 'path';\nimport { parseImportString, type ImportStringResult } from '@ms-cloudpack/path-string-parsing';\nimport { sourceExtensions } from '@ms-cloudpack/path-utilities';\nimport { builtinModules } from 'module';\n\n/** Treat files with no extension as JS for purposes below */\nconst allSourceExtensions = [...sourceExtensions, ''];\n\n/**\n * Returns a dictionary where key is the package name and value is a set of required paths.\n * Eg. `{ '@fluentui/react': new Set([ '.', './lib/Button' ]) }`\n */\nexport async function findImports(filePaths: string[]): Promise<Record<string, Set<string>>> {\n const requiredExports: Record<string, Set<string>> = {};\n const visitedPaths = new Set(filePaths);\n const pathsToParse: string[] = [...filePaths];\n\n while (pathsToParse.length) {\n const filePath = pathsToParse.shift();\n // Ignore any non-JS/TS files such as SVGs and sourcemaps\n if (!filePath || !allSourceExtensions.includes(path.extname(filePath))) {\n continue;\n }\n\n const source = await fsPromises.readFile(filePath, 'utf-8');\n let rawImports: ReturnType<typeof parse>[0];\n try {\n // es-module-lexer/parse may return Promise in some conditions\n // although it is not declared in the type definition\n // https://github.com/guybedford/es-module-lexer/issues/155\n [rawImports] = await (parse(source) as unknown as Promise<ReturnType<typeof parse>>);\n } catch (err) {\n // This could happen if the source file isn't valid JS\n // (unlikely after adding the check above to only attempt parsing JS/TS files)\n console.warn(`Failed to parse ${filePath}:`, err, '\\nSource is:\\n', source);\n continue;\n }\n const imports = Array.from(new Set(rawImports))\n .map((i) => {\n // The es-module-lexer returns entries where the \"n\" property equals the import source.\n // This includes the package name and path. For example, in this case:\n //\n // import { Button } from '@fluentui/react/lib/Button';\n //\n // The \"n\" property would be \"@fluentui/react/lib/Button\".\n // The \"s\" and \"e\" properties represent the start/end character positions of\n // the import source. The \"ss\" and \"se\" properties represent the start/end\n // character positions of the import specifier starting with \"import\". This\n // may be useful for determining if the import is sync or async.\n //\n // Currently when the import source is a backtick string, the \"n\" property\n // is undefined. This is a bug in es-module-lexer. We may need to handle this\n // at the javascript layer and expand it into multiple potential imports.\n if (!i.n) {\n console.debug(\n `Found an import that didn't parse correctly:\\nFilename:\\n${filePath}\\n\\nImport:\\n${source.slice(\n i.s,\n i.e,\n )}`,\n );\n return undefined;\n }\n\n return parseImportString(i.n);\n })\n .filter(Boolean) as ImportStringResult[];\n\n for (const { packageName, importPath } of imports) {\n if (packageName?.startsWith('.')) {\n const localPath = path.resolve(path.dirname(filePath), packageName, importPath || '');\n\n if (!visitedPaths.has(localPath)) {\n visitedPaths.add(localPath);\n pathsToParse.push(localPath);\n }\n } else if (packageName && !packageName.startsWith('node:') && !builtinModules.includes(packageName)) {\n requiredExports[packageName] ??= new Set();\n requiredExports[packageName].add(importPath || '.');\n }\n }\n }\n\n return requiredExports;\n}\n"]}
1
+ {"version":3,"file":"findImports.js","sourceRoot":"","sources":["../../src/utilities/findImports.ts"],"names":[],"mappings":"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","sourcesContent":["import { parse } from 'es-module-lexer';\nimport fsPromises from 'fs/promises';\nimport path from 'path';\nimport { parseImportString, type ImportStringResult } from '@ms-cloudpack/path-string-parsing';\nimport { builtinModules } from 'module';\n\n/**\n * Returns a dictionary where key is the package name and value is a set of required paths.\n * Eg. `{ '@fluentui/react': [ '.', './lib/Button' ] }`\n */\nexport async function findImports(filePaths: string[]): Promise<Record<string, string[]>> {\n const requiredExports: Record<string, Set<string>> = {};\n const visitedPaths = new Set(filePaths);\n const pathsToParse: string[] = [...filePaths];\n\n while (pathsToParse.length) {\n const filePath = pathsToParse.shift();\n // Ignore any non-JS/TS files such as SVGs and sourcemaps\n if (!filePath || path.extname(filePath) !== '.js') {\n continue;\n }\n\n const source = await fsPromises.readFile(filePath, 'utf-8');\n let rawImports: ReturnType<typeof parse>[0];\n try {\n // es-module-lexer/parse may return Promise in some conditions\n // although it is not declared in the type definition\n // https://github.com/guybedford/es-module-lexer/issues/155\n [rawImports] = await (parse(source) as unknown as Promise<ReturnType<typeof parse>>);\n } catch (err) {\n // This could happen if the source file isn't valid JS\n // (unlikely after adding the check above to only attempt parsing JS/TS files)\n console.warn(`Failed to parse ${filePath}:`, err, '\\nSource is:\\n', source);\n continue;\n }\n const imports = Array.from(new Set(rawImports))\n .map((i) => {\n // The es-module-lexer returns entries where the \"n\" property equals the import source.\n // This includes the package name and path. For example, in this case:\n //\n // import { Button } from '@fluentui/react/lib/Button';\n //\n // The \"n\" property would be \"@fluentui/react/lib/Button\".\n // The \"s\" and \"e\" properties represent the start/end character positions of\n // the import source. The \"ss\" and \"se\" properties represent the start/end\n // character positions of the import specifier starting with \"import\". This\n // may be useful for determining if the import is sync or async.\n //\n // Currently when the import source is a backtick string, the \"n\" property\n // is undefined. This is a bug in es-module-lexer. We may need to handle this\n // at the javascript layer and expand it into multiple potential imports.\n if (!i.n) {\n console.debug(\n `Found an import that didn't parse correctly:\\nFilename:\\n${filePath}\\n\\nImport:\\n${source.slice(\n i.s,\n i.e,\n )}`,\n );\n return undefined;\n }\n\n return parseImportString(i.n);\n })\n .filter(Boolean) as ImportStringResult[];\n\n for (const { packageName, importPath } of imports) {\n if (packageName?.startsWith('.')) {\n const localPath = path.resolve(path.dirname(filePath), packageName, importPath || '');\n\n if (!visitedPaths.has(localPath)) {\n visitedPaths.add(localPath);\n pathsToParse.push(localPath);\n }\n } else if (packageName && !packageName.startsWith('node:') && !builtinModules.includes(packageName)) {\n requiredExports[packageName] ??= new Set();\n requiredExports[packageName].add(importPath || '.');\n }\n }\n }\n\n return Object.entries(requiredExports).reduce(\n (acc, [packageName, importPaths]) => {\n acc[packageName] = Array.from(importPaths);\n return acc;\n },\n {} as Record<string, string[]>,\n );\n}\n"]}
@@ -1,10 +1,8 @@
1
- import { type ResolveMap } from '@ms-cloudpack/package-utilities';
2
1
  import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';
3
2
  export declare function getBundleDetails(options: {
4
3
  packagePath: string;
5
4
  }, context: {
6
5
  packages: PackageDefinitionsCache;
7
- resolveMap: ResolveMap;
8
6
  }): Promise<{
9
7
  bundleId: string;
10
8
  isExternal: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"getBundleDetails.d.ts","sourceRoot":"","sources":["../../src/utilities/getBundleDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAIrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAG3E,wBAAsB,gBAAgB,CACpC,OAAO,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,EAChC,OAAO,EAAE;IAAE,QAAQ,EAAE,uBAAuB,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE;;;;;;;GA+BvE"}
1
+ {"version":3,"file":"getBundleDetails.d.ts","sourceRoot":"","sources":["../../src/utilities/getBundleDetails.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,wBAAsB,gBAAgB,CACpC,OAAO,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,EAChC,OAAO,EAAE;IAAE,QAAQ,EAAE,uBAAuB,CAAA;CAAE;;;;;;;GAmC/C"}
@@ -1,11 +1,11 @@
1
1
  import { isExternalPackage } from '@ms-cloudpack/package-utilities';
2
+ import hash from 'object-hash';
2
3
  import filenamify from 'filenamify';
3
4
  import path from 'path';
4
5
  import { getCachePath } from './getCachePath.js';
5
- import { hashPackage } from './hashPackage.js';
6
6
  export async function getBundleDetails(options, context) {
7
7
  const { packagePath } = options;
8
- const { packages, resolveMap } = context;
8
+ const { packages } = context;
9
9
  const definition = await packages.get(packagePath);
10
10
  if (!definition) {
11
11
  throw new Error(`Package definition (package.json) missing or invalid at "${packagePath}"`);
@@ -15,7 +15,11 @@ export async function getBundleDetails(options, context) {
15
15
  throw new Error(`Package definition (package.json) missing name at "${packagePath}"`);
16
16
  }
17
17
  const isExternal = isExternalPackage(packagePath);
18
- const bundleId = await hashPackage({ packagePath }, { packages, resolveMap });
18
+ const bundleId = hash({
19
+ name: packageName,
20
+ ...definition,
21
+ version: (isExternal ? version : packagePath) || packagePath,
22
+ });
19
23
  // Derive where the output should be.
20
24
  const folderName = `${filenamify(packageName)}-${version}-${bundleId}`;
21
25
  const outputPath = path.join(getCachePath(), folderName);
@@ -1 +1 @@
1
- {"version":3,"file":"getBundleDetails.js","sourceRoot":"","sources":["../../src/utilities/getBundleDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAmB,MAAM,iCAAiC,CAAC;AACrF,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAgC,EAChC,OAAsE;IAEtE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAChC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACzC,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAEnD,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,4DAA4D,WAAW,GAAG,CAAC,CAAC;KAC7F;IAED,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;IAElD,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,sDAAsD,WAAW,GAAG,CAAC,CAAC;KACvF;IAED,MAAM,UAAU,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;IAE9E,qCAAqC;IACrC,MAAM,UAAU,GAAG,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;IACvE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,UAAU,CAAC,CAAC;IAEzD,OAAO;QACL,QAAQ;QACR,UAAU;QACV,cAAc,EAAE;YACd,IAAI,EAAE,UAAU;YAChB,UAAU;SACX;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { isExternalPackage, type ResolveMap } from '@ms-cloudpack/package-utilities';\nimport filenamify from 'filenamify';\nimport path from 'path';\nimport { getCachePath } from './getCachePath.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport { hashPackage } from './hashPackage.js';\n\nexport async function getBundleDetails(\n options: { packagePath: string },\n context: { packages: PackageDefinitionsCache; resolveMap: ResolveMap },\n) {\n const { packagePath } = options;\n const { packages, resolveMap } = context;\n const definition = await packages.get(packagePath);\n\n if (!definition) {\n throw new Error(`Package definition (package.json) missing or invalid at \"${packagePath}\"`);\n }\n\n const { name: packageName, version } = definition;\n\n if (!packageName) {\n throw new Error(`Package definition (package.json) missing name at \"${packagePath}\"`);\n }\n\n const isExternal = isExternalPackage(packagePath);\n const bundleId = await hashPackage({ packagePath }, { packages, resolveMap });\n\n // Derive where the output should be.\n const folderName = `${filenamify(packageName)}-${version}-${bundleId}`;\n const outputPath = path.join(getCachePath(), folderName);\n\n return {\n bundleId,\n isExternal,\n outputLocation: {\n path: outputPath,\n folderName,\n },\n };\n}\n"]}
1
+ {"version":3,"file":"getBundleDetails.js","sourceRoot":"","sources":["../../src/utilities/getBundleDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAgC,EAChC,OAA8C;IAE9C,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAChC,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC7B,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAEnD,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,IAAI,KAAK,CAAC,4DAA4D,WAAW,GAAG,CAAC,CAAC;KAC7F;IAED,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;IAElD,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,sDAAsD,WAAW,GAAG,CAAC,CAAC;KACvF;IAED,MAAM,UAAU,GAAG,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,IAAI,CAAC;QACpB,IAAI,EAAE,WAAW;QACjB,GAAG,UAAU;QACb,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,WAAW;KAC7D,CAAC,CAAC;IAEH,qCAAqC;IACrC,MAAM,UAAU,GAAG,GAAG,UAAU,CAAC,WAAW,CAAC,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC;IACvE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,UAAU,CAAC,CAAC;IAEzD,OAAO;QACL,QAAQ;QACR,UAAU;QACV,cAAc,EAAE;YACd,IAAI,EAAE,UAAU;YAChB,UAAU;SACX;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { isExternalPackage } from '@ms-cloudpack/package-utilities';\nimport hash from 'object-hash';\nimport filenamify from 'filenamify';\nimport path from 'path';\nimport { getCachePath } from './getCachePath.js';\nimport type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\n\nexport async function getBundleDetails(\n options: { packagePath: string },\n context: { packages: PackageDefinitionsCache },\n) {\n const { packagePath } = options;\n const { packages } = context;\n const definition = await packages.get(packagePath);\n\n if (!definition) {\n throw new Error(`Package definition (package.json) missing or invalid at \"${packagePath}\"`);\n }\n\n const { name: packageName, version } = definition;\n\n if (!packageName) {\n throw new Error(`Package definition (package.json) missing name at \"${packagePath}\"`);\n }\n\n const isExternal = isExternalPackage(packagePath);\n const bundleId = hash({\n name: packageName,\n ...definition,\n version: (isExternal ? version : packagePath) || packagePath,\n });\n\n // Derive where the output should be.\n const folderName = `${filenamify(packageName)}-${version}-${bundleId}`;\n const outputPath = path.join(getCachePath(), folderName);\n\n return {\n bundleId,\n isExternal,\n outputLocation: {\n path: outputPath,\n folderName,\n },\n };\n}\n"]}
@@ -10,7 +10,7 @@ export async function getPackagesToSync(options) {
10
10
  }))
11
11
  .filter((item) => item);
12
12
  for (const { path: packagePath, name, version } of packageEntries) {
13
- const details = await getBundleDetails({ packagePath }, { packages, resolveMap });
13
+ const details = await getBundleDetails({ packagePath }, { packages });
14
14
  if (details.isExternal) {
15
15
  list.push({ ...details.outputLocation, friendlyName: `${name}@${version}` });
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getPackagesToSync.js","sourceRoot":"","sources":["../../src/utilities/getPackagesToSync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAyC,MAAM,iCAAiC,CAAC;AAC7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQzD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAGvC;IACC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACzC,MAAM,IAAI,GAAoB,EAAE,CAAC;IAEjC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3C,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CACnB,mBAAmB,CAAC;QAClB,WAAW;QACX,UAAU;KACX,CAAC,CACH;SACA,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAsB,CAAC;IAE/C,KAAK,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,cAAc,EAAE;QACjE,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;QAClF,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,YAAY,EAAE,GAAG,IAAI,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC;SAC9E;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport { findResolveMapEntry, type ResolveMap, type ResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport { getBundleDetails } from './getBundleDetails.js';\n\nexport interface PackageToSync {\n path: string;\n folderName: string;\n friendlyName: string;\n}\n\nexport async function getPackagesToSync(options: {\n packages: PackageDefinitionsCache;\n resolveMap: ResolveMap;\n}): Promise<PackageToSync[]> {\n const { packages, resolveMap } = options;\n const list: PackageToSync[] = [];\n\n const packageEntries = Object.keys(resolveMap)\n .map((packageName) =>\n findResolveMapEntry({\n packageName,\n resolveMap,\n }),\n )\n .filter((item) => item) as ResolveMapEntry[];\n\n for (const { path: packagePath, name, version } of packageEntries) {\n const details = await getBundleDetails({ packagePath }, { packages, resolveMap });\n if (details.isExternal) {\n list.push({ ...details.outputLocation, friendlyName: `${name}@${version}` });\n }\n }\n\n return list;\n}\n"]}
1
+ {"version":3,"file":"getPackagesToSync.js","sourceRoot":"","sources":["../../src/utilities/getPackagesToSync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAyC,MAAM,iCAAiC,CAAC;AAC7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQzD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAGvC;IACC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IACzC,MAAM,IAAI,GAAoB,EAAE,CAAC;IAEjC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3C,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CACnB,mBAAmB,CAAC;QAClB,WAAW;QACX,UAAU;KACX,CAAC,CACH;SACA,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAsB,CAAC;IAE/C,KAAK,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,cAAc,EAAE;QACjE,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACtE,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,YAAY,EAAE,GAAG,IAAI,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC;SAC9E;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';\nimport { findResolveMapEntry, type ResolveMap, type ResolveMapEntry } from '@ms-cloudpack/package-utilities';\nimport { getBundleDetails } from './getBundleDetails.js';\n\nexport interface PackageToSync {\n path: string;\n folderName: string;\n friendlyName: string;\n}\n\nexport async function getPackagesToSync(options: {\n packages: PackageDefinitionsCache;\n resolveMap: ResolveMap;\n}): Promise<PackageToSync[]> {\n const { packages, resolveMap } = options;\n const list: PackageToSync[] = [];\n\n const packageEntries = Object.keys(resolveMap)\n .map((packageName) =>\n findResolveMapEntry({\n packageName,\n resolveMap,\n }),\n )\n .filter((item) => item) as ResolveMapEntry[];\n\n for (const { path: packagePath, name, version } of packageEntries) {\n const details = await getBundleDetails({ packagePath }, { packages });\n if (details.isExternal) {\n list.push({ ...details.outputLocation, friendlyName: `${name}@${version}` });\n }\n }\n\n return list;\n}\n"]}
@@ -1,8 +1,6 @@
1
- import type { PackageDefinitionsCache } from '@ms-cloudpack/bundler-types';
2
- import { type ResolveMap } from '@ms-cloudpack/package-utilities';
3
- import { type PackageIdentifier } from './getPackagePath.js';
4
- export declare function hashPackage(packageIdentifier: PackageIdentifier, context: {
5
- packages: PackageDefinitionsCache;
6
- resolveMap: ResolveMap;
1
+ export declare function hashPackage<T extends object>(options: {
2
+ packagePath: string;
3
+ isExternal: boolean;
4
+ additionalProperties: T;
7
5
  }): Promise<string>;
8
6
  //# sourceMappingURL=hashPackage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hashPackage.d.ts","sourceRoot":"","sources":["../../src/utilities/hashPackage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAA2B,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAGlE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAI7D,wBAAsB,WAAW,CAC/B,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE;IAAE,QAAQ,EAAE,uBAAuB,CAAC;IAAC,UAAU,EAAE,UAAU,CAAA;CAAE,GACrE,OAAO,CAAC,MAAM,CAAC,CAyBjB"}
1
+ {"version":3,"file":"hashPackage.d.ts","sourceRoot":"","sources":["../../src/utilities/hashPackage.ts"],"names":[],"mappings":"AASA,wBAAsB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,oBAAoB,EAAE,CAAC,CAAC;CACzB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBlB"}
@@ -1,27 +1,21 @@
1
- import {} from '@ms-cloudpack/package-utilities';
1
+ import glob from 'fast-glob';
2
+ import { existsSync } from 'fs';
3
+ import { hash } from 'glob-hasher';
2
4
  import objectHash from 'object-hash';
5
+ import path from 'path';
3
6
  import { performance } from 'perf_hooks';
4
- import {} from './getPackagePath.js';
5
- import { getPackageHashEntries } from './getPackageHashEntries.js';
6
- import { calculateHashOfInlinedDependencies } from './calculateHashOfInlinedDependencies.js';
7
- export async function hashPackage(packageIdentifier, context) {
7
+ const excludeNodeModules = '!**/node_modules/**';
8
+ export async function hashPackage(options) {
8
9
  const start = performance.now();
9
- const hashPackageWithContext = (options) => {
10
- return hashPackage(options, context);
11
- };
12
- const hashDependencies = (dependencies) => {
13
- return calculateHashOfInlinedDependencies({
14
- inlinedDependencies: dependencies,
15
- hashPackage: hashPackageWithContext,
16
- });
17
- };
18
- const hashEntries = await getPackageHashEntries(packageIdentifier, {
19
- ...context,
20
- hashDependencies,
10
+ const { packagePath, isExternal, additionalProperties } = options;
11
+ const shouldUseSrc = !isExternal && existsSync(path.join(packagePath, 'src'));
12
+ const patterns = shouldUseSrc ? ['src/**', '*.json', excludeNodeModules] : ['**', excludeNodeModules];
13
+ const files = await glob(patterns, {
14
+ cwd: packagePath,
21
15
  });
22
- const hashResult = objectHash(hashEntries);
23
- const { name, version } = hashEntries;
24
- console.debug(`Hashed ${name}@${version} in ${performance.now() - start}ms`);
25
- return hashResult;
16
+ const globHash = hash(files, { cwd: packagePath });
17
+ const result = objectHash({ files: globHash, additionalProperties }, { algorithm: 'md5' });
18
+ console.debug(`Hashed ${path.basename(packagePath)} in ${performance.now() - start}ms`);
19
+ return result;
26
20
  }
27
21
  //# sourceMappingURL=hashPackage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hashPackage.js","sourceRoot":"","sources":["../../src/utilities/hashPackage.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,MAAM,iCAAiC,CAAC;AAClE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAA0B,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAE7F,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,iBAAoC,EACpC,OAAsE;IAEtE,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAEhC,MAAM,sBAAsB,GAAG,CAAC,OAA0B,EAAE,EAAE;QAC5D,OAAO,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC,CAAC;IAEF,MAAM,gBAAgB,GAAG,CAAC,YAAqC,EAAE,EAAE;QACjE,OAAO,kCAAkC,CAAC;YACxC,mBAAmB,EAAE,YAAY;YACjC,WAAW,EAAE,sBAAsB;SACpC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,MAAM,qBAAqB,CAAC,iBAAiB,EAAE;QACjE,GAAG,OAAO;QACV,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAE3C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,WAAW,CAAC;IACtC,OAAO,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,OAAO,OAAO,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;IAE7E,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import type { PackageDefinitionsCache, PackageJsonDependencies } from '@ms-cloudpack/bundler-types';\nimport { type ResolveMap } from '@ms-cloudpack/package-utilities';\nimport objectHash from 'object-hash';\nimport { performance } from 'perf_hooks';\nimport { type PackageIdentifier } from './getPackagePath.js';\nimport { getPackageHashEntries } from './getPackageHashEntries.js';\nimport { calculateHashOfInlinedDependencies } from './calculateHashOfInlinedDependencies.js';\n\nexport async function hashPackage(\n packageIdentifier: PackageIdentifier,\n context: { packages: PackageDefinitionsCache; resolveMap: ResolveMap },\n): Promise<string> {\n const start = performance.now();\n\n const hashPackageWithContext = (options: PackageIdentifier) => {\n return hashPackage(options, context);\n };\n\n const hashDependencies = (dependencies: PackageJsonDependencies) => {\n return calculateHashOfInlinedDependencies({\n inlinedDependencies: dependencies,\n hashPackage: hashPackageWithContext,\n });\n };\n\n const hashEntries = await getPackageHashEntries(packageIdentifier, {\n ...context,\n hashDependencies,\n });\n\n const hashResult = objectHash(hashEntries);\n\n const { name, version } = hashEntries;\n console.debug(`Hashed ${name}@${version} in ${performance.now() - start}ms`);\n\n return hashResult;\n}\n"]}
1
+ {"version":3,"file":"hashPackage.js","sourceRoot":"","sources":["../../src/utilities/hashPackage.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAmB,OAInD;IACC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAChC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC;IAElE,MAAM,YAAY,GAAG,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;IAE9E,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;IACtG,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE;QACjC,GAAG,EAAE,WAAW;KACjB,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;IACnD,MAAM,MAAM,GAAG,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAE3F,OAAO,CAAC,KAAK,CAAC,UAAU,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,CAAC;IACxF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import glob from 'fast-glob';\nimport { existsSync } from 'fs';\nimport { hash } from 'glob-hasher';\nimport objectHash from 'object-hash';\nimport path from 'path';\nimport { performance } from 'perf_hooks';\n\nconst excludeNodeModules = '!**/node_modules/**';\n\nexport async function hashPackage<T extends object>(options: {\n packagePath: string;\n isExternal: boolean;\n additionalProperties: T;\n}): Promise<string> {\n const start = performance.now();\n const { packagePath, isExternal, additionalProperties } = options;\n\n const shouldUseSrc = !isExternal && existsSync(path.join(packagePath, 'src'));\n\n const patterns = shouldUseSrc ? ['src/**', '*.json', excludeNodeModules] : ['**', excludeNodeModules];\n const files = await glob(patterns, {\n cwd: packagePath,\n });\n\n const globHash = hash(files, { cwd: packagePath });\n const result = objectHash({ files: globHash, additionalProperties }, { algorithm: 'md5' });\n\n console.debug(`Hashed ${path.basename(packagePath)} in ${performance.now() - start}ms`);\n return result;\n}\n"]}
@@ -8,6 +8,6 @@ interface ValidateResultsJsonOptions {
8
8
  * @param options - The options to use when validating the result.
9
9
  * @returns True if the result is valid, false otherwise.
10
10
  */
11
- export declare function validateBundleRequestResult(options: ValidateResultsJsonOptions): boolean;
11
+ export declare function isCachedResultValid(options: ValidateResultsJsonOptions): boolean;
12
12
  export {};
13
13
  //# sourceMappingURL=validateBundleRequestResult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validateBundleRequestResult.d.ts","sourceRoot":"","sources":["../../src/utilities/validateBundleRequestResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,UAAU,0BAA0B;IAClC,aAAa,EAAE,aAAa,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CA0BxF"}
1
+ {"version":3,"file":"validateBundleRequestResult.d.ts","sourceRoot":"","sources":["../../src/utilities/validateBundleRequestResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,UAAU,0BAA0B;IAClC,aAAa,EAAE,aAAa,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAoBhF"}
@@ -3,9 +3,9 @@
3
3
  * @param options - The options to use when validating the result.
4
4
  * @returns True if the result is valid, false otherwise.
5
5
  */
6
- export function validateBundleRequestResult(options) {
6
+ export function isCachedResultValid(options) {
7
7
  const { bundleRequest, hash } = options;
8
- const { enableCacheInternalPackages, enableFindImports, isExternal, result } = bundleRequest;
8
+ const { enableCacheInternalPackages, isExternal, result } = bundleRequest;
9
9
  if (!result) {
10
10
  // The result is undefined, so the result is invalid
11
11
  return false;
@@ -14,11 +14,6 @@ export function validateBundleRequestResult(options) {
14
14
  // There are errors, so the result is invalid
15
15
  return false;
16
16
  }
17
- const { dependencies } = result;
18
- if (enableFindImports && !dependencies) {
19
- // enableFindImports is true, but dependencies are undefined, dependencies should have been populated by bundleTask. This is an invalid result.
20
- return false;
21
- }
22
17
  if (enableCacheInternalPackages && !isExternal && result.hash !== hash) {
23
18
  // The package is internal, enableCacheInternalPackages is enabled but hashes do not match, this is an invalid result.
24
19
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"validateBundleRequestResult.js","sourceRoot":"","sources":["../../src/utilities/validateBundleRequestResult.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CAAC,OAAmC;IAC7E,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;IAE7F,IAAI,CAAC,MAAM,EAAE;QACX,oDAAoD;QACpD,OAAO,KAAK,CAAC;KACd;IAED,IAAI,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;QAC1B,6CAA6C;QAC7C,OAAO,KAAK,CAAC;KACd;IAED,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;IAChC,IAAI,iBAAiB,IAAI,CAAC,YAAY,EAAE;QACtC,+IAA+I;QAC/I,OAAO,KAAK,CAAC;KACd;IAED,IAAI,2BAA2B,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE;QACtE,sHAAsH;QACtH,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { BundleRequest } from '../types/BundleRequest.js';\n\ninterface ValidateResultsJsonOptions {\n bundleRequest: BundleRequest;\n hash?: string;\n}\n\n/**\n * Validates the result of a bundle request.\n * @param options - The options to use when validating the result.\n * @returns True if the result is valid, false otherwise.\n */\nexport function validateBundleRequestResult(options: ValidateResultsJsonOptions): boolean {\n const { bundleRequest, hash } = options;\n const { enableCacheInternalPackages, enableFindImports, isExternal, result } = bundleRequest;\n\n if (!result) {\n // The result is undefined, so the result is invalid\n return false;\n }\n\n if (result?.errors?.length) {\n // There are errors, so the result is invalid\n return false;\n }\n\n const { dependencies } = result;\n if (enableFindImports && !dependencies) {\n // enableFindImports is true, but dependencies are undefined, dependencies should have been populated by bundleTask. This is an invalid result.\n return false;\n }\n\n if (enableCacheInternalPackages && !isExternal && result.hash !== hash) {\n // The package is internal, enableCacheInternalPackages is enabled but hashes do not match, this is an invalid result.\n return false;\n }\n\n return true;\n}\n"]}
1
+ {"version":3,"file":"validateBundleRequestResult.js","sourceRoot":"","sources":["../../src/utilities/validateBundleRequestResult.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAmC;IACrE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,EAAE,2BAA2B,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,aAAa,CAAC;IAE1E,IAAI,CAAC,MAAM,EAAE;QACX,oDAAoD;QACpD,OAAO,KAAK,CAAC;KACd;IAED,IAAI,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;QAC1B,6CAA6C;QAC7C,OAAO,KAAK,CAAC;KACd;IAED,IAAI,2BAA2B,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE;QACtE,sHAAsH;QACtH,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { BundleRequest } from '../types/BundleRequest.js';\n\ninterface ValidateResultsJsonOptions {\n bundleRequest: BundleRequest;\n hash?: string;\n}\n\n/**\n * Validates the result of a bundle request.\n * @param options - The options to use when validating the result.\n * @returns True if the result is valid, false otherwise.\n */\nexport function isCachedResultValid(options: ValidateResultsJsonOptions): boolean {\n const { bundleRequest, hash } = options;\n const { enableCacheInternalPackages, isExternal, result } = bundleRequest;\n\n if (!result) {\n // The result is undefined, so the result is invalid\n return false;\n }\n\n if (result?.errors?.length) {\n // There are errors, so the result is invalid\n return false;\n }\n\n if (enableCacheInternalPackages && !isExternal && result.hash !== hash) {\n // The package is internal, enableCacheInternalPackages is enabled but hashes do not match, this is an invalid result.\n return false;\n }\n\n return true;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/api-server",
3
- "version": "0.17.1",
3
+ "version": "0.18.1",
4
4
  "description": "An implementation of the API server that does interacts with a task scheduler.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,19 +25,19 @@
25
25
  "@lage-run/scheduler": "^1.0.0",
26
26
  "@lage-run/target-graph": "^0.8.6",
27
27
  "@lage-run/hasher": "^1.0.0",
28
- "@ms-cloudpack/bundler": "^0.14.12",
29
- "@ms-cloudpack/bundler-types": "^0.18.1",
30
- "@ms-cloudpack/config": "^0.12.2",
28
+ "@ms-cloudpack/bundler": "^0.14.14",
29
+ "@ms-cloudpack/bundler-types": "^0.19.1",
30
+ "@ms-cloudpack/config": "^0.12.4",
31
31
  "@ms-cloudpack/create-express-app": "^1.3.9",
32
32
  "@ms-cloudpack/data-bus": "^0.4.0",
33
33
  "@ms-cloudpack/file-watcher": "^0.1.0",
34
34
  "@ms-cloudpack/json-utilities": "^0.0.7",
35
- "@ms-cloudpack/package-utilities": "^5.1.4",
35
+ "@ms-cloudpack/package-utilities": "^5.1.6",
36
36
  "@ms-cloudpack/path-string-parsing": "^1.0.3",
37
37
  "@ms-cloudpack/path-utilities": "^2.3.2",
38
- "@ms-cloudpack/task-reporter": "^0.7.2",
38
+ "@ms-cloudpack/task-reporter": "^0.8.0",
39
39
  "@ms-cloudpack/telemetry": "^0.3.8",
40
- "@ms-cloudpack/remote-cache": "^0.1.6",
40
+ "@ms-cloudpack/remote-cache": "^0.1.7",
41
41
  "@trpc/client": "^10.21.1",
42
42
  "@trpc/server": "^10.21.1",
43
43
  "chokidar": "^3.5.3",
@@ -1,9 +0,0 @@
1
- import type { PackageJsonDependencies } from '@ms-cloudpack/bundler-types';
2
- export declare function calculateHashOfInlinedDependencies(options: {
3
- inlinedDependencies: PackageJsonDependencies;
4
- hashPackage: (options: {
5
- name: string;
6
- version?: string;
7
- }) => Promise<string>;
8
- }): Promise<Record<string, string>>;
9
- //# sourceMappingURL=calculateHashOfInlinedDependencies.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateHashOfInlinedDependencies.d.ts","sourceRoot":"","sources":["../../src/utilities/calculateHashOfInlinedDependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,wBAAsB,kCAAkC,CAAC,OAAO,EAAE;IAChE,mBAAmB,EAAE,uBAAuB,CAAC;IAC7C,WAAW,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/E,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAwB,MAAM,CAAY,CAAC,CAuBnE"}
@@ -1,18 +0,0 @@
1
- export async function calculateHashOfInlinedDependencies(options) {
2
- const { inlinedDependencies, hashPackage } = options;
3
- const calculatePackageHash = async ([name, version]) => {
4
- return {
5
- name,
6
- hash: await hashPackage({ name, version }),
7
- };
8
- };
9
- // Calculate the hashes of all inlined dependencies in parallel
10
- const inlinedDependencyKeyValuePairs = await Promise.all(Object.entries(inlinedDependencies).map(calculatePackageHash));
11
- // Convert the array of key value pairs to a dictionary
12
- const inlinedDependenciesHashes = {};
13
- for (const entry of inlinedDependencyKeyValuePairs) {
14
- inlinedDependenciesHashes[entry.name] = entry.hash;
15
- }
16
- return inlinedDependenciesHashes;
17
- }
18
- //# sourceMappingURL=calculateHashOfInlinedDependencies.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"calculateHashOfInlinedDependencies.js","sourceRoot":"","sources":["../../src/utilities/calculateHashOfInlinedDependencies.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,kCAAkC,CAAC,OAGxD;IACC,MAAM,EAAE,mBAAmB,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAErD,MAAM,oBAAoB,GAAG,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,CAA+B,EAAE,EAAE;QACnF,OAAO;YACL,IAAI;YACJ,IAAI,EAAE,MAAM,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;SAC3C,CAAC;IACJ,CAAC,CAAC;IAEF,+DAA+D;IAC/D,MAAM,8BAA8B,GAAG,MAAM,OAAO,CAAC,GAAG,CACtD,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAC9D,CAAC;IAEF,uDAAuD;IACvD,MAAM,yBAAyB,GAA2B,EAAE,CAAC;IAE7D,KAAK,MAAM,KAAK,IAAI,8BAA8B,EAAE;QAClD,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC;KACpD;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC","sourcesContent":["import type { PackageJsonDependencies } from '@ms-cloudpack/bundler-types';\n\nexport async function calculateHashOfInlinedDependencies(options: {\n inlinedDependencies: PackageJsonDependencies;\n hashPackage: (options: { name: string; version?: string }) => Promise<string>;\n}): Promise<Record<string /* dependency name */, string /* hash */>> {\n const { inlinedDependencies, hashPackage } = options;\n\n const calculatePackageHash = async ([name, version]: [string, string | undefined]) => {\n return {\n name,\n hash: await hashPackage({ name, version }),\n };\n };\n\n // Calculate the hashes of all inlined dependencies in parallel\n const inlinedDependencyKeyValuePairs = await Promise.all(\n Object.entries(inlinedDependencies).map(calculatePackageHash),\n );\n\n // Convert the array of key value pairs to a dictionary\n const inlinedDependenciesHashes: Record<string, string> = {};\n\n for (const entry of inlinedDependencyKeyValuePairs) {\n inlinedDependenciesHashes[entry.name] = entry.hash;\n }\n\n return inlinedDependenciesHashes;\n}\n"]}
@@ -1,69 +0,0 @@
1
- import type { PackageDefinitionsCache, PackageJsonDependencies } from '@ms-cloudpack/bundler-types';
2
- import { type ResolveMap } from '@ms-cloudpack/package-utilities';
3
- import { type PackageIdentifier } from './getPackagePath.js';
4
- /**
5
- * @returns the entries that are used to calculate the hash of a package
6
- */
7
- export declare function getPackageHashEntries(packageIdentifier: PackageIdentifier, context: {
8
- packages: PackageDefinitionsCache;
9
- resolveMap: ResolveMap;
10
- hashDependencies: (dependencies: PackageJsonDependencies) => Promise<Record<string, string>>;
11
- }): Promise<{
12
- version: string;
13
- filesHash: Record<string, string> | null | undefined;
14
- inlinedDependenciesHash: Record<string, string> | undefined;
15
- name?: string | undefined;
16
- description?: string | undefined;
17
- files?: string[] | undefined;
18
- directories?: {
19
- [directoryType: string]: string | undefined;
20
- bin?: string | undefined;
21
- lib?: string | undefined;
22
- } | undefined;
23
- type?: "module" | "commonjs" | undefined;
24
- main?: string | undefined;
25
- module?: string | undefined;
26
- bin?: string | Partial<Record<string, string>> | undefined;
27
- esnext?: string | {
28
- [moduleName: string]: string | undefined;
29
- main?: string | undefined;
30
- browser?: string | undefined;
31
- } | undefined;
32
- browser?: string | Partial<Record<string, string | false>> | undefined;
33
- sideEffects?: boolean | string[] | undefined;
34
- types?: string | undefined;
35
- typings?: string | undefined;
36
- typesVersions?: Partial<Record<string, Partial<Record<string, string[]>>>> | undefined;
37
- exports?: import("@ms-cloudpack/bundler-types").PackageJsonExports | undefined;
38
- imports?: import("@ms-cloudpack/bundler-types").PackageJsonImports | undefined;
39
- dependencies?: Partial<Record<string, string>> | undefined;
40
- devDependencies?: Partial<Record<string, string>> | undefined;
41
- peerDependencies?: Partial<Record<string, string>> | undefined;
42
- peerDependenciesMeta?: Partial<Record<string, {
43
- optional: true;
44
- }>> | undefined;
45
- optionalDependencies?: Partial<Record<string, string>> | undefined;
46
- bundledDependencies?: Partial<Record<string, string>> | undefined;
47
- bundleDependencies?: Partial<Record<string, string>> | undefined;
48
- inlinedDependencies?: Partial<Record<string, string>> | undefined;
49
- engines?: {
50
- [x: string & Record<never, never>]: string | undefined;
51
- node?: string | undefined;
52
- npm?: string | undefined;
53
- } | undefined;
54
- os?: import("@ms-cloudpack/bundler-types").LiteralOrString<"aix" | "darwin" | "freebsd" | "linux" | "openbsd" | "sunos" | "win32" | "!aix" | "!darwin" | "!freebsd" | "!linux" | "!openbsd" | "!sunos" | "!win32">[] | undefined;
55
- cpu?: import("@ms-cloudpack/bundler-types").LiteralOrString<"arm" | "arm64" | "ia32" | "mips" | "mipsel" | "ppc" | "ppc64" | "s390" | "s390x" | "x32" | "x64" | "!arm" | "!arm64" | "!ia32" | "!mips" | "!mipsel" | "!ppc" | "!ppc64" | "!s390" | "!s390x" | "!x32" | "!x64">[] | undefined;
56
- private?: boolean | undefined;
57
- publishConfig?: {
58
- [additionalProperties: string]: unknown;
59
- access?: "public" | "restricted" | undefined;
60
- registry?: string | undefined;
61
- tag?: string | undefined;
62
- } | undefined;
63
- packageManager?: string | undefined;
64
- workspaces?: string[] | {
65
- packages?: string[] | undefined;
66
- nohoist?: string[] | undefined;
67
- } | undefined;
68
- }>;
69
- //# sourceMappingURL=getPackageHashEntries.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getPackageHashEntries.d.ts","sourceRoot":"","sources":["../../src/utilities/getPackageHashEntries.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7E;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE;IACP,QAAQ,EAAE,uBAAuB,CAAC;IAClC,UAAU,EAAE,UAAU,CAAC;IACvB,gBAAgB,EAAE,CAAC,YAAY,EAAE,uBAAuB,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BF"}