Skip to content

csv-parser library updates #576

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 3 commits into from
Jan 24, 2025
Merged

csv-parser library updates #576

merged 3 commits into from
Jan 24, 2025

Conversation

jpolitz
Copy link
Member

@jpolitz jpolitz commented Jan 22, 2025

No description provided.

If we have a sendRpc target (like VScode) we can try to fill in the fs library
to some extent.

We won't be able to get full coverage because we can't do synchronous RPCs (so
e.g. filelib won't work transparently)

But we can do a lot of it, and we can probably update the pyret-lang files to
use a reasonable subset that we can polyfill with RPCs to embedding contexts
that do have a filesystem
@jpolitz
Copy link
Member Author

jpolitz commented Jan 22, 2025

This is the idea of this + brownplt/pyret-lang#1769

image

var fsWrapper = {
fs: {
readFile: async function(path, opts, callback) {
debugger;
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove

@@ -337,7 +337,7 @@ libpyret:

$(BUNDLED_DEPS): src/scripts/npm-dependencies.js
# Explicitly exclude crypto, buffer, and stylus, nested npm dependencies that aren't needed
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix comment

if(!window.MESSAGES.sendRpc) { throw new Error("Cannot readFile on the web"); }
else {
try {
const result = await window.MESSAGES.sendRpc('fs', 'readFileSync', [path]);
Copy link
Member Author

Choose a reason for hiding this comment

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

Should also do stuff with opts here to get back the utf8 string

@jpolitz jpolitz merged commit 3bd63e9 into horizon Jan 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant