Closed adrianmcli closed 6 years ago
@DiscRiskandBisque I've added a windows script for linking contracts: https://github.com/truffle-box/react-box/pull/65/files#diff-52dbbf94d5c54b68c0cad0702ba94a96R19
"script": {
"link-contracts": "run-script-os",
"link-contracts:linux:darwin": "cd src && ln -s ../../build/contracts contracts",
"link-contracts:win32": "cd src && mklink \\D C:\\..\\build\\contracts contracts"
}
The run-script-os
devDependency will run the right script depending on the machine's OS.
This PR is now ready to be merged.
@DiscRiskandBisque
I'm using the following script for making a symlink on Windows, I grabbed it from your edit to my tutorial:
mklink \D C:\..\build\contracts contracts
But shouldn't it be a relative symlink instead? Something like:
mklink \D ..\..\build\contracts contracts
For reference, the linux version is:
ln -s ../../build/contracts contracts
This PR seeks to overhaul the Truffle box in many ways, read on to find out more.
Done
The following items have already been implemented in this PR.
Frontend client
/client
.v1.0-beta.35
(note: currently, only for the React app).getContractInstance.js
to replacetruffle-contract
dependency (this can change).link-contracts
npm script to create a symlink in thesrc
folderTruffle project
truffle-box.json
to use new scripts when unboxing.^0.4.24
.How to test (i.e. try it out)
Checkout the branch:
Run
truffle develop
and then run tests, compile, and migrate:In a new terminal, navigate to the
client
folder, install dependencies, and run the link contracts script:Start the frontend client with
npm start
.Make sure you are using a browser where MetaMask is disabled (we will add support for this later, see above) and navigate to
http://locahost:3000
in your browser.Observe that the stored value is 5.