-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 remotion autocompletion to fig #633
Conversation
Overviewsrc/create-video.ts:Info:URLs:
src/npx.ts:Info:Single Functions:postProcess: function (out) {
const cli = [...suggestions].reduce(
(acc, { name }) => [...acc, name],
[]
);
return out
.split("\n")
.filter((name) => !cli.includes(name))
.map((name) => ({
name,
icon: "fig://icon?type=command",
loadSpec: name,
}));
} URLs:
src/yarn.ts:Info:Script: function (context) {
return `\cat ${context[context.length - 2]}/package.json`;
} Script: function (out) {
if (out.trim() == "") {
return [];
}
try {
const packageContent = JSON.parse(out);
const scripts = packageContent["scripts"];
if (scripts) {
return Object.keys(scripts).map((script) => ({ name: script }));
}
} catch (e) {}
return [];
} Script: function (out) {
if (out.trim() == "") {
return [];
}
try {
const startIndex = out.indexOf("{");
const endIndex = out.indexOf("}");
let output = out.substring(startIndex, endIndex + 1);
// TODO: fix hacky code
// reason: JSON parse was not working without double quotes
output = output
.replace(/\'/gi, '"')
.replace("lastUpdateCheck", '"lastUpdateCheck"')
.replace("registry", '"lastUpdateCheck"');
const configObject = JSON.parse(output);
if (configObject) {
return Object.keys(configObject).map((key) => ({ name: key }));
}
} catch (e) {}
return [];
} src/remotion.ts:Info: |
Hello @MatteoGauthier,
Please add a 👍 as a reaction to this comment to show that you read this. |
Hi, thanks for contributing! I converted this PR to draft since |
Okay thanks you ! |
I've removed |
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.
Love remotion, thanks for submitting a spec for it!
Thanks for your proposals, loved to work on this ! |
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.
LGTM, thanks a lot for this contribution 🎉
Thank you @MatteoGauthier and @QuiiBz! 🥳 Already in the Terminal, so cool! |
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
This PR add remotion autocompletion
npx remotion render
npx remotion still
npx remotion preview