Update TypeScript and add SCSS module declarations#46
Open
Zuoqiu-Yingyi wants to merge 1 commit into
Open
Conversation
Member
|
为什么不升级到 6.x。 可以使用这个: |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s TypeScript/tooling dependencies and adds TypeScript declarations for importing SCSS, with additional TypeScript non-null/definite-assignment assertions applied in the sample plugin code.
Changes:
- Upgraded build/dev dependencies (notably
typescript,sass-loader,webpack-cli) and updated the pnpm lockfile accordingly. - Added a
*.scssTypeScript module declaration file for SCSS imports. - Updated
src/index.tswith definite-assignment (!:) and non-null (!) assertions for TypeScript compatibility.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
src/index.ts |
Adds TypeScript assertions around DOM queries and editor access to satisfy stricter typing. |
src/declarations.d.ts |
Introduces a TS declaration for importing *.scss files. |
package.json |
Bumps key toolchain dependencies (TypeScript / loaders / webpack CLI). |
pnpm-lock.yaml |
Lockfile updates reflecting the dependency upgrades/removals. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+445
to
450
| new Protyle(this.app, dialog.element.querySelector<HTMLElement>("#protyle")!, { | ||
| blockId: this.getEditor()!.protyle.block.rootID, | ||
| }); | ||
| fetchPost("/api/system/currentTime", {}, (response) => { | ||
| dialog.element.querySelector("#time").innerHTML = new Date(response.data).toString(); | ||
| dialog.element.querySelector<HTMLElement>("#time")!.innerHTML = new Date(response.data).toString(); | ||
| }); |
Comment on lines
468
to
472
| openAttributePanel({ | ||
| nodeElement: this.getEditor().protyle.wysiwyg.element.firstElementChild as HTMLElement, | ||
| protyle: this.getEditor().protyle, | ||
| nodeElement: this.getEditor()!.protyle!.wysiwyg!.element.firstElementChild! as HTMLElement, | ||
| protyle: this.getEditor()!.protyle!, | ||
| focusName: "custom", | ||
| }); |
Comment on lines
487
to
490
| (getModelByDockType("file") as Files).selectItem( | ||
| this.getEditor().protyle.notebookId, | ||
| this.getEditor().protyle.path, | ||
| this.getEditor()!.protyle.notebookId!, | ||
| this.getEditor()!.protyle.path!, | ||
| ); |
Comment on lines
529
to
533
| const tab = await openTab({ | ||
| app: this.app, | ||
| doc: { | ||
| id: this.getEditor().protyle.block.rootID, | ||
| id: this.getEditor()!.protyle.block.rootID!, | ||
| }, |
Comment on lines
568
to
572
| this.addFloatLayer({ | ||
| refDefs: [{refID: this.getEditor().protyle.block.rootID}], | ||
| refDefs: [{refID: this.getEditor()!.protyle.block.rootID!}], | ||
| x: window.innerWidth - 768 - 120, | ||
| y: 32, | ||
| isBacklink: false, |
Comment on lines
580
to
582
| openWindow({ | ||
| doc: {id: this.getEditor().protyle.block.rootID}, | ||
| doc: {id: this.getEditor()!.protyle.block.rootID!}, | ||
| }); |
Comment on lines
589
to
+590
| click: () => { | ||
| openMobileFileById(this.app, this.getEditor().protyle.block.rootID); | ||
| openMobileFileById(this.app, this.getEditor()!.protyle.block.rootID!); |
Comment on lines
40
to
42
| "zip-webpack-plugin": "^4.0.3" | ||
| } | ||
| } |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
REL: #42 (comment)
This pull request updates several build tool dependencies to their latest versions, focusing on
typescript,sass-loader,webpack-cli, and related packages. These upgrades ensure compatibility with newer Node.js versions and provide the latest features and bug fixes.Dependency upgrades:
typescriptfrom version 4.9.5 to 5.9.3, along with all related TypeScript ESLint packages and utilities to ensure compatibility. [1] [2] [3] [4] [5] [6] [7] [8]sass-loaderfrom 16.0.8 to 17.0.0, updating its peer dependencies and removing optional support fornode-sass. [1] [2] [3] [4]webpack-clifrom 7.0.2 to 7.0.3 and updated all references to this version in the lockfile. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]terser-webpack-pluginfrom 5.6.0 to 5.6.1. [1] [2] [3]Minor dependency updates and cleanup:
electron-to-chromium(1.5.361 → 1.5.363) andwhich-typed-array(1.1.20 → 1.1.21), and removed unused packages likefastest-levenshtein. [1] [2] [3] [4] [5] [6] [7]These updates help keep the project secure and compatible with the latest tooling and environments.