@pmelab/gtd 26.1.0 → 27.0.0
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/.claude-plugin/plugin.json +1 -1
- package/README.md +16 -3
- package/dist/chunks/{Schema-B5yK7QrT.mjs → Schema-CyImoHTj.mjs} +56 -3
- package/dist/chunks/{reserved-6pAgFGgB.mjs → reserved-BL9krPao.mjs} +1 -1
- package/dist/chunks/{wire-DA7q2ikx.mjs → wire-BY1S-obW.mjs} +5 -2
- package/dist/gtd.bundle.mjs +85 -16
- package/dist/testkit.mjs +163 -17
- package/dist/wire.mjs +2 -2
- package/dist/workflows/feature.mjs +1 -1
- package/dist/workflows/fix.mjs +1 -1
- package/dist/workflows/review.mjs +1 -1
- package/package.json +2 -2
- package/src/cli/Cli.test.ts +53 -1
- package/src/cli/Cli.ts +48 -6
- package/src/cli/Output.ts +3 -1
- package/src/cli/Program.test.ts +1 -0
- package/src/cli/Program.ts +28 -7
- package/src/cli/Strays.test.ts +88 -0
- package/src/cli/Strays.ts +56 -0
- package/src/platform/Git.test.ts +96 -1
- package/src/platform/Git.ts +24 -0
- package/src/step/index.ts +1 -0
- package/src/step/strayPaths.test.ts +17 -0
- package/src/step/strayPaths.ts +8 -0
- package/src/testkit/FakeGitOperations.ts +2 -0
- package/src/testkit/GitTiers.ts +67 -1
- package/src/testkit/InMemRepo.ts +7 -0
- package/src/testkit/Layers.test.ts +34 -1
- package/src/testkit/Layers.ts +21 -1
- package/src/testkit/TestRepo.ts +1 -1
- package/src/wire/ExitCodes.test.ts +11 -3
- package/src/wire/ExitCodes.ts +3 -0
- package/src/wire/Glob.test.ts +35 -0
- package/src/wire/Glob.ts +1 -1
package/src/wire/ExitCodes.ts
CHANGED
|
@@ -3,6 +3,8 @@ export const EXIT_OK = 0
|
|
|
3
3
|
export const EXIT_RUNTIME_ERROR = 1
|
|
4
4
|
/** gtd was invoked wrong — an unknown option/command, bad arity, a scope violation, a decode failure. */
|
|
5
5
|
export const EXIT_USAGE_ERROR = 2
|
|
6
|
+
/** `gtd strays` found touched paths outside the allowlist — that command's only, and it carries no other meaning. */
|
|
7
|
+
export const EXIT_STRAYS_FOUND = 10
|
|
6
8
|
export const EXIT_SIGINT = 130
|
|
7
9
|
export const EXIT_SIGTERM = 143
|
|
8
10
|
|
|
@@ -11,6 +13,7 @@ export const EXIT_CODES: ReadonlySet<number> = new Set([
|
|
|
11
13
|
EXIT_OK,
|
|
12
14
|
EXIT_RUNTIME_ERROR,
|
|
13
15
|
EXIT_USAGE_ERROR,
|
|
16
|
+
EXIT_STRAYS_FOUND,
|
|
14
17
|
EXIT_SIGINT,
|
|
15
18
|
EXIT_SIGTERM,
|
|
16
19
|
])
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest"
|
|
2
|
+
import { globMatches } from "./Glob.js"
|
|
3
|
+
|
|
4
|
+
describe("globMatches", () => {
|
|
5
|
+
it("`*` stays within one segment; `**` crosses segments, zero included", () => {
|
|
6
|
+
expect(globMatches("a.md", "*.md")).toBe(true)
|
|
7
|
+
expect(globMatches("docs/a.md", "*.md")).toBe(false)
|
|
8
|
+
expect(globMatches("src/x/y/a.ts", "src/**")).toBe(true)
|
|
9
|
+
expect(globMatches("a.ts", "**/a.ts")).toBe(true)
|
|
10
|
+
expect(globMatches("x/a.ts", "**/a.ts")).toBe(true)
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
it("dotfiles match `*` and `**` like any other path", () => {
|
|
14
|
+
expect(globMatches(".env", "*")).toBe(true)
|
|
15
|
+
expect(globMatches("dir/.hidden", "dir/*")).toBe(true)
|
|
16
|
+
expect(globMatches(".github/ci.yml", "**")).toBe(true)
|
|
17
|
+
expect(globMatches(".github/ci.yml", "*")).toBe(false)
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it("matches case-sensitively", () => {
|
|
21
|
+
expect(globMatches("README.md", "readme.md")).toBe(false)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it("`?` and `[` are literal", () => {
|
|
25
|
+
expect(globMatches("a?.txt", "a?.txt")).toBe(true)
|
|
26
|
+
expect(globMatches("ab.txt", "a?.txt")).toBe(false)
|
|
27
|
+
expect(globMatches("[a].txt", "[a].txt")).toBe(true)
|
|
28
|
+
expect(globMatches("a.txt", "[a].txt")).toBe(false)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it("`**` crosses a path containing a line break", () => {
|
|
32
|
+
expect(globMatches("weird\nname.txt", "**")).toBe(true)
|
|
33
|
+
expect(globMatches("d/a\nb", "d/**")).toBe(true)
|
|
34
|
+
})
|
|
35
|
+
})
|
package/src/wire/Glob.ts
CHANGED