mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-18 23:42:43 +00:00
* chore(deps): re-upgrade ink 6 → 7.0.3 (upstream Static remount fix landed) PR #3860 first upgraded ink 6 → 7.0.2. PR #4083 reverted because of a TUI regression: `<Static>` did not re-emit items when its `key` prop was bumped, so `/clear` / Ctrl+O / refreshStatic left the history area blank under ink 7.0.2. ink 7.0.3 (released after #4083) contains the exact fixes: - be9f44cda Fix: <Static> remount via key change drops new items (#948) - 669c4386c Fix: Drop stale <Static> output from fullStaticOutput on identity change (#950) - 7c2267c01 Fix `useBoxMetrics` not accepting ref objects with an initial null value (#945) Changes: - `ink` ^6.2.3 → ^7.0.3 (root hoist + cli direct) - `react` ^19.1.0 → ^19.2.4 (cli direct; ink 7.0.3 peerDeps requires >=19.2.0) - `react`/`react-dom` overrides ^19.2.4 added so the transitive graph stays deduped to a single instance (avoids `Invalid hook call` from multiple React copies, the classic ink-upgrade hazard) - `wrap-ansi` already on ^10.0.0 from #4083's partial-revert (no change) Verified: - `npm ls ink` → single `ink@7.0.3` across all peer deps - `npm ls react` → single `react@19.2.4` - `npm run typecheck --workspace=@qwen-code/qwen-code` clean - `npm run typecheck --workspace=@qwen-code/qwen-code-core` clean - Composer.test.tsx 20/20, MainContent.test.tsx 6/6, TableRenderer.test.tsx 59/59 + 1 skipped — all key UI components green on the new ink The Static-remount regression is upstream-fixed in 7.0.3, so the runtime path is restored without needing #3941's overflowY-self-managed viewport. #3941 (virtual viewport) remains an opt-in performance feature on top. * fix(deps,cli): add @types/react overrides + move refreshStatic out of setCurrentModel updater Two follow-ups from the multi-round audit of the ink 7.0.3 re-upgrade: 1. @types/react / @types/react-dom now pinned to ^19.2.0 in root overrides. packages/web-templates still declares @types/react ^18.2.0 in its devDeps. Today the CLI build is unaffected (web-templates's 18.x types are nested in its own node_modules and the React-using src/insight and src/export-html files are excluded from its tsconfig build), but a future reincludes-or-hoist accident would land conflicting global JSX namespaces in the CLI compile graph. Match the dep dedup we already enforce for `react` and `react-dom` so the type graph stays as deduped as the runtime graph. 2. AppContainer's onModelChange handler was calling refreshStatic() as a side-effect inside the setCurrentModel updater. React.StrictMode double-invokes state updaters in dev, so model swaps fired two clearTerminal writes + two <Static> key bumps. The double work was masked under ink 6 (key changes were no-ops on <Static>), but ink 7.0.3 honors key changes — the doubled work is now potentially visible as a faster flash-flash on every model switch. Refactor: setCurrentModel becomes a pure setter; refreshStatic moves into a useEffect keyed on currentModel with a ref-comparison guard so the first render doesn't fire. Single clearTerminal write per real model change, even under StrictMode. Verified: npm ls ink → single 7.0.3, npm ls react → single 19.2.4, npm ls @types/react → 19.2.10 hoisted (npm flags web-templates's 18.x constraint as overridden, which is the intended behavior). Typecheck clean across cli + core workspaces. * fix(cli): collapse model-change effect back into one batched handler wenshao's PR #4119 review correctly flagged that splitting the onModelChange flow into two effects (b25831b0e) reintroduced the issue #3899 freeze regression on every model switch: 1. setCurrentModel(model) commits first, with the OLD historyRemountKey. 2. <Static key={`${historyRemountKey}-${currentModel}`}> sees its key change (because currentModel did) and remounts immediately. 3. MainContent's render-phase progressive-replay reset only fires when historyRemountKey changes, so replayCount is still the full mergedHistory.length from any prior catch-up. 4. The remounted Static dumps the entire history in one synchronous layout pass — exactly the freeze progressive replay was added to avoid (#3899). The second effect's refreshStatic() bump arrives a render too late. Fix: do not split. Both side effects (refreshStatic, which writes clearTerminal + bumps historyRemountKey, and setCurrentModel) live in the event handler again, with a ref guard for same-model notifications. The React.StrictMode concern that motivatedb25831b0eis addressed by keeping the side effect OUT of the setState updater (it now runs once per event-handler invocation, not once per double-invoked updater call). Both setState calls land in the same React batch, so historyRemountKey and currentModel update together — MainContent's render-phase reset sees the new key, replayCount drops to the first chunk, and Static remounts with chunked replay intact. Tests: - AppContainer.test.tsx: 4 new tests covering the synchronous refreshStatic side-effect contract, same-model no-op, ref-guarded StrictMode double-invoke, and unsubscribe-on-unmount. - MainContent.test.tsx: new regression guard — when currentModel changes but historyRemountKey is held constant, progressive replay must NOT reset (pins the MainContent invariant the two-effect refactor accidentally relied on). Verified: vitest packages/cli AppContainer + MainContent green (82/82). Typecheck clean. Generated with AI Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> --------- Co-authored-by: 秦奇 <gary.gq@alibaba-inc.com> Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
157 lines
7.2 KiB
JSON
157 lines
7.2 KiB
JSON
{
|
|
"name": "@qwen-code/qwen-code",
|
|
"version": "0.15.11",
|
|
"engines": {
|
|
"node": ">=22.0.0"
|
|
},
|
|
"type": "module",
|
|
"workspaces": [
|
|
"packages/*",
|
|
"packages/channels/base",
|
|
"packages/channels/telegram",
|
|
"packages/channels/weixin",
|
|
"packages/channels/dingtalk",
|
|
"packages/channels/plugin-example"
|
|
],
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/QwenLM/qwen-code.git"
|
|
},
|
|
"config": {
|
|
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.15.11"
|
|
},
|
|
"scripts": {
|
|
"start": "cross-env node scripts/start.js",
|
|
"dev": "node scripts/dev.js",
|
|
"debug": "cross-env DEBUG=1 node --inspect-brk scripts/start.js",
|
|
"generate": "node scripts/generate-git-commit-info.js",
|
|
"generate:settings-schema": "node --import tsx/esm scripts/generate-settings-schema.ts",
|
|
"build": "node scripts/build.js",
|
|
"build-and-start": "npm run build && npm run start",
|
|
"build:vscode": "node scripts/build_vscode_companion.js",
|
|
"build:all": "npm run build && npm run build:sandbox && npm run build:vscode",
|
|
"build:packages": "npm run build --workspaces",
|
|
"build:sandbox": "node scripts/build_sandbox.js",
|
|
"bundle": "npm run generate && node esbuild.config.js && node scripts/copy_bundle_assets.js",
|
|
"test": "npm run test --workspaces --if-present --parallel",
|
|
"test:ci": "npm run test:ci --workspaces --if-present --parallel && npm run test:scripts",
|
|
"test:scripts": "vitest run --config ./scripts/tests/vitest.config.ts",
|
|
"test:e2e": "cross-env VERBOSE=true KEEP_OUTPUT=true npm run test:integration:sandbox:none",
|
|
"test:integration:all": "npm run test:integration:sandbox:none && npm run test:integration:sandbox:docker && npm run test:integration:sandbox:podman",
|
|
"test:integration:sandbox:none": "cross-env QWEN_SANDBOX=false vitest run --root ./integration-tests",
|
|
"test:integration:sandbox:docker": "cross-env QWEN_SANDBOX=docker npm run build:sandbox && QWEN_SANDBOX=docker vitest run --root ./integration-tests",
|
|
"test:integration:sandbox:podman": "cross-env QWEN_SANDBOX=podman vitest run --root ./integration-tests",
|
|
"test:integration:sdk:sandbox:none": "cross-env QWEN_SANDBOX=false vitest run --root ./integration-tests --poolOptions.threads.maxThreads 2 sdk-typescript",
|
|
"test:integration:sdk:sandbox:docker": "cross-env QWEN_SANDBOX=docker npm run build:sandbox && QWEN_SANDBOX=docker vitest run --root ./integration-tests --poolOptions.threads.maxThreads 2 sdk-typescript",
|
|
"test:sdk:python": "python3 -m pytest -c packages/sdk-python/pyproject.toml packages/sdk-python/tests -q",
|
|
"test:integration:cli:sandbox:none": "cross-env QWEN_SANDBOX=false vitest run --root ./integration-tests cli",
|
|
"test:integration:cli:sandbox:docker": "cross-env QWEN_SANDBOX=docker npm run build:sandbox && QWEN_SANDBOX=docker vitest run --root ./integration-tests cli",
|
|
"test:integration:interactive:sandbox:none": "cross-env QWEN_SANDBOX=false vitest run --root ./integration-tests interactive",
|
|
"test:integration:interactive:sandbox:docker": "cross-env QWEN_SANDBOX=docker npm run build:sandbox && QWEN_SANDBOX=docker vitest run --root ./integration-tests interactive",
|
|
"test:terminal-bench": "cross-env VERBOSE=true KEEP_OUTPUT=true vitest run --config ./vitest.terminal-bench.config.ts --root ./integration-tests",
|
|
"test:terminal-bench:oracle": "cross-env VERBOSE=true KEEP_OUTPUT=true vitest run --config ./vitest.terminal-bench.config.ts --root ./integration-tests -t 'oracle'",
|
|
"test:terminal-bench:qwen": "cross-env VERBOSE=true KEEP_OUTPUT=true vitest run --config ./vitest.terminal-bench.config.ts --root ./integration-tests -t 'qwen'",
|
|
"lint": "eslint . --ext .ts,.tsx && eslint integration-tests",
|
|
"lint:fix": "eslint . --fix && eslint integration-tests --fix",
|
|
"lint:ci": "eslint . --ext .ts,.tsx --max-warnings 0 && eslint integration-tests --max-warnings 0",
|
|
"lint:sdk:python": "python3 -m ruff check --config packages/sdk-python/pyproject.toml packages/sdk-python",
|
|
"lint:all": "node scripts/lint.js",
|
|
"format": "prettier --experimental-cli --write .",
|
|
"typecheck": "npm run typecheck --workspaces --if-present",
|
|
"typecheck:sdk:python": "python3 -m mypy --config-file packages/sdk-python/pyproject.toml packages/sdk-python/src",
|
|
"smoke:sdk:python": "python3 packages/sdk-python/scripts/smoke_real.py",
|
|
"build:sdk:python": "python3 -m build packages/sdk-python",
|
|
"check-i18n": "npm run check-i18n --workspace=packages/cli",
|
|
"preflight": "npm run clean && npm ci && npm run format && npm run lint:ci && npm run build && npm run typecheck && npm run test:ci",
|
|
"prepare": "husky && npm run build && npm run bundle",
|
|
"prepare:package": "node scripts/prepare-package.js",
|
|
"package:standalone": "node scripts/create-standalone-package.js",
|
|
"package:standalone:release": "node scripts/build-standalone-release.js",
|
|
"release:version": "node scripts/version.js",
|
|
"telemetry": "node scripts/telemetry.js",
|
|
"check:lockfile": "node scripts/check-lockfile.js",
|
|
"clean": "node scripts/clean.js",
|
|
"pre-commit": "node scripts/pre-commit.js"
|
|
},
|
|
"overrides": {
|
|
"ansi-regex": "6.2.2",
|
|
"cliui": {
|
|
"wrap-ansi": "7.0.0"
|
|
},
|
|
"baseline-browser-mapping": "^2.9.19",
|
|
"normalize-package-data": "^7.0.1",
|
|
"react": "^19.2.4",
|
|
"react-dom": "^19.2.4",
|
|
"@types/react": "^19.2.0",
|
|
"@types/react-dom": "^19.2.0"
|
|
},
|
|
"bin": {
|
|
"qwen": "dist/cli.js"
|
|
},
|
|
"files": [
|
|
"dist/",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"devDependencies": {
|
|
"@types/marked": "^5.0.2",
|
|
"@types/mime-types": "^3.0.1",
|
|
"@types/minimatch": "^5.1.2",
|
|
"@types/mock-fs": "^4.13.4",
|
|
"@types/shell-quote": "^1.7.5",
|
|
"@types/uuid": "^10.0.0",
|
|
"@vitest/coverage-v8": "^3.1.1",
|
|
"@vitest/eslint-plugin": "^1.3.4",
|
|
"@xterm/headless": "^5.5.0",
|
|
"@xterm/xterm": "^6.0.0",
|
|
"cross-env": "^7.0.3",
|
|
"esbuild": "^0.25.0",
|
|
"esbuild-plugin-wasm": "^1.1.0",
|
|
"eslint": "^9.24.0",
|
|
"eslint-config-prettier": "^10.1.2",
|
|
"eslint-plugin-import": "^2.31.0",
|
|
"eslint-plugin-license-header": "^0.8.0",
|
|
"eslint-plugin-react": "^7.37.5",
|
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
"glob": "^10.5.0",
|
|
"globals": "^16.0.0",
|
|
"husky": "^9.1.7",
|
|
"json": "^11.0.0",
|
|
"lint-staged": "^16.1.6",
|
|
"memfs": "^4.42.0",
|
|
"mnemonist": "^0.40.3",
|
|
"mock-fs": "^5.5.0",
|
|
"msw": "^2.10.4",
|
|
"npm-run-all": "^4.1.5",
|
|
"prettier": "^3.5.3",
|
|
"react-devtools-core": "^6.1.5",
|
|
"semver": "^7.7.2",
|
|
"strip-ansi": "^7.1.2",
|
|
"tsx": "^4.20.3",
|
|
"typescript-eslint": "^8.30.1",
|
|
"vitest": "^3.2.4",
|
|
"yargs": "^17.7.2"
|
|
},
|
|
"dependencies": {
|
|
"@testing-library/dom": "^10.4.1",
|
|
"ink": "^7.0.3",
|
|
"simple-git": "^3.28.0"
|
|
},
|
|
"optionalDependencies": {
|
|
"@lydell/node-pty": "1.2.0-beta.10",
|
|
"@lydell/node-pty-darwin-arm64": "1.2.0-beta.10",
|
|
"@lydell/node-pty-darwin-x64": "1.2.0-beta.10",
|
|
"@lydell/node-pty-linux-x64": "1.2.0-beta.10",
|
|
"@lydell/node-pty-win32-arm64": "1.2.0-beta.10",
|
|
"@lydell/node-pty-win32-x64": "1.2.0-beta.10"
|
|
},
|
|
"lint-staged": {
|
|
"*.{js,jsx,ts,tsx}": [
|
|
"prettier --write",
|
|
"eslint --fix --max-warnings 0 --no-warn-ignored"
|
|
],
|
|
"*.{json,md}": [
|
|
"prettier --write"
|
|
]
|
|
}
|
|
}
|