@lage-run/hasher 0.2.1 → 0.2.2

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.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,22 @@
2
2
  "name": "@lage-run/hasher",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 08 Mar 2023 17:35:15 GMT",
5
+ "date": "Wed, 29 Mar 2023 20:02:22 GMT",
6
+ "tag": "@lage-run/hasher_v0.2.2",
7
+ "version": "0.2.2",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com",
12
+ "package": "@lage-run/hasher",
13
+ "commit": "3554c6c3bc2226933a819fd1123ada422848d7d4",
14
+ "comment": "moving back to fast-glob for globbing, as it was more accurate"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Wed, 08 Mar 2023 17:35:28 GMT",
6
21
  "tag": "@lage-run/hasher_v0.2.1",
7
22
  "version": "0.2.1",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Change Log - @lage-run/hasher
2
2
 
3
- This log was last generated on Wed, 08 Mar 2023 17:35:15 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 29 Mar 2023 20:02:22 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.2.2
8
+
9
+ Wed, 29 Mar 2023 20:02:22 GMT
10
+
11
+ ### Patches
12
+
13
+ - moving back to fast-glob for globbing, as it was more accurate (kchau@microsoft.com)
14
+
7
15
  ## 0.2.1
8
16
 
9
- Wed, 08 Mar 2023 17:35:15 GMT
17
+ Wed, 08 Mar 2023 17:35:28 GMT
10
18
 
11
19
  ### Patches
12
20
 
@@ -84,7 +84,8 @@ describe("The main Hasher class", ()=>{
84
84
  await monorepo.init(_path.default.join(fixturesPath, fixture));
85
85
  const packageRoot = monorepo.root;
86
86
  const buildSignature = "yarn build";
87
- const hasher = new _index.Hasher(packageRoot);
87
+ const repoInfo = await (0, _index.getRepoInfo)(monorepo.root);
88
+ const hasher = new _index.Hasher(packageRoot, repoInfo);
88
89
  const hash = await hasher.createPackageHash(buildSignature);
89
90
  return hash;
90
91
  };
package/lib/index.d.ts CHANGED
@@ -1,13 +1,14 @@
1
1
  import type { WorkspaceInfo } from "workspace-tools";
2
2
  import type { PackageHashInfo } from "./hashOfPackage.js";
3
+ import type { RepoInfo } from "./repoInfo.js";
3
4
  export interface IHasher {
4
5
  createPackageHash: (salt: string) => Promise<string>;
5
6
  }
6
7
  export declare function addToQueue(dependencyNames: string[], queue: string[], done: PackageHashInfo[], workspaces: WorkspaceInfo): void;
7
8
  export declare class Hasher implements IHasher {
8
9
  private packageRoot;
9
- private repoInfo?;
10
- constructor(packageRoot: string);
10
+ private repoInfo;
11
+ constructor(packageRoot: string, repoInfo: RepoInfo);
11
12
  createPackageHash(salt: string): Promise<string>;
12
13
  }
13
14
  export * from "./repoInfo.js";
package/lib/index.js CHANGED
@@ -15,7 +15,7 @@ _export(exports, {
15
15
  const _workspaceTools = require("workspace-tools");
16
16
  const _hashOfPackageJs = require("./hashOfPackage.js");
17
17
  const _helpersJs = require("./helpers.js");
18
- const _repoInfoJs = _exportStar(require("./repoInfo.js"), exports);
18
+ _exportStar(require("./repoInfo.js"), exports);
19
19
  function _exportStar(from, to) {
20
20
  Object.keys(from).forEach(function(k) {
21
21
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
@@ -45,8 +45,7 @@ function addToQueue(dependencyNames, queue, done, workspaces) {
45
45
  }
46
46
  class Hasher {
47
47
  async createPackageHash(salt) {
48
- const packageRoot = await (0, _helpersJs.getPackageRoot)(this.packageRoot);
49
- this.repoInfo = await (0, _repoInfoJs.getRepoInfo)(packageRoot);
48
+ const packageRoot = this.packageRoot;
50
49
  const { workspaceInfo } = this.repoInfo;
51
50
  const queue = [
52
51
  packageRoot
@@ -69,7 +68,8 @@ class Hasher {
69
68
  ]);
70
69
  return combinedHash;
71
70
  }
72
- constructor(packageRoot){
71
+ constructor(packageRoot, repoInfo){
73
72
  this.packageRoot = packageRoot;
73
+ this.repoInfo = repoInfo;
74
74
  }
75
75
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/hasher",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Hasher for Lage Targets",
5
5
  "repository": {
6
6
  "url": "https://github.com/microsoft/lage"