diff --git a/doc/import-cost.txt b/doc/import-cost.txt index 3ea7048..6ef1de5 100644 --- a/doc/import-cost.txt +++ b/doc/import-cost.txt @@ -1,7 +1,7 @@ *import-cost* *import-cost.txt* -Author: Barrett Ruth -Homepage: +Author: Barrett Ruth +Homepage: =============================================================================== INTRODUCTION *import-cost.nvim* @@ -10,7 +10,7 @@ import-cost.nvim displays the costs of javascript imports inside neovim. It works with ES6 and CommonJS modules in any javascript, javascriptreact, typescript, or typescriptreact files. -Author: Barrett Ruth +Author: Barrett Ruth =============================================================================== SETUP *import-cost.setup()* diff --git a/install.ps1 b/install.ps1 deleted file mode 100644 index 7a6cf4f..0000000 --- a/install.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -Param( - [Parameter(Mandatory=$true)] - [ValidateSet('npm','yarn','pnpm', ErrorMessage = 'Must provide node.js package manager')] - [string]$package_manager -) - -git clone 'https://github.com/wix/import-cost.git' -if (-not $?) { - Write-Host 'Failed to clone wix/import-cost' -ForegroundColor Red - exit 1 -} - -cd import-cost -if (-not $?) { exit 1 } -iex "$package_manager install" -cd .. - -cp .\index.js .\import-cost\index.js - diff --git a/lua/import-cost.lua b/lua/import-cost.lua index d1b3515..19d252d 100644 --- a/lua/import-cost.lua +++ b/lua/import-cost.lua @@ -1,11 +1,7 @@ local M = {} local function is_ic_buf(bufnr) - local ok, filetype = pcall(vim.api.nvim_buf_get_option, bufnr, 'filetype') - - if not ok then - return false - end + local filetype = vim.api.nvim_buf_get_option(bufnr, 'filetype') return vim.tbl_contains(M.config.filetypes, filetype) end @@ -27,7 +23,6 @@ M.config = { 'javascriptreact', 'typescript', 'typescriptreact', - 'svelte' }, format = { byte_format = '%.1fb', diff --git a/readme.md b/readme.md index 36108bd..01deb1f 100644 --- a/readme.md +++ b/readme.md @@ -8,8 +8,7 @@ Display the costs of javascript imports inside neovim with the power of ## Installation 1. Install regularly with your neovim package manager - - *NOTE*: pnpm is not supported because [import-cost](https://github.com/wix/import-cost) does not. -3. Run `install.sh` with your node.js package manager to setup import-cost: +2. Run `install.sh` with your node.js package manager to setup import-cost: ```sh sh install.sh '' @@ -21,10 +20,8 @@ may look like the following: ```lua require('lazy').setup { { - 'barrettruth/import-cost.nvim', + 'barrett-ruth/import-cost.nvim', build = 'sh install.sh yarn', - -- if on windows - -- build = 'pwsh install.ps1 yarn', config = true } } @@ -47,7 +44,7 @@ See `:h import-cost` for more information thus, unavoidable) 2. Long wait times - once again, the npm module may take quite a while before fully parsing packages -3. [pnpm problems](https://github.com/barrettruth/import-cost.nvim/issues/5) +3. [pnpm problems](https://github.com/barrett-ruth/import-cost.nvim/issues/5) ## Acknowledgements