@awsless/ts-file-cache 0.0.10 → 0.0.11

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/README.MD CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # File hash for js & ts files.
2
+ # @awsless/ts-file-cache
3
3
 
4
4
  Attempt to create a hash from an js/ts file and all it's dependecies.
5
5
  The goal is to generate a new hash when ever the file or it's dependecies change.
@@ -10,3 +10,10 @@ const workspace = await loadWorkspace('.')
10
10
  const hash = await generateFileHash(workspace, "./file.ts")
11
11
 
12
12
  ```
13
+
14
+ ```ts
15
+
16
+ const workspace = await loadWorkspace('.')
17
+ const hash = await generateFolderHash(workspace, "./src")
18
+
19
+ ```
package/dist/index.cjs CHANGED
@@ -67,6 +67,10 @@ var findImports = async (file, code) => {
67
67
  if (importee.startsWith(".")) {
68
68
  return (0, import_path.resolve)((0, import_path.dirname)(file), importee);
69
69
  }
70
+ const parts = importee.split("/");
71
+ if (parts.length > 2) {
72
+ return parts.slice(0, 2).join("/");
73
+ }
70
74
  return importee;
71
75
  });
72
76
  };
package/dist/index.js CHANGED
@@ -41,6 +41,10 @@ var findImports = async (file, code) => {
41
41
  if (importee.startsWith(".")) {
42
42
  return resolve(dirname(file), importee);
43
43
  }
44
+ const parts = importee.split("/");
45
+ if (parts.length > 2) {
46
+ return parts.slice(0, 2).join("/");
47
+ }
44
48
  return importee;
45
49
  });
46
50
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awsless/ts-file-cache",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {