Skip to content

Update TypeScript and add SCSS module declarations#46

Open
Zuoqiu-Yingyi wants to merge 1 commit into
siyuan-note:mainfrom
Zuoqiu-Yingyi:chore/update-typescript
Open

Update TypeScript and add SCSS module declarations#46
Zuoqiu-Yingyi wants to merge 1 commit into
siyuan-note:mainfrom
Zuoqiu-Yingyi:chore/update-typescript

Conversation

@Zuoqiu-Yingyi
Copy link
Copy Markdown
Contributor

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:

  • Upgraded typescript from 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]
  • Upgraded sass-loader from 16.0.8 to 17.0.0, updating its peer dependencies and removing optional support for node-sass. [1] [2] [3] [4]
  • Upgraded webpack-cli from 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]
  • Upgraded terser-webpack-plugin from 5.6.0 to 5.6.1. [1] [2] [3]

Minor dependency updates and cleanup:

  • Updated minor dependencies such as electron-to-chromium (1.5.361 → 1.5.363) and which-typed-array (1.1.20 → 1.1.21), and removed unused packages like fastest-levenshtein. [1] [2] [3] [4] [5] [6] [7]

These updates help keep the project secure and compatible with the latest tooling and environments.

@Vanessa219
Copy link
Copy Markdown
Member

为什么不升级到 6.x。

可以使用这个:
"strictNullChecks": false

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 *.scss TypeScript module declaration file for SCSS imports.
  • Updated src/index.ts with 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 thread src/index.ts
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 thread src/index.ts
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 thread src/index.ts
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 thread src/index.ts
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 thread src/index.ts
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 thread src/index.ts
Comment on lines 580 to 582
openWindow({
doc: {id: this.getEditor().protyle.block.rootID},
doc: {id: this.getEditor()!.protyle.block.rootID!},
});
Comment thread src/index.ts
Comment on lines 589 to +590
click: () => {
openMobileFileById(this.app, this.getEditor().protyle.block.rootID);
openMobileFileById(this.app, this.getEditor()!.protyle.block.rootID!);
Comment thread package.json
Comment on lines 40 to 42
"zip-webpack-plugin": "^4.0.3"
}
}
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.

3 participants