Skip to content

Commit

Permalink
chore: sync code
Browse files Browse the repository at this point in the history
  • Loading branch information
nyqykk committed Dec 17, 2024
2 parents 096924c + 16ad0f8 commit 344ac78
Show file tree
Hide file tree
Showing 27 changed files with 85 additions and 55 deletions.
6 changes: 6 additions & 0 deletions .changeset/nasty-lemons-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rsdoctor/core': patch
'@rsdoctor/sdk': patch
---

chore: add changesets for 0.4.12
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/1-bug-report.en-US.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "🐞 Bug Report"
description: Report a Bug to Rsdoctor
title: "[Bug]: "
type: Bug
labels: ["🐞 bug"]
body:
- type: markdown
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/2-feature-request.en-US.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "💡 Feature Request"
description: Submit a new feature request to Rsdoctor
title: "[Feature]: "
type: Enhancement
labels: ["💡 feature"]
body:
- type: markdown
Expand Down
6 changes: 3 additions & 3 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
"@rsdoctor/types": "workspace:*",
"@rsdoctor/utils": "workspace:*",
"@rsdoctor/webpack-plugin": "workspace:*",
"@rspack/core": "^1.1.4",
"@rspack/core": "^1.1.6",
"@types/lodash": "^4.17.13",
"@types/node": "^16",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "^18.3.16",
"@types/react-dom": "^18.3.5",
"fast-glob": "^3.3.2",
"loader-utils": "^2.0.4",
"playwright": "1.33.0",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
"devDependencies": {
"@biomejs/biome": "1.5.1",
"@changesets/cli": "^2.27.10",
"@modern-js/module-tools": "^2.63.0",
"@modern-js/module-tools": "^2.63.2",
"@rsdoctor/tsconfig": "workspace:*",
"@scripts/test-helper": "workspace:*",
"check-dependency-version-consistency": "^4.1.0",
"check-dependency-version-consistency": "^4.1.1",
"cross-env": "^7.0.3",
"cspell-ban-words": "^0.0.4",
"husky": "^9.1.7",
"nano-staged": "^0.8.0",
"nx": "^17.3.2",
"prettier": "^3.3.3",
"prettier": "^3.4.2",
"vite-tsconfig-paths": "4.3.2",
"vitest": "1.6.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@rsdoctor/sdk": "workspace:*",
"@rsdoctor/types": "workspace:*",
"@rsdoctor/utils": "workspace:*",
"axios": "^1.7.8",
"axios": "^1.7.9",
"ora": "^5.4.1",
"picocolors": "^1.1.1",
"tslib": "2.8.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
"dist/"
],
"devDependencies": {
"@rsbuild/core": "^1.1.7",
"@rsbuild/core": "^1.1.10",
"@rsbuild/plugin-node-polyfill": "^1.2.0",
"@rsbuild/plugin-react": "^1.0.7",
"@rsbuild/plugin-sass": "^1.1.1",
"@rsbuild/plugin-react": "^1.1.0",
"@rsbuild/plugin-sass": "^1.1.2",
"@rsbuild/plugin-type-check": "^1.1.0",
"@rsdoctor/components": "workspace:*",
"@rsdoctor/types": "workspace:*",
"@types/node": "^16",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "^18.3.16",
"@types/react-dom": "^18.3.5",
"@types/serve-static": "1.15.7",
"antd": "5.15.3",
"normalize.css": "8.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
"@types/lodash-es": "4.17.12",
"@types/node": "^16",
"@types/path-browserify": "1.0.3",
"@types/react": "^18.3.12",
"@types/react": "^18.3.16",
"@types/react-highlight-words": "^0.20.0",
"@types/url-parse": "1.4.11",
"ansi-to-react": "6.1.6",
"antd": "5.15.3",
"axios": "^1.7.8",
"axios": "^1.7.9",
"dayjs": "1.11.13",
"echarts": "^5.5.1",
"echarts-for-react": "^3.0.2",
Expand Down
5 changes: 0 additions & 5 deletions packages/components/src/components/Alert/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ export const Alert: React.FC<AlertProps> = (props) => {
return <CodeChangeAlert data={data} cwd={cwd} />;
}

// TODO: If need add emo alters.
if (data.type === 'emo') {
return <></>;
}

if (data.type === 'package-relation') {
const { getPackageRelationContentComponent } = props;
return (
Expand Down
4 changes: 0 additions & 4 deletions packages/components/src/components/Alert/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,3 @@ export interface LinkAlertProps {
error?: CheckSyntaxError;
};
}

export interface EMOAlertProps {
data: Rule.EMORuleStoreData;
}
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@rsdoctor/sdk": "workspace:*",
"@rsdoctor/types": "workspace:*",
"@rsdoctor/utils": "workspace:*",
"axios": "^1.7.8",
"axios": "^1.7.9",
"enhanced-resolve": "5.12.0",
"filesize": "^10.1.6",
"fs-extra": "^11.1.1",
Expand All @@ -85,7 +85,7 @@
"browserslist-load-config": "^1.0.0"
},
"devDependencies": {
"@rspack/core": "^1.1.4",
"@rspack/core": "^1.1.6",
"@scripts/test-helper": "workspace:*",
"@types/fs-extra": "^11.0.4",
"@types/lodash": "^4.17.13",
Expand Down
15 changes: 12 additions & 3 deletions packages/core/src/build-utils/build/chunks/generateTileGraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type IGenerateReportOpts = {
reportTitle?: string;
bundleDir?: string;
openBrowser?: boolean;
reportDir?: string;
};
async function generateJSONReportUtil(
bundleStats: Plugin.BaseStats,
Expand All @@ -33,14 +34,22 @@ export async function generateTileGraph(
buildOutputPath: string,
) {
try {
const { reportFilename } = opts;
const { reportFilename, reportDir } = opts;
await generateJSONReportUtil(bundleStats, {
...opts,
openBrowser: false,
bundleDir: buildOutputPath,
bundleDir: reportDir || buildOutputPath,
});

return path.join(buildOutputPath, `${reportFilename}`);
return path.join(
reportDir
? path.resolve(
buildOutputPath,
path.relative(buildOutputPath, reportDir),
)
: buildOutputPath,
`${reportFilename}`,
);
} catch (e) {
debug(() => `Generate webpack-bundle-analyzer tile graph has error:${e}`);
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export const ensureModulesChunksGraphFn = (
ChunksBuildUtils.TileGraphReportName,
),
reportTitle: 'bundle-analyzer',
reportDir: _this.options.reportDir,
},
compiler.outputPath,
);
Expand Down
8 changes: 4 additions & 4 deletions packages/document/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
},
"devDependencies": {
"@rsdoctor/types": "workspace:*",
"@rspress/plugin-rss": "^1.37.3",
"@rspress/plugin-rss": "^1.38.0",
"@types/node": "^16",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "^18.3.16",
"@types/react-dom": "^18.3.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"rsbuild-plugin-google-analytics": "^1.0.3",
Expand All @@ -40,6 +40,6 @@
"dependencies": {
"@rstack-dev/doc-ui": "1.5.4",
"react-markdown": "^9.0.1",
"rspress": "^1.37.3"
"rspress": "^1.38.0"
}
}
2 changes: 1 addition & 1 deletion packages/graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@rsdoctor/types": "workspace:*",
"@rsdoctor/utils": "workspace:*",
"lodash": "^4.17.21",
"socket.io": "4.7.2",
"socket.io": "4.8.1",
"source-map": "^0.7.4"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"lodash": "^4.17.21"
},
"devDependencies": {
"@rspack/core": "^1.1.4",
"@rspack/core": "^1.1.6",
"@types/lodash": "^4.17.13",
"@types/node": "^16",
"@types/tapable": "2.2.7",
Expand Down
12 changes: 11 additions & 1 deletion packages/rspack-plugin/src/multiple.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { RsdoctorSDKController } from '@rsdoctor/sdk';
import { RsdoctorPrimarySDK, RsdoctorSDKController } from '@rsdoctor/sdk';
import type { Linter } from '@rsdoctor/types';
import type { RsdoctorMultiplePluginOptions } from '@rsdoctor/core';

import { RsdoctorRspackPlugin } from './plugin';
import { normalizeUserConfig } from '@rsdoctor/core/plugins';
import { Compiler } from '@rspack/core';

let globalController: RsdoctorSDKController | undefined;

Expand Down Expand Up @@ -44,4 +45,13 @@ export class RsdoctorRspackMultiplePlugin<
});
this.controller = controller;
}

apply(compiler: Compiler) {
if ('dependencies' in compiler.options) {
(this.sdk as RsdoctorPrimarySDK).dependencies =
compiler.options.dependencies;
}

super.apply(compiler);
}
}
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"lodash": "^4.17.21",
"open": "^8.4.2",
"serve-static": "1.16.2",
"socket.io": "4.7.2",
"socket.io": "4.8.1",
"source-map": "^0.7.4",
"tapable": "2.2.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/sdk/multiple/controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Manifest } from '@rsdoctor/types';
import { RsdoctorPrimarySDK } from './slave';
import { RsdoctorPrimarySDK } from './primary';

export class RsdoctorSDKController {
readonly slaves: RsdoctorPrimarySDK[] = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/sdk/multiple/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './controller';
export * from './slave';
export * from './primary';
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export class RsdoctorPrimarySDK extends RsdoctorSDK {

public readonly stage: number;

public dependencies: Array<string> | undefined;

private uploadPieces!: Promise<void>;

private finishUploadPieceSwitch!: () => void;
Expand Down Expand Up @@ -78,9 +80,15 @@ export class RsdoctorPrimarySDK extends RsdoctorSDK {
}

protected async writeManifest() {
const { parent, cloudData } = this;

await Promise.all(this.parent.slaves.map((item) => item.uploadPieces));
const { parent, cloudData, dependencies } = this;

if (!dependencies?.length) {
await Promise.all(
this.parent.slaves
.filter((item) => !item.dependencies?.length)
.map((item) => item.uploadPieces),
);
}

if (cloudData) {
cloudData.name = this.name;
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/sdk/multiple/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Server } from '@rsdoctor/utils/build';
import { RsdoctorServer } from '../server';
import type { RsdoctorPrimarySDK } from './slave';
import type { RsdoctorPrimarySDK } from './primary';

export class RsdoctorSlaveServer extends RsdoctorServer {
protected sdk: RsdoctorPrimarySDK;
Expand Down
4 changes: 2 additions & 2 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"source-map": "^0.7.4"
},
"devDependencies": {
"@rspack/core": "^1.1.4",
"@rspack/core": "^1.1.6",
"@types/node": "^16",
"@types/react": "^18.3.12",
"@types/react": "^18.3.16",
"tslib": "2.8.1",
"typescript": "^5.2.2"
},
Expand Down
9 changes: 1 addition & 8 deletions packages/types/src/rule/data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { WorkspaceCheckDataType } from '../emo';
import type { RuleMessage, RuleMessageCodeEnumerated } from './code';
import type { SourceRange } from '../sdk';
import type { PackageBasicData } from '../sdk/package';
Expand Down Expand Up @@ -127,11 +126,6 @@ export interface CodeChangeRuleStoreData extends BaseRuleStoreData {
};
}

export interface EMORuleStoreData extends BaseRuleStoreData {
type: 'emo';
emoCheckData: WorkspaceCheckDataType;
}

export interface OverlayRuleStoreData extends BaseRuleStoreData {
code: RuleMessageCodeEnumerated.Overlay;
stack?: string;
Expand All @@ -142,7 +136,6 @@ export type RuleStoreDataItem =
| FileRelationRuleStoreData
| CodeChangeRuleStoreData
| PackageRelationDiffRuleStoreData
| CodeViewRuleStoreData
| EMORuleStoreData;
| CodeViewRuleStoreData;

export type RuleStoreData = RuleStoreDataItem[];
12 changes: 11 additions & 1 deletion packages/webpack-plugin/src/multiple.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { RsdoctorSDKController } from '@rsdoctor/sdk';
import { RsdoctorPrimarySDK, RsdoctorSDKController } from '@rsdoctor/sdk';
import type { Linter } from '@rsdoctor/types';
import type { RsdoctorMultiplePluginOptions } from '@rsdoctor/core';

import { RsdoctorWebpackPlugin } from './plugin';
import { normalizeUserConfig } from '@rsdoctor/core/plugins';
import type { Compiler } from 'webpack';

let globalController: RsdoctorSDKController | undefined;

Expand Down Expand Up @@ -45,4 +46,13 @@ export class RsdoctorWebpackMultiplePlugin<

this.controller = controller;
}

apply(compiler: Compiler) {
if ('dependencies' in compiler.options) {
(this.sdk as RsdoctorPrimarySDK).dependencies =
compiler.options.dependencies;
}

super.apply(compiler);
}
}
2 changes: 1 addition & 1 deletion scripts/test-helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dev": "modern build --watch"
},
"dependencies": {
"@rspack/core": "^1.1.4",
"@rspack/core": "^1.1.6",
"@types/lodash": "^4.17.13",
"@types/node": "^16",
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-packages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@manypkg/get-packages": "^2.2.2",
"@modern-js/generator-utils": "^3.7.6",
"@modern-js/generator-utils": "^3.7.8",
"fs-extra": "^11.1.1"
},
"devDependencies": {
Expand Down

0 comments on commit 344ac78

Please sign in to comment.