Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

full eslint #625

Merged
merged 7 commits into from
Feb 27, 2024
Merged

full eslint #625

merged 7 commits into from
Feb 27, 2024

Conversation

tharvik
Copy link
Collaborator

@tharvik tharvik commented Feb 12, 2024

found out that eslint was not working on much files (ie, only on javascript files that we don't have anymore).

  • commonize the eslint configuration to process all typescript files around
  • fix a bunch of lint issues
  • also making discojs-core platform independant, by using isomorphic-* libs and ES standards

@tharvik tharvik added bug Something isn't working discojs Related to Disco.js labels Feb 12, 2024
@tharvik tharvik self-assigned this Feb 12, 2024
@tharvik tharvik mentioned this pull request Feb 12, 2024
@tharvik tharvik force-pushed the add-workspaces branch 4 times, most recently from d5ae78c to c42de2d Compare February 13, 2024 14:54
@tharvik tharvik changed the title Better split node & web full eslint Feb 13, 2024
@tharvik tharvik force-pushed the add-workspaces branch 2 times, most recently from 6d9d521 to 7f7eb3b Compare February 14, 2024 10:11
Base automatically changed from add-workspaces to develop February 14, 2024 10:22
@tharvik tharvik force-pushed the better-split-node-web branch 4 times, most recently from 58d6e8f to c40c62d Compare February 16, 2024 15:18
@tharvik tharvik marked this pull request as ready for review February 16, 2024 16:02
Copy link
Collaborator

@JulienVig JulienVig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

It seems node-webrtc doesn't support Apple Silicon, indeed on M2 running npm ci raises this error:

npm ERR! code 1
npm ERR! path /Users/vignoud/Disco/review_repo/node_modules/wrtc
npm ERR! command failed
npm ERR! command sh -c -- node scripts/download-prebuilt.js
npm ERR! response status 404 Not Found on https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | darwin | arm64
npm ERR! node-pre-gyp info check checked for "/Users/vignoud/Disco/review_repo/node_modules/wrtc/build/Release/wrtc.node" (not found)
npm ERR! node-pre-gyp http GET https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install error
npm ERR! node-pre-gyp ERR! stack Error: response status 404 Not Found on https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz
npm ERR! node-pre-gyp ERR! stack     at /Users/vignoud/Disco/review_repo/node_modules/@mapbox/node-pre-gyp/lib/install.js:67:15
npm ERR! node-pre-gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR! node-pre-gyp ERR! System Darwin 23.3.0
npm ERR! node-pre-gyp ERR! command "/Users/vignoud/.nvm/versions/node/v16.20.2/bin/node" "/Users/vignoud/Disco/review_repo/node_modules/.bin/node-pre-gyp" "install"
npm ERR! node-pre-gyp ERR! cwd /Users/vignoud/Disco/review_repo/node_modules/wrtc
npm ERR! node-pre-gyp ERR! node -v v16.20.2
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.11
npm ERR! node-pre-gyp ERR! not ok

I found a few open issues with a similar installation error:

None of the fixes I tried worked on M2. I didn't try this one.

FYI issue #698 mentions using @koush/wrtc instead, which I see you removed from the dependencies. I tried npm i @koush/wrtc anyway but still doesn't work so I don't know what changed compared to when it used to work on my M2.

@tharvik
Copy link
Collaborator Author

tharvik commented Feb 19, 2024

It seems node-webrtc doesn't support Apple Silicon
[...]
FYI issue #698 mentions using @koush/wrtc instead, which I see you removed from the dependencies. I tried npm i @koush/wrtc anyway but still doesn't work so I don't know what changed compared to when it used to work on my M2.

ho it remaines me that we add that, I though it was an issue of early userspace M2 support and that was fixed in the meantime. looks like it wasn't.

wrtc is an abandonned project, a bunch of people are actually building it by themself, publishing binaries around but there isn't a concerted effort. it'll be nice to actually get rid of it a some point and use node-datachannel that seems more modern. tracking in #633.
for quick fixes, @koush/wrtc was last released 2y ago, I'm more in favor of using @roamhq/wrtc that got released some months ago (and is the only one that updated its readme expliciting support for node-18) we are still at node-16, I mixed my PRs oupsi

@tharvik
Copy link
Collaborator Author

tharvik commented Feb 19, 2024

@JulienVig as I don't have a M2 around, can you try out the latest commit plz? :)

JulienVig
JulienVig previously approved these changes Feb 22, 2024
Copy link
Collaborator

@JulienVig JulienVig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, the code is much cleaner!

I saw you created a new module isomorphic-wrtc, could you maybe add a few lines of explanation in the doc about what's the purpose of this module? For example as a README.md in the isomorphic-wrtc or in the Structure section of DEV.md

@JulienVig JulienVig dismissed their stale review February 22, 2024 12:20

Unnoticed error

@JulienVig JulienVig self-requested a review February 22, 2024 12:21
Copy link
Collaborator

@JulienVig JulienVig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm -ws run build fails because the isomorphic-wrtc doesn't have a build script:

Lifecycle script build failed with error:
npm ERR! Error: Missing script: "build"

@tharvik
Copy link
Collaborator Author

tharvik commented Feb 26, 2024

I saw you created a new module isomorphic-wrtc, could you maybe add a few lines of explanation in the doc about what's the purpose of this module?

indeed, it's a bit cryptic when you first come to the project. added some infos in isomorphic-wrtc/README.md

npm -ws run build fails because the isomorphic-wrtc doesn't have a build script:

ho right, I didn't check the return code when doing that. added empty scripts for build/lint/test

Copy link
Collaborator

@JulienVig JulienVig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@tharvik tharvik merged commit 675c9f9 into develop Feb 27, 2024
20 checks passed
@tharvik tharvik deleted the better-split-node-web branch February 27, 2024 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discojs Related to Disco.js
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants