New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add bun completion spec
#703
base: master
Are you sure you want to change the base?
Conversation
Overviewsrc/bun.ts:Info:Script: function (out, [npmClient]) {
if (out.trim() == "") {
return [];
}
try {
const packageContent = JSON.parse(out);
const scripts = packageContent["scripts"];
const figCompletions = packageContent["fig"] || {};
if (scripts) {
return Object.entries(scripts).map(([scriptName, scriptContents]) => {
const icon =
npmClient === "yarn"
? "fig://icon?type=yarn"
: "fig://icon?type=npm";
const customScripts: Fig.Suggestion = figCompletions[scriptName];
return {
name: scriptName,
icon,
description: scriptContents as string,
/**
* If there are custom definitions for the scripts
* we want to overide the default values
* */
...customScripts,
};
});
}
} catch (e) {
console.error(e);
}
return [];
} |
|
Hello @nicholasoxford,
Please add a |
|
|
||
| /** Generator that lists package.json scripts (with the respect to the `fig` field) */ | ||
| export const bunScriptsGenerator: Fig.Generator = { | ||
| script: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should be able to get this same information faster & more accurately via bun getcompletes s. I need to add support for returning the contents of the script rather than just the script name, but I'm happy to do that.
| description: "Bundle dependencies of input files into a .bun", | ||
| }, | ||
| { | ||
| name: "create", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bun c shorthand exists for bun create - should be ["c", "create"]


What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Additional info: