@lage-run/cli 0.6.1 → 0.6.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/cli",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 18 Jan 2023 19:11:01 GMT",
5
+ "date": "Wed, 18 Jan 2023 23:26:58 GMT",
6
+ "tag": "@lage-run/cli_v0.6.2",
7
+ "version": "0.6.2",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "kchau@microsoft.com",
12
+ "package": "@lage-run/cli",
13
+ "commit": "a81971fa10a5b39552f79e062e120808302580ce",
14
+ "comment": "get rid of any imports not from node built-ins for these runners"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Wed, 18 Jan 2023 19:11:10 GMT",
6
21
  "tag": "@lage-run/cli_v0.6.1",
7
22
  "version": "0.6.1",
8
23
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Change Log - @lage-run/cli
2
2
 
3
- This log was last generated on Wed, 18 Jan 2023 19:11:01 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 18 Jan 2023 23:26:58 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.6.2
8
+
9
+ Wed, 18 Jan 2023 23:26:58 GMT
10
+
11
+ ### Patches
12
+
13
+ - get rid of any imports not from node built-ins for these runners (kchau@microsoft.com)
14
+
7
15
  ## 0.6.1
8
16
 
9
- Wed, 18 Jan 2023 19:11:01 GMT
17
+ Wed, 18 Jan 2023 19:11:10 GMT
10
18
 
11
19
  ### Patches
12
20
 
@@ -1,4 +1 @@
1
- /// <reference types="node" />
2
- import type fs from "fs";
3
1
  export declare function getCacheDir(workspace: string, internalCacheFolder: string): string;
4
- export declare function removeCacheEntry(entryPath: string, entryStat: fs.Stats): Promise<void>;
@@ -2,18 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- getCacheDir: ()=>getCacheDir,
13
- removeCacheEntry: ()=>removeCacheEntry
5
+ Object.defineProperty(exports, "getCacheDir", {
6
+ enumerable: true,
7
+ get: ()=>getCacheDir
14
8
  });
15
9
  const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
16
- const _promises = require("fs/promises");
17
10
  function _interopRequireDefault(obj) {
18
11
  return obj && obj.__esModule ? obj : {
19
12
  default: obj
@@ -23,12 +16,3 @@ function getCacheDir(workspace, internalCacheFolder) {
23
16
  const cacheFolder = !internalCacheFolder ? undefined : internalCacheFolder;
24
17
  return _path.default.join(workspace, cacheFolder ?? "node_modules/.cache/backfill");
25
18
  }
26
- async function removeCacheEntry(entryPath, entryStat) {
27
- if (entryStat.isDirectory()) {
28
- return (0, _promises.rm)(entryPath, {
29
- recursive: true
30
- });
31
- } else {
32
- return (0, _promises.unlink)(entryPath);
33
- }
34
- }
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "ClearCacheRunner", {
9
9
  const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
10
10
  const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
11
11
  const _promises = require("fs/promises");
12
- const _cacheDirJs = require("../cacheDir.js");
13
12
  function _interopRequireDefault(obj) {
14
13
  return obj && obj.__esModule ? obj : {
15
14
  default: obj
@@ -28,9 +27,18 @@ class ClearCacheRunner {
28
27
  for (const entry of entries){
29
28
  const entryPath = _path.default.join(cachePath, entry);
30
29
  const entryStat = await (0, _promises.stat)(entryPath);
31
- await (0, _cacheDirJs.removeCacheEntry)(entryPath, entryStat);
30
+ await removeCacheEntry(entryPath, entryStat);
32
31
  }
33
32
  }
34
33
  }
35
34
  }
36
35
  }
36
+ async function removeCacheEntry(entryPath, entryStat) {
37
+ if (entryStat.isDirectory()) {
38
+ return (0, _promises.rm)(entryPath, {
39
+ recursive: true
40
+ });
41
+ } else {
42
+ return (0, _promises.unlink)(entryPath);
43
+ }
44
+ }
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "PruneCacheRunner", {
9
9
  const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
10
10
  const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
11
11
  const _promises = require("fs/promises");
12
- const _cacheDirJs = require("../cacheDir.js");
13
12
  function _interopRequireDefault(obj) {
14
13
  return obj && obj.__esModule ? obj : {
15
14
  default: obj
@@ -30,10 +29,19 @@ class PruneCacheRunner {
30
29
  const entryPath = _path.default.join(cachePath, entry);
31
30
  const entryStat = await (0, _promises.stat)(entryPath);
32
31
  if (now - entryStat.mtime.getTime() > prunePeriod * MS_IN_A_DAY) {
33
- await (0, _cacheDirJs.removeCacheEntry)(entryPath, entryStat);
32
+ await removeCacheEntry(entryPath, entryStat);
34
33
  }
35
34
  }
36
35
  }
37
36
  }
38
37
  }
39
38
  }
39
+ async function removeCacheEntry(entryPath, entryStat) {
40
+ if (entryStat.isDirectory()) {
41
+ return (0, _promises.rm)(entryPath, {
42
+ recursive: true
43
+ });
44
+ } else {
45
+ return (0, _promises.unlink)(entryPath);
46
+ }
47
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lage-run/cli",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Command Line Interface for Lage",
5
5
  "repository": {
6
6
  "url": "https://github.com/microsoft/lage"