Coder Social home page Coder Social logo

fig's Introduction


os Signup Documentation Discord Twitter

Autocompletion Boilerplate

This repository is a template for individuals / teams looking to build autocomplete specs for private CLIs and scripts (ie scripts that they do not want to make public).

This repo is almost exactly the same as withfig/autocomplete except the dev/ and specs/ folders are empty (they will appear after you run npm run create-boilerplate)

Documentation

Using this repo

Build your first spec in < 3 min: fig.io/docs/getting-started

  1. Click "Use this Template" above. Name it fig-autocomplete-private

  2. Clone your forked repo and create an example spec

# Replace `YOUR_GITHUB_USERNAME` with your own github username
git clone https://github.com/YOUR_GITHUB_USERNAME/fig-autocomplete-private.git fig-autocomplete-private
cd fig-autocomplete-private

# Add withfig/autocomplete as a remote
git remote add upstream https://github.com/withfig/autocomplete-boilerplate.git

# Install packages
npm install

# Create an example spec (call it "abc")
npm run create-example

# Turn on "dev mode"
npm run dev
  1. Now go to your terminal and type abc[space]. Your example spec will appear. ๐Ÿ˜Š

Other things to know

  • Edit your spec in typescript in the dev/ folder
  • On save, specs are compiled to the specs/ folder
  • In dev mode specs are read from the specs folders. Otherwise they are read from ~/.fig/autocomplete

Save My Spec for Personal use

Compile your spec then save it to your ~/.fig/autocomplete folder

# Compile your spec(s) to the specs/ folder
npm run build

# Copy your spec from the specs/ folder to the ~/.fig/autocomplete folder
npm run copy <spec-name>

Share my Spec with My Team

Compile your spec(s) to the specs/ folder

# Compile your spec
npm run build

# Commit your changes and push to your repo
git add .
git commit -m "my message"
git push origin master

Now have your team clone your repo and then copy all the specs over to their ~/.fig/autocomplete folder

git clone https://github.com/YOUR_GITHUB_USERNAME/fig-autocomplete-private.git fig-autocomplete-private
cd fig-autocomplete-private

# Copy all specs from the specs/ folder to the ~/.fig/autocomplete folder
npm run copy:all

Alternatively, you can simply share your compiled .js file with anyone (e.g. through email or Slack). Once they put the file in their ~/.fig/autocomplete folder, it will start working!

Note: Fig is working on providing a much better experience for sharing specs with your team. We are hoping to launch it very soon.

Other available package.json commands

# Create a new spec from a boilerplate template
npm run create-boilerplate

# Typecheck all specs in the dev/ folder
npm test

# Compile typescripts specs from dev/ folder to specs/ folder
npm run build

# Copy all specs from the specs/ folder to the ~/.fig/autocomplete folder
npm run copy:all

# Copy an individual spec from the specs/ folder to the ~/.fig/autocomplete folder
npm run copy <spec-name>

๐Ÿ˜Š Need Help?

Email [email protected]

Join our community

fig's People

Contributors

vsamaru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.