Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into grant/update-eslint-c…
Browse files Browse the repository at this point in the history
…onfig-autocomplete-2.0.0
  • Loading branch information
grant0417 committed May 10, 2024
2 parents 5425c7f + b673203 commit e699a37
Show file tree
Hide file tree
Showing 24 changed files with 692 additions and 1,641 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
- name: Install dependencies and build # build is a postinstall script
run: pnpm install --frozen-lockfile
- name: Lint packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
- name: Install dependencies and build # build is a postinstall script
run: pnpm install --frozen-lockfile
- name: Test packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-autocomplete-tools-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
- run: |
pnpm install
pnpm run --filter ./cli/tools-cli generate-spec > generated.ts
- name: 'Create Autocomplete PR'
uses: withfig/push-to-fig-autocomplete-action@v1
uses: withfig/push-to-fig-autocomplete-action@v2
with:
token: ${{ secrets.FIG_BOT_TOKEN }}
autocomplete-spec-name: '@withfig/autocomplete-tools'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-create-completion-spec-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
- run: |
pnpm install
pnpm run --filter ./cli/create-completion-spec generate-spec > generated.ts
- name: 'Create Autocomplete PR'
uses: withfig/push-to-fig-autocomplete-action@v1
uses: withfig/push-to-fig-autocomplete-action@v2
with:
token: ${{ secrets.FIG_BOT_TOKEN }}
autocomplete-spec-name: 'create-completion-spec'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.FIG_BOT_TOKEN }}
repository: withfig/public-site-nextjs
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-publish-spec-to-team-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v1
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.FIG_BOT_TOKEN }}
repository: withfig/publish-spec-to-team
Expand All @@ -20,12 +20,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
- run: |
pnpm install
pnpm run --filter ./cli/publish-spec generate-spec > generated.ts
- name: 'Create Autocomplete PR'
uses: withfig/push-to-fig-autocomplete-action@v1
uses: withfig/push-to-fig-autocomplete-action@v2
with:
token: ${{ secrets.FIG_BOT_TOKEN }}
autocomplete-spec-name: '@fig/publish-spec'
Expand Down
4 changes: 2 additions & 2 deletions cli/create-completion-spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
},
"devDependencies": {
"@fig/complete-commander": "workspace:^",
"@types/node": "^20.10.6",
"tsx": "^4.7.0",
"@types/node": "^20.12.11",
"tsx": "^4.9.3",
"typescript": "^5.3.3"
},
"publishConfig": {
Expand Down
12 changes: 6 additions & 6 deletions cli/publish-spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@
"homepage": "https://github.com/withfig/autocomplete-tools#readme",
"dependencies": {
"commander": "^11.1.0",
"esbuild": "^0.19.11",
"esbuild": "^0.20.2",
"node-fetch": "^3.3.2",
"prettier": "^3.1.1",
"prettier": "^3.2.5",
"prompts": "^2.4.2"
},
"devDependencies": {
"@fig/complete-commander": "workspace:^",
"@types/express": "^4.17.21",
"@types/multer": "^1.4.11",
"@types/node": "^20.10.6",
"@types/node-fetch": "^2.6.10",
"@types/node": "^20.12.11",
"@types/node-fetch": "^2.6.11",
"@types/prompts": "^2.4.9",
"express": "^4.18.2",
"express": "^4.19.2",
"multer": "1.4.5-lts.1",
"picocolors": "^1.0.0",
"tsx": "^4.7.0",
"tsx": "^4.9.3",
"typescript": "^5.3.3"
},
"publishConfig": {
Expand Down
16 changes: 8 additions & 8 deletions cli/tools-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@withfig/autocomplete-tools",
"version": "2.9.2",
"version": "2.10.0",
"description": "Command line tools for working with fig autocomplete specs",
"author": "The Fig Team",
"scripts": {
Expand All @@ -23,23 +23,23 @@
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"@fig/autocomplete-helpers": "workspace:^",
"@fig/autocomplete-merge": "workspace:^",
"@types/semver": "^7.5.6",
"@types/semver": "^7.5.8",
"chalk": "^4.1.2",
"chokidar": "^3.5.3",
"chokidar": "^3.6.0",
"commander": "^11.1.0",
"create-completion-spec": "workspace:^",
"esbuild": "^0.19.11",
"esbuild": "^0.20.2",
"fast-glob": "^3.3.2",
"module-from-string": "^3.3.0",
"prettier": "^3.1.1",
"semver": "^7.5.4",
"prettier": "^3.2.5",
"semver": "^7.6.0",
"typescript": "^5.3.3"
},
"devDependencies": {
"@fig/complete-commander": "workspace:^",
"@types/node": "^20.10.6",
"@types/node": "^20.12.11",
"@withfig/autocomplete-types": "workspace:^",
"tsx": "^4.7.0"
"tsx": "^4.9.3"
},
"fig": {
"build": {
Expand Down
39 changes: 17 additions & 22 deletions cli/tools-cli/src/scripts/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from "path";
import chalk from "chalk";
import { Command } from "commander";
import { runCompiler } from "./compile";
import { isCwInstalled, setSetting } from "./settings";
import { isQInstalled, setSetting } from "./settings";

const AUTOCOMPLETE_LOG_FILE = path.join(os.homedir(), ".fig", "logs", "specs.log");

Expand All @@ -27,42 +27,37 @@ async function runProgram({ outdir }: { outdir?: string }) {
if (os.type() === "Darwin") {
const globalFigAppPath = "/Applications/Fig.app";
const localFigAppPath = path.join(os.homedir(), "Applications/Fig.app");
const globalCwAppPath = "/Applications/CodeWhisperer.app";
const localCwAppPath = path.join(os.homedir(), "Applications/CodeWhisperer.app");
const globalQAppPath = "/Applications/Amazon Q.app";
const localQAppPath = path.join(os.homedir(), "Applications/Amazon Q.app");

if (
!fs.existsSync(globalFigAppPath) &&
!fs.existsSync(localFigAppPath) &&
!fs.existsSync(globalCwAppPath) &&
!fs.existsSync(localCwAppPath)
!fs.existsSync(globalQAppPath) &&
!fs.existsSync(localQAppPath)
) {
console.log(
"\n******\n\n",
chalk.bold(chalk.yellow(" WARNING: CodeWhisperer for command line app is not installed")),
chalk.bold(chalk.yellow(" WARNING: Amazon Q for command line app is not installed")),
"\n\n",
chalk.bold(chalk.cyan(" Download CodeWhisperer for command line at:")),
"\n https://docs.aws.amazon.com/codewhisperer/latest/userguide/command-line-getting-started-installing.html",
chalk.bold(chalk.cyan(" Download Amazon Q for command line at:")),
"\n https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-getting-started-installing.html",
"\n\n******\n"
);
}
} else if (os.type() === "Linux") {
// if (!commandStatus("fig_desktop --version")) {
// console.log(
// "\n******\n\n",
// chalk.bold(chalk.yellow(" WARNING: Fig App is not installed")),
// "\n\n",
// chalk.bold(chalk.cyan(" For early Linux support please join our Discord:")),
// "\n https://fig.io/community",
// "\n\n******\n"
// );
// }
} else if (!isCwInstalled()) {
console.log(
"\n******\n\n",
chalk.bold(chalk.yellow(" WARNING: CodeWhisperer for command line app is not installed")),
chalk.bold(chalk.yellow(" WARNING: Amazon Q for command line on Linux is not supported yet")),
"\n\n"
);
} else if (!isQInstalled()) {
console.log(
"\n******\n\n",
chalk.bold(chalk.yellow(" WARNING: Amazon Q for command line is not installed")),
"\n\n",
chalk.bold(chalk.cyan(" Download CodeWhisperer for command line at:")),
"\n https://docs.aws.amazon.com/codewhisperer/latest/userguide/command-line-getting-started-installing.html",
chalk.bold(chalk.cyan(" Download Amazon Q for command line at:")),
"\n https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-getting-started-installing.html",
"\n\n******\n"
);
}
Expand Down
17 changes: 13 additions & 4 deletions cli/tools-cli/src/scripts/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,20 @@ export function isCwInstalled(): boolean {
return IS_CW_INSTALLED;
}

export function setSetting(key: string, value: unknown) {
if (isFigInstalled()) {
commandStatus("fig", ["settings", key, JSON.stringify(value)]);
let IS_Q_INSTALLED: boolean | undefined;
export function isQInstalled(): boolean {
if (IS_Q_INSTALLED === undefined) {
IS_Q_INSTALLED = commandStatus("q", ["--version"]);
}
if (isCwInstalled()) {
return IS_Q_INSTALLED;
}

export function setSetting(key: string, value: unknown) {
if (isQInstalled()) {
commandStatus("q", ["settings", key, JSON.stringify(value)]);
} else if (isCwInstalled()) {
commandStatus("cw", ["settings", key, JSON.stringify(value)]);
} else if (isFigInstalled()) {
commandStatus("fig", ["settings", key, JSON.stringify(value)]);
}
}
8 changes: 4 additions & 4 deletions generators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
"devDependencies": {
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"@types/node": "^20.10.6",
"@types/node": "^20.12.11",
"@types/sinon-chai": "^3.2.12",
"@withfig/autocomplete-types": "workspace:^",
"chai": "^4.3.10",
"mocha": "^10.2.0",
"sinon": "^17.0.1",
"mocha": "^10.4.0",
"sinon": "^17.0.2",
"sinon-chai": "^3.7.0",
"tsx": "^4.7.0",
"tsx": "^4.9.3",
"typescript": "^5.3.3"
},
"publishConfig": {
Expand Down
14 changes: 7 additions & 7 deletions helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@
},
"author": "Fig Team",
"dependencies": {
"semver": "^7.5.4",
"semver": "^7.6.0",
"typescript": "^5.3.3"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.3",
"@tsconfig/recommended": "^1.0.6",
"@types/jest": "^29.5.11",
"@types/node": "^20.10.6",
"@types/semver": "^7.5.6",
"@types/node": "^20.12.11",
"@types/semver": "^7.5.8",
"@withfig/autocomplete-types": "workspace:^",
"jest": "^29.7.0",
"prettier": "^3.1.1",
"ts-jest": "^29.1.1",
"tsx": "^4.7.0"
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"tsx": "^4.9.3"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 3 additions & 3 deletions hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"build": "tsc"
},
"dependencies": {
"@withfig/api-bindings": "^0.29.4",
"react": "^18.2.0"
"@withfig/api-bindings": "^0.30.5",
"react": "^18.3.1"
},
"devDependencies": {
"@types/react": "^18.2.46",
"@types/react": "^18.3.1",
"@withfig/autocomplete-types": "workspace:^",
"typescript": "^5.3.3"
},
Expand Down
6 changes: 3 additions & 3 deletions integrations/commander/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
"commander": "^11.1.0"
},
"dependencies": {
"prettier": "^3.1.1"
"prettier": "^3.2.5"
},
"devDependencies": {
"@types/node": "^20.10.6",
"@types/node": "^20.12.11",
"@withfig/autocomplete-types": "workspace:^",
"chalk": "^5.3.0",
"commander": "^11.1.0",
"tsx": "^4.7.0",
"tsx": "^4.9.3",
"typescript": "^5.3.3"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions integrations/oclif/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"bugs": "https://github.com/withfig/autocomplete-tools/issues",
"dependencies": {
"@oclif/core": "^2.8.11",
"prettier": "^3.1.1"
"prettier": "^3.2.5"
},
"devDependencies": {
"@types/node": "^20.10.6",
"@types/node": "^20.12.11",
"@withfig/autocomplete-types": "workspace:^",
"oclif": "^3.11.3",
"tslib": "^2.6.2",
Expand Down
6 changes: 3 additions & 3 deletions merge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"dependencies": {
"prettier": "^3.1.1",
"prettier": "^3.2.5",
"ts-morph": "^12.2.0",
"typescript": "^5.3.3"
},
"files": [
"lib/"
],
"devDependencies": {
"@types/node": "^20.10.6",
"tsx": "^4.7.0"
"@types/node": "^20.12.11",
"tsx": "^4.9.3"
},
"fig": {
"build": {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.2",
"husky": "^8.0.3",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.11",
"lint-staged": "^15.2.0",
"prettier": "3.1.0",
"turbo": "^1.11.3"
"prettier": "3.2.5",
"turbo": "^1.13.3"
},
"scripts": {
"lint": "eslint .",
Expand Down
Loading

0 comments on commit e699a37

Please sign in to comment.