You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.
We need to document & improve how to work locally, using npm link.
For example, right now when I work on the coopcycle-bot project , here is what I do:
cd /path/to/coopcycle-js
npm link
cd /path/to/coopcycle-bot
npm link coopcycle-js
This creates a symbolic link in node_modules for the coopcycle-js project.
I still need to run npm run build inside the coopcycle-js folder to reflect the changes.
The text was updated successfully, but these errors were encountered:
npm run link is a slow process for just symlinking stuff, actually a linux like
ln -sf is faster and works like a charm normally, when your dependencies in both repos have similar versioning.
quick solution is to add in coopcycle-bot a dev command "npm run dev" that should look like this:
"scripts": {
"dev-symlink": "cd node_modules && ln -sf ../../coopcycle-js .",
"dev-watch-coopcycle-js": "cd ../coopcycle-js && npm run dev",
"dev-pm2": "./node_modules/.bin/pm2 start pm2.config.js",
"dev": "npm run dev-symlink && npm run dev-watch-coopcycle-js && npm run dev-pm2",
"watch": "webpack-dev-server --content-base=web/"
}
and in pm2 config, add a watch on the coopcycle-js build
(by adding like "nodemon": "^1.11.0" in devDependencies)
and things should be synchronized.
BUT the process and the sync is very slow like this! You trigger a complete webpack build, that is a bit overkill, because you may only want actually the last updates on the Client class definition only defined in client.js, if I am not wrong (this is the only part used by the coopcylcle-bot)?
BEST PRACTICE should be to extract from coopcycle-js the code that you need for both repos, that looks like utils, and create therefore a small lib with the Client Class definition, shared with symlinks like this for both coopcyle-bot and coopcycle-js repo.
We need to document & improve how to work locally, using
npm link
.For example, right now when I work on the coopcycle-bot project , here is what I do:
This creates a symbolic link in
node_modules
for thecoopcycle-js
project.I still need to run
npm run build
inside thecoopcycle-js
folder to reflect the changes.The text was updated successfully, but these errors were encountered: