Bit: Update/Exclude files after a component is tracked does not work

Created on 31 Jul 2019  路  5Comments  路  Source: teambit/bit

I track a component with bit add command, after that, I want to remove a file from the component and its not working.
I added the component with this command: bit add sum/* -m sum/a.js -i sum
and after I try to exclude a file from the component, so I run bit add sum/* -m sum/a.js -e 'sum/b.js' -i sum and it does not exclude that file from the component.
So I think that after you track a component, you can't update it with the exclude flag.

You can download this tar to easily reproduce the bug.
test1.tar.gz

Steps to Reproduce

  1. Open the tar file.
  2. Run bit add sum/* -m sum/a.js -e 'sum/b.js' -i sum

Specifications

  • Bit version: 14.2.4-dev.1
  • Node version: v12.7.0
areadd typbug

Most helpful comment

Still having this issue, this is lowkey ridiculous because what bit is meant to be and it can't properly exclude files and it's not clear in the documentation which is minimal in this category.
Glob patterns cause the add command to fail and only a literal filename works for exclusion. I'm using storybook and want to not track those files as they're not needed.

All 5 comments

Thanks, we will check it and update.

Is there any update on this issue? I'm experiencing this same issue on 14.7.1

I've narrowed this down to the _mergeFilesWithExistingComponentMapFiles function in add-component.ts. It's merging the existing component files (which may include a newly excluded file) with the new set of files (which doesn't include the newly excluded files) which results in the new exclusion files not being excluded. I will make an attempt at solving this tomorrow, although I've never worked directly with Typescript before.

Still having this issue, this is lowkey ridiculous because what bit is meant to be and it can't properly exclude files and it's not clear in the documentation which is minimal in this category.
Glob patterns cause the add command to fail and only a literal filename works for exclusion. I'm using storybook and want to not track those files as they're not needed.

Seeing the same issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nvthuong1996 picture nvthuong1996  路  13Comments

jimmi-joensson picture jimmi-joensson  路  14Comments

nsams picture nsams  路  12Comments

seed-of-apricot picture seed-of-apricot  路  21Comments

AmitFeldman picture AmitFeldman  路  22Comments