-
Notifications
You must be signed in to change notification settings - Fork 6
build(extension): Add build-time type checks #77
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
Conversation
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
|
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring: Next stepsTake a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with |
|
@SocketSecurity ignore npm/vscode-jsonrpc@6.0.0 ignore npm/vscode-languageclient@7.0.0 ignore npm/vscode-languageserver@7.0.0 ignore npm/vite-plugin-checker@0.8.0
|
| "build:clean": "yarn clean && yarn build", | ||
| "build:docs": "yarn workspaces foreach --all --exclude @ocap/monorepo --exclude @ocap/extension --parallel --interlaced --verbose run build:docs", | ||
| "build:source": "yarn workspaces foreach --all --topological --parallel --interlaced --exclude @ocap/monorepo --verbose run build", | ||
| "build:watch": "yarn run build --watch", |
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.
This script had been broken forever and is probably a lost cause.
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.
Let's see if we end up introducing some pivot on this down the road 🤞
| }, | ||
| "references": [{ "path": "../test-utils" }], | ||
| "include": ["./src", "test/envelope-kit-fixtures.ts"] | ||
| "include": ["./src", "./test/envelope-kit-fixtures.ts"] |
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.
Just for consistency.
SMotaal
left a comment
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 🚀
| "build:clean": "yarn clean && yarn build", | ||
| "build:docs": "yarn workspaces foreach --all --exclude @ocap/monorepo --exclude @ocap/extension --parallel --interlaced --verbose run build:docs", | ||
| "build:source": "yarn workspaces foreach --all --topological --parallel --interlaced --exclude @ocap/monorepo --verbose run build", | ||
| "build:watch": "yarn run build --watch", |
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.
Let's see if we end up introducing some pivot on this down the road 🤞
| jsTrustedPrelude({ | ||
| trustedPreludes: jsTrustedPreludes, | ||
| }), | ||
| viteChecker({ typescript: { tsconfigPath: 'tsconfig.build.json' } }), |
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.
I noticed type-checking came last, and tried to reorder the plugins to bail early on failure without luck. It is not an issue of urgency for now, and if need be, we may need to revisit this down the road.
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.
I'm not sure what the behavioral significance is of the order of the plugins array, but yeah, what I have seems to work.
Adds build-time type checks to Vite via
vite-plugin-checker, which we configure to runtscas part of the Vite pipeline.As part of this, the
lint:typesscript introduced in #73 (f.k.a.build:types, which was a misnomer) is removed. In essence, I first attempted to establish alint:typesscript common across all packages. Any monorepo-wide implementation thereof turns out to be equivalent to just running a full, declaration-only TypeScript build of the entire monorepo (see the TypeScript project references documentation for details). This being the case, rather than using a one-off script for@ocap/extension, I found a Vite plugin that allows us to check types as part of the build process, as we do everywhere else.