feat: manually mirror opencoze's code from bytedance

Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
fanlv
2025-07-20 17:36:12 +08:00
commit 890153324f
14811 changed files with 1923430 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.bytedance.net/rush-plugins/rush-build-cache-plugin-options.schema.json",
"key": "Wek6C-xcBtNNroagxV305NFAcmXOriQRps64",
"envList": [
// BUILD_TYPE 在 SCM 里面应该是 offline、test、online [Witty]
"BUILD_TYPE",
// bot studio 构建时需要根据 region 环境区分打包
"REGION",
// 用于区分 inhouse/release 环境
"CUSTOM_VERSION",
"CI",
"CI_LIGHTING",
// coze cli 构建时需要区分 inhouse/release 环境
"PUBLIC_INHOUSE"
]
}

View File

@@ -0,0 +1,25 @@
# Rush uses this file to configure the NPM package registry during installation. It is applicable
# to PNPM, NPM, and Yarn package managers. It is used by operations such as "rush install",
# "rush update", and the "install-run.js" scripts.
#
# NOTE: The "rush publish" command uses .npmrc-publish instead.
#
# Before invoking the package manager, Rush will copy this file to the folder where installation
# is performed. The copied file will omit any config lines that reference environment variables
# that are undefined in that session; this avoids problems that would otherwise result due to
# a missing variable being replaced by an empty string.
#
# * * * SECURITY WARNING * * *
#
# It is NOT recommended to store authentication tokens in a text file on a lab machine, because
# other unrelated processes may be able to read the file. Also, the file may persist indefinitely,
# for example if the machine loses power. A safer practice is to pass the token via an
# environment variable, which can be referenced from .npmrc using ${} expansion. For example:
#
# //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
#
registry=https://registry.npmjs.org
always-auth=false
prefer-frozen-lockfile=true
public-hoist-pattern[]=*storybook*

View File

@@ -0,0 +1,109 @@
/**
* This configuration file manages Rush integration with JFrog Artifactory services.
* More documentation is available on the Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/artifactory.schema.json",
"packageRegistry": {
/**
* (Required) Set this to "true" to enable Rush to manage tokens for an Artifactory NPM registry.
* When enabled, "rush install" will automatically detect when the user's ~/.npmrc
* authentication token is missing or expired. And "rush setup" will prompt the user to
* renew their token.
*
* The default value is false.
*/
"enabled": false,
/**
* (Required) Specify the URL of your NPM registry. This is the same URL that appears in
* your .npmrc file. It should look something like this example:
*
* https://your-company.jfrog.io/your-project/api/npm/npm-private/
*/
"registryUrl": "",
/**
* A list of custom strings that "rush setup" should add to the user's ~/.npmrc file at the time
* when the token is updated. This could be used for example to configure the company registry
* to be used whenever NPM is invoked as a standalone command (but it's not needed for Rush
* operations like "rush add" and "rush install", which get their mappings from the monorepo's
* common/config/rush/.npmrc file).
*
* NOTE: The ~/.npmrc settings are global for the user account on a given machine, so be careful
* about adding settings that may interfere with other work outside the monorepo.
*/
"userNpmrcLinesToAdd": [
// "@example:registry=https://your-company.jfrog.io/your-project/api/npm/npm-private/"
],
/**
* (Required) Specifies the URL of the Artifactory control panel where the user can generate
* an API key. This URL is printed after the "visitWebsite" message.
* It should look something like this example: https://your-company.jfrog.io/
* Specify an empty string to suppress this line entirely.
*/
"artifactoryWebsiteUrl": "",
/**
* Uncomment this line to specify the type of credential to save in the user's ~/.npmrc file.
* The default is "password", which means the user's API token will be traded in for an
* npm password specific to that registry. Optionally you can specify "authToken", which
* will save the user's API token as credentials instead.
*/
// "credentialType": "password",
/**
* These settings allow the "rush setup" interactive prompts to be customized, for
* example with messages specific to your team or configuration. Specify an empty string
* to suppress that message entirely.
*/
"messageOverrides": {
/**
* Overrides the message that normally says:
* "This monorepo consumes packages from an Artifactory private NPM registry."
*/
// "introduction": "",
/**
* Overrides the message that normally says:
* "Please contact the repository maintainers for help with setting up an Artifactory user account."
*/
// "obtainAnAccount": "",
/**
* Overrides the message that normally says:
* "Please open this URL in your web browser:"
*
* The "artifactoryWebsiteUrl" string is printed after this message.
*/
// "visitWebsite": "",
/**
* Overrides the message that normally says:
* "Your user name appears in the upper-right corner of the JFrog website."
*/
// "locateUserName": "",
/**
* Overrides the message that normally says:
* "Click 'Edit Profile' on the JFrog website. Click the 'Generate API Key'
* button if you haven't already done so previously."
*/
// "locateApiKey": ""
/**
* Overrides the message that normally prompts:
* "What is your Artifactory user name?"
*/
// "userNamePrompt": ""
/**
* Overrides the message that normally prompts:
* "What is your Artifactory API key?"
*/
// "apiKeyPrompt": ""
}
}
}

View File

@@ -0,0 +1,100 @@
/**
* This configuration file manages Rush's build cache feature.
* More documentation is available on the Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/build-cache.schema.json",
/**
* (Required) EXPERIMENTAL - Set this to true to enable the build cache feature.
*
* See https://rushjs.io/pages/maintainer/build_cache/ for details about this experimental feature.
*/
"buildCacheEnabled": false,
/**
* (Required) Choose where project build outputs will be cached.
*
* Possible values: "local-only", "azure-blob-storage", "amazon-s3"
*/
"cacheProvider": "local-only",
/**
* Setting this property overrides the cache entry ID. If this property is set, it must contain
* a [hash] token.
*
* Other available tokens:
* - [projectName]
* - [projectName:normalize]
* - [phaseName]
* - [phaseName:normalize]
* - [phaseName:trimPrefix]
*/
"cacheEntryNamePattern": "[projectName:normalize]-[phaseName:normalize]-[hash]",
/**
* Use this configuration with "cacheProvider"="azure-blob-storage"
*/
"azureBlobStorageConfiguration": {
/**
* (Required) The name of the the Azure storage account to use for build cache.
*/
// "storageAccountName": "example",
/**
* (Required) The name of the container in the Azure storage account to use for build cache.
*/
// "storageContainerName": "my-container",
/**
* The Azure environment the storage account exists in. Defaults to AzurePublicCloud.
*
* Possible values: "AzurePublicCloud", "AzureChina", "AzureGermany", "AzureGovernment"
*/
// "azureEnvironment": "AzurePublicCloud",
/**
* An optional prefix for cache item blob names.
*/
// "blobPrefix": "my-prefix",
/**
* If set to true, allow writing to the cache. Defaults to false.
*/
// "isCacheWriteAllowed": true
},
/**
* Use this configuration with "cacheProvider"="amazon-s3"
*/
"amazonS3Configuration": {
/**
* (Required unless s3Endpoint is specified) The name of the bucket to use for build cache.
* Example: "my-bucket"
*/
// "s3Bucket": "my-bucket",
/**
* (Required unless s3Bucket is specified) The Amazon S3 endpoint of the bucket to use for build cache.
* This should not include any path; use the s3Prefix to set the path.
* Examples: "my-bucket.s3.us-east-2.amazonaws.com" or "http://localhost:9000"
*/
// "s3Endpoint": "https://my-bucket.s3.us-east-2.amazonaws.com",
/**
* (Required) The Amazon S3 region of the bucket to use for build cache.
* Example: "us-east-1"
*/
// "s3Region": "us-east-1",
/**
* An optional prefix ("folder") for cache items. It should not start with "/".
*/
// "s3Prefix": "my-prefix",
/**
* If set to true, allow writing to the cache. Defaults to false.
*/
// "isCacheWriteAllowed": true
}
}

View File

@@ -0,0 +1,22 @@
/**
* This configuration file manages Rush's cobuild feature.
* More documentation is available on the Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/cobuild.schema.json",
/**
* (Required) EXPERIMENTAL - Set this to true to enable the cobuild feature.
* RUSH_COBUILD_CONTEXT_ID should always be specified as an environment variable with an non-empty string,
* otherwise the cobuild feature will be disabled.
*/
"cobuildFeatureEnabled": false,
/**
* (Required) Choose where cobuild lock will be acquired.
*
* The lock provider is registered by the rush plugins.
* For example, @rushstack/rush-redis-cobuild-plugin registers the "redis" lock provider.
*/
"cobuildLockProvider": "redis"
}

View File

@@ -0,0 +1,102 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json",
"commands": [
{
"name": "lint-staged",
"commandKind": "global",
"summary": "⭐️️ Use to run some task before commit",
"safeForSimultaneousRushProcesses": true,
"autoinstallerName": "rush-lint-staged",
"shellCommand": "lint-staged --config common/autoinstallers/rush-lint-staged/.lintstagedrc.js --shell '/bin/bash' --concurrent 8"
},
{
"commandKind": "bulk",
"name": "lint",
"ignoreMissingScript": true,
"enableParallelism": true,
"incremental": true,
"shellCommand": "eslint ./ --cache",
"allowWarningsInSuccessfulBuild": true,
"summary": "⭐️️ Run lint command for each package",
"safeForSimultaneousRushProcesses": true
},
{
"name": "commitlint",
"commandKind": "global",
"summary": "⭐️️ Used by the pre-commit Git hook. This command invokes commitlint to ensure that the commit messages meet the conventional commit format",
"safeForSimultaneousRushProcesses": true,
"autoinstallerName": "rush-commitlint",
"shellCommand": "commitlint"
},
{
"commandKind": "bulk",
"name": "test",
"description": "Executes automated tests.",
"allowWarningsInSuccessfulBuild": true,
"ignoreMissingScript": true,
"enableParallelism": true,
"summary": "⭐️️ Run test command for each package"
},
{
"commandKind": "bulk",
"name": "test:cov",
"description": "Executes automated tests with coverage collection.",
"allowWarningsInSuccessfulBuild": true,
"ignoreMissingScript": true,
"enableParallelism": true,
"incremental": true,
"ignoreDependencyOrder": true,
"safeForSimultaneousRushProcesses": true,
"summary": "⭐️️ Run coverage command for each package"
},
{
"commandKind": "bulk",
"name": "build",
"allowWarningsInSuccessfulBuild": true,
"ignoreMissingScript": true,
"enableParallelism": true,
"ignoreDependencyOrder": false,
"summary": "⭐️️ Run build command for each package"
},
{
"commandKind": "bulk",
"name": "pre-build",
"safeForSimultaneousRushProcesses": true,
"allowWarningsInSuccessfulBuild": true,
"ignoreMissingScript": true,
"enableParallelism": true,
"summary": "⭐️️ Run pre-build command for packages with tag:phase-prebuild"
},
{
"name": "commit",
"commandKind": "global",
"summary": "⭐️️ Commit lint hook",
"safeForSimultaneousRushProcesses": true,
"autoinstallerName": "rush-commitlint",
"shellCommand": "export PRE_LINT='1' && rush lint-staged && cd common/autoinstallers/rush-commitlint && git cz"
}
],
"parameters": [
{
"parameterKind": "string",
"argumentName": "MESSAGE",
"longName": "--edit",
"description": "",
"associatedCommands": ["commitlint"]
},
{
"parameterKind": "string",
"argumentName": "MESSAGE",
"longName": "--config",
"description": "",
"associatedCommands": ["commitlint"]
},
{
"parameterKind": "flag",
"longName": "--no-verify",
"shortName": "-n",
"description": "use no verify",
"associatedCommands": ["commit"]
}
]
}

View File

@@ -0,0 +1,27 @@
/**
* This configuration file allows repo maintainers to configure extra details to be
* printed alongside certain Rush messages. More documentation is available on the
* Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/custom-tips.schema.json",
/**
* Specifies the custom tips to be displayed by Rush.
*/
"customTips": [
// {
// /**
// * (REQUIRED) An identifier indicating a message that may be printed by Rush.
// * If that message is printed, then this custom tip will be shown.
// * Consult the Rush documentation for the current list of possible identifiers.
// */
// "tipId": "TIP_RUSH_INCONSISTENT_VERSIONS",
//
// /**
// * (REQUIRED) The message text to be displayed for this tip.
// */
// "message": "For additional troubleshooting information, refer this wiki article:\n\nhttps://intranet.contoso.com/docs/pnpm-mismatch"
// }
]
}

View File

@@ -0,0 +1,74 @@
/**
* This configuration file defines a deployment scenario for use with the "rush deploy" command.
* The default scenario file path is "deploy.json"; additional files use the naming pattern
* "deploy-<scenario-name>.json". For full documentation, please see https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/deploy-scenario.schema.json",
/**
* The "rush deploy" command prepares a deployment folder, starting from the main project and collecting
* all of its dependencies (both NPM packages and other Rush projects). The main project is specified
* using the "--project" parameter. The "deploymentProjectNames" setting lists the allowable choices for
* the "--project" parameter; this documents the intended deployments for your monorepo and helps validate
* that "rush deploy" is invoked correctly. If there is only one item in the "deploymentProjectNames" array,
* then "--project" can be omitted. The names should be complete package names as declared in rush.json.
*
* If the main project should include other unrelated Rush projects, add it to the "projectSettings" section,
* and then specify those projects in the "additionalProjectsToInclude" list.
*/
"deploymentProjectNames": [
"@coze-studio/app"
],
// solve deploy error: ERROR: Symlink targets not under folder
"dependencySettings": [],
/**
* When deploying a local Rush project, the package.json "devDependencies" are normally excluded.
* If you want to include them, set "includeDevDependencies" to true.
*
* The default value is false.
*/
// "includeDevDependencies": true,
/**
* When deploying a local Rush project, normally the .npmignore filter is applied so that Rush only copies
* files that would be packaged by "npm pack". Setting "includeNpmIgnoreFiles" to true will disable this
* filtering so that all files are copied (with a few trivial exceptions such as the "node_modules" folder).
*
* The default value is false.
*/
"includeNpmIgnoreFiles": false,
/**
* To improve backwards compatibility with legacy packages, the PNPM package manager installs extra links in the
* node_modules folder that enable packages to import undeclared dependencies. In some cases this workaround may
* double the number of links created. If your deployment does not require this workaround, you can set
* "omitPnpmWorkaroundLinks" to true to avoid creating the extra links.
*
* The default value is false.
*/
// "omitPnpmWorkaroundLinks": true,
/**
* Specify how links (symbolic links, hard links, and/or NTFS junctions) will be created in the deployed folder:
*
* - "default": Create the links while copying the files; this is the default behavior.
* - "script": A Node.js script called "create-links.js" will be written. When executed, this script will
* create the links described in the "deploy-metadata.json" output file.
* - "none": Do nothing; some other tool may create the links later.
*/
// "linkCreation": "script",
/**
* If this path is specified, then after "rush deploy", recursively copy the files from this folder to
* the deployment target folder (common/deploy). This can be used to provide additional configuration files
* or scripts needed by the server when deploying. The path is resolved relative to the repository root.
*/
// "folderToCopy": "repo-tools/assets/deploy-config",
/**
* Customize how Rush projects are processed during deployment.
*/
"projectSettings": []
}

View File

@@ -0,0 +1,67 @@
/**
* This configuration file allows repo maintainers to enable and disable experimental
* Rush features. More documentation is available on the Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/experiments.schema.json",
/**
* By default, 'rush install' passes --no-prefer-frozen-lockfile to 'pnpm install'.
* Set this option to true to pass '--frozen-lockfile' instead for faster installs.
*/
"usePnpmFrozenLockfileForRushInstall": true,
/**
* By default, 'rush update' passes --no-prefer-frozen-lockfile to 'pnpm install'.
* Set this option to true to pass '--prefer-frozen-lockfile' instead to minimize shrinkwrap changes.
*/
"usePnpmPreferFrozenLockfileForRushUpdate": true,
/**
* By default, 'rush update' runs as a single operation.
* Set this option to true to instead update the lockfile with `--lockfile-only`, then perform a `--frozen-lockfile` install.
* Necessary when using the `afterAllResolved` hook in .pnpmfile.cjs.
*/
// "usePnpmLockfileOnlyThenFrozenLockfileForRushUpdate": true,
/**
* If using the 'preventManualShrinkwrapChanges' option, restricts the hash to only include the layout of external dependencies.
* Used to allow links between workspace projects or the addition/removal of references to existing dependency versions to not
* cause hash changes.
*/
// "omitImportersFromPreventManualShrinkwrapChanges": true,
/**
* If true, the chmod field in temporary project tar headers will not be normalized.
* This normalization can help ensure consistent tarball integrity across platforms.
*/
// "noChmodFieldInTarHeaderNormalization": true,
/**
* If true, build caching will respect the allowWarningsInSuccessfulBuild flag and cache builds with warnings.
* This will not replay warnings from the cached build.
*/
"buildCacheWithAllowWarningsInSuccessfulBuild": true,
/**
* If true, the phased commands feature is enabled. To use this feature, create a "phased" command
* in common/config/rush/command-line.json.
*/
// "phasedCommands": true,
/**
* If true, perform a clean install after when running `rush install` or `rush update` if the
* `.npmrc` file has changed since the last install.
*/
// "cleanInstallAfterNpmrcChanges": true,
/**
* If true, print the outputs of shell commands defined in event hooks to the console.
*/
"printEventHooksOutputToConsole": false,
/**
* If true, Rush will not allow node_modules in the repo folder or in parent folders.
*/
"forbidPhantomResolvableNodeModulesFolders": true
}

View File

@@ -0,0 +1,36 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/pnpm-config.schema.json",
"useWorkspaces": true,
"autoInstallPeers": true,
"strictPeerDependencies": false,
"environmentVariables": {
"NODE_OPTIONS": {
"value": "--max-old-space-size=4096",
"override": false
}
},
"globalOverrides": {
"sass@1.74.1>immutable": "3.8.2",
"web-streams-polyfill": "3.3.2",
"vitest@1.4.0>vite": "5.1.6",
"debug": "4.3.3",
"type-fest": "3.13.1",
"@types/node": "18.18.9",
"leveldown": "6.1.1",
"ahooks": "3.7.8",
"terser-webpack-plugin@5.3.10>webpack": "5.89.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss@3.3.6>postcss": "8.4.49",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"@coze-arch/coze-design": "0.0.6-alpha.101d0c",
"typescript": "5.8.2"
},
"globalPeerDependencyRules": {},
"globalPackageExtensions": {},
"globalNeverBuiltDependencies": ["canvas", "better-sqlite3"],
"globalAllowedDeprecatedVersions": {},
"globalPatchedDependencies": {},
"unsupportedPackageJsonSettings": {}
}

View File

@@ -0,0 +1,4 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
"preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f"
}

View File

@@ -0,0 +1,40 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush-plugins.schema.json",
"plugins": [
{
"packageName": "rush-init-project-plugin",
"pluginName": "rush-init-project-plugin",
"autoinstallerName": "plugins"
},
{
"packageName": "@coze-arch/rush-run-tsc-plugin",
"pluginName": "@coze-arch/rush-run-tsc-plugin",
"autoinstallerName": "plugins"
},
{
"packageName": "@coze-arch/rush-publish-plugin",
"pluginName": "@coze-arch/rush-publish-plugin",
"autoinstallerName": "plugins"
},
{
"packageName": "@coze-arch/rush-fix-ts-refers-plugin",
"pluginName": "@coze-arch/rush-fix-ts-refers-plugin",
"autoinstallerName": "plugins"
},
{
"packageName": "@coze-arch/rush-increment-run-plugin",
"pluginName": "@coze-arch/rush-increment-run-plugin",
"autoinstallerName": "plugins"
},
{
"packageName": "@coze-arch/rush-dep-level-check-plugin",
"pluginName": "@coze-arch/rush-dep-level-check-plugin",
"autoinstallerName": "plugins"
},
{
"packageName": "@coze-arch/rush-clear-build-cache-plugin",
"pluginName": "@coze-arch/rush-clear-build-cache-plugin",
"autoinstallerName": "plugins"
}
]
}

View File

@@ -0,0 +1,30 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/subspaces.schema.json",
/**
* Set this flag to "true" to enable usage of subspaces.
*/
"subspacesEnabled": true,
/**
* When a command such as "rush update" is invoked without the "--subspace" or "--to"
* parameters, Rush will install all subspaces. In a huge monorepo with numerous subspaces,
* this would be extremely slow. Set "preventSelectingAllSubspaces" to true to avoid this
* mistake by always requiring selection parameters for commands such as "rush update".
*/
"preventSelectingAllSubspaces": false,
/**
* The list of subspace names, which should be lowercase alphanumeric words separated by
* hyphens, for example "my-subspace". The corresponding config files will have paths
* such as "common/config/subspaces/my-subspace/package-lock.yaml".
*/
"subspaceNames": [
// The "default" subspace always exists even if you don't define it,
// but let's include it for clarity
"default",
"e2e", // 👈👈👈 Our secondary subspace name
"e2e-opencoze"
]
}

View File

@@ -0,0 +1,102 @@
/**
* This is configuration file is used for advanced publishing configurations with Rush.
* More documentation is available on the Rush website: https://rushjs.io
*/
/**
* A list of version policy definitions. A "version policy" is a custom package versioning
* strategy that affects "rush change", "rush version", and "rush publish". The strategy applies
* to a set of projects that are specified using the "versionPolicyName" field in rush.json.
*/
[
// {
// /**
// * (Required) Indicates the kind of version policy being defined ("lockStepVersion" or "individualVersion").
// *
// * The "lockStepVersion" mode specifies that the projects will use "lock-step versioning". This
// * strategy is appropriate for a set of packages that act as selectable components of a
// * unified product. The entire set of packages are always published together, and always share
// * the same NPM version number. When the packages depend on other packages in the set, the
// * SemVer range is usually restricted to a single version.
// */
// "definitionName": "lockStepVersion",
//
// /**
// * (Required) The name that will be used for the "versionPolicyName" field in rush.json.
// * This name is also used command-line parameters such as "--version-policy"
// * and "--to-version-policy".
// */
// "policyName": "MyBigFramework",
//
// /**
// * (Required) The current version. All packages belonging to the set should have this version
// * in the current branch. When bumping versions, Rush uses this to determine the next version.
// * (The "version" field in package.json is NOT considered.)
// */
// "version": "1.0.0",
//
// /**
// * (Required) The type of bump that will be performed when publishing the next release.
// * When creating a release branch in Git, this field should be updated according to the
// * type of release.
// *
// * Valid values are: "prerelease", "minor", "patch", "major"
// */
// "nextBump": "prerelease",
//
// /**
// * (Optional) If specified, all packages in the set share a common CHANGELOG.md file.
// * This file is stored with the specified "main" project, which must be a member of the set.
// *
// * If this field is omitted, then a separate CHANGELOG.md file will be maintained for each
// * package in the set.
// */
// "mainProject": "my-app",
//
// /**
// * (Optional) If enabled, the "rush change" command will prompt the user for their email address
// * and include it in the JSON change files. If an organization maintains multiple repos, tracking
// * this contact information may be useful for a service that automatically upgrades packages and
// * needs to notify engineers whose change may be responsible for a downstream build break. It might
// * also be useful for crediting contributors. Rush itself does not do anything with the collected
// * email addresses. The default value is "false".
// */
// // "includeEmailInChangeFile": true
// },
//
// {
// /**
// * (Required) Indicates the kind of version policy being defined ("lockStepVersion" or "individualVersion").
// *
// * The "individualVersion" mode specifies that the projects will use "individual versioning".
// * This is the typical NPM model where each package has an independent version number
// * and CHANGELOG.md file. Although a single CI definition is responsible for publishing the
// * packages, they otherwise don't have any special relationship. The version bumping will
// * depend on how developers answer the "rush change" questions for each package that
// * is changed.
// */
// "definitionName": "individualVersion",
//
// "policyName": "MyRandomLibraries",
//
// /**
// * (Optional) This can be used to enforce that all packages in the set must share a common
// * major version number, e.g. because they are from the same major release branch.
// * It can also be used to discourage people from accidentally making "MAJOR" SemVer changes
// * inappropriately. The minor/patch version parts will be bumped independently according
// * to the types of changes made to each project, according to the "rush change" command.
// */
// "lockedMajor": 3,
//
// /**
// * (Optional) When publishing is managed by Rush, by default the "rush change" command will
// * request changes for any projects that are modified by a pull request. These change entries
// * will produce a CHANGELOG.md file. If you author your CHANGELOG.md manually or announce updates
// * in some other way, set "exemptFromRushChange" to true to tell "rush change" to ignore the projects
// * belonging to this version policy.
// */
// "exemptFromRushChange": false,
//
// // "includeEmailInChangeFile": true
// }
]

View File

@@ -0,0 +1,25 @@
# Rush uses this file to configure the NPM package registry during installation. It is applicable
# to PNPM, NPM, and Yarn package managers. It is used by operations such as "rush install",
# "rush update", and the "install-run.js" scripts.
#
# NOTE: The "rush publish" command uses .npmrc-publish instead.
#
# Before invoking the package manager, Rush will copy this file to the folder where installation
# is performed. The copied file will omit any config lines that reference environment variables
# that are undefined in that session; this avoids problems that would otherwise result due to
# a missing variable being replaced by an empty string.
#
# * * * SECURITY WARNING * * *
#
# It is NOT recommended to store authentication tokens in a text file on a lab machine, because
# other unrelated processes may be able to read the file. Also, the file may persist indefinitely,
# for example if the machine loses power. A safer practice is to pass the token via an
# environment variable, which can be referenced from .npmrc using ${} expansion. For example:
#
# //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
#
registry=https://registry.npmjs.org
always-auth=false
prefer-frozen-lockfile=true
public-hoist-pattern[]=*storybook*

View File

@@ -0,0 +1,53 @@
'use strict';
/**
* When using the PNPM package manager, you can use pnpmfile.js to workaround
* dependencies that have mistakes in their package.json file. (This feature is
* functionally similar to Yarn's "resolutions".)
*
* For details, see the PNPM documentation:
* https://pnpm.js.org/docs/en/hooks.html
*
* IMPORTANT: SINCE THIS FILE CONTAINS EXECUTABLE CODE, MODIFYING IT IS LIKELY TO INVALIDATE
* ANY CACHED DEPENDENCY ANALYSIS. After any modification to pnpmfile.js, it's recommended to run
* "rush update --full" so that PNPM will recalculate all version selections.
*/
module.exports = {
hooks: {
readPackage,
},
};
/**
* This hook is invoked during installation before a package's dependencies
* are selected.
* The `packageJson` parameter is the deserialized package.json
* contents for the package that is about to be installed.
* The `context` parameter provides a log() function.
* The return value is the updated object.
*/
function readPackage(packageJson, context) {
// // The karma types have a missing dependency on typings from the log4js package.
// if (packageJson.name === '@types/karma') {
// context.log('Fixed up dependencies for @types/karma');
// packageJson.dependencies['log4js'] = '0.6.38';
// }
switch (packageJson.name) {
case '@nclc/plugin-manager': {
delete packageJson.dependencies['react'];
break;
}
case '@bdeefe/suite-design': {
packageJson.peerDependencies['react-dom'] =
packageJson.peerDependencies['react'];
break;
}
case '@byte-starry/nclc-types': {
packageJson.peerDependencies = {};
break;
}
}
return packageJson;
}

View File

@@ -0,0 +1,49 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/common-versions.schema.json",
"ensureConsistentVersions": true,
"preferredVersions": {
"@coze-arch/coze-design": "0.0.6-alpha.101d0c"
},
"allowedAlternativeVersions": {
"@coze-arch/coze-design": ["0.0.6-alpha.101d0c"],
"@rspack/cli": ["0.6.0"],
"@rspack/core": ["0.6.0", ">=0.7"],
"@rspack/plugin-react-refresh": ["0.6.0"],
"@rsbuild/core": ["0.7.1", "~1.1.0", "1.1.13", "~1.3.1"],
"@rsbuild/plugin-svgr": ["0.7.1", "~1.0.5", "~1.0.6", "~1.0.7"],
"@rsbuild/plugin-less": ["~1.1.0", "~1.2.1"],
"@rsbuild/plugin-react": ["0.7.1", "~1.0.7", "~1.1.0", "~1.1.1"],
"@inquirer/prompts": ["^5.3.5"],
"react-router": ["^6.22.0", "^4.0.0 || ^5.0.0"],
"react-router-dom": ["^6.22.0"],
"mobx-react-lite": ["^4.0.7"],
"@babel/core": ["^7.26.0"],
"@babel/runtime": ["^7.26.0"],
"webpack": ["~5.91.0"],
"postcss": ["^8.4.49"],
"storybook": ["~8.4.2"],
"@storybook/addon-essentials": ["~8.4.2"],
"@storybook/blocks": ["~8.4.2"],
"@storybook/react": ["~8.4.2"],
"@swc/helpers": ["0.5.3"],
"@rushstack/rush-sdk": ["5.147.1"],
"@douyinfe/semi-ui": ["2.49.2", "2.61.0"],
"styled-components": [">= 2", ">=4"],
"less": ["^3.13.1"],
"axios": ["^1.7.1"],
"@types/node": ["18.18.9"],
"tailwindcss": [">=3.0.0 || insiders"],
"less-loader": ["^7.1.0"],
"react-is": [">=16.8.0", ">=16.8.0 || >=17.0.0"],
"typescript": ["5.7.2"],
"@storybook/addon-interactions": ["^7.6.7", "~8.4.2"],
"@storybook/addon-links": ["^7.6.7", "~8.4.2"],
"@rsbuild/plugin-sass": ["0.7.1", "~1.1.0"],
"prop-types": ["^15.5.7", "^15.6.2"],
"nanoid": ["3.3.7"],
"react-native": [">=0.58"],
"ahooks": ["^3.8.0"],
"@visactor/vchart": ["1.13.8", "1.11.3"],
"@mui/material": ["^5.0.0"]
}
}

View File

@@ -0,0 +1,46 @@
{
"useWorkspaces": true,
"autoInstallPeers": true,
"strictPeerDependencies": false,
"environmentVariables": {
"NODE_OPTIONS": {
"value": "--max-old-space-size=4096",
"override": false
}
},
"globalOverrides": {
"@coze-arch/coze-design": "0.0.6-alpha.101d0c",
"inversify": "6.0.2",
"sass@1.74.1>immutable": "3.8.2",
"web-streams-polyfill": "3.3.2",
"vitest@1.4.0>vite": "5.1.6",
"debug": "4.3.3",
"type-fest": "3.13.1",
"@types/node": "18.18.9",
"leveldown": "6.1.1",
"ahooks": "3.7.8",
"terser-webpack-plugin@5.3.10>webpack": "5.89.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss@3.3.6>postcss": "8.4.49",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"typescript": "5.8.2",
"mdast-util-gfm>mdast-util-gfm-autolink-literal": "2.0.0"
},
"globalPeerDependencyRules": {
"allowedVersions": {
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15"
}
},
"globalPackageExtensions": {},
"globalNeverBuiltDependencies": ["canvas", "better-sqlite3"],
"globalAllowedDeprecatedVersions": {},
"globalPatchedDependencies": {
"web-streams-polyfill@3.3.2": "patches/web-streams-polyfill@3.3.2.patch",
"ahooks@3.7.8": "patches/ahooks@3.7.8.patch",
"@douyinfe/semi-rspack-plugin@2.61.0": "patches/@douyinfe__semi-rspack-plugin@2.61.0.patch"
},
"unsupportedPackageJsonSettings": {}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
diff --git a/lib/loaders/semi-theme-loader.js b/lib/loaders/semi-theme-loader.js
index d43048cc5919b8720f6ebfba37c9313d89ae857c..863954ee319c964188b2272091b19c6e8f21b0b3 100644
--- a/lib/loaders/semi-theme-loader.js
+++ b/lib/loaders/semi-theme-loader.js
@@ -14,12 +14,6 @@ function SemiThemeLoader(source) {
// inject once
const cssVarStr = `@import "~${theme}/scss/global.scss";\n`;
let animationStr = `@import "~${theme}/scss/animation.scss";\n`;
- try {
- require.resolve(`${theme}/scss/animation.scss`);
- }
- catch (e) {
- animationStr = ''; // fallback to empty string
- }
const shouldInject = source.includes('semi-base');
let fileStr = source;
let componentVariables;

View File

@@ -0,0 +1,26 @@
diff --git a/es/useInfiniteScroll/index.js b/es/useInfiniteScroll/index.js
index 55d84ef685df259db1fc3ab0e72f1dd2f9112685..1fb357f6bef8d9d3897b0f029ad0063092fad017 100644
--- a/es/useInfiniteScroll/index.js
+++ b/es/useInfiniteScroll/index.js
@@ -67,7 +67,7 @@ var useInfiniteScroll = function (service, options) {
setTimeout(function () {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
scrollMethod();
- });
+ },10);
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(d);
},
onError: function (e) {
diff --git a/lib/useInfiniteScroll/index.js b/lib/useInfiniteScroll/index.js
index 1316c779812180c4d85b52b226f8b0bf7cb6319e..2da9301551d1a939e94ca032e3bf28c5a061bd30 100644
--- a/lib/useInfiniteScroll/index.js
+++ b/lib/useInfiniteScroll/index.js
@@ -74,7 +74,7 @@ var useInfiniteScroll = function useInfiniteScroll(service, options) {
setTimeout(function () {
// eslint-disable-next-line @typescript-eslint/no-use-before-define
scrollMethod();
- });
+ },10);
_onSuccess === null || _onSuccess === void 0 ? void 0 : _onSuccess(d);
},
onError: function onError(e) {

View File

@@ -0,0 +1,53 @@
diff --git a/dist/types/polyfill.d.ts b/dist/types/polyfill.d.ts
index e44c6635e7579aa8abbd08c6ad3271ebbe60a464..b4bc055b17952a2c148d2e4b8588306099b8fea1 100644
--- a/dist/types/polyfill.d.ts
+++ b/dist/types/polyfill.d.ts
@@ -130,12 +130,12 @@ export declare class ReadableByteStreamController {
*
* @public
*/
-export declare class ReadableStream<R = any> {
- constructor(underlyingSource: UnderlyingByteSource, strategy?: {
+export interface ReadableStream<R = any> {
+ new (underlyingSource: UnderlyingByteSource, strategy?: {
highWaterMark?: number;
size?: undefined;
});
- constructor(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>);
+ new (underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>);
/**
* Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.
*/
@@ -267,11 +267,8 @@ export declare class ReadableStreamBYOBReader {
* @public
*/
export declare type ReadableStreamBYOBReadResult<T extends ArrayBufferView> = {
- done: false;
+ done: boolean;
value: T;
-} | {
- done: true;
- value: T | undefined;
};
/**
diff --git a/dist/types/ts3.6/polyfill.d.ts b/dist/types/ts3.6/polyfill.d.ts
index c398f7eb0a65382916e2a94490dab5c7f2d2d390..ffc798107af0cf83bb330caf9025838e23dcfcb7 100644
--- a/dist/types/ts3.6/polyfill.d.ts
+++ b/dist/types/ts3.6/polyfill.d.ts
@@ -130,12 +130,12 @@ export declare class ReadableByteStreamController {
*
* @public
*/
-export declare class ReadableStream<R = any> {
- constructor(underlyingSource: UnderlyingByteSource, strategy?: {
+export interface ReadableStream<R = any> {
+ new (underlyingSource: UnderlyingByteSource, strategy?: {
highWaterMark?: number;
size?: undefined;
});
- constructor(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>);
+ new (underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>);
/**
* Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.
*/

View File

@@ -0,0 +1,84 @@
diff --git a/dist/types/ponyfill.d.ts b/dist/types/ponyfill.d.ts
index f34e6659372d838f8f189f3f453eb664524e11f2..d1e9a9e65c4f95950f214704b3855ec97b861e3c 100644
--- a/dist/types/ponyfill.d.ts
+++ b/dist/types/ponyfill.d.ts
@@ -126,12 +126,12 @@ export declare class ReadableByteStreamController {
*
* @public
*/
-export declare class ReadableStream<R = any> {
- constructor(underlyingSource: UnderlyingByteSource, strategy?: {
+export interface ReadableStream<R = any> {
+ new(underlyingSource: UnderlyingByteSource, strategy?: {
highWaterMark?: number;
size?: undefined;
});
- constructor(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>);
+ new(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>);
/*
* Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.
*/
@@ -220,7 +220,7 @@ export declare class ReadableStream<R = any> {
* This can be used to adapt various kinds of objects into a readable stream,
* such as an array, an async generator, or a Node.js readable stream.
*/
- static from<R>(asyncIterable: Iterable<R> | AsyncIterable<R> | ReadableStreamLike<R>): ReadableStream<R>;
+ from<R>(asyncIterable: Iterable<R> | AsyncIterable<R> | ReadableStreamLike<R>): ReadableStream<R>;
}
/**
* An async iterator returned by {@link ReadableStream.values}.
@@ -279,11 +279,8 @@ export declare interface ReadableStreamBYOBReaderReadOptions {
* @public
*/
export declare type ReadableStreamBYOBReadResult<T extends ArrayBufferView> = {
- done: false;
+ done: boolean;
value: T;
-} | {
- done: true;
- value: T | undefined;
};
/**
* A pull-into request in a {@link ReadableByteStreamController}.
diff --git a/dist/types/ts3.6/ponyfill.d.ts b/dist/types/ts3.6/ponyfill.d.ts
index 73058007c661c20662d5c9336cb272cc7b7948fe..02fc82bd0d38b3b50856dff6722c31990eaf3156 100644
--- a/dist/types/ts3.6/ponyfill.d.ts
+++ b/dist/types/ts3.6/ponyfill.d.ts
@@ -134,12 +134,12 @@ export declare class ReadableByteStreamController {
*
* @public
*/
-export declare class ReadableStream<R = any> {
- constructor(underlyingSource: UnderlyingByteSource, strategy?: {
+export interface ReadableStream<R = any> {
+ new(underlyingSource: UnderlyingByteSource, strategy?: {
highWaterMark?: number;
size?: undefined;
});
- constructor(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>);
+ new(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>);
/**
* Whether or not the readable stream is locked to a {@link ReadableStreamDefaultReader | reader}.
*/
@@ -225,7 +225,7 @@ export declare class ReadableStream<R = any> {
* This can be used to adapt various kinds of objects into a readable stream,
* such as an array, an async generator, or a Node.js readable stream.
*/
- static from<R>(asyncIterable: Iterable<R> | AsyncIterable<R> | ReadableStreamLike<R>): ReadableStream<R>;
+ from<R>(asyncIterable: Iterable<R> | AsyncIterable<R> | ReadableStreamLike<R>): ReadableStream<R>;
}
/**
@@ -288,11 +288,8 @@ export declare interface ReadableStreamBYOBReaderReadOptions {
* @public
*/
export declare type ReadableStreamBYOBReadResult<T extends ArrayBufferView> = {
- done: false;
+ done: boolean;
value: T;
-} | {
- done: true;
- value: T | undefined;
};
/**

View File

@@ -0,0 +1,4 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
"preferredVersionsHash": "92954d50ed42b259ae8eb030b1cd5a4aa3b9319e"
}

View File

@@ -0,0 +1,31 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
neverBuiltDependencies:
- better-sqlite3
- canvas
overrides:
sass@1.74.1>immutable: 3.8.2
web-streams-polyfill: 3.3.2
vitest@1.4.0>vite: 5.1.6
debug: 4.3.3
type-fest: 3.13.1
'@types/node': 18.18.9
leveldown: 6.1.1
ahooks: 3.7.8
terser-webpack-plugin@5.3.10>webpack: 5.89.0
react: 18.2.0
react-dom: 18.2.0
tailwindcss@3.3.6>postcss: 8.4.49
'@types/react': 18.2.37
'@types/react-dom': 18.2.15
'@coze-arch/coze-design': 0.0.6-alpha.101d0c
typescript: 5.8.2
importers:
.: {}

View File

@@ -0,0 +1,4 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
"preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f"
}

View File

@@ -0,0 +1,25 @@
# Rush uses this file to configure the NPM package registry during installation. It is applicable
# to PNPM, NPM, and Yarn package managers. It is used by operations such as "rush install",
# "rush update", and the "install-run.js" scripts.
#
# NOTE: The "rush publish" command uses .npmrc-publish instead.
#
# Before invoking the package manager, Rush will copy this file to the folder where installation
# is performed. The copied file will omit any config lines that reference environment variables
# that are undefined in that session; this avoids problems that would otherwise result due to
# a missing variable being replaced by an empty string.
#
# * * * SECURITY WARNING * * *
#
# It is NOT recommended to store authentication tokens in a text file on a lab machine, because
# other unrelated processes may be able to read the file. Also, the file may persist indefinitely,
# for example if the machine loses power. A safer practice is to pass the token via an
# environment variable, which can be referenced from .npmrc using ${} expansion. For example:
#
# //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}
#
registry=https://registry.npmjs.org
always-auth=false
prefer-frozen-lockfile=true
public-hoist-pattern[]=*storybook*

View File

@@ -0,0 +1,38 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/pnpm-config.schema.json",
"useWorkspaces": true,
"autoInstallPeers": true,
"strictPeerDependencies": false,
"environmentVariables": {
"NODE_OPTIONS": {
"value": "--max-old-space-size=4096",
"override": false
}
},
"globalOverrides": {
"sass@1.74.1>immutable": "3.8.2",
"web-streams-polyfill": "3.3.2",
"vitest@1.4.0>vite": "5.1.6",
"debug": "4.3.3",
"type-fest": "3.13.1",
"@types/node": "18.18.9",
"leveldown": "6.1.1",
"ahooks": "3.7.8",
"terser-webpack-plugin@5.3.10>webpack": "5.89.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss@3.3.6>postcss": "8.4.49",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"typescript": "5.8.2"
},
"globalPeerDependencyRules": {},
"globalPackageExtensions": {},
"globalNeverBuiltDependencies": [
"canvas",
"better-sqlite3"
],
"globalAllowedDeprecatedVersions": {},
"globalPatchedDependencies": {},
"unsupportedPackageJsonSettings": {}
}

1089
common/config/subspaces/e2e/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
{
"preferredVersionsHash": "bf21a9e8fbc5a3846fb05b4fa0859e0917b2202f"
}