Skip to content
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

Merged
merged 5 commits into from Oct 5, 2021
Merged

feat: add remotion autocompletion to fig #633

merged 5 commits into from Oct 5, 2021

Conversation

MatteoGauthier
Copy link
Contributor

@MatteoGauthier MatteoGauthier commented Oct 2, 2021

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

This PR add remotion autocompletion

  • I’ve reduced the length of arguments label from "entry-file" to "entry" in order to fit in fig popup
  • npx remotion render
  • npx remotion still
  • npx remotion preview

@withfig-bot
Copy link
Collaborator

withfig-bot commented Oct 2, 2021

Overview

src/create-video.ts:

Info:

URLs:

  • https://raw.githubusercontent.com/remotion-dev/remotion/main/packages/docs/static/img/logo-small.png

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:

  • https://raw.githubusercontent.com/babel/logo/master/babel.png
  • https://reactnative.dev/img/pwa/manifest-icon-512.png
  • https://reactnative.dev/img/pwa/manifest-icon-512.png
  • https://tailwindcss.com/favicon-32x32.png
  • https://nextjs.org/static/favicon/favicon-16x16.png
  • https://raw.githubusercontent.com/pmndrs/branding/master/logo.svg
  • https://raw.githubusercontent.com/prisma/docs/main/src/images/favicon-16x16.png
  • https://eslint.org/assets/img/favicon.512x512.png
  • https://prettier.io/icon.png
  • https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Typescript_logo_2020.svg/240px-Typescript_logo_2020.svg.png
  • https://avatars.githubusercontent.com/u/20165699?s=200&v=4
  • https://fig.io/icons/fig-light.png
  • https://nextjs.org/static/favicon/favicon-16x16.png
  • https://raw.githubusercontent.com/remotion-dev/remotion/main/packages/docs/static/img/logo-small.png
  • https://raw.githubusercontent.com/remotion-dev/remotion/main/packages/docs/static/img/logo-small.png

src/yarn.ts:

Info:

Script:
cat "$(yarn global dir)/package.json"
script(function):

 function (context) {
    return `\cat ${context[context.length - 2]}/package.json`;
  }

Script:
cat "$(yarn global dir)/package.json"
postProcess(function):

 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:
yarn config list
postProcess(function):

 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:

@withfig-bot
Copy link
Collaborator

Hello @MatteoGauthier,
thank you very much for creating a Pull Request!
Here is a small checklist to get this PR merged as quickly as possible:

  • Do all subcommands / options which take arguments have the arg property (arg: {})?
  • Are all options modular? E.g. a -u -x instead of -aux
  • Have all other checks passed?

Please add a 👍 as a reaction to this comment to show that you read this.

src/npx.ts Show resolved Hide resolved
@QuiiBz QuiiBz marked this pull request as draft October 2, 2021 16:24
@QuiiBz
Copy link
Contributor

QuiiBz commented Oct 2, 2021

Hi, thanks for contributing! I converted this PR to draft since npx remotion lambda is waiting to be done, feel free to mark it "Ready for review" when it's done!

@MatteoGauthier
Copy link
Contributor Author

Hi, thanks for contributing! I converted this PR to draft since npx remotion lambda is waiting to be done, feel free to mark it "Ready for review" when it's done!

Okay thanks you !

@MatteoGauthier
Copy link
Contributor Author

I've removed npx remotion lambda to the checklist remotion creator didn't want this feature implemented for now.

@MatteoGauthier MatteoGauthier marked this pull request as ready for review October 4, 2021 14:35
QuiiBz
QuiiBz previously requested changes Oct 4, 2021
Copy link
Contributor

@QuiiBz QuiiBz left a 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!

src/remotion.ts Outdated Show resolved Hide resolved
src/remotion.ts Outdated Show resolved Hide resolved
src/remotion.ts Show resolved Hide resolved
src/remotion.ts Show resolved Hide resolved
src/remotion.ts Show resolved Hide resolved
src/remotion.ts Outdated Show resolved Hide resolved
src/remotion.ts Show resolved Hide resolved
@MatteoGauthier
Copy link
Contributor Author

Love remotion, thanks for submitting a spec for it!

Thanks for your proposals, loved to work on this !

@mschrage mschrage dismissed QuiiBz’s stale review October 5, 2021 18:27

Changes were addressed!

Copy link
Contributor

@QuiiBz QuiiBz left a 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 🎉

@mschrage mschrage merged commit c56643b into withfig:master Oct 5, 2021
@JonnyBurger
Copy link
Contributor

Thank you @MatteoGauthier and @QuiiBz! 🥳 Already in the Terminal, so cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants