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,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"
}