-
-
Notifications
You must be signed in to change notification settings - Fork 79
feat!: migrate logs-sdk to nostics, bump devframe to v0.3 #350
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
Merged
+529
−255
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8be0a15
feat: migrate logs-sdk to nostics, bump devframe to v0.3
antfu f4afa1e
Merge remote-tracking branch 'origin/main' into antfu/devframe-v0.3
antfu 1384f41
fix: patch devframe@0.3.0 to dedupe duplicate dts interfaces
antfu 456e302
Merge remote-tracking branch 'origin/main' into antfu/devframe-v0.3
antfu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Submodule devframe
updated
51 files
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,53 +1,44 @@ | ||
| import { colors as c } from 'devframe/utils/colors' | ||
| import { consoleReporter, createLogger, defineDiagnostics } from 'logs-sdk' | ||
| import { ansiFormatter } from 'logs-sdk/formatters/ansi' | ||
| import { defineDiagnostics, reporterLog } from 'nostics' | ||
|
|
||
| export const diagnostics = defineDiagnostics({ | ||
| docsBase: 'https://devtools.vite.dev/errors', | ||
| reporters: [reporterLog], | ||
| codes: { | ||
| DTK0008: { | ||
| message: 'Client authentication is disabled. Any browser can connect to the devtools and access your server and filesystem.', | ||
| level: 'warn', | ||
| why: 'Client authentication is disabled. Any browser can connect to the devtools and access your server and filesystem.', | ||
| }, | ||
| DTK0010: { | ||
| message: 'Static build is still experimental and not yet complete. Generated output may be missing features and can change without notice.', | ||
| level: 'warn', | ||
| why: 'Static build is still experimental and not yet complete. Generated output may be missing features and can change without notice.', | ||
| }, | ||
| DTK0011: { | ||
| message: (p: { name: string }) => `RPC error on executing "${p.name}"`, | ||
| why: (p: { name: string }) => `RPC error on executing "${p.name}"`, | ||
| }, | ||
| DTK0012: { | ||
| message: 'RPC error on executing rpc', | ||
| why: 'RPC error on executing rpc', | ||
| }, | ||
| DTK0013: { | ||
| message: (p: { name: string, clientId: string }) => `Unauthorized access to method ${JSON.stringify(p.name)} from client [${p.clientId}]`, | ||
| why: (p: { name: string, clientId: string }) => `Unauthorized access to method ${JSON.stringify(p.name)} from client [${p.clientId}]`, | ||
| }, | ||
| DTK0014: { | ||
| message: (p: { name: string }) => `Error setting up plugin ${p.name}`, | ||
| why: (p: { name: string }) => `Error setting up plugin ${p.name}`, | ||
| }, | ||
| DTK0023: { | ||
| message: 'viteServer is required in dev mode', | ||
| why: 'viteServer is required in dev mode', | ||
| }, | ||
| DTK0028: { | ||
| message: 'Path is outside the workspace root', | ||
| why: 'Path is outside the workspace root', | ||
| }, | ||
| DTK0029: { | ||
| message: 'Path is outside the workspace root', | ||
| why: 'Path is outside the workspace root', | ||
| }, | ||
| DTK0030: { | ||
| message: (p: { id: string }) => `Dock entry with id "${p.id}" not found`, | ||
| why: (p: { id: string }) => `Dock entry with id "${p.id}" not found`, | ||
| }, | ||
| DTK0031: { | ||
| message: (p: { id: string }) => `Dock entry with id "${p.id}" is not a launcher`, | ||
| why: (p: { id: string }) => `Dock entry with id "${p.id}" is not a launcher`, | ||
| }, | ||
| DTK0032: { | ||
| message: (p: { id: string }) => `Error launching dock entry "${p.id}"`, | ||
| why: (p: { id: string }) => `Error launching dock entry "${p.id}"`, | ||
| }, | ||
| }, | ||
| }) | ||
|
|
||
| export const logger = createLogger({ | ||
| diagnostics: [diagnostics], | ||
| formatter: ansiFormatter(c), | ||
| reporters: consoleReporter, | ||
| }) |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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 realizing, after much trial and error, that it's not possible to type the
.throw()call to have never. In TS, only an explicit root-leverconst fn: () => never = ...works. Maybe we should just remove it and tell people to usethrow diagnostics.X.report()(already works)