@lage-run/hasher 1.1.0 → 1.1.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,52 @@
2
2
  "name": "@lage-run/hasher",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 15 Mar 2024 04:34:52 GMT",
5
+ "date": "Mon, 10 Jun 2024 23:50:24 GMT",
6
+ "version": "1.1.2",
7
+ "tag": "@lage-run/hasher_v1.1.2",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com_msteamsmdb",
12
+ "package": "@lage-run/hasher",
13
+ "commit": "0894d97ebfedc339b77161c40fa8643d93e4486d",
14
+ "comment": "matching correct glob and exclude patterns"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Sun, 05 May 2024 22:55:45 GMT",
21
+ "version": "1.1.1",
22
+ "tag": "@lage-run/hasher_v1.1.1",
23
+ "comments": {
24
+ "patch": [
25
+ {
26
+ "author": "kchau@microsoft.com",
27
+ "package": "@lage-run/hasher",
28
+ "commit": "1e36de04ab83fc0cde38062fc1543e4b12902166",
29
+ "comment": "fixing hashing issues related to rust panic"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Wed, 17 Apr 2024 23:20:47 GMT",
36
+ "version": "1.1.0",
37
+ "tag": "@lage-run/hasher_v1.1.0",
38
+ "comments": {
39
+ "none": [
40
+ {
41
+ "author": "elcraig@microsoft.com",
42
+ "package": "@lage-run/hasher",
43
+ "commit": "fb4fcb8419cc778210104d7d04102fc95df13d5b",
44
+ "comment": "Update formatting"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Fri, 15 Mar 2024 04:35:11 GMT",
6
51
  "version": "1.1.0",
7
52
  "tag": "@lage-run/hasher_v1.1.0",
8
53
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @lage-run/hasher
2
2
 
3
- This log was last generated on Fri, 15 Mar 2024 04:34:52 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 10 Jun 2024 23:50:24 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.1.2
8
+
9
+ Mon, 10 Jun 2024 23:50:24 GMT
10
+
11
+ ### Patches
12
+
13
+ - matching correct glob and exclude patterns (kchau@microsoft.com_msteamsmdb)
14
+
15
+ ## 1.1.1
16
+
17
+ Sun, 05 May 2024 22:55:45 GMT
18
+
19
+ ### Patches
20
+
21
+ - fixing hashing issues related to rust panic (kchau@microsoft.com)
22
+
7
23
  ## 1.1.0
8
24
 
9
- Fri, 15 Mar 2024 04:34:52 GMT
25
+ Fri, 15 Mar 2024 04:35:11 GMT
10
26
 
11
27
  ### Minor changes
12
28
 
package/README.md CHANGED
@@ -1,2 +1,3 @@
1
1
  # @lage-run/hasher
2
- This package takes code from both backfill-hasher & package-dep-hash and strips out the extraneous dependencies: backfill-logger and @rushstack/node-core-lib. This is done so that `lage` can become a pure ES Module package. It also allows us to control how the hashing works should lage gains the ability to customize the `inputs` in the future.
2
+
3
+ This package takes code from both backfill-hasher & package-dep-hash and strips out the extraneous dependencies: backfill-logger and @rushstack/node-core-lib. This is done so that `lage` can become a pure ES Module package. It also allows us to control how the hashing works should lage gains the ability to customize the `inputs` in the future.
package/lib/FileHasher.js CHANGED
@@ -156,9 +156,9 @@ class FileHasher {
156
156
  _class_private_field_get(this, _store)[file] = {
157
157
  mtime: stat.mtimeMs,
158
158
  size: Number(stat.size),
159
- hash
159
+ hash: hash ?? ""
160
160
  };
161
- hashes[file] = hash;
161
+ hashes[file] = hash ?? "";
162
162
  }
163
163
  return hashes;
164
164
  }
@@ -125,8 +125,8 @@ async function findFilesFromGitTree(packagePath, patterns) {
125
125
  const trackedPromise = (0, _execa.default)("git", [
126
126
  "ls-files",
127
127
  "-z",
128
- ...patterns.filter((p)=>!p.startsWith("!")),
129
- ...patterns.filter((p)=>p.startsWith("!")).map((p)=>`:!:${p.slice(1)}`)
128
+ ...patterns.filter((p)=>!p.startsWith("!")).map((p)=>`:(glob)${p}`),
129
+ ...patterns.filter((p)=>p.startsWith("!")).map((p)=>`:(exclude,glob)${p.slice(1)}`)
130
130
  ], {
131
131
  cwd
132
132
  }).then((lsFilesResults)=>{
@@ -137,10 +137,11 @@ async function findFilesFromGitTree(packagePath, patterns) {
137
137
  });
138
138
  const untrackedPromise = includeUntracked ? (0, _execa.default)("git", [
139
139
  "ls-files",
140
+ "-z",
140
141
  "-o",
141
142
  "--exclude-standard",
142
- ...patterns.filter((p)=>!p.startsWith("!")),
143
- ...patterns.filter((p)=>p.startsWith("!")).map((p)=>`:!:${p.slice(1)}`)
143
+ ...patterns.filter((p)=>!p.startsWith("!")).map((p)=>`:(glob)${p}`),
144
+ ...patterns.filter((p)=>p.startsWith("!")).map((p)=>`:(exclude,glob)${p.slice(1)}`)
144
145
  ], {
145
146
  cwd
146
147
  }).then((lsOtherResults)=>{
@@ -141,7 +141,7 @@ class TargetHasher {
141
141
  const fileFashes = (0, _globhasher.hash)(files, {
142
142
  cwd: root
143
143
  }) ?? {};
144
- const hashes = Object.values(fileFashes);
144
+ const hashes = Object.values(fileFashes).filter((hash)=>hash !== undefined && hash !== null);
145
145
  return (0, _hashStrings.hashStrings)(hashes);
146
146
  }
147
147
  // 1. add hash of target's inputs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/hasher",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Hasher for Lage Targets",
5
5
  "repository": {
6
6
  "url": "https://github.com/microsoft/lage"
@@ -19,7 +19,7 @@
19
19
  "@lage-run/logger": "^1.3.0",
20
20
  "execa": "5.1.1",
21
21
  "workspace-tools": "0.36.4",
22
- "glob-hasher": "^1.3.0",
22
+ "glob-hasher": "^1.4.2",
23
23
  "graceful-fs": "4.2.11"
24
24
  },
25
25
  "devDependencies": {