Are there any instructions on forking the repo? I have forked the repo but am unable to get Handsontable running locally.
Forking the Handsontable Repo
Here we have the guide on how to build Handsontable locally: https://handsontable.com/docs/react-data-grid/custom-builds/
Thank you @adrian.szymanski . After I follow the instructions provided, I’m not able to import the locally running module. My package.json is below:
"dependencies": { "handsontable": "../handsontable", },
This should allow me to import the locally built handsontable as follows:
import Handsontable from 'handsontable';
I’m getting the following error:
Failed to resolve import "handsontable" from "utils/handsontable/index.ts". Does the file exist?
Do you actually need to run the npm deploy process in order to import the handsontable module?
If Handsontable is being accessed as a dependency then running it through NPM might be necessary.
@adrian.szymanski ,
How do members of the Handsontable team code locally? Are you using npm link to create a symlink to the local repo?
I found a solution. The key was using npm pack. The instructions are below, courtesy of chat-gpt/me:
1. Fork and Clone Handsontable
If you haven’t already, fork the Handsontable repository and clone it:
git clone https://github.com/YOUR_GITHUB_USERNAME/handsontable.git
cd handsontable
2. Install Dependencies
npm install
3. Build the Package
npm run build
4. Change the directory to the tmp directory and Create a Tarball Using npm pack
cd handsontable/tmp
npm pack
This will generate a .tgz file in the current directory, named something like:
handsontable-<version>.tgz
For example, if the version is 13.0.0, it will generate:
handsontable-13.0.0.tgz
5. Move the Tarball to Your Project
mv handsontable-13.0.0.tgz /path/to/your/project
6. Install the Tarball in Your Project
npm install ./handsontable-13.0.0.tgz
This will install the packed version of Handsontable as a dependency.
7. Import and Use Handsontable
Now, you can import Handsontable as usual:
import Handsontable from 'handsontable';
import 'handsontable/dist/handsontable.full.css';
8. Verify the Installation
To confirm that Handsontable is installed correctly, check package.json:
"dependencies": {
"handsontable": "file:./handsontable-13.0.0.tgz"
}
You can also check node_modules/handsontable to see if it’s there.
9. Updating Handsontable
If you make changes to your local Handsontable fork and want to update your project:
Rebuild the package:
npm run build
npm pack
Move the new .tgz file to your project.
Reinstall it:
npm install ./handsontable-13.0.0.tgz
I’m glad that you have a solution and shard it with other users. Thank you. I will close this topic now, but please, open a new one if you have any other questions.