reset-to-add

v1.0.3arrow_drop_down
v1.0.3
v1.0.2
v1.0.1
v1.0.0
STATUS
None
DOWNLOADS
157
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
6 years ago
SIZE
56 KB
Resets all components in workspace back to "new", as if they were just added. (e.g. "bit.extensions/workspace/[email protected]" --> "workspace/reset-to-add") Clears any old data in bit's data models.
1 contributor
Install reset-to-add as a package?
Copied
npm i @bit/bit.extensions.workspace.reset-to-add
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
chevron_left
chevron_right

reset-to-add

An extension to clear local workspace and re-add the components.

Disclaimer

This extension is for internal use only.
This extension modify bit’s internal files and might corrupt your workspace, Don’t use it unless you are sure you know what you are doing.
This extension uses experimental APIs which might break without any notice.
Make sure to backup your workspace before using this.

About

This extension will do the following:

  • Clear your bit objects
  • Change the bitmap file so each component is without a version, without a scope and marked as not exported

It will actually reset your workspace to the state it was after you run bit init and bit add for all of your components. before the tag and export.

Installation

import the extension anywhere in your machine using

bit import bit.extensions/workspace/reset-to-add

Create a global bit.json file:

nano ~/Library/Caches/Bit/config/bit.json

Add the following to the bit.json:

{
    "extensions": {
        "bit.extensions/workspace/[email protected]": {
            "options": {
                "file": "path to the component index file"
            }
        }
    }
}

Make sure to set the path to the extension file.
To make sure the install worked correctly, just run

bit --help

you should see in the bottom the following:

extensions commands
    reset-to-add   clear local workspace and re-add the components

Usage

This extension will add a new command bit reset-to-add which doesn’t get any args.
All you need to do is run it on the desired workspace.
This extension must run on the workspace root level (where the .bitmap file exists).

Help and resources