lalph 0.2.8 → 0.2.10
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/dist/cli.mjs +28 -5
- package/package.json +1 -1
- package/src/GitFlow.ts +8 -2
- package/src/PromptGen.ts +3 -1
- package/src/Worktree.ts +19 -1
- package/src/commands/root.ts +5 -0
package/dist/cli.mjs
CHANGED
|
@@ -151008,7 +151008,9 @@ Once you have completed your review, you should:
|
|
|
151008
151008
|
|
|
151009
151009
|
${options.gitFlow.reviewInstructions}
|
|
151010
151010
|
|
|
151011
|
-
|
|
151011
|
+
**Everything should be done without interaction or asking for permission.**
|
|
151012
|
+
|
|
151013
|
+
# Previous instructions (only for context, do not repeat)
|
|
151012
151014
|
|
|
151013
151015
|
${options.prompt}`;
|
|
151014
151016
|
const promptReviewCustom = (options) => `${options.prompt}
|
|
@@ -151188,9 +151190,9 @@ var Worktree = class extends Service$1()("lalph/Worktree", { make: gen(function*
|
|
|
151188
151190
|
yield* fs.makeDirectory(pathService.join(directory, ".lalph"), { recursive: true });
|
|
151189
151191
|
const setupPath = pathService.resolve("scripts", "worktree-setup.sh");
|
|
151190
151192
|
yield* seedSetupScript(setupPath);
|
|
151193
|
+
yield* seedCheckoutScript(pathService.resolve("scripts", "checkout-setup.sh"));
|
|
151191
151194
|
if (yield* fs.exists(setupPath)) yield* make$23({
|
|
151192
151195
|
cwd: directory,
|
|
151193
|
-
extendEnv: true,
|
|
151194
151196
|
shell: process.env.SHELL ?? true
|
|
151195
151197
|
})`${setupPath}`.pipe(exitCode);
|
|
151196
151198
|
return {
|
|
@@ -151221,6 +151223,12 @@ const seedSetupScript = fnUntraced(function* (setupPath) {
|
|
|
151221
151223
|
yield* fs.writeFileString(setupPath, setupScriptTemplate(baseBranch));
|
|
151222
151224
|
yield* fs.chmod(setupPath, 493);
|
|
151223
151225
|
});
|
|
151226
|
+
const seedCheckoutScript = fnUntraced(function* (setupPath) {
|
|
151227
|
+
const fs = yield* FileSystem;
|
|
151228
|
+
if (yield* fs.exists(setupPath)) return;
|
|
151229
|
+
yield* fs.writeFileString(setupPath, checkoutScriptTemplate);
|
|
151230
|
+
yield* fs.chmod(setupPath, 493);
|
|
151231
|
+
});
|
|
151224
151232
|
const discoverBaseBranch = gen(function* () {
|
|
151225
151233
|
const originHead = yield* make$23`git symbolic-ref --short refs/remotes/origin/HEAD`.pipe(string, catch_$1((_) => succeed$1("")), map$8((output) => output.trim()));
|
|
151226
151234
|
if (originHead !== "") return originHead.startsWith("origin/") ? originHead.slice(7) : originHead;
|
|
@@ -151235,6 +151243,13 @@ git checkout origin/${baseBranch}
|
|
|
151235
151243
|
|
|
151236
151244
|
# Seeded by lalph. Customize this to prepare new worktrees.
|
|
151237
151245
|
`;
|
|
151246
|
+
const checkoutScriptTemplate = `#!/usr/bin/env bash
|
|
151247
|
+
set -euo pipefail
|
|
151248
|
+
|
|
151249
|
+
pnpm install || true
|
|
151250
|
+
|
|
151251
|
+
# Seeded by lalph. Customize this to prepare branches after checkout.
|
|
151252
|
+
`;
|
|
151238
151253
|
const makeExecHelpers = fnUntraced(function* (options) {
|
|
151239
151254
|
const spawner = yield* ChildProcessSpawner;
|
|
151240
151255
|
const provide = provideService(ChildProcessSpawner, spawner);
|
|
@@ -151571,7 +151586,10 @@ const GitFlowPR = succeed$2(GitFlow, GitFlow.of({
|
|
|
151571
151586
|
- **DO NOT** commit any of the files in the \`.lalph\` directory.
|
|
151572
151587
|
- You have full permission to push branches, create PRs or create git commits.`,
|
|
151573
151588
|
reviewInstructions: `You are already on the PR branch with their changes.
|
|
151574
|
-
After making any changes, commit and push them to the same pull request
|
|
151589
|
+
After making any changes, commit and push them to the same pull request.
|
|
151590
|
+
|
|
151591
|
+
- **DO NOT** commit any of the files in the \`.lalph\` directory.
|
|
151592
|
+
- You have full permission to push branches, create PRs or create git commits.`,
|
|
151575
151593
|
postWork: () => void_$1,
|
|
151576
151594
|
autoMerge: fnUntraced(function* (options) {
|
|
151577
151595
|
const prd = yield* Prd;
|
|
@@ -151600,7 +151618,10 @@ const GitFlowCommit = effect$1(GitFlow, gen(function* () {
|
|
|
151600
151618
|
commitInstructions: () => `When you have completed your changes, **you must** commit them to the current local branch. Do not git push your changes or switch branches.
|
|
151601
151619
|
- **DO NOT** commit any of the files in the \`.lalph\` directory.`,
|
|
151602
151620
|
reviewInstructions: `You are already on the branch with their changes.
|
|
151603
|
-
After making any changes, commit them to the same branch. Do not git push your changes or switch branches
|
|
151621
|
+
After making any changes, commit them to the same branch. Do not git push your changes or switch branches.
|
|
151622
|
+
|
|
151623
|
+
- **DO NOT** commit any of the files in the \`.lalph\` directory.
|
|
151624
|
+
- You have full permission to create git commits.`,
|
|
151604
151625
|
postWork: fnUntraced(function* ({ worktree, targetBranch, issueId }) {
|
|
151605
151626
|
if (!targetBranch) return yield* logWarning("GitFlowCommit: No target branch specified, skipping postWork.");
|
|
151606
151627
|
const prd = yield* Prd;
|
|
@@ -151854,6 +151875,8 @@ const run = fnUntraced(function* (options) {
|
|
|
151854
151875
|
yield* worktree.exec`git branch -D ${gitFlow.branch}`;
|
|
151855
151876
|
yield* worktree.exec`git checkout -b ${gitFlow.branch}`;
|
|
151856
151877
|
}
|
|
151878
|
+
const checkoutScript = pathService.resolve("scripts", "checkout-setup.sh");
|
|
151879
|
+
if (yield* fs.exists(checkoutScript)) yield* worktree.exec`${checkoutScript}`;
|
|
151857
151880
|
yield* addFinalizer(fnUntraced(function* () {
|
|
151858
151881
|
const currentBranchName = yield* worktree.currentBranch(worktree.directory).pipe(option$1, map$8(getOrUndefined));
|
|
151859
151882
|
if (!currentBranchName) return;
|
|
@@ -152209,7 +152232,7 @@ const commandSource = make$35("source").pipe(withDescription("Select the issue s
|
|
|
152209
152232
|
|
|
152210
152233
|
//#endregion
|
|
152211
152234
|
//#region package.json
|
|
152212
|
-
var version = "0.2.
|
|
152235
|
+
var version = "0.2.10";
|
|
152213
152236
|
|
|
152214
152237
|
//#endregion
|
|
152215
152238
|
//#region src/commands/projects/ls.ts
|
package/package.json
CHANGED
package/src/GitFlow.ts
CHANGED
|
@@ -74,7 +74,10 @@ export const GitFlowPR = Layer.succeed(
|
|
|
74
74
|
- You have full permission to push branches, create PRs or create git commits.`,
|
|
75
75
|
|
|
76
76
|
reviewInstructions: `You are already on the PR branch with their changes.
|
|
77
|
-
After making any changes, commit and push them to the same pull request
|
|
77
|
+
After making any changes, commit and push them to the same pull request.
|
|
78
|
+
|
|
79
|
+
- **DO NOT** commit any of the files in the \`.lalph\` directory.
|
|
80
|
+
- You have full permission to push branches, create PRs or create git commits.`,
|
|
78
81
|
|
|
79
82
|
postWork: () => Effect.void,
|
|
80
83
|
autoMerge: Effect.fnUntraced(function* (options) {
|
|
@@ -126,7 +129,10 @@ export const GitFlowCommit = Layer.effect(
|
|
|
126
129
|
- **DO NOT** commit any of the files in the \`.lalph\` directory.`,
|
|
127
130
|
|
|
128
131
|
reviewInstructions: `You are already on the branch with their changes.
|
|
129
|
-
After making any changes, commit them to the same branch. Do not git push your changes or switch branches
|
|
132
|
+
After making any changes, commit them to the same branch. Do not git push your changes or switch branches.
|
|
133
|
+
|
|
134
|
+
- **DO NOT** commit any of the files in the \`.lalph\` directory.
|
|
135
|
+
- You have full permission to create git commits.`,
|
|
130
136
|
|
|
131
137
|
postWork: Effect.fnUntraced(function* ({
|
|
132
138
|
worktree,
|
package/src/PromptGen.ts
CHANGED
|
@@ -198,7 +198,9 @@ Once you have completed your review, you should:
|
|
|
198
198
|
|
|
199
199
|
${options.gitFlow.reviewInstructions}
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
**Everything should be done without interaction or asking for permission.**
|
|
202
|
+
|
|
203
|
+
# Previous instructions (only for context, do not repeat)
|
|
202
204
|
|
|
203
205
|
${options.prompt}`
|
|
204
206
|
|
package/src/Worktree.ts
CHANGED
|
@@ -54,10 +54,12 @@ export class Worktree extends ServiceMap.Service<Worktree>()("lalph/Worktree", {
|
|
|
54
54
|
|
|
55
55
|
const setupPath = pathService.resolve("scripts", "worktree-setup.sh")
|
|
56
56
|
yield* seedSetupScript(setupPath)
|
|
57
|
+
yield* seedCheckoutScript(
|
|
58
|
+
pathService.resolve("scripts", "checkout-setup.sh"),
|
|
59
|
+
)
|
|
57
60
|
if (yield* fs.exists(setupPath)) {
|
|
58
61
|
yield* ChildProcess.make({
|
|
59
62
|
cwd: directory,
|
|
60
|
-
extendEnv: true,
|
|
61
63
|
shell: process.env.SHELL ?? true,
|
|
62
64
|
})`${setupPath}`.pipe(ChildProcess.exitCode)
|
|
63
65
|
}
|
|
@@ -105,6 +107,15 @@ const seedSetupScript = Effect.fnUntraced(function* (setupPath: string) {
|
|
|
105
107
|
yield* fs.chmod(setupPath, 0o755)
|
|
106
108
|
})
|
|
107
109
|
|
|
110
|
+
const seedCheckoutScript = Effect.fnUntraced(function* (setupPath: string) {
|
|
111
|
+
const fs = yield* FileSystem.FileSystem
|
|
112
|
+
|
|
113
|
+
if (yield* fs.exists(setupPath)) return
|
|
114
|
+
|
|
115
|
+
yield* fs.writeFileString(setupPath, checkoutScriptTemplate)
|
|
116
|
+
yield* fs.chmod(setupPath, 0o755)
|
|
117
|
+
})
|
|
118
|
+
|
|
108
119
|
const discoverBaseBranch = Effect.gen(function* () {
|
|
109
120
|
const originHead =
|
|
110
121
|
yield* ChildProcess.make`git symbolic-ref --short refs/remotes/origin/HEAD`.pipe(
|
|
@@ -137,6 +148,13 @@ git checkout origin/${baseBranch}
|
|
|
137
148
|
|
|
138
149
|
# Seeded by lalph. Customize this to prepare new worktrees.
|
|
139
150
|
`
|
|
151
|
+
const checkoutScriptTemplate = `#!/usr/bin/env bash
|
|
152
|
+
set -euo pipefail
|
|
153
|
+
|
|
154
|
+
pnpm install || true
|
|
155
|
+
|
|
156
|
+
# Seeded by lalph. Customize this to prepare branches after checkout.
|
|
157
|
+
`
|
|
140
158
|
|
|
141
159
|
const makeExecHelpers = Effect.fnUntraced(function* (options: {
|
|
142
160
|
readonly directory: string
|
package/src/commands/root.ts
CHANGED
|
@@ -79,6 +79,11 @@ const run = Effect.fnUntraced(
|
|
|
79
79
|
yield* worktree.exec`git checkout -b ${gitFlow.branch}`
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
const checkoutScript = pathService.resolve("scripts", "checkout-setup.sh")
|
|
83
|
+
if (yield* fs.exists(checkoutScript)) {
|
|
84
|
+
yield* worktree.exec`${checkoutScript}`
|
|
85
|
+
}
|
|
86
|
+
|
|
82
87
|
// ensure cleanup of branch after run
|
|
83
88
|
yield* Effect.addFinalizer(
|
|
84
89
|
Effect.fnUntraced(function* () {
|