From 4caa67d300b3f7aa87d56f2e483d2d15588639b8 Mon Sep 17 00:00:00 2001 From: qihai Date: Mon, 19 Jan 2026 19:48:29 +0800 Subject: [PATCH 1/2] feat(all): rushx-config and rush-project json shcema globally --- .vscode/rushx-config.schema.json | 130 +++++++++++++++++++++++++++++++ .vscode/settings.json | 18 ++++- 2 files changed, 144 insertions(+), 4 deletions(-) create mode 100644 .vscode/rushx-config.schema.json diff --git a/.vscode/rushx-config.schema.json b/.vscode/rushx-config.schema.json new file mode 100644 index 000000000..552a139ba --- /dev/null +++ b/.vscode/rushx-config.schema.json @@ -0,0 +1,130 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "codecov": { + "$ref": "#/definitions/codecov", + "description": "Unit test-related configurations, such as threshold gates and diff directory settings." + }, + "team": { + "type": "array", + "description": "The associated team.", + "items": [ + { + "type": "string" + } + ] + }, + "level": { + "type": "array", + "description": "The classification level of the package.", + "items": [ + { + "type": "string" + } + ] + }, + "packageAudit": { + "$ref": "#/definitions/packageAudit", + "description": "Configurations related to the package quality detection tools." + }, + "dupCheck": { + "$ref": "#/definitions/dupCheck", + "description": "Configurations related to code duplication detection." + } + }, + "definitions": { + "codecov": { + "type": "object", + "properties": { + "coverage": { + "type": "number", + "description": "Coverage threshold." + }, + "incrementCoverage": { + "type": "number", + "description": "Incremental coverage threshold." + }, + "ignoreDiff": { + "type": "array", + "description": "Configure directories to ignore in incremental coverage calculation; glob pattern matching is supported.", + "items": [ + { + "type": "string" + } + ] + }, + "level-0": { + "$ref": "#/definitions/level" + }, + "level-1": { + "$ref": "#/definitions/level" + }, + "level-2": { + "$ref": "#/definitions/level" + }, + "level-3": { + "$ref": "#/definitions/level" + }, + "level-4": { + "$ref": "#/definitions/level" + } + } + }, + "level": { + "type": "object", + "properties": { + "coverage": { + "type": "number", + "description": "Coverage threshold." + }, + "incrementCoverage": { + "type": "number", + "description": "Incremental coverage threshold." + } + } + }, + "packageAudit": { + "type": "object", + "description": "Configurations related to scanning rules.", + "properties": { + "enable": { "type": "boolean" }, + "rules": { + "type": "array", + "items": [ + { + "type": "array", + "items": [ + { + "type": "string", + "description": "Rule names; currently supports these three types: owners, rule-project.json, essential-config-file.", + "enum": [ + "rule-project.json", + "owners", + "essential-config-file" + ] + }, + { "type": "string", "enum": ["error", "warn"] }, + { + "type": "object", + "description": "Supplementary configuration for rules; can be of a nullable type." + } + ] + } + ] + } + } + }, + "dupCheck": { + "type": "object", + "description": "Configurations related to code duplication detection.", + "properties": { + "ignoreGlobPatterns": { + "title": "Glob patterns to be ignored for detection (relative to the current package directory, not the configuration file directory).", + "type": "array", + "items": { "type": "string" } + } + } + } + } +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 478d4b011..ae4e7959a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -124,6 +124,19 @@ "stylelint.validate": ["css", "scss", "less"], "stylelint.stylelintPath": "frontend/config/stylelint-config/node_modules/stylelint", "emmet.triggerExpansionOnTab": true, + "svg.preview.background": "white", + "git.openRepositoryInParentFolders": "always", + "references.preferredLocation": "view", + "json.schemas": [ + { + "fileMatch": ["rushx-config.json"], + "url": "./.vscode/rushx-config.schema.json" + }, + { + "fileMatch": ["rush-project.json"], + "url": "https://developer.microsoft.com/json-schemas/rush/v5/rush-project.schema.json" + } + ], "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, @@ -174,8 +187,5 @@ }, "[sql]": { "editor.defaultFormatter": "adpyke.vscode-sql-formatter" - }, - "svg.preview.background": "white", - "git.openRepositoryInParentFolders": "always", - "references.preferredLocation": "view" + } } From 91b479298e304bfa9eba7082331af2002daf1ad6 Mon Sep 17 00:00:00 2001 From: qihai Date: Mon, 19 Jan 2026 19:50:19 +0800 Subject: [PATCH 2/2] feat: rm useless rushx-config.schema.json --- frontend/config/ts-config/config/rushx-config.json | 1 - frontend/packages/cozeloop/base-hooks/config/rushx-config.json | 1 - .../packages/cozeloop/biz-components/config/rushx-config.json | 1 - frontend/packages/cozeloop/biz-config/config/rushx-config.json | 1 - frontend/packages/cozeloop/biz-hooks/config/rushx-config.json | 1 - frontend/packages/cozeloop/env/config/rushx-config.json | 1 - .../packages/cozeloop/evaluate-adapter/config/rushx-config.json | 1 - .../cozeloop/evaluate-components/config/rushx-config.json | 1 - frontend/packages/cozeloop/i18n/config/rushx-config.json | 1 - .../cozeloop/observation-adapter/config/rushx-config.json | 1 - frontend/packages/cozeloop/route/config/rushx-config.json | 1 - .../packages/cozeloop/shared-components/config/rushx-config.json | 1 - frontend/packages/cozeloop/toolkit/config/rushx-config.json | 1 - 13 files changed, 13 deletions(-) diff --git a/frontend/config/ts-config/config/rushx-config.json b/frontend/config/ts-config/config/rushx-config.json index d18999060..d565a5ac3 100644 --- a/frontend/config/ts-config/config/rushx-config.json +++ b/frontend/config/ts-config/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../rushx-config.schema.json", "packageAudit": { "enable": true, "rules": [ diff --git a/frontend/packages/cozeloop/base-hooks/config/rushx-config.json b/frontend/packages/cozeloop/base-hooks/config/rushx-config.json index 163816fb2..728e4122a 100644 --- a/frontend/packages/cozeloop/base-hooks/config/rushx-config.json +++ b/frontend/packages/cozeloop/base-hooks/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["src/**"] } diff --git a/frontend/packages/cozeloop/biz-components/config/rushx-config.json b/frontend/packages/cozeloop/biz-components/config/rushx-config.json index f8e734d74..bc32e7ff8 100644 --- a/frontend/packages/cozeloop/biz-components/config/rushx-config.json +++ b/frontend/packages/cozeloop/biz-components/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["src/**", "i18n/**"] } diff --git a/frontend/packages/cozeloop/biz-config/config/rushx-config.json b/frontend/packages/cozeloop/biz-config/config/rushx-config.json index 163816fb2..728e4122a 100644 --- a/frontend/packages/cozeloop/biz-config/config/rushx-config.json +++ b/frontend/packages/cozeloop/biz-config/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["src/**"] } diff --git a/frontend/packages/cozeloop/biz-hooks/config/rushx-config.json b/frontend/packages/cozeloop/biz-hooks/config/rushx-config.json index 163816fb2..728e4122a 100644 --- a/frontend/packages/cozeloop/biz-hooks/config/rushx-config.json +++ b/frontend/packages/cozeloop/biz-hooks/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["src/**"] } diff --git a/frontend/packages/cozeloop/env/config/rushx-config.json b/frontend/packages/cozeloop/env/config/rushx-config.json index f8e734d74..bc32e7ff8 100644 --- a/frontend/packages/cozeloop/env/config/rushx-config.json +++ b/frontend/packages/cozeloop/env/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["src/**", "i18n/**"] } diff --git a/frontend/packages/cozeloop/evaluate-adapter/config/rushx-config.json b/frontend/packages/cozeloop/evaluate-adapter/config/rushx-config.json index 5aba06cab..b60c3e17b 100644 --- a/frontend/packages/cozeloop/evaluate-adapter/config/rushx-config.json +++ b/frontend/packages/cozeloop/evaluate-adapter/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["stories/**"] } diff --git a/frontend/packages/cozeloop/evaluate-components/config/rushx-config.json b/frontend/packages/cozeloop/evaluate-components/config/rushx-config.json index 5aba06cab..b60c3e17b 100644 --- a/frontend/packages/cozeloop/evaluate-components/config/rushx-config.json +++ b/frontend/packages/cozeloop/evaluate-components/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["stories/**"] } diff --git a/frontend/packages/cozeloop/i18n/config/rushx-config.json b/frontend/packages/cozeloop/i18n/config/rushx-config.json index ad6481f82..20e5885ac 100644 --- a/frontend/packages/cozeloop/i18n/config/rushx-config.json +++ b/frontend/packages/cozeloop/i18n/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["script/*"] } diff --git a/frontend/packages/cozeloop/observation-adapter/config/rushx-config.json b/frontend/packages/cozeloop/observation-adapter/config/rushx-config.json index 5aba06cab..b60c3e17b 100644 --- a/frontend/packages/cozeloop/observation-adapter/config/rushx-config.json +++ b/frontend/packages/cozeloop/observation-adapter/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["stories/**"] } diff --git a/frontend/packages/cozeloop/route/config/rushx-config.json b/frontend/packages/cozeloop/route/config/rushx-config.json index 163816fb2..728e4122a 100644 --- a/frontend/packages/cozeloop/route/config/rushx-config.json +++ b/frontend/packages/cozeloop/route/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["src/**"] } diff --git a/frontend/packages/cozeloop/shared-components/config/rushx-config.json b/frontend/packages/cozeloop/shared-components/config/rushx-config.json index ac5b51541..728e4122a 100644 --- a/frontend/packages/cozeloop/shared-components/config/rushx-config.json +++ b/frontend/packages/cozeloop/shared-components/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["src/**"] } diff --git a/frontend/packages/cozeloop/toolkit/config/rushx-config.json b/frontend/packages/cozeloop/toolkit/config/rushx-config.json index 163816fb2..728e4122a 100644 --- a/frontend/packages/cozeloop/toolkit/config/rushx-config.json +++ b/frontend/packages/cozeloop/toolkit/config/rushx-config.json @@ -1,5 +1,4 @@ { - "$schema": "../../../../rushx-config.schema.json", "dupCheck": { "ignoreGlobPatterns": ["src/**"] }