-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[feat] Continuation of node fs polyfill with directory support #4087
Conversation
Seems I've been caught out by the move to 'use strict' and a stale version of the VS Code plugin. I'll work through the issues raised. |
@ry Any idea why the windows CI is failing with access denied issues for my new tests (using Example failing output:
Failing test for above output, failing on
These failures occur for both reading the current directory, e.g. Also, as an aside, neither my VS Code nor tools/lint.py picked up on the new strict typescript rules. Running the cargo tests was the only way to discover these issues. Any ideas on how to get the new stricter rules showing in VS Code? |
Not sure...
I'm not sure but I think VS Code / ESLint probably sniff for tsconfig.json and assumes non-strict when it doesn't find it. Maybe @kitsonk can give more clues. |
OK, no worries, I'll dig around deeper and also take latest master as I'm seeing other reports of CI failures on Windows, maybe related. |
It would be up to whatever plugin to determine what to configure the language service yet. If it is @axetroy plugin, then I don't know if he has defaulted to strict mode now under Deno. |
Yes, if you enable the private readonly DEFAULT_OPTIONS: ts_module.CompilerOptions = {
allowJs: true,
checkJs: false,
strict: true,
esModuleInterop: true,
jsx: this.typescript.JsxEmit.React,
module: this.typescript.ModuleKind.ESNext,
moduleResolution: this.typescript.ModuleResolutionKind.NodeJs,
outDir: "$deno$",
resolveJsonModule: true,
sourceMap: true,
stripComments: true,
target: this.typescript.ScriptTarget.ESNext,
noEmit: true,
noEmitHelpers: true
}; |
Thanks both. I'm using the axetroy plugin, so will see if I can reproduce the missing strict behaviour I was seeing earlier and raise an issue if found. |
hi again, this one seems missing in your implementation : |
Ah, nice spot, thanks. It was actually there, but under a different name while I was testing something. Now renamed as it should. |
Well, that was a touch harder than I anticipated, but every day is a learning day :) Now ready for review. |
@ry - This is now ready for review. |
@ry - ready for review again. In the general, should I tag you (and/or others?) on pull requests ready for review? There's absolutely no rush with this one, but I'm unclear what the best process is once a PR is ready for review. Let me know what's best. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - just one comment...
(And yes, tagging me is a good way to get a review - sorry for the delay)
@ry link added and now ready for review again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* denoland/master: (22 commits) fix event target tests Support async function and EventListenerObject as listeners (denoland#4240) Allow BadResource errors to take a custom message (denoland#4251) Document TypeScript compiler options (denoland#4241) refactor: preliminary cleanup of Deno.runTests() (denoland#4237) refactor: cleanup compiler runtimes (denoland#4230) Use discord instead of gitter (denoland#4253) Remove unnecessary macro from cli/ops/tty.rs (denoland#4254) Remove Deno.errors.Other (denoland#4249) refactor: rewrite testPerm into unitTest (denoland#4231) Migrate internal bundles to System (denoland#4233) Fix inlining of lib.dom.iterable.d.ts. (denoland#4242) Fix `deno install` file name including extra dot on Windows (denoland#4243) assert build success for test plugin (denoland#4223) Disable flaky and broken tests (denoland#4239) add assertOps sanitizer in cli/js/ unit tests (denoland#4209) misc: reduce unnecesarry output in cli/js tests (denoland#4182) feat(std/node): add directory classes (denoland#4087) Do not convert exceptions to JSON and back (denoland#4214) Don't reset exception handle after calling ErrWithV8Handle::get_handle() (denoland#4214) ...
Continuation of the work for the fs polyfill in support of #3403. Specifically this adds internal implementations of the directory classes used in node and exported by yet to be implemented Deno fs polyfill methods fs.opendir(), fs.opendirSync(), or fsPromises.opendir().