Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
thetomcraig committed Jan 21, 2025
2 parents 19e2609 + 3d1447c commit d2f5c5d
Show file tree
Hide file tree
Showing 4,651 changed files with 75,700 additions and 33,784 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
47 changes: 36 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
// We want to enable this in the long run. For now there are a lot of errors that needs to be handled.
// "plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/typescript",
"prettier"
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
"sourceType": "module",
"project": true
},
"plugins": [
"@typescript-eslint",
Expand All @@ -20,28 +23,41 @@
],
"rules": {
"import/no-relative-packages": "error",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/consistent-type-assertions": [
"error",
{
"assertionStyle": "as"
}
],
"@typescript-eslint/naming-convention": "warn",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": ["objectLiteralProperty"],
"format": ["camelCase"],
"filter": {
"regex": "[.]",
"match": false
}
}
],
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/no-unused-vars": [
"warn",
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"curly": "warn",
"curly": "error",
"eqeqeq": [
"warn",
"error",
"always",
{
"null": "never"
Expand All @@ -57,7 +73,7 @@
"error",
"MemberExpression[object.property.name='constructor'][property.name='name']"
],
"no-throw-literal": "warn",
"no-throw-literal": "error",
"semi": "off",
"unicorn/prefer-module": "error",
"mocha/no-skipped-tests": "error",
Expand All @@ -68,28 +84,37 @@
"files": ["*.tsx"],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
"error",
{
"selector": ["function"],
"format": ["PascalCase", "camelCase"]
}
]
}
},
{
"files": [
"jest.config.ts",
"docusaurus.config.mts",
"mdx-components.tsx",
"typings/**"
],
"extends": ["plugin:@typescript-eslint/disable-type-checked"]
}
],
"settings": {
"import/resolver": {
"typescript": {
"alwaysTryTypes": true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`

"project": ["tsconfig.json", "packages/*/tsconfig.json"]
}
}
},
"ignorePatterns": [
"**/vendor/**/*.ts",
"**/vendor/**/*.js",
"**/generated/**",
"**/out/**",
"**/generated/**"
"**/vendor/**/*.js",
"**/vendor/**/*.ts",
"/data/playground/**"
]
}
11 changes: 8 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
* @pokey @AndreasArvidsson
* @cursorless-dev/code-owners

*keyboard* @pokey @AndreasArvidsson @josharian
*Keyboard* @pokey @AndreasArvidsson @josharian
*keyboard* @cursorless-dev/code-owners @josharian
*Keyboard* @cursorless-dev/code-owners @josharian

*neovim* @cursorless-dev/code-owners @saidelike @fidgetingbits
*Neovim* @cursorless-dev/code-owners @saidelike @fidgetingbits
*nvim* @cursorless-dev/code-owners @saidelike @fidgetingbits
*Nvim* @cursorless-dev/code-owners @saidelike @fidgetingbits
17 changes: 0 additions & 17 deletions .github/PULL_REQUEST_TEMPLATE/new_programming_language.md

This file was deleted.

13 changes: 13 additions & 0 deletions .github/actions/lint-lua-ls/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Lua Language Server Lint"
description: "Lints all lua files with lua-language-server"
runs:
using: "composite"
steps:
- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix profile install --accept-flake-config .#lua-language-server
shell: bash
- run: scripts/lint-lua-ls.sh
shell: bash
17 changes: 17 additions & 0 deletions .github/actions/test-neovim-lua/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Neovim Lua Tests"
description: "Set up Neovim Lua environment and run Busted tests"
runs:
using: "composite"
steps:
- uses: leafo/gh-actions-lua@v10
with:
luaVersion: "luajit-openresty"
- uses: leafo/gh-actions-luarocks@v4
- shell: bash
run: |
luarocks install busted
luarocks install luafilesystem
- shell: bash
run: |
cd cursorless.nvim
busted --run unit
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,46 @@ jobs:
registryUrl: https://marketplace.visualstudio.com
extensionFile: ${{ steps.publishToOpenVSX.outputs.vsixPath }}

publish-neovim-extension:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
environment: production
env:
CURSORLESS_REPO_ROOT: ${{ github.workspace }}
STAGING_DIRECTORY: ${{ github.workspace }}/cursorless.nvim-staging
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm --color install
- run: pnpm --color compile
- run: pnpm --color --filter '!cursorless-org' --filter '!cursorless-org-*' build
env:
CURSORLESS_DEPLOY: true
- uses: actions/checkout@v4
with:
token: ${{ secrets.CURSORLESS_BOT_TOKEN }}
repository: hands-free-vim/cursorless.nvim
path: ${{ env.STAGING_DIRECTORY }}
- name: Configure GPG Key
working-directory: ${{ env.STAGING_DIRECTORY }}
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
env:
GPG_SIGNING_KEY: ${{ secrets.CURSORLESS_BOT_GPG_SIGNING_KEY }}
- name: git config
working-directory: ${{ env.STAGING_DIRECTORY }}
run: |
git config user.name cursorless-bot
git config user.email [email protected]
git config user.signingkey A9387720AFC62221
git config commit.gpgsign true
- name: Push compiled files to cursorless.nvim plugin repo
run: bash -x scripts/deploy-cursorless-nvim.sh ${{ env.STAGING_DIRECTORY }}

push-cursorless-talon:
name: Push cursorless-talon subrepo
runs-on: ubuntu-latest
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ on:
types: [opened, synchronize, reopened]
merge_group:
branches: [main]
workflow_dispatch:

jobs:
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
env:
CURSORLESS_REPO_ROOT: ${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: corepack enable
Expand All @@ -24,6 +27,8 @@ jobs:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm --color install
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
- uses: leafo/gh-actions-lua@v9
- uses: leafo/gh-actions-luarocks@v4
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()
41 changes: 34 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
types: [opened, synchronize, reopened]
merge_group:
branches: [main]
workflow_dispatch:

jobs:
test:
Expand All @@ -16,24 +17,27 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
vscode_version: [stable]
app_version: [stable]
include:
- os: ubuntu-latest
vscode_version: legacy
app_version: legacy
runs-on: ${{ matrix.os }}
env:
VSCODE_VERSION: ${{ matrix.vscode_version }}
APP_VERSION: ${{ matrix.app_version }}
NEOVIM_VERSION: ${{ matrix.app_version == 'stable' && 'stable' || 'v0.10.0' }}
VSCODE_CRASH_DIR: ${{ github.workspace }}/artifacts/dumps
VSCODE_LOGS_DIR: ${{ github.workspace }}/artifacts/logs
CURSORLESS_REPO_ROOT: ${{ github.workspace }}
TEMP_DIR: ${{ github.workspace }}/temp
NODE_OPTIONS: "--max-old-space-size=4096"
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- run: mkdir -p "${{ env.VSCODE_CRASH_DIR }}" "${{ env.VSCODE_LOGS_DIR }}"
- run: mkdir -p "${{ env.VSCODE_CRASH_DIR }}" "${{ env.VSCODE_LOGS_DIR }}" "${{ env.TEMP_DIR }}"
shell: bash
- run: pnpm --color install
- run: pnpm --color compile
Expand All @@ -42,9 +46,32 @@ jobs:
if: runner.os == 'Linux'
- run: pnpm --color test
if: runner.os != 'Linux'
- run: xvfb-run -a pnpm -F @cursorless/test-harness test:talonJs
if: runner.os == 'Linux' && matrix.vscode_version == 'stable'
- run: pnpm -F @cursorless/test-harness test:talonJs
if: runner.os != 'Linux' && matrix.vscode_version == 'stable'
- run: xvfb-run -a pnpm -F @cursorless/cursorless-everywhere-talon-e2e test:quickjs
if: runner.os == 'Linux' && matrix.vscode_version == 'stable'
- run: pnpm -F @cursorless/cursorless-everywhere-talon-e2e test:quickjs
if: runner.os != 'Linux' && matrix.vscode_version == 'stable'
- run: bash -x scripts/install-neovim-dependencies.sh
- uses: rhysd/action-setup-vim@v1
id: vim
with:
version: ${{ env.NEOVIM_VERSION }}
neovim: true
- name: Run neovim tests
run: xvfb-run -a pnpm -F @cursorless/test-harness test:neovim
if: runner.os == 'Linux'
env:
NEOVIM_PATH: ${{ steps.vim.outputs.executable }}
- uses: ./.github/actions/test-neovim-lua/
if: runner.os == 'Linux' && matrix.app_version == 'stable'
- uses: ./.github/actions/lint-lua-ls/
if: runner.os == 'Linux' && matrix.app_version == 'stable'
- name: Create vscode dist that can be installed locally
run: pnpm -F @cursorless/cursorless-vscode populate-dist --local-install
if: runner.os == 'Linux' && matrix.vscode_version == 'stable'
if: runner.os == 'Linux' && matrix.app_version == 'stable'
- name: Test create vsix
id: createVsix
uses: HaaLeo/publish-vscode-extension@v1
Expand All @@ -53,10 +80,10 @@ jobs:
packagePath: packages/cursorless-vscode/dist
dryRun: true
- run: mv ${{ steps.createVsix.outputs.vsixPath }} cursorless-development.vsix
if: runner.os == 'Linux' && matrix.vscode_version == 'stable'
if: runner.os == 'Linux' && matrix.app_version == 'stable'
- name: Upload vsix
uses: actions/upload-artifact@v4
if: runner.os == 'Linux' && matrix.vscode_version == 'stable'
if: runner.os == 'Linux' && matrix.app_version == 'stable'
with:
name: vsix
path: cursorless-development.vsix
Expand Down
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
out
dist
testOut
node_modules
.vscode-test/
*.vsix
/package-lock.json
*.DS_Store
.DS_Store
meta.json
.luacheckcache

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

Expand Down Expand Up @@ -42,3 +45,10 @@ next-env.d.ts

# test subset config
packages/test-harness/testSubsetGrep.properties

# cursorless-neovim
cursorless.nvim/node/cursorless-neovim
cursorless.nvim/node/test-harness

# nix
.direnv/
8 changes: 8 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
std = luajit
cache = true
codes = true
ignore = { "432" }

globals = {
"vim",
}
6 changes: 6 additions & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"runtime.version": "Lua 5.1",
"diagnostics.ignoredFiles": "Disable",
"diagnostics.globals": ["vim", "talon", "it", "describe"],
"workspace.ignoreDir": ["data/playground/lua/", ".luarocks", ".lua"]
}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.12.1
v20.18.0
Loading

0 comments on commit d2f5c5d

Please sign in to comment.