diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 800b6043..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,27 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', - parserOptions: { - project: 'tsconfig.json', - sourceType: 'module', - }, - plugins: ['@typescript-eslint/eslint-plugin'], - extends: [ - 'airbnb-base', - 'airbnb-typescript/base', - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - 'prettier', - ], - root: true, - env: { - node: true, - jest: true, - }, - rules: { - '@typescript-eslint/no-explicit-any': 'off', - 'max-len': 'off', - 'import/prefer-default-export': 'off', - 'no-console': 'off', - 'class-methods-use-this': 'off', - }, -}; diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2534a947..b6cf6a98 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,22 +13,10 @@ jobs: name: Vim strategy: matrix: - # os: [macos-latest, ubuntu-20.04, windows-latest] - os: [macos-latest, ubuntu-20.04] + os: [ubuntu-latest] vim-version: [v7.4.2119, v8.2.5172] - include: - - node-version: 16 - - os: macos-latest - target: macos - - os: ubuntu-20.04 - target: linux - # - os: windows-latest - # target: win runs-on: ${{ matrix.os }} steps: - - name: Install FUSE for linux - if: matrix.target == 'linux' - run: sudo apt-get install libfuse2 - name: Checkout kkoomen/vim-doge uses: actions/checkout@v2 with: @@ -38,17 +26,8 @@ jobs: with: repository: junegunn/vader.vim path: vader.vim - - name: Setup nodejs - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci --no-save --verbose - - name: Build Unix binary - if: matrix.target != 'win' - run: npm run build:binary:unix - - name: Build Windows binary - if: matrix.target == 'win' - run: npm run build:binary:windows + - run: rustup update stable && rustup default stable + - run: ./scripts/build.sh - name: Setup vim uses: thinca/action-setup-vim@v1 id: vim @@ -59,51 +38,51 @@ jobs: run: ./scripts/run-vader-tests.sh "${{ steps.vim.outputs.executable }}" shell: bash - tests_neovim: - name: NeoVim - strategy: - matrix: - os: [macos-latest, ubuntu-20.04] - vim-version: [v0.3.2, head] - include: - - node-version: 16 - - os: macos-latest - target: macos - - os: ubuntu-20.04 - target: linux - runs-on: ${{ matrix.os }} - steps: - - name: Checkout kkoomen/vim-doge - uses: actions/checkout@v2 - with: - submodules: true - - name: Checkout junegunn/vader.vim - uses: actions/checkout@v2 - with: - repository: junegunn/vader.vim - path: vader.vim - - name: Setup nodejs - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci --no-save --verbose - - name: Build binary - run: npm run build:binary:unix - - name: Setup neovim - uses: thinca/action-setup-vim@v1 - id: vim - with: - vim_version: ${{ matrix.vim-version }} - vim_type: neovim - - name: Run tests - run: ./scripts/run-vader-tests.sh "${{ steps.vim.outputs.executable }}" - shell: bash + # tests_neovim: + # name: NeoVim + # strategy: + # matrix: + # os: [ubuntu-latest] + # vim-version: [v0.3.2, head] + # include: + # - node-version: 16 + # - os: macos-latest + # target: macos + # - os: ubuntu-20.04 + # target: linux + # runs-on: ${{ matrix.os }} + # steps: + # - name: Checkout kkoomen/vim-doge + # uses: actions/checkout@v2 + # with: + # submodules: true + # - name: Checkout junegunn/vader.vim + # uses: actions/checkout@v2 + # with: + # repository: junegunn/vader.vim + # path: vader.vim + # - name: Setup nodejs + # uses: actions/setup-node@v1 + # with: + # node-version: ${{ matrix.node-version }} + # - run: npm ci --no-save --verbose + # - name: Build binary + # run: npm run build:binary:unix + # - name: Setup neovim + # uses: thinca/action-setup-vim@v1 + # id: vim + # with: + # vim_version: ${{ matrix.vim-version }} + # vim_type: neovim + # - name: Run tests + # run: ./scripts/run-vader-tests.sh "${{ steps.vim.outputs.executable }}" + # shell: bash - vint: - name: Linter - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 - - run: pip install vim-vint - - run: vint -s ./autoload ./plugin + # vint: + # name: Linter + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v2 + # - uses: actions/setup-python@v1 + # - run: pip install vim-vint + # - run: vint -s ./autoload ./plugin diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 5e2863a1..00000000 --- a/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "printWidth": 100, - "singleQuote": true, - "trailingComma": "all" -} diff --git a/.release-it.json b/.release-it.json deleted file mode 100644 index 3b5c10bb..00000000 --- a/.release-it.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "hooks": { - "before:init": ["npm run format", "npm run lint"], - "after:bump": [ - "git checkout -b release/v${version} && echo v${version} > .version && git add .version" - ], - "after:git:release": ["gh pr create --title 'Release v${version}' --body ''"] - }, - "git": { - "push": true, - "commitMessage": "chore(release): v${version} :tada:", - "tagAnnotation": "Release v${version}", - "tagName": "v${version}" - }, - "npm": { - "publish": false - }, - "github": { - "release": false, - "releaseName": "Release v${version}" - }, - "plugins": { - "@release-it/conventional-changelog": { - "preset": "conventionalcommits", - "infile": "CHANGELOG.md" - } - } -} diff --git a/.version b/.version deleted file mode 100644 index 0bf0fe3b..00000000 --- a/.version +++ /dev/null @@ -1 +0,0 @@ -v3.22.0 diff --git a/scripts/build.sh b/scripts/build.sh index a6f13522..09cb21f5 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -5,9 +5,6 @@ set -e set -u -echo "System info:" -uname -a - ROOT_DIR=$(cd "$(dirname "$0")/.."; pwd -P) OUTFILE="${1:-}" @@ -16,7 +13,10 @@ cd $ROOT_DIR [[ -e ./bin/vim-doge ]] && rm -f ./bin/vim-doge # Build the binary. -npx caxa --input "$ROOT_DIR/build" --output "./bin/vim-doge" -- "{{caxa}}/node_modules/.bin/node" "{{caxa}}/index.js" +cd $ROOT_DIR/helper +cargo build --release +cp target/release/vim-doge-helper $ROOT_DIR/bin/ +cd $ROOT_DIR # Archive the binary. if [[ "$OUTFILE" != "" ]]; then @@ -24,7 +24,7 @@ if [[ "$OUTFILE" != "" ]]; then cd $ROOT_DIR/bin rm -f ./*.tar.gz echo "==> Archiving $ROOT_DIR/bin/vim-doge -> $ROOT_DIR/bin/$OUTFILE" - tar -czf "$OUTFILE" vim-doge + tar -czf "$OUTFILE" vim-doge-helper fi -echo "🎉 Done building vim-doge binaries" +echo "🎉 Done building vim-doge-helper" diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 5019264e..c0c8c81d 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -15,18 +15,6 @@ if (Test-Path $outFile) { rm "$outFile" } -try { - Invoke-WebRequest -uri $downloadUrl -OutFile ( New-Item -Path "$assetPath" -Force ) - Expand-Archive -LiteralPath "$assetPath" -DestinationPath "$rootDir\bin" - rm "$assetPath" -} catch { - echo "No release found for vim-doge for Windows." - echo "This is due to a bug in node-gyp which doesn't allow vim-doge to be build for Windows." - echo "" - echo "Currently, the latest stable release for Windows is v3.11.0." - echo "" - echo "HOW TO INSTALL v3.11.0:" - echo "- Download the latest release from: https://github.com/kkoomen/vim-doge/releases/download/v3.11.0/vim-doge-win64.zip" - echo "- Unzip the vim-doge-win64.zip" - echo "- Put the vim-doge binary inside ~/path/to/vim-doge/bin/ (e.g. vim-plug would be: ~/.vim/plugged/vim-doge/bin/)" -} +Invoke-WebRequest -uri $downloadUrl -OutFile ( New-Item -Path "$assetPath" -Force ) +Expand-Archive -LiteralPath "$assetPath" -DestinationPath "$rootDir\bin" +rm "$assetPath" diff --git a/scripts/install.sh b/scripts/install.sh index b4bf167b..c669e647 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -14,8 +14,8 @@ else exit 127 fi -if [ -e ./bin/vim-doge ]; then - rm -f ./bin/vim-doge +if [ -e ./bin/vim-doge-helper ]; then + rm -f ./bin/vim-doge-helper fi @@ -24,14 +24,14 @@ cd "$ROOT_DIR" [ ! -d ./bin ] && mkdir ./bin OS="$(uname)" -OUTFILE="$ROOT_DIR/bin/vim-doge" -PKG_VERSION=$(cat "$ROOT_DIR/.version") -RELEASE_URL="https://github.com/kkoomen/vim-doge/releases/download/$PKG_VERSION" +OUTFILE="$ROOT_DIR/bin/vim-doge-helper" +APP_VERSION=$(cat helper/Cargo.toml | grep version | head -n 1 | sed -E 's/version = "([0-9]+.[0-9]+.[0-9]+)"/\1/') +RELEASE_URL="https://github.com/kkoomen/vim-doge/releases/download/$APP_VERSION" if [ $OS = 'Darwin' ]; then - TARGET="vim-doge-macos" + TARGET="vim-doge-helper-macos" elif [ $OS = 'Linux' ]; then - TARGET="vim-doge-linux" + TARGET="vim-doge-helper-linux" else echo "vim-doge does not support your system" exit 1 @@ -44,6 +44,6 @@ curl -L --progress-bar \ --fail \ --output "$FILENAME" \ "$DOWNLOAD_URL" -tar xzf "$FILENAME" && mv "vim-doge" "$OUTFILE" +tar xzf "$FILENAME" && mv "vim-doge-helper" "$OUTFILE" rm -f "$FILENAME" chmod +x "$OUTFILE"