bet-cli 0.1.2 → 0.1.4
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 +21 -1
- package/dist/commands/completion.js +2 -0
- package/dist/commands/ignore.js +78 -0
- package/dist/commands/update.js +139 -80
- package/dist/index.js +7 -1
- package/dist/lib/config.js +27 -0
- package/dist/lib/cron.js +115 -6
- package/dist/lib/help.js +81 -0
- package/dist/lib/ignore.js +45 -0
- package/dist/lib/log-dir.js +22 -0
- package/dist/lib/logger.js +80 -0
- package/dist/lib/metadata.js +2 -3
- package/dist/lib/scan.js +5 -10
- package/package.json +1 -1
- package/src/commands/completion.ts +2 -0
- package/src/commands/ignore.ts +93 -0
- package/src/commands/update.ts +80 -17
- package/src/index.ts +8 -1
- package/src/lib/config.ts +28 -1
- package/src/lib/cron.ts +152 -9
- package/src/lib/help.ts +122 -0
- package/src/lib/ignore.ts +52 -0
- package/src/lib/log-dir.ts +26 -0
- package/src/lib/logger.ts +92 -0
- package/src/lib/metadata.ts +2 -3
- package/src/lib/scan.ts +5 -10
- package/src/lib/types.ts +6 -0
- package/tests/config.test.ts +175 -1
- package/tests/cron.test.ts +243 -0
- package/tests/ignore.test.ts +179 -0
- package/tests/metadata.test.ts +3 -2
- package/tests/scan.test.ts +5 -4
- package/tests/update.test.ts +20 -1
package/tests/update.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { willOverrideRoots } from "../src/commands/update.js";
|
|
2
|
+
import { willOverrideRoots, projectSlug, DEFAULT_SLUG_PARENT_FOLDERS } from "../src/commands/update.js";
|
|
3
3
|
import type { RootConfig } from "../src/lib/types.js";
|
|
4
4
|
|
|
5
5
|
const root = (path: string, name: string): RootConfig => ({ path, name });
|
|
@@ -27,4 +27,23 @@ describe("update", () => {
|
|
|
27
27
|
expect(willOverrideRoots(undefined, [])).toBe(false);
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
|
+
|
|
31
|
+
describe("projectSlug", () => {
|
|
32
|
+
it("uses parent name when path ends with default slugParentFolders (src, app)", () => {
|
|
33
|
+
expect(projectSlug("/code/my-api/src", DEFAULT_SLUG_PARENT_FOLDERS)).toBe("my-api");
|
|
34
|
+
expect(projectSlug("/code/my-api/app", DEFAULT_SLUG_PARENT_FOLDERS)).toBe("my-api");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("uses basename when path does not end with default slugParentFolders", () => {
|
|
38
|
+
expect(projectSlug("/code/my-api/other", DEFAULT_SLUG_PARENT_FOLDERS)).toBe("other");
|
|
39
|
+
expect(projectSlug("/code/my-api", DEFAULT_SLUG_PARENT_FOLDERS)).toBe("my-api");
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("uses custom slugParentFolders when provided", () => {
|
|
43
|
+
const custom = ["lib"];
|
|
44
|
+
expect(projectSlug("/code/my-api/lib", custom)).toBe("my-api");
|
|
45
|
+
expect(projectSlug("/code/my-api/src", custom)).toBe("src");
|
|
46
|
+
expect(projectSlug("/code/my-api/app", custom)).toBe("app");
|
|
47
|
+
});
|
|
48
|
+
});
|
|
30
49
|
});
|