Repository navigation
fix: react-app and node build #449
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
Merged
Merged
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
96c065d
feat: improve docs homepage design
Prachi-Gupta2808 9798036
Update docs/src/pages/index.jsx
Prachi-Gupta2808 c0227fb
Address review feedback
Prachi-Gupta2808 7a0bb18
fix: add Node.js support via worker_threads
Prachi-Gupta2808 487092e
Merge branch 'dev' into fix/node-js-support
Ryan-Millard 1033f47
feat(console-js): add Node.js example app with sharp image loading
Prachi-Gupta2808 42cbf20
Merge branch 'fix/node-js-support' of https://github.com/Prachi-Gupta…
Prachi-Gupta2808 c84b8d1
Merge branch 'dev' into fix/node-js-support
Prachi-Gupta2808 ec6e076
fix(wasmClient): use worker_threads event emitter style for Node.js
Prachi-Gupta2808 099e92c
resolve node build panic
Krasner e9933b0
webgpu support fix for node.js
Krasner ca3d7a5
fix
Krasner 8165522
chore: revert unrelated files to same state as on dev branch
Ryan-Millard 93576f2
fix(packages/js): move webgpu to be a true dependency
Ryan-Millard 2da714c
fix(packages/js): revert webgpu to optional peerDependency
Prachi-Gupta2808 d4e284f
Merge branch 'dev' into fix/node-js-support
Ryan-Millard 54ccf79
refactor(packages/js): build using Vite for browser and Node
Ryan-Millard 4ceed9c
temp
Ryan-Millard b406a34
bring up-to date with dev
Krasner 8330c5f
fix build process
Krasner 1333dc9
remove images from example apps
Krasner 7292e50
update lockfile
Krasner 0e6bf05
formatting
Krasner 85b5e25
update ci build
Krasner 0f3ed46
update Justfile
Krasner 16ee02b
update docusaurus config
Krasner 4a74983
fix gpu deallocation
Krasner c1fb14d
install all pnpm packages
Krasner 469d272
chore(packages/js): remove unused import
Ryan-Millard 1e1e4d7
chore(packages/js): format files
Ryan-Millard 803ab7a
Merge branch 'dev' into dev/node-js
Ryan-Millard 4ec4588
ci(.github/workflows/build-react-app.yml): build js package for brows…
Ryan-Millard e77f478
chore: apply coderabbit's suggestions and cleanup
Ryan-Millard de36169
Merge branch 'dev/node-js' of https://github.com/Krasner/Img2Num into…
Ryan-Millard 5f0e62e
add newline
Krasner 5a64c1a
remove output.svg
Krasner 4ad6e54
Merge branch 'dev' into dev/node-js
Ryan-Millard 9d5fe79
chore(Justfile): add final newline
Ryan-Millard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import { writeFileSync } from "fs"; | ||
| import { imageToSvg } from "img2num"; | ||
| import sharp from "sharp"; | ||
|
|
||
| const imagePath = process.argv[2]; | ||
|
|
||
| if (!imagePath) { | ||
| console.error("Usage: node index.js <image-path>"); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| console.log(`Processing image: ${imagePath}`); | ||
|
|
||
| const { data, info } = await sharp(imagePath).ensureAlpha().raw().toBuffer({ resolveWithObject: true }); | ||
|
|
||
| const pixels = new Uint8ClampedArray(data.buffer); | ||
|
Ryan-Millard marked this conversation as resolved.
Resolved
|
||
| const { width, height } = info; | ||
|
|
||
| console.log(`Image size: ${width}x${height}`); | ||
| console.log("Running img2num in Node.js..."); | ||
|
|
||
| const { svg } = await imageToSvg({ pixels, width, height }); | ||
|
|
||
| writeFileSync("output.svg", svg); | ||
| console.log("Done! SVG saved to output.svg"); | ||
| process.exit(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "name": "console-js", | ||
| "version": "1.0.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "start": "node index.js" | ||
| }, | ||
| "dependencies": { | ||
| "img2num": "workspace:*", | ||
| "sharp": "^0.33.0" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.