Comments (8)
Yes, restarted from scratch many times ...
Anyway, the rebootDevice merge solved the immediate problem so running from a local xkeys repo is not so pressing. I'll keep trying occasionally when I have time - it would be nice to know what's not right about my setup.
BTW with updated developer instructions in the README, I think it's still good to run yarn
by itself before running yarn lerna exec yarn link
since that will fail if lerna is not installed already - probably a common situation for non-yarn/monorepo users.
from xkeys.
Try running yarn build
from the root of of the repo, did that work? (I should probably add that to the Readme)
from xkeys.
Thanks, yarn build
works just fine.
On the other hand, npm link
& yarn link
, which you suggested elsewhere, aren't working as expected. One aspect of that is (maybe) that package.json has "name": "xkeys-monorepo" which could be confusing things. Also, probably not so important, "version": "2.0.0"
from xkeys.
It gets a little bit complicated due to this being a mono repo, I suppose.
To set up the link for the node library of xkeys you have to
cd packages/node
yarn link
And in your test project
yarn link xkeys
Also remember to run yarn build
every time you've made changes in the xkeys repo, before you try them out in your test project.
from xkeys.
After the yarn link xkeys
I see that test app's node_modules now has the link. However the test app's node_modules also has @xkeys-lib which is not linked. When I run the test app, it starts with Error notification saying
Uncaught Exception:
undefined:undefined
and after dismissing the notification the gui is displayed but shows no devices (whereas it normally would). When I close the gui window there's another Error notification, this time saying
Uncaught Exception:
TypeError: Cannot read property 'stop' of undefined
stop() is only used once when exiting the app and is called on the xkeysPanel object returned by the watcher's on.connected event, so looks like xkeysPanel is never properly instantiated, so undefined.
It's not really your problem so feel free to close the issue but if you have any other ideas I'm happy to try them.
from xkeys.
No worries, I'd love to help!
Finally it's monday morning and I'm in front of an actual computer again. My previous attempts to help was from mobile and memory..
Here's my current attempt, which I've now tested locally. Please check it out, if it works ok I'll add it to the README.
First, pull the latest changes from master (I've added a convenience script in there).
To set up the xkeys-library for linking:
# In the xkeys repo:
yarn lerna exec yarn link # This runs "yarn link" in all of the mono-repo packages
yarn build
Set up your local test repo to used the linked xkeys libraries:
# In your test repo (for Node.js version):
yarn link xkeys
yarn link @xkeys-lib/core
# In your test repo (for the web-HID version):
yarn link xkeys-webhid
yarn link @xkeys-lib/core
Every time after you've made any changes to the xkeys-repo:
# In the xkeys repo:
yarn build
After you're done, you've PR:ed your changes, they have beeen merged in and published to a new version, you probably want to unlink and used the published version again:
To unlink the xkeys-lib from your local test repo:
# In your test repo (for Node.js version):
yarn unlink xkeys
yarn unlink @xkeys-lib/core
yarn --force # So that it reinstalls the regular libs
from xkeys.
Nearly there! Before running the first yarn lerna exec yarn link
in xkeys repo, need first to run yarn
to install all the requirements, in particular lerna. Then, following the rest of the instructions sets up all the links.
Now the "interesting" part. When I make a change in xkeys and run yarn build
, I can see the changes in the test app's node_modules/@xkeys-lib/core/dist/xkeys.js & xkeys.d.ts (which, of course, are now following links back to xkeys changed files). When I run the test app and invoke the new rebootDevice(), I still have an error saying the device object has no such function.
However if I do a normal installation of the test app (i.e. without links) and modify node_modules/@xkeys-lib/core/dist/xkeys.js & xkeys.d.ts by hand to be exactly the same as the linked cases, then the new rebootDevice() works as expected.
from xkeys.
Huh, that's a strange problem.
What I usually do when having strange issues like this, is to remove the npm modules folders completely and restart from scratch
from xkeys.
Related Issues (20)
- Support for XKE-64 JogT-bar HOT 2
- Log for XKE-128 HOT 1
- Discussion: Major updates to the library HOT 16
- XK-12 Joystick using wrong bits HOT 8
- XK-8 support HOT 15
- Feature: WebHID HOT 1
- Closing down neatly HOT 4
- Can XKeysWatcher handle existing connections? HOT 2
- Multiple devices HOT 6
- Backlight methods HOT 6
- Any known problems with Raspberry Pi? HOT 2
- XKeys.listAllConnectedPanels is not a function HOT 9
- How to dispose of an xkeysPanel? HOT 10
- call a xkeys function out of the watcher HOT 4
- UnhandledPromiseRejectionWarning when watcher fails to open device HOT 1
- npm packages have a lot of 'junk' files HOT 1
- XK-24 EEPROM retaining code? HOT 2
- yarn build-record-test doesn't work in root of repo
- Intermittent "NotAllowedError: Failed to write the report." on Chrome v115+ HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xkeys.