-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies, add GitHub Pull Requests extension, and enhance …
…error messaging (#686) * run prettier * Update various dependencies, remove zx package, and enhance error messaging with URL in run script * Add GitHub Pull Requests extension to devcontainer and vscode configs * Add mustache template engine usage example to parsers documentation * Update mustache template functions and documentation in parsers and types * add husky * Added commit message automation script using GenAI in the project's husky hook configuration * Update commit-msg hook to run only if commit message is not empty * Add condition to skip message generator if a commit message is provided * Modify husky commit-msg hook to always run message generator * better user message filter
- Loading branch information
Showing
55 changed files
with
1,422 additions
and
1,611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node packages/cli/built/genaiscript.cjs run commit-msg "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
prettier $(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') --write --ignore-unknown | ||
git update-index --again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1004,9 +1004,9 @@ | |
"@types/unist" "*" | ||
|
||
"@types/node@*", "@types/node@>=20": | ||
version "22.5.2" | ||
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.2.tgz#e42344429702e69e28c839a7e16a8262a8086793" | ||
integrity sha512-acJsPTEqYqulZS/Yp/S3GgeE6GZ0qYODUR8aVr/DkhHQ8l9nd4j5x1/ZJy9/gHrRlFMqkO6i0I3E27Alu4jjPg== | ||
version "22.5.3" | ||
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.3.tgz#91a374e42c6e7ccb5893a87f1775f36ce1671d65" | ||
integrity sha512-njripolh85IA9SQGTAqbmnNZTdxv7X/4OYGPz8tgy5JDr8MP+uDBa921GpYEoDDnwm0Hmn5ZPeJgiiSTPoOzkQ== | ||
dependencies: | ||
undici-types "~6.19.2" | ||
|
||
|
@@ -3262,10 +3262,10 @@ postcss-selector-parser@^6.1.1: | |
cssesc "^3.0.0" | ||
util-deprecate "^1.0.2" | ||
|
||
postcss@^8.4.38, postcss@^8.4.41: | ||
version "8.4.44" | ||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.44.tgz#d56834ef6508610ba224bb22b2457b2169ed0480" | ||
integrity sha512-Aweb9unOEpQ3ezu4Q00DPvvM2ZTUitJdNKeP/+uQgr1IBIqu574IaZoURId7BKtWMREwzKa9OgzPzezWGPWFQw== | ||
postcss@^8.4.38, postcss@^8.4.43: | ||
version "8.4.45" | ||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.45.tgz#538d13d89a16ef71edbf75d895284ae06b79e603" | ||
integrity sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q== | ||
dependencies: | ||
nanoid "^3.3.7" | ||
picocolors "^1.0.1" | ||
|
@@ -3972,12 +3972,12 @@ vfile@^6.0.0, vfile@^6.0.2, vfile@^6.0.3: | |
vfile-message "^4.0.0" | ||
|
||
vite@^5.4.2: | ||
version "5.4.2" | ||
resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.2.tgz#8acb6ec4bfab823cdfc1cb2d6c53ed311bc4e47e" | ||
integrity sha512-dDrQTRHp5C1fTFzcSaMxjk6vdpKvT+2/mIdE07Gw2ykehT49O0z/VHS3zZ8iV/Gh8BJJKHWOe5RjaNrW5xf/GA== | ||
version "5.4.3" | ||
resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.3.tgz#771c470e808cb6732f204e1ee96c2ed65b97a0eb" | ||
integrity sha512-IH+nl64eq9lJjFqU+/yrRnrHPVTlgy42/+IzbOdaFDVlyLgI/wDlf+FCobXLX1cT0X5+7LMyH1mIy2xJdLfo8Q== | ||
dependencies: | ||
esbuild "^0.21.3" | ||
postcss "^8.4.41" | ||
postcss "^8.4.43" | ||
rollup "^4.20.0" | ||
optionalDependencies: | ||
fsevents "~2.3.3" | ||
|
@@ -4231,9 +4231,9 @@ [email protected]: | |
integrity sha512-CBKFWExMn46Foo4cldiChEzn7S7SRV+wqiluAb6xmueD/fGyRHIhX8m14vVGgeFWjN540nKCNVj6P21eQjgTuA== | ||
|
||
yaml@^2.5.0: | ||
version "2.5.0" | ||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.0.tgz#c6165a721cf8000e91c36490a41d7be25176cf5d" | ||
integrity sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw== | ||
version "2.5.1" | ||
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.1.tgz#c9772aacf62cb7494a95b0c4f1fb065b563db130" | ||
integrity sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q== | ||
|
||
yargs-parser@^21.1.1: | ||
version "21.1.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const msg = env.files[0] | ||
const msgContent = msg.content | ||
?.split(/\n/g) | ||
.filter((l) => l && !/^#/.test(l)) | ||
.join("\n") | ||
if (msgContent) cancel("commit message already exists") | ||
|
||
// Check for staged changes and stage all changes if none are staged | ||
let diff = await host.exec("git", ["diff", "--cached"]) | ||
if (!diff.stdout) cancel("no staged changes") | ||
// Generate commit message | ||
const res = await runPrompt( | ||
(_) => { | ||
_.def("GIT_DIFF", diff, { maxTokens: 20000 }) | ||
_.$`GIT_DIFF is a diff of all staged changes, coming from the command: | ||
\`\`\` | ||
git diff --cached | ||
\`\`\` | ||
Please generate a concise, one-line commit message for these changes. | ||
- do NOT add quotes` | ||
}, | ||
{ cache: false, temperature: 0.8 } | ||
) | ||
|
||
if (res.error) throw res.error | ||
const message = res.text | ||
if (!message) cancel("no message generated") | ||
await workspace.writeText(msg.filename, message) |
Oops, something went wrong.