Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into roland/ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
cstrnt committed Apr 9, 2021
2 parents 33fe90f + 2ff693c commit 0782d5e
Show file tree
Hide file tree
Showing 176 changed files with 81,244 additions and 7,381 deletions.
27 changes: 27 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
},
extends: [
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended",
"plugin:fig-linter/recommended",
],
plugins: ["fig-linter"],
rules: {
"@typescript-eslint/explicit-module-boundary-types": 0,
"prettier/prettier": [
"error",
{
// Optional Prettier config changes
trailingComma: "es5",
printWidth: 80,
},
],
"no-unused-vars": ["off"],
"@typescript-eslint/no-unused-vars": ["off"],
},
};
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @QuiiBz @cstrnt @falky97 @mattschrage @rolandtshen
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Bug Report 🐞
about: Something isn't working as expected? Here is the right place to report. For questions, please use forum.withfig.com
labels: "Bug"
---

<!--
Please fill out each section below, otherwise, your issue will be closed. This info allows Fig maintainers to diagnose (and fix!) your issue as quickly as possible.
Useful Links:
- Documentation: https://withfig.com/docs/autocomplete/getting-started
Before opening a new issue, please search existing issues: https://github.com/withfig/autocomplete/issues
-->

### Completion Spec

What completion spec does this bug refer to? Or is it Fig itself?

### Description

Describe the issue that you're seeing.

### Steps to reproduce

Clear steps describing how to reproduce the issue. **Please** link to a reproduction, this makes your issue _much_ easier to diagnose (seriously).

### Expected result

What should happen?

### Actual result

What happened.

### System Information

*Fig Version:*

*OS:*

*Device:*

### Potential Solution

(optional) What could be a solution to solve this bug?
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/cli_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: CLI Request
about: Is there a CLI which doesn't have autocompletion? Request it here!
labels: "CLI Request"
---

### CLI Tool

What CLI tool is missing autocompletion in Fig?

### Useful Links

Please add some links to the docs of that tool or the `--help`text

### Top Workflows

What are the most used commands or workflows in that CLI tool (for you)?

25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Enhancement
about: You have an Idea on how to improve Fig? Let us know!
labels: "Enhancement"
---

### Completion Spec

What completion spec does this enhancement refer to? Or is it Fig itself?

### Description

Describe the issue that you're seeing.

### Steps to reproduce

Clear steps describing how to reproduce the issue. **Please** link to a reproduction, this makes your issue _much_ easier to diagnose (seriously).

### Expected result

What should happen?

### Actual result

What happened.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Other
about: You want to tell us something which doesn't fit into the other categories? Use this template!
labels: "Other"
---

### Question

Do you have a Question? Make sure to check out our forum [here](https://forum.withfig.com/)


### Community

Do you want to get updates or chat with the creators and maintainers from Fig? Check out our community Slack [here](https://figcommunity.slack.com/join/shared_invite/zt-fupa9n8g-sfHm8MyBn1DBaCj8SoIxSA#/shared-invite/email)
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Run Linter

on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run lint
16 changes: 4 additions & 12 deletions .github/workflows/lint.js.yml → .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Run Linter

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
name: Typecheck Files

on: [push, pull_request]
jobs:
build:

typecheck:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install joi --save-dev
- run: npm install
- run: npm test
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.DS_Store
building_scripts/
node_modules
.idea
dist
build
npm-debug.log
.env
.env
.idea/
.vscode
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 2 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ This Code of Conduct applies within all project spaces, and it also applies when

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [INSERT EMAIL ADDRESS]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq
For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq
59 changes: 45 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,57 @@
## Add a completion spec for a CLI tool
Looking to improve autocomplete functionality or add support for your favorite CLI tool? We welcome contributions for new specs!

Completion specs are defined in a *declarative* JSON schema, that specifies `subcommands`, `options` and `arguments`. Suggestions can be generated dynamically by running shell commands or reading local files, in addition to the information in the spec itself.
Completion specs are defined in a *declarative* schema that specifies `subcommands`, `options` and `arguments`. Suggestions can be generated dynamically by running shell commands or reading local files, in addition to the information in the spec itself.

**For more documentation and tutorials**, visit [withfig.com/docs](https://withfig.com/docs/autocomplete/getting-started)

**To request completions for a CLI tool**, open an [issue](https://github.com/withfig/autocomplete/issues/new).
**To request completions for a CLI tool**, open an [issue](https://github.com/withfig/autocomplete/issues/new/choose).

## Linting Your Spec
The autocomplete spec linter can be run to validate the format of completion specs. Run it to get syntax and type errors from your autocomplete spec.

To use the linter, run the following command from the root folder.
`node linter.js specs/[specName].js`
## Get Started

```bash
git clone https://github.com/withfig/autocomplete.git fig-autocomplete
cd fig-autocomplete

# Install packages
npm install

# Go into testing mode
npm run dev
```

Edit your spec in the `dev/` folder. It will compile to the `specs/` folder on save. Start testing your spec immediately in your terminal.

**Note**: Fig usually looks for completion specs in your `~/.fig/autocomplete` folder. When in testing mode, we check your cloned repo's `specs/` folder

<br/>


## Other available commands
```bash

# 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>
```

To run the linter on ALL specs in the /specs folder, run
`node linter.js`

## FAQ

#### What terminals does Fig work with?
Fig works with iTerm and Terminal app.
Fig works with iTerm, the native MacOS Terminal app, Hyper and the integrated terminal in VSCode.

#### How does Fig work?
Fig uses the Accessibility API on Mac to insert text on your behalf and read the current keybuffer.
Expand All @@ -46,11 +78,10 @@ Fig uses the Accessibility API on Mac to insert text on your behalf and read the
Currently, Fig is only available on MacOS.

#### How can I get access?
Sign up for the waitlist at [withfig.com](https://withfig.com?ref=github-autocomplete). Fig is currently in a private beta. We are onboarding batches of new users each week.

#### Can I use this for internal scripts and CLI tools at my company?
Yes! Check out the [autocomplete for teams](https://withfig.com/docs/autocomplete/autocomplete-for-teams) in our docs. Reach out to [email protected] if you need help.

Sign up for the waitlist at [withfig.com](https://withfig.com?ref=github-autocomplete). Fig is currently in a private beta. We are onboarding batches of new users each week.

#### Can I use Fig to build autocomplete for my team's internal scripts and CLI tools?
Yes! Check out our guide on how to [get started building autocomplete specs](https://withfig.com/docs/autocomplete/getting-started).

#### Did we miss something?
Get in touch at [email protected] or chat with us on [Slack](https://withfig.com/community)
3 changes: 0 additions & 3 deletions copy.sh

This file was deleted.

Loading

0 comments on commit 0782d5e

Please sign in to comment.