-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add overall page feat: add overall page feat: add overall page feat: add overall page feat: add overall page feat: add overall page feat: add overall page
- Loading branch information
Showing
139 changed files
with
13,657 additions
and
407 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
'@rsdoctor/webpack-plugin': patch | ||
'@rsdoctor/rspack-plugin': patch | ||
'@rsdoctor/components': patch | ||
'@rsdoctor/client': patch | ||
'@rsdoctor/graph': patch | ||
'@rsdoctor/core': patch | ||
'@rsdoctor/sdk': patch | ||
--- | ||
|
||
Rsdoctor report platform add overall page (close: #25) |
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,35 @@ | ||
{ | ||
"name": "@example/doctor-webpack-minimal", | ||
"version": "0.0.1", | ||
"description": "", | ||
"files": [ | ||
"dist", | ||
"src", | ||
"package.json" | ||
], | ||
"scripts": { | ||
"compile": "node -r tsm ./node_modules/webpack/bin/webpack.js -c webpack.config.ts", | ||
"build:analysis": "ENABLE_CLIENT_SERVER=true npm run compile" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@babel/highlight": "7.18.6", | ||
"chalk": "4.1.2", | ||
"htmlparser2": "7.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "14.18.26", | ||
"@rsdoctor/types": "workspace:*", | ||
"@rsdoctor/webpack-plugin": "workspace:*", | ||
"bundle-stats": "4.1.7", | ||
"eslint": "8.22.0", | ||
"ts-loader": "9.4.2", | ||
"tslib": "2.4.1", | ||
"tsm": "2.3.0", | ||
"typescript": "^5.2.2", | ||
"webpack": "5.89.0", | ||
"webpack-cli": "5.0.0" | ||
} | ||
} |
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,15 @@ | ||
import Parser from 'htmlparser2'; | ||
|
||
export function getHtmlText(code: string) { | ||
let context = ''; | ||
|
||
const parser = new Parser.Parser({ | ||
ontext(data) { | ||
context += data; | ||
}, | ||
}); | ||
|
||
parser.write(code); | ||
|
||
return context; | ||
} |
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 @@ | ||
import { Instance } from 'chalk'; | ||
import { highlight } from './utils'; | ||
import { getHtmlText } from './html'; | ||
import { key6 } from './utils2'; | ||
|
||
const print = new Instance(); | ||
|
||
print(key6); | ||
print(getHtmlText('<div>测试文本</div>')); | ||
print(highlight?.('const abc = 123;')); |
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 @@ | ||
declare module '@babel/highlight'; |
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,7 @@ | ||
import highlight from '@babel/highlight'; | ||
|
||
export { highlight }; | ||
export const key1 = '123'; | ||
export const key2 = '123'; | ||
|
||
console.log(key2); |
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,14 @@ | ||
import { Linter } from '@rsdoctor/types'; | ||
|
||
export function toSeverity(input: Linter.SeverityInput, defaultLevel: Linter.Severity): Linter.Severity { | ||
if (input === 'off') { | ||
return Linter.Severity.Ignore; | ||
} | ||
|
||
if (input === 'on') { | ||
return defaultLevel; | ||
} | ||
|
||
const key = `${input[0].toUpperCase()}${input.slice(1)}` as Linter.SeverityString; | ||
return Linter.Severity[key] as Linter.Severity; | ||
} |
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,5 @@ | ||
export * as utils6 from './utils6'; | ||
|
||
export * from './utils'; | ||
export * from './utils4'; | ||
export * from './html'; |
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,3 @@ | ||
import { key1 } from './utils'; | ||
|
||
export const key3 = key1 + 1; |
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 @@ | ||
export * from './utils5'; |
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 @@ | ||
export * from './utils6'; |
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 @@ | ||
export const key6 = 'key6'; |
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,9 @@ | ||
{ | ||
"extends": "@rsdoctor/tsconfig/base", | ||
"include": ["src", "webpack.config.ts"], | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"baseUrl": ".", | ||
"module": "ESNext" | ||
} | ||
} |
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,45 @@ | ||
import { resolve } from 'path'; | ||
import { Configuration } from 'webpack'; | ||
import { RsdoctorWebpackPlugin } from '@rsdoctor/webpack-plugin'; | ||
|
||
const data: Configuration = { | ||
entry: './src/index.ts', | ||
mode: 'none', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, | ||
loader: 'ts-loader', | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
mainFields: ['browser', 'module', 'main'], | ||
extensions: ['.ts', '.js', '.json', '.wasm'], | ||
}, | ||
output: { | ||
path: resolve(__dirname, 'dist'), | ||
filename: 'minimal.js', | ||
}, | ||
optimization: { | ||
concatenateModules: true, | ||
usedExports: true, | ||
mangleExports: true, | ||
providedExports: true, | ||
}, | ||
stats: { | ||
assets: true, | ||
warnings: true, | ||
errors: true, | ||
modules: true, | ||
colors: true, | ||
chunks: true, | ||
builtAt: true, | ||
hash: true, | ||
ids: true, | ||
}, | ||
devtool: 'source-map', | ||
plugins: [new RsdoctorWebpackPlugin({ disableClientServer: !process.env.ENABLE_CLIENT_SERVER })], | ||
}; | ||
|
||
export default data; |
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 @@ | ||
# @rsdoctor/components |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023-present Bytedance, Inc. and its affiliates. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,15 @@ | ||
# Rsdoctor | ||
|
||
Rsdoctor is a tool for diagnosing and analyzing the build process and build artifacts to help developers quickly identify and solve problems. | ||
|
||
It also supports Webpack and Rspack builders, as well as various build frameworks, such as Rsbuild. | ||
|
||
## Documentation | ||
|
||
## Contributing | ||
|
||
Please read the [Contributing Guide](https://github.com/web-infra-dev/rsdoctor/blob/main/CONTRIBUTING.md). | ||
|
||
## License | ||
|
||
Rsdoctor is [MIT licensed](https://github.com/web-infra-dev/rsdoctor/blob/main/LICENSE). |
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,19 @@ | ||
import { Constants } from '@rsdoctor/types'; | ||
|
||
import path from 'path'; | ||
|
||
export const DistPath = path.resolve(__dirname, '../dist'); | ||
|
||
export const DistResourcePath = path.resolve(__dirname, '../dist/resource'); | ||
|
||
export const WebpackDoctorDirPath = path.resolve(__dirname, `../dist/${Constants.DoctorOutputFolder}`); | ||
|
||
export const WebpackStatsFilePath = path.resolve(__dirname, '../dist/stats.json'); | ||
|
||
export const PortForWeb = 8681; | ||
|
||
export const PortForCLI = 8123; | ||
|
||
export const ClientEntry = path.resolve(__dirname, '../src/index.tsx'); | ||
|
||
export const RsdoctorWebpackPluginMain = path.resolve(__dirname, '../../webpack-plugin/dist'); |
Oops, something went wrong.