-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump to v1.0.4, add type files, fix type issues
This adds Typescript to devDependencies and a `prepack` script to generate `types/*.d.ts{,map}` files for distribution. It also adds a jsonconfig.json files to ensure Visual Studio Code performs more thorough type checking. Enables strict type checking, but disables null and implicit "any" checks. Fixes several existing issues, noted below. Inspired by VS Code warnings from importing v1.0.3 into mbland/rollup-plugin-handlebars-precompiler. Based on guidance from: - https://code.visualstudio.com/docs/nodejs/working-with-javascript - https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html - https://code.visualstudio.com/docs/languages/jsconfig - https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html - https://www.typescriptlang.org/docs/handbook/modules/introduction.html - https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html Minor issues fixed: - The `@returns` type of `TestPageOpener.create()` was originally `TestPageOpener`, but is now `Promise<TestPageOpener>`. - The `beforeAll()` handler originally returned `Promise<TestPageOpener>`, and now returns nothing. - Added '.js' extension to all internal imports. - Added @ts-nocheck to vite and vitest config files. - Changed `@returns {Promise}` to `@returns {Promise<void>}`. - Expanded the `resetGlobals()` event callback so the `delete` statements and `resolve()` call are on separate lines. - Added `eslint-env browser` and `@type {HTMLScriptElement}` to test/event-ordering-demo/main.js. - Added `@ts-expect-error` comment when overriding `globalThis.window` in JsdomPageOpener. More substantial fixes: - Assigned `const Event = globalThis.window.Event` and changed `window.Event` to just `Event` in JsdomPageOpener. Using the builtin Node.js Event was incompatible with the jsdom Window and Document implementations. - Changed the jsdom and jsdom.JSDOM parameters of the JsdomPageOpener constructor to type "object". I had tried using: ```js /** @typedef {typeof import('jsdom')} jsdom */ ``` Which worked great in VS Code, but broke the jsdoc CLI. I found a couple jsdoc CLI plugins which seemed like they would strip this comment, but couldn't get them to work. My JSDoc comments could stand to use some work to get the `jsdoc`-generated site to look better and make more sense. They already work great in VS Code, though, and at least don't break the CLI.
- Loading branch information
Showing
16 changed files
with
69 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -11,4 +11,6 @@ node_modules/ | |
out/ | ||
pnpm-debug.log | ||
tmp/ | ||
types/ | ||
*.log | ||
*.tgz |
This file contains 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 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 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 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 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,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"checkJs": true, | ||
"module": "nodenext", | ||
"strict": true, | ||
"strictNullChecks": false, | ||
"noImplicitAny": false | ||
}, | ||
"exclude": ["node_modules"] | ||
} |
This file contains 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 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 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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