build(site): [SITE-07] bind Monaco DOM adaptations and WinJS reference notices

This commit is contained in:
Harvey Zhao committed 2026-09-15 13:26:55 +08:00
1 parent 3eb5500525
commit 1fed96a909
25 files changed
+6931 -7

No files matched your search

+2
View File
@@ -45,5 +45,7 @@ refactor/baselines/monaco-core-locales.json text eol=lf
refactor/baselines/site-vendor/monaco-contributions/** -text whitespace=-trailing-space,cr-at-eol
refactor/baselines/site-vendor/monaco-css-build/** -text whitespace=-trailing-space,cr-at-eol
refactor/baselines/site-vendor/monaco-node-path/** -text whitespace=-trailing-space,cr-at-eol
refactor/baselines/site-vendor/monaco-dom/** -text whitespace=-trailing-space,cr-at-eol
docs/licenses/monaco-editor/core-dom/** -text whitespace=-trailing-space,cr-at-eol
docs/licenses/monaco-editor/core-path/** -text whitespace=-trailing-space,cr-at-eol
refactor/baselines/monaco-node-path-fixtures.json text eol=lf
+6
View File
@@ -121,6 +121,10 @@ Included component: nodejs path (Monaco core) 14.16.0
Source: https://github.com/nodejs/node/blob/bd60e93357a118204ea238d94e7a9e4209d93062/lib/path.js
Included component: WinJS-derived DOM helpers (Monaco core) unversioned adaptation; reference WinJS 4.4.5
Source: https://github.com/winjs/winjs/tree/4329b1133b243d9ded3b5a1f98d096ee8e80e889
- licenses/monaco-editor/LICENSE
- licenses/monaco-editor/ThirdPartyNotices.txt
- licenses/monaco-editor/codicons/LICENSE
@@ -148,6 +152,8 @@ Source: https://github.com/nodejs/node/blob/bd60e93357a118204ea238d94e7a9e4209d9
- licenses/monaco-editor/core-origins/marked-vscode-license.txt
- licenses/monaco-editor/core-origins/ATTRIBUTION.md
- licenses/monaco-editor/core-path/ATTRIBUTION.md
- licenses/monaco-editor/core-dom/LICENSE.txt
- licenses/monaco-editor/core-dom/ATTRIBUTION.md
## console legacy-vendor-with-TS-adapter
@@ -0,0 +1,29 @@
# WinJS-derived DOM helpers in Monaco
Monaco 0.30.1 embeds VS Code dom.ts from commit
829382514cb1065f5ebb90f436e1c6103e153953. Its Microsoft/MIT source explicitly
marks SizeUtils, getTopLeftOffset, getTotalWidth, getContentHeight and
getTotalHeight as adapted from WinJS; getContentWidth uses the same dimension
helpers. These six declaration blocks match the editor's archived source map.
The comment does not name an original WinJS release. That original version
remains unknown. For a reproducible comparison, WinJS 4.4.5 at commit
4329b1133b243d9ded3b5a1f98d096ee8e80e889 supplies _ElementUtilities.js and the
complete Microsoft MIT license included alongside this note. This does not
assert that Monaco bundled unmodified WinJS 4.4.5 or the entire WinJS library.
Existing adaptations include CSS property access and pixel conversion changes,
separate typed dimension helpers, and position calculations with borders, RTL
scroll handling and shadow-root checks. The WinJS reference has its own computed
style, unit conversion and position implementation. These differences are not
changes introduced by the ArtPlayer refactor. No editor runtime bytes changed.
Sources:
- https://github.com/microsoft/vscode/blob/829382514cb1065f5ebb90f436e1c6103e153953/src/vs/base/browser/dom.ts
- https://github.com/winjs/winjs/blob/4329b1133b243d9ded3b5a1f98d096ee8e80e889/src/js/WinJS/Utilities/_ElementUtilities.js
- https://github.com/winjs/winjs/blob/4329b1133b243d9ded3b5a1f98d096ee8e80e889/License.txt
Complete reference terms: [WinJS license](./LICENSE.txt). The editor's existing
Microsoft MIT license and original ThirdPartyNotices are retained. Unicode
data, other embedded sources and complete original core compilation remain
separate review work; this notice is not a claim of complete source clearance.
@@ -0,0 +1,13 @@
WinJS
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+2 -1
View File
@@ -173,7 +173,8 @@
"verify:monaco-core-build": "node scripts/site-vendor/monaco/reproduce-core-build.ts",
"verify:monaco-contributions": "node scripts/site-vendor/monaco/reproduce-contributions.ts",
"verify:monaco-css": "node scripts/site-vendor/monaco/reproduce-css.ts",
"verify:monaco-node-path": "node scripts/site-vendor/monaco/reproduce-node-path.ts"
"verify:monaco-node-path": "node scripts/site-vendor/monaco/reproduce-node-path.ts",
"verify:monaco-dom-origins": "node scripts/site-vendor/monaco/reproduce-dom-origins.ts"
},
"browserslist": "last 1 Chrome version",
"devDependencies": {
@@ -0,0 +1,105 @@
{
"schemaVersion": 1,
"task": "SITE-07",
"archives": [
{
"name": "monaco-editor",
"version": "0.30.1",
"tarball": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.30.1.tgz",
"integrity": "sha512-B/y4+b2O5G2gjuxIFtCE2EkM17R2NM7/3F8x0qcPsqy4V83bitJTIO4TIeZpYlzu/xy6INiY/+84BEm6+7Cmzg==",
"sha256": "d7872ab742036036eca48cd54e43d751bede56742f0689bcf4049bcf701468c7"
},
{
"name": "monaco-editor-core",
"version": "0.30.1",
"tarball": "https://registry.npmjs.org/monaco-editor-core/-/monaco-editor-core-0.30.1.tgz",
"integrity": "sha512-WNxfchYafMZXVfysqg/ESW4MtOpYLPaIKrzudNlgwYvfYID+O/nwSZI5X+KxW84roVzHsNgFGyOOesfHFZwYUA==",
"sha256": "a3b004061373a7f6217eba6399f1a1de31970bee2eee693aada289035198c5ec"
}
],
"remotes": [
{
"source": "refactor/baselines/site-vendor/monaco-dom/winjs-elements.txt",
"sha256": "170254869783ef61cbad53294cc32ffded8d0a74272df3dc29dd3c2b63345ad4",
"gitBlobSha": "6abc27ccf155118eef70d51c653b0ebee03a4008",
"apiUrl": "https://api.github.com/repos/winjs/winjs/contents/src/js/WinJS/Utilities/_ElementUtilities.js?ref=4329b1133b243d9ded3b5a1f98d096ee8e80e889"
},
{
"source": "refactor/baselines/site-vendor/monaco-dom/winjs-license.txt",
"sha256": "13217bb585c27ee298f49c7aec2ef74578bc0d644880906a89d2c3ccec5d647e",
"gitBlobSha": "baf9dc11a362fe41cb5981195b7981c895df1278",
"apiUrl": "https://api.github.com/repos/winjs/winjs/contents/License.txt?ref=4329b1133b243d9ded3b5a1f98d096ee8e80e889"
},
{
"source": "refactor/baselines/site-vendor/monaco-dom/vscode-dom.txt",
"sha256": "a195debeedbf20f58cb5f0fd2306867030eb0fa00cc9f5302b5abf3c425bf73c",
"gitBlobSha": "6148eb300923a1ce56a7b9d91c8a534000c5626f",
"apiUrl": "https://api.github.com/repos/microsoft/vscode/contents/src/vs/base/browser/dom.ts?ref=829382514cb1065f5ebb90f436e1c6103e153953"
}
],
"vscodeSource": "refactor/baselines/site-vendor/monaco-dom/vscode-dom.txt",
"winjsSource": "refactor/baselines/site-vendor/monaco-dom/winjs-elements.txt",
"originalWinjsVersion": null,
"map": {
"archive": "monaco-editor-core-0.30.1",
"member": "package/dev/vs/editor/editor.main.js.map",
"sha256": "22a1b5ff5f423adc4575004d2ae0ae231ba59516e6aa9c2fabe8a006c2730316",
"source": "file:///Users/alex/src/vscode/out-editor-src/vs/base/browser/dom.ts"
},
"fragments": [
{
"name": "SizeUtils",
"sha256": "e6f713ff2be5cd6d17e451879bddfe80a284612765c8beb63ffd6d9868b43aae"
},
{
"name": "getTopLeftOffset",
"sha256": "96fae7b3098e5d64d3fa935c32d53ba27df415e0c7e7547cf859311dc114ec9b"
},
{
"name": "getTotalWidth",
"sha256": "e2e6c899f46a2823ae10d40a63570338906f6e8c224c70e920f613b616872896"
},
{
"name": "getContentWidth",
"sha256": "5beab28852e52e549478637b41d1a23af4499278073b6e6d5bc260c05d5b087e"
},
{
"name": "getContentHeight",
"sha256": "1cc472cf950fb7fe5e2eb7a00e75b7ae3542f98e8eeb3939a309db2c7857678c"
},
{
"name": "getTotalHeight",
"sha256": "e48172f26d39b0695c2897f05cfb02a0defce160354965083ff1de607484784b"
}
],
"shipped": {
"archive": "monaco-editor-0.30.1",
"member": "package/min/vs/editor/editor.main.js",
"target": "docs/assets/js/vs/editor/editor.main.js",
"sha256": "05a50ed50bb013b6e7a82d25686186aa7bdff8b8209c7badab00e046b5e99618"
},
"component": {
"name": "WinJS-derived DOM helpers (Monaco core)",
"version": "unversioned adaptation; reference WinJS 4.4.5",
"tarball": "https://github.com/winjs/winjs/tree/4329b1133b243d9ded3b5a1f98d096ee8e80e889",
"assets": [
"docs/assets/js/vs/editor/editor.main.js"
],
"notices": [
"docs/licenses/monaco-editor/core-dom/LICENSE.txt",
"docs/licenses/monaco-editor/core-dom/ATTRIBUTION.md"
]
},
"notices": [
{
"source": "refactor/baselines/site-vendor/monaco-dom/winjs-license.txt",
"target": "docs/licenses/monaco-editor/core-dom/LICENSE.txt",
"sha256": "13217bb585c27ee298f49c7aec2ef74578bc0d644880906a89d2c3ccec5d647e"
},
{
"source": "refactor/baselines/site-vendor/monaco-dom/ATTRIBUTION.md.txt",
"target": "docs/licenses/monaco-editor/core-dom/ATTRIBUTION.md",
"sha256": "0858d19261742809cecd7174a0a06b2b0013a4b9560b78aede1edd3dd350da21"
}
]
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,29 @@
# WinJS-derived DOM helpers in Monaco
Monaco 0.30.1 embeds VS Code dom.ts from commit
829382514cb1065f5ebb90f436e1c6103e153953. Its Microsoft/MIT source explicitly
marks SizeUtils, getTopLeftOffset, getTotalWidth, getContentHeight and
getTotalHeight as adapted from WinJS; getContentWidth uses the same dimension
helpers. These six declaration blocks match the editor's archived source map.
The comment does not name an original WinJS release. That original version
remains unknown. For a reproducible comparison, WinJS 4.4.5 at commit
4329b1133b243d9ded3b5a1f98d096ee8e80e889 supplies _ElementUtilities.js and the
complete Microsoft MIT license included alongside this note. This does not
assert that Monaco bundled unmodified WinJS 4.4.5 or the entire WinJS library.
Existing adaptations include CSS property access and pixel conversion changes,
separate typed dimension helpers, and position calculations with borders, RTL
scroll handling and shadow-root checks. The WinJS reference has its own computed
style, unit conversion and position implementation. These differences are not
changes introduced by the ArtPlayer refactor. No editor runtime bytes changed.
Sources:
- https://github.com/microsoft/vscode/blob/829382514cb1065f5ebb90f436e1c6103e153953/src/vs/base/browser/dom.ts
- https://github.com/winjs/winjs/blob/4329b1133b243d9ded3b5a1f98d096ee8e80e889/src/js/WinJS/Utilities/_ElementUtilities.js
- https://github.com/winjs/winjs/blob/4329b1133b243d9ded3b5a1f98d096ee8e80e889/License.txt
Complete reference terms: [WinJS license](./LICENSE.txt). The editor's existing
Microsoft MIT license and original ThirdPartyNotices are retained. Unicode
data, other embedded sources and complete original core compilation remain
separate review work; this notice is not a claim of complete source clearance.
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,13 @@
WinJS
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,51 @@
# SITE-07 Monaco DOM 改编来源与通知交付
来源 HEAD:`3eb550052531094753207bdadf4b0e32687792de`。SITE-07 继续 doing,
VENDOR-06 继续 open;本次没有更改编辑器脚本、CSS、worker 或播放器运行字节。
## 已核实范围
固定 VS Code `829382514cb1065f5ebb90f436e1c6103e153953` 的 dom.ts 五处明确注明
WinJS 改编。六个完整声明块——SizeUtils、getTopLeftOffset、getTotalWidth、
getContentWidth、getContentHeight、getTotalHeight——与 Monaco 0.30.1 原始
source map 的对应内容精确相同;当前 editor.main.js 与固定 npm 归档逐字节一致。
这不是完整 DOM 模块的编译证明,也不把 reference 注释等同于特定上游版本证据。
原注释没有 WinJS 版本。本批固定 WinJS 4.4.5 提交
`4329b1133b243d9ded3b5a1f98d096ee8e80e889` 的 `_ElementUtilities.js` 和完整
Microsoft MIT 许可作比较,保留 `originalWinjsVersion: null`。参考源码与 VS Code
改编存在像素转换、CSS 属性读取、尺寸助手、边框/RTL/ShadowRoot 位置处理等差异,
没有把两套实现强行判为完全相同,也没有声称添加前必然缺少 Microsoft 的许可授权。
完整参考许可和说明作为补充交付,原 Monaco 许可及 ThirdPartyNotices 均保留。
固定远端文件同时校验 SHA-256 和 Git blob SHA;两个 npm archive 校验 SHA-512/
SHA-256。源码保存在 `baselines/site-vendor/monaco-dom/`,保留原始字节,不经
Git 自动换行转换。说明明确标注参考版本和未知原始版本,后续 AI 不应把它改写为
“Monaco 内含原版 WinJS 4.4.5”。
## 实现与维护
- `scripts/site-vendor/monaco/dom-origins.ts` 管理声明边界及来源/通知绑定;以现有
TypeScript 5.9.3 parser 识别完整顶层节点,不执行下载的 WinJS 代码。
- `reproduce-dom-origins.ts` 校验冻结来源、源码片段与原 map、交付脚本归档身份;
新增 `yarn verify:monaco-dom-origins [--fetch]`,没有新依赖或锁文件变化。
- 正常 `build:site-notices` 增加 core-dom 完整许可/说明及索引,合计 88 份 notice
加索引 89 outputs;校验器拒绝遗漏编辑器归属、条款或来源声明。
- 测试覆盖缺少/重复声明、同名字符串冒充声明、遗漏条款和错误资产归属。真实
浏览器直接调用现有 Monaco 模块,在 padding/border/margin/嵌套滚动前后检查
尺寸和原生页面位置;不是测试自造 DOM 工具的替代实现。
维护入口与复跑命令见 [Monaco README](../../scripts/site-vendor/monaco/README.md)。
## 验证与限制
Node 24.21.0、Yarn 1.22.22;30/30 单测,严格 docs-tools 类型与定向只读 lint
通过。联网/离线来源核验、正常通知生成及只读检查分别执行并记录。
Chromium 153.0.8010.12、Firefox 155.0、WebKit 26.6 的 DOM 检查和移动页面实际
播放/全部 notice HTTP/新增相对链接共 6/6,零跳过/重试;原始网络诊断保留在
[机器证据](../baselines/monaco-dom-origins-validation.json),不宣称所有请求无取消。
原始 WinJS 改编版本仍未知;Unicode 数据、其他内嵌来源、完整 core TS 编译及
SITE-07 其他范围继续开放。没有在本轮补证据时悄悄放宽这些验收条件;202/266
完成数不变。回退本批时一并撤销通知绑定/新增文件并重建索引,不触碰原编辑器
资产。未推送、部署或发布。
+1 -1
View File
@@ -655,7 +655,7 @@
- SITE-AI-DOCS-01: [记录](changes/2026-09-14-SITE-AI-DOCS-01-documentation-pipeline.md) [记录](baselines/documentation-pipeline-validation.json)
- SITE-BUILD-01: [记录](changes/2026-09-14-SITE-BUILD-01-staged-builds.md) [记录](baselines/site-build-validation.json)
- SITE-03: [记录](changes/2026-09-14-SITE-03-desktop-editor.md) [记录](baselines/site-editor-validation.json)
- SITE-07: [记录](site-inventory.md) [记录](baselines/site-provenance.json) [记录](changes/2026-09-14-SITE-07-vendor-notices.md) [记录](baselines/site-notices-checkpoint.json) [记录](baselines/site-codicons-provenance.json) [记录](baselines/site-codicons-validation.json) [记录](changes/2026-09-15-SITE-07-codicons.md) [记录](baselines/vconsole-notices-provenance.json) [记录](baselines/vconsole-notices-validation.json) [记录](changes/2026-09-15-SITE-07-vconsole-notices.md) [记录](console-modernization.md) [记录](baselines/site-console-inventory.json) [记录](baselines/site-console-validation.json) [记录](changes/2026-09-15-SITE-07-console-baseline.md) [记录](baselines/console-feed-provenance.json) [记录](changes/2026-09-15-SITE-07-console-feed-source.md) [记录](baselines/console-commonjs-provenance.json) [记录](changes/2026-09-15-SITE-07-console-commonjs.md) [记录](baselines/console-esm-provenance.json) [记录](changes/2026-09-15-SITE-07-console-esm.md) [记录](baselines/console-embedded-notices.json) [记录](baselines/console-notices-validation.json) [记录](changes/2026-09-15-SITE-07-console-notices.md) [记录](baselines/console-embedded-sources.json) [记录](baselines/console-embedded-validation.json) [记录](changes/2026-09-15-SITE-07-console-embedded-sources.md) [记录](baselines/console-derived-attribution.json) [记录](baselines/console-derived-validation.json) [记录](changes/2026-09-15-SITE-07-console-derived-attribution.md) [记录](baselines/console-stackoverflow-provenance.json) [记录](baselines/console-stackoverflow-validation.json) [记录](changes/2026-09-15-SITE-07-console-stackoverflow.md) [记录](baselines/console-shallowequal-validation.json) [记录](changes/2026-09-15-SITE-07-console-shallowequal.md) [记录](console-notice-review.md) [记录](baselines/console-notice-review-validation.json) [记录](changes/2026-09-15-SITE-07-console-notice-review.md) [记录](baselines/monaco-typescript-provenance.json) [记录](baselines/monaco-typescript-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-typescript.md) [记录](baselines/monaco-languages-provenance.json) [记录](baselines/monaco-languages-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-languages.md) [记录](baselines/monaco-language-notices.json) [记录](baselines/monaco-language-notices-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-language-notices.md) [记录](baselines/monaco-modes-provenance.json) [记录](baselines/monaco-modes-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-modes.md) [记录](baselines/monaco-basic-provenance.json) [记录](baselines/monaco-basic-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-basic.md) [记录](baselines/monaco-core-origins-provenance.json) [记录](baselines/monaco-core-origins-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-core-origins.md) [记录](baselines/monaco-core-build-provenance.json) [记录](baselines/monaco-core-build-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-core-build.md) [记录](baselines/monaco-contributions-provenance.json) [记录](baselines/monaco-contributions-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-contributions.md) [记录](baselines/monaco-css-build-provenance.json) [记录](baselines/monaco-css-build-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-css.md) [记录](baselines/monaco-node-path-provenance.json) [记录](baselines/monaco-node-path-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-node-path.md)
- SITE-07: [记录](site-inventory.md) [记录](baselines/site-provenance.json) [记录](changes/2026-09-14-SITE-07-vendor-notices.md) [记录](baselines/site-notices-checkpoint.json) [记录](baselines/site-codicons-provenance.json) [记录](baselines/site-codicons-validation.json) [记录](changes/2026-09-15-SITE-07-codicons.md) [记录](baselines/vconsole-notices-provenance.json) [记录](baselines/vconsole-notices-validation.json) [记录](changes/2026-09-15-SITE-07-vconsole-notices.md) [记录](console-modernization.md) [记录](baselines/site-console-inventory.json) [记录](baselines/site-console-validation.json) [记录](changes/2026-09-15-SITE-07-console-baseline.md) [记录](baselines/console-feed-provenance.json) [记录](changes/2026-09-15-SITE-07-console-feed-source.md) [记录](baselines/console-commonjs-provenance.json) [记录](changes/2026-09-15-SITE-07-console-commonjs.md) [记录](baselines/console-esm-provenance.json) [记录](changes/2026-09-15-SITE-07-console-esm.md) [记录](baselines/console-embedded-notices.json) [记录](baselines/console-notices-validation.json) [记录](changes/2026-09-15-SITE-07-console-notices.md) [记录](baselines/console-embedded-sources.json) [记录](baselines/console-embedded-validation.json) [记录](changes/2026-09-15-SITE-07-console-embedded-sources.md) [记录](baselines/console-derived-attribution.json) [记录](baselines/console-derived-validation.json) [记录](changes/2026-09-15-SITE-07-console-derived-attribution.md) [记录](baselines/console-stackoverflow-provenance.json) [记录](baselines/console-stackoverflow-validation.json) [记录](changes/2026-09-15-SITE-07-console-stackoverflow.md) [记录](baselines/console-shallowequal-validation.json) [记录](changes/2026-09-15-SITE-07-console-shallowequal.md) [记录](console-notice-review.md) [记录](baselines/console-notice-review-validation.json) [记录](changes/2026-09-15-SITE-07-console-notice-review.md) [记录](baselines/monaco-typescript-provenance.json) [记录](baselines/monaco-typescript-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-typescript.md) [记录](baselines/monaco-languages-provenance.json) [记录](baselines/monaco-languages-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-languages.md) [记录](baselines/monaco-language-notices.json) [记录](baselines/monaco-language-notices-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-language-notices.md) [记录](baselines/monaco-modes-provenance.json) [记录](baselines/monaco-modes-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-modes.md) [记录](baselines/monaco-basic-provenance.json) [记录](baselines/monaco-basic-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-basic.md) [记录](baselines/monaco-core-origins-provenance.json) [记录](baselines/monaco-core-origins-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-core-origins.md) [记录](baselines/monaco-core-build-provenance.json) [记录](baselines/monaco-core-build-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-core-build.md) [记录](baselines/monaco-contributions-provenance.json) [记录](baselines/monaco-contributions-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-contributions.md) [记录](baselines/monaco-css-build-provenance.json) [记录](baselines/monaco-css-build-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-css.md) [记录](baselines/monaco-node-path-provenance.json) [记录](baselines/monaco-node-path-validation.json) [记录](changes/2026-09-15-SITE-07-monaco-node-path.md) [记录](changes/2026-09-15-SITE-07-monaco-dom.md) [记录](baselines/monaco-dom-origins-validation.json)
- EX-01: [记录](changes/2026-09-14-EX-01-react-consumer.md) [记录](baselines/react-consumer-validation.json) [记录](scripts/react-consumer.mjs)
- EX-02: [记录](changes/2026-09-14-EX-02-vue-consumer.md) [记录](baselines/vue-consumer-validation.json) [记录](scripts/vue-consumer.mjs)
- MOD-01: [记录](changes/2026-09-15-MOD-01-bun-evaluation.md) [记录](baselines/bun-install-validation.json) [记录](bun-evaluation.md)
+6
View File
@@ -1,5 +1,11 @@
# 进度与证据
## SITE-07 Monaco DOM 改编来源与通知绑定
六段 DOM 声明与固定 VS Code 源码及原始 source map 精确对应,当前 editor.main.js 与原 npm 归档相同。新增 WinJS 4.4.5 固定参考源码/完整 MIT 条款和明确的未知原始改编版本说明;普通构建交付 88 份 notice 加索引。30/30 单测、类型/lint、联网/离线复验和三浏览器尺寸/滚动位置/移动实播/通知 HTTP 6/6 通过。见[记录](changes/2026-09-15-SITE-07-monaco-dom.md)和[证据](baselines/monaco-dom-origins-validation.json)。
新增验证脚本仅用已有 TypeScript parser,无依赖/锁或运行资产变化。原始 WinJS 改编版本、Unicode/其他内嵌来源、完整 core 编译及 SITE-07 其他交付仍开放,VENDOR-06 不关闭。202/266 done、21 doing、43 todo 不变;接续其余来源和实际插件验收,未推送/部署/发布。
## PKG-AUDIO-05 同文件前缀与原生缓冲检查点
仅改变同一 MP4/AAC 的 HTTP 放行前缀,Windows WebKit 能起播,但四项较大前缀诊断仍没有可信 waiting。默认三引擎 12 项诊断通过,实际 progressed/waiting 为 Chromium/Firefox 8/8、WebKit 0/4;诊断退出成功不算缓冲验收。新增参数只影响 native spec,放行前请求字节/媒体状态独立保存,恢复失败也保留观察。原插件集成断言、超时和运行字节均未改。见[检查点](changes/2026-09-15-PKG-AUDIO-05-prefix.md)及[证据](baselines/audio-prefix-validation.json)。
+5 -2
View File
@@ -661,11 +661,14 @@
"refactor/changes/2026-09-15-SITE-07-monaco-css.md",
"refactor/baselines/monaco-node-path-provenance.json",
"refactor/baselines/monaco-node-path-validation.json",
"refactor/changes/2026-09-15-SITE-07-monaco-node-path.md"
"refactor/changes/2026-09-15-SITE-07-monaco-node-path.md",
"refactor/changes/2026-09-15-SITE-07-monaco-dom.md",
"refactor/baselines/monaco-dom-origins-provenance.json",
"refactor/baselines/monaco-dom-origins-validation.json"
],
"compatibleResolution": "Keep separate from owned TS migration. Verify source/version/diff and license notices before replacement; preserve API/CSS/worker URLs and run owning package tests.",
"closureCriteria": "固定上游版本/内容差异、完整组件许可与分发 notices,兼容测试通过;仅当前上游许可证名称不足以关闭。",
"workspaceState": "Monaco 0.30.1 remains byte-pinned, including its known CSS newline-only difference. Codicons 0.0.26, TypeScript 4.4.4 and language-service licenses are delivered. Three service workers, four modes and 76 basic-language bundles reproduce exactly; all 13 core JS minified outputs reproduce with locked esbuild 0.12.6 on Windows x64. Loader/header and css/nls source origins match fixed Git; two maps inventory 584 prepared-source entries and 549 different names. DOMPurify 2.3.1 and marked 3.0.2 have exact source adaptations and complete notice supplements; 85 site notices were verified by HTTP/mobile browser checks. Latest contribution check verifies six archives and 102 Git members, emits 88 TS registration modules and uses RequireJS 2.3.6/Terser 5.9.0 to reproduce the entire dev/min editor assembly, including core string-table entry, dependency injection, order, alias and map trailer. Latest units 23/23, strict type/lint and offline/network source checks pass; modes/tokenizer regressions pass 6/6 across three engines with 2523 token cases per engine. Earlier ten-locale editing/find 30/30 and diff-worker 3/3 evidence remains recorded separately. CSS now reproduces from 68 styles, three embedded images and the copied font, with 81 verified Git members. The archived transport/plugin recipes match every prepared ESM stylesheet; explicit normalization of 70 generated CRLF separators reproduces the entire development CSS. cssnano 4.1.11/PostCSS 7.0.35 reproduce complete minified CSS using isolated frozen Yarn installs (153 selectors/143 versions) and historical browser defaults. The site retains its five header CRLF differences. The exact upstream stage that normalized the 70 development separators is still unidentified. Latest units 25/25, strict type/lint and offline/network checks pass; new three-engine style/theme/font/resize regressions pass 3/3. Original core TS compilation and remaining embedded-origin review stay open; this is not release approval or an exhaustive sanitizer audit. The Node path origin is now fixed to v14.16.0/bd60e93357a118204ea238d94e7a9e4209d93062 and the verified VS Code port. Its complete existing notice text matches both sources; a source supplement corrects the older index link without rewriting it. Six removed exports reproduce both source-map inputs; pinned TS 4.5.0-dev.20211021 emits exact full editor/worker modules. Thirty deterministic original Node path results pass in each browser engine, together with all 86 delivered notices and actual playback: 6/6 browser, 28/28 unit, type/lint, offline/network checks. Chromium retains one observed media ERR_ABORTED despite successful playback. Other embedded origins/full core compilation remain open."
"workspaceState": "Monaco 0.30.1 remains byte-pinned, including its known CSS newline-only difference. Codicons 0.0.26, TypeScript 4.4.4 and language-service licenses are delivered. Three service workers, four modes and 76 basic-language bundles reproduce exactly; all 13 core JS minified outputs reproduce with locked esbuild 0.12.6 on Windows x64. Loader/header and css/nls source origins match fixed Git; two maps inventory 584 prepared-source entries and 549 different names. DOMPurify 2.3.1 and marked 3.0.2 have exact source adaptations and complete notice supplements; 85 site notices were verified by HTTP/mobile browser checks. Latest contribution check verifies six archives and 102 Git members, emits 88 TS registration modules and uses RequireJS 2.3.6/Terser 5.9.0 to reproduce the entire dev/min editor assembly, including core string-table entry, dependency injection, order, alias and map trailer. Latest units 23/23, strict type/lint and offline/network source checks pass; modes/tokenizer regressions pass 6/6 across three engines with 2523 token cases per engine. Earlier ten-locale editing/find 30/30 and diff-worker 3/3 evidence remains recorded separately. CSS now reproduces from 68 styles, three embedded images and the copied font, with 81 verified Git members. The archived transport/plugin recipes match every prepared ESM stylesheet; explicit normalization of 70 generated CRLF separators reproduces the entire development CSS. cssnano 4.1.11/PostCSS 7.0.35 reproduce complete minified CSS using isolated frozen Yarn installs (153 selectors/143 versions) and historical browser defaults. The site retains its five header CRLF differences. The exact upstream stage that normalized the 70 development separators is still unidentified. Latest units 25/25, strict type/lint and offline/network checks pass; new three-engine style/theme/font/resize regressions pass 3/3. Original core TS compilation and remaining embedded-origin review stay open; this is not release approval or an exhaustive sanitizer audit. The Node path origin is now fixed to v14.16.0/bd60e93357a118204ea238d94e7a9e4209d93062 and the verified VS Code port. Its complete existing notice text matches both sources; a source supplement corrects the older index link without rewriting it. Six removed exports reproduce both source-map inputs; pinned TS 4.5.0-dev.20211021 emits exact full editor/worker modules. Thirty deterministic original Node path results pass in each browser engine, together with all 86 delivered notices and actual playback: 6/6 browser, 28/28 unit, type/lint, offline/network checks. Chromium retains one observed media ERR_ABORTED despite successful playback. Other embedded origins/full core compilation remain open. DOM helpers now bind six exact VS Code/source-map declarations and fixed WinJS4.4.5 comparison source/complete MIT terms to the unchanged editor; original adaptation version remains unknown, not inferred from that reference. Other origins and full original core compilation remain open."
},
{
"id": "VENDOR-07",
+3 -1
View File
@@ -4556,7 +4556,9 @@
"changes/2026-09-15-SITE-07-monaco-css.md",
"baselines/monaco-node-path-provenance.json",
"baselines/monaco-node-path-validation.json",
"changes/2026-09-15-SITE-07-monaco-node-path.md"
"changes/2026-09-15-SITE-07-monaco-node-path.md",
"changes/2026-09-15-SITE-07-monaco-dom.md",
"baselines/monaco-dom-origins-validation.json"
]
},
{
+3 -2
View File
@@ -512,10 +512,11 @@
"SITE-05"
],
"sourceStatus": "Monaco 0.30.1 verified against official npm archive: 98 byte-exact files, one CSS newline-only difference. The bundled font additionally matches @vscode/codicons 0.0.26 exactly; see site-codicons-provenance.json.",
"licenseStatus": "Full Monaco root notices and Codicons historical notices are delivered. The actual TypeScript 4.4.4 worker is exactly reproduced and has a complete original LICENSE/CopyrightNotice/ThirdPartyNoticeText supplement plus attribution; the original stale 2.7.2 label is preserved with explanation. Other bundled-component completeness remains under VENDOR-06. No permission for unrelated fonts/media is inferred. CSS/HTML/JSON worker source proof now binds seven service packages to nine original license/third-party notice files, two embedded formatter headers and attribution. JSON glob BSD conditions and actual formatter author years are retained; all 81 site notices pass HTTP byte checks. Mode/core/basic-language and remaining embedded-source completeness stay open. All four language mode bundles are now exactly reproduced and the two shared npm dependencies are bound to those mode assets as well as workers. Core/basic-language and remaining upstream-origin review stay open.",
"licenseStatus": "Full Monaco root notices and Codicons historical notices are delivered. The actual TypeScript 4.4.4 worker is exactly reproduced and has a complete original LICENSE/CopyrightNotice/ThirdPartyNoticeText supplement plus attribution; the original stale 2.7.2 label is preserved with explanation. Other bundled-component completeness remains under VENDOR-06. No permission for unrelated fonts/media is inferred. CSS/HTML/JSON worker source proof now binds seven service packages to nine original license/third-party notice files, two embedded formatter headers and attribution. JSON glob BSD conditions and actual formatter author years are retained; all 81 site notices pass HTTP byte checks. Mode/core/basic-language and remaining embedded-source completeness stay open. All four language mode bundles are now exactly reproduced and the two shared npm dependencies are bound to those mode assets as well as workers. Core/basic-language and remaining upstream-origin review stay open. DOM adaptation supplement now delivers fixed WinJS4.4.5 reference terms and explicit unknown-original-version attribution; six fixed VS Code declaration blocks match the original source map.88 notice files plus index are served; remaining provenance is not waived.",
"upstreamSources": [
"https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.30.1.tgz",
"https://registry.npmjs.org/@vscode/codicons/-/codicons-0.0.26.tgz"
"https://registry.npmjs.org/@vscode/codicons/-/codicons-0.0.26.tgz",
"https://github.com/winjs/winjs/tree/4329b1133b243d9ded3b5a1f98d096ee8e80e889"
],
"upstreamReviewedAt": "2026-09-15",
"updatePolicy": "Keep separate from owned TS migration. Verify source/version/diff and license notices before replacement; preserve API/CSS/worker URLs and run owning package tests.",
+3
View File
@@ -3,6 +3,7 @@ import fs from 'node:fs'
import process from 'node:process'
import { verifyConsoleNoticeSources } from './site-vendor/console/notices.ts'
import { verifyMonacoCoreNotices } from './site-vendor/monaco/core-origins.ts'
import { verifyMonacoDomNotices } from './site-vendor/monaco/dom-origins.ts'
import { verifyMonacoPathNotices } from './site-vendor/monaco/node-path.ts'
import { verifyMonacoLanguageNotices } from './site-vendor/monaco/notices.ts'
import { writeOrCheckNotices } from './site-vendor/notices.ts'
@@ -14,6 +15,7 @@ assert.deepEqual(manifest.groups.map(group => group.name).sort(), ['console', 'm
assert.deepEqual(manifest.groups.filter(group => group.name !== 'console').flatMap(group => (group.components || []).map(component => component.name)).sort(), [
'@babel/runtime',
'@vscode/codicons',
'WinJS-derived DOM helpers (Monaco core)',
'copy-text-to-clipboard',
'core-js',
'css-loader',
@@ -91,6 +93,7 @@ for (const name of ['LICENSE', 'MIT-LICENSE', 'ATTRIBUTION.md'])
assert(vconsoleNotices?.includes(`docs/licenses/vconsole/${name}`), `Missing vConsole notice: ${name}`)
verifyConsoleNoticeSources(process.cwd(), manifest)
verifyMonacoCoreNotices(process.cwd(), manifest)
verifyMonacoDomNotices(process.cwd(), manifest)
verifyMonacoPathNotices(process.cwd(), manifest)
verifyMonacoLanguageNotices(process.cwd(), manifest)
const count = writeOrCheckNotices(process.cwd(), manifest, process.argv.includes('--check'))
+22
View File
@@ -1025,6 +1025,16 @@
"source": "refactor/baselines/site-vendor/monaco-node-path/ATTRIBUTION.md.txt",
"target": "docs/licenses/monaco-editor/core-path/ATTRIBUTION.md",
"sha256": "40583c701c0bcbd8e10935652a0a8b02e2073b0ef040fb7be7b939c437d8b8dc"
},
{
"source": "refactor/baselines/site-vendor/monaco-dom/winjs-license.txt",
"target": "docs/licenses/monaco-editor/core-dom/LICENSE.txt",
"sha256": "13217bb585c27ee298f49c7aec2ef74578bc0d644880906a89d2c3ccec5d647e"
},
{
"source": "refactor/baselines/site-vendor/monaco-dom/ATTRIBUTION.md.txt",
"target": "docs/licenses/monaco-editor/core-dom/ATTRIBUTION.md",
"sha256": "0858d19261742809cecd7174a0a06b2b0013a4b9560b78aede1edd3dd350da21"
}
],
"review": "The complete upstream Monaco LICENSE/ThirdPartyNotices are retained. The unmodified bundled Codicons font exactly matches @vscode/codicons 0.0.26; its historical README, CC BY 4.0 content license, MIT code license and added attribution are distributed below. Other site assets remain subject to their separate provenance reviews.",
@@ -1217,6 +1227,18 @@
"docs/licenses/monaco-editor/ThirdPartyNotices.txt",
"docs/licenses/monaco-editor/core-path/ATTRIBUTION.md"
]
},
{
"name": "WinJS-derived DOM helpers (Monaco core)",
"version": "unversioned adaptation; reference WinJS 4.4.5",
"tarball": "https://github.com/winjs/winjs/tree/4329b1133b243d9ded3b5a1f98d096ee8e80e889",
"assets": [
"docs/assets/js/vs/editor/editor.main.js"
],
"notices": [
"docs/licenses/monaco-editor/core-dom/LICENSE.txt",
"docs/licenses/monaco-editor/core-dom/ATTRIBUTION.md"
]
}
]
},
+36
View File
@@ -370,3 +370,39 @@ yarn test:browser test/browser/editor-path.spec.js test/browser/site-vendor.spec
Full original core TypeScript compilation, WinJS/Unicode/other embedded origins
and the overall SITE-07 acceptance remain separate. A path-module proof is not
an exhaustive claim about every Node API or the rest of Monaco.
## WinJS-derived DOM declarations
`dom-origins.ts` identifies six complete top-level declaration blocks in fixed
VS Code `dom.ts`. `reproduce-dom-origins.ts` verifies those exact blocks in the
original editor source map and checks that the shipped editor still equals the
fixed npm archive. AST declaration boundaries reject same-named strings, missing
blocks and duplicate declarations. This is not compilation of the full DOM module.
The source explicitly attributes helpers to WinJS but does not identify the copied
version. The record keeps `originalWinjsVersion: null`. A fixed WinJS 4.4.5 source
and its complete Microsoft MIT terms provide a reproducible comparison, not an
assertion that Monaco incorporates that exact unmodified release. The generated
core-dom attribution explains CSS/pixel, position and typed-helper adaptations.
Do not replace this distinction with a guessed version during later maintenance.
The ordinary notice build binds the reference license and attribution to the
editor asset; it rejects omitted terms or a changed source/asset relationship.
The site now carries 88 notice files plus its index. Frozen source and delivered
terms preserve original bytes through Git attributes. No dependencies or editor
runtime bytes changed; the verifier uses the existing TypeScript parser.
```sh
yarn verify:monaco-dom-origins --fetch
yarn verify:monaco-dom-origins
yarn build:site-notices
yarn check:site-notices
yarn test:browser editor-dom.spec.js site-vendor.spec.js --workers=1
```
The browser test calls the actual shipped editor's dimension/position helpers
with borders, padding, margins and nested scrolling, comparing page offsets with
native geometry. The site test checks all notice HTTP bytes, relative links and
real mobile-page playback. Unicode/other embedded sources, unknown original
WinJS version, complete original core compilation and SITE-07 acceptance remain
open. Source comments and this bounded proof are not full provenance clearance.
+63
View File
@@ -0,0 +1,63 @@
import type { VendorManifest } from '../notices.ts'
import type { Archive, Member, Remote } from './archives.ts'
import assert from 'node:assert/strict'
import { Buffer } from 'node:buffer'
import fs from 'node:fs'
import path from 'node:path'
import ts from 'typescript'
import { hash } from './archives.ts'
export const domOriginNames = ['SizeUtils', 'getTopLeftOffset', 'getTotalWidth', 'getContentWidth', 'getContentHeight', 'getTotalHeight']
export interface DomOrigins {
archives: Archive[]
remotes: Remote[]
vscodeSource: string
winjsSource: string
map: Member & { source: string }
fragments: { name: string, sha256: string }[]
shipped: Member & { target: string }
component: { name: string, version: string, tarball: string, assets: string[], notices: string[] }
notices: { source: string, target: string, sha256: string }[]
originalWinjsVersion: null
}
// Match declaration boundaries, never a same-named string or a substring of a function.
export function domOriginFragments(source: string): Map<string, string> {
const file = ts.createSourceFile('dom.ts', source, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS)
const fragments = new Map<string, string>()
for (const node of file.statements) {
if ((!ts.isClassDeclaration(node) && !ts.isFunctionDeclaration(node)) || !node.name || !domOriginNames.includes(node.name.text))
continue
assert(!fragments.has(node.name.text), 'Repeated DOM origin declaration')
fragments.set(node.name.text, node.getText(file))
}
assert.deepEqual([...fragments.keys()], domOriginNames, 'Missing or reordered DOM origin declarations')
return fragments
}
export function readDomOrigins(root: string): DomOrigins {
return JSON.parse(fs.readFileSync(path.join(root, 'refactor/baselines/monaco-dom-origins-provenance.json'), 'utf8'))
}
export function verifyMonacoDomNotices(root: string, manifest: VendorManifest): void {
const record = readDomOrigins(root)
assert.equal(record.originalWinjsVersion, null, 'Do not invent the original WinJS adaptation version')
assert.equal(record.component.name, 'WinJS-derived DOM helpers (Monaco core)')
assert.equal(record.component.version, 'unversioned adaptation; reference WinJS 4.4.5')
assert.equal(record.component.tarball, 'https://github.com/winjs/winjs/tree/4329b1133b243d9ded3b5a1f98d096ee8e80e889', 'Wrong fixed WinJS reference')
assert.deepEqual(record.component.assets, ['docs/assets/js/vs/editor/editor.main.js'], 'Wrong DOM origin assets')
assert.deepEqual(record.notices.map(notice => notice.target), ['docs/licenses/monaco-editor/core-dom/LICENSE.txt', 'docs/licenses/monaco-editor/core-dom/ATTRIBUTION.md'], 'Missing complete DOM notice set')
assert.deepEqual(record.component.notices, record.notices.map(notice => notice.target), 'Missing DOM attribution or terms')
const group = manifest.groups.find(group => group.name === 'monaco-editor')
assert(group, 'Missing Monaco DOM group')
assert.deepEqual(group.components?.filter(item => item.name === record.component.name), [record.component], 'Wrong Monaco DOM notice binding')
for (const notice of record.notices) {
assert.deepEqual(group.notices.filter(item => item.target === notice.target), [notice], 'Missing Monaco DOM notice')
assert.equal(hash(fs.readFileSync(path.join(root, notice.source))), notice.sha256, 'Changed Monaco DOM terms')
}
const source = fs.readFileSync(path.join(root, record.vscodeSource), 'utf8')
assert.equal((source.match(/Adapted from WinJS/g) || []).length, 5, 'Changed explicit DOM attribution')
const fragments = domOriginFragments(source)
assert.deepEqual(record.fragments, [...fragments].map(([name, content]) => ({ name, sha256: hash(Buffer.from(content)) })), 'Changed DOM origin source fragments')
}
@@ -0,0 +1,25 @@
import assert from 'node:assert/strict'
import fs from 'node:fs'
import path from 'node:path'
import process from 'node:process'
import { fileURLToPath } from 'node:url'
import { ArchiveCache } from './archives.ts'
import { domOriginFragments, readDomOrigins, verifyMonacoDomNotices } from './dom-origins.ts'
const root = fileURLToPath(new URL('../../../', import.meta.url))
assert(process.argv.slice(2).every(arg => arg === '--fetch'), 'Use reproduce-dom-origins.ts [--fetch]')
assert.equal(process.version, `v${fs.readFileSync(path.join(root, '.node-version'), 'utf8').trim()}`, 'Use canonical Node')
const record = readDomOrigins(root)
const cache = new ArchiveCache(root, path.join(root, 'refactor/.cache/monaco-review'))
await cache.verify(record.archives, record.remotes, process.argv.includes('--fetch'))
verifyMonacoDomNotices(root, JSON.parse(fs.readFileSync(path.join(root, 'scripts/site-vendor/manifest.json'), 'utf8')))
const map: { sources: string[], sourcesContent: string[] } = JSON.parse(cache.member(record.map).toString('utf8'))
assert.equal(map.sources.filter(source => source === record.map.source).length, 1, 'Missing or repeated DOM source map entry')
const mapped = domOriginFragments(map.sourcesContent[map.sources.indexOf(record.map.source)]!)
const original = domOriginFragments(fs.readFileSync(path.join(root, record.vscodeSource), 'utf8'))
assert.deepEqual(mapped, original, 'Prepared DOM adaptations differ from fixed VS Code source')
assert.deepEqual(fs.readFileSync(path.join(root, record.shipped.target)), cache.member(record.shipped), 'Shipped DOM asset changed')
const winjs = fs.readFileSync(path.join(root, record.winjsSource), 'utf8')
for (const name of ['convertToPixels', 'getDimension', 'getTotalWidth', 'getContentWidth', 'getContentHeight', 'getTotalHeight', 'getPosition'])
assert(winjs.includes(name), 'Missing referenced WinJS helper')
console.log(JSON.stringify({ archives: record.archives.length, gitSources: record.remotes.length, unchangedMappedAdaptations: mapped.size, shippedAssetMatchesArchive: true, originalWinjsVersion: null, referenceVersion: '4.4.5', fullDomCompilation: false }))
+45
View File
@@ -0,0 +1,45 @@
import { expect, test } from './fixtures.js'
test('docs Monaco DOM helpers preserve dimensions and offsets through nested scrolling', async ({ page }, testInfo) => {
await page.goto('/test/player.html?core=candidate&chapter=published')
await page.addScriptTag({ url: '/assets/js/vs/loader.js' })
const observations = await page.evaluate(async () => {
window.require.config({ paths: { vs: '/assets/js/vs' } })
const load = ids => new Promise((resolve, reject) => window.require(ids, (...modules) => resolve(modules), reject))
await load(['vs/editor/editor.main'])
const [dom] = await load(['vs/base/browser/dom'])
const host = document.createElement('div')
host.style.cssText = 'position:relative;width:300px;height:160px;border:5px solid;overflow:scroll;'
const spacer = document.createElement('div')
spacer.style.cssText = 'width:600px;height:500px;'
const child = document.createElement('div')
child.style.cssText = 'box-sizing:content-box;position:absolute;left:70px;top:90px;width:120px;height:50px;padding:3px;border:2px solid;margin:7px;'
host.append(spacer, child)
document.body.append(host)
try {
return [[0, 0], [25, 35], [0, 0]].map(([left, top]) => {
host.scrollLeft = left
host.scrollTop = top
const rect = child.getBoundingClientRect()
return {
scroll: [host.scrollLeft, host.scrollTop],
content: [dom.getContentWidth(child), dom.getContentHeight(child)],
total: [dom.getTotalWidth(child), dom.getTotalHeight(child)],
offset: dom.getTopLeftOffset(child),
native: { left: rect.left + window.scrollX, top: rect.top + window.scrollY },
}
})
}
finally {
host.remove()
}
})
for (const value of observations) {
expect(value.content).toEqual([120, 50])
expect(value.total).toEqual([144, 74])
expect(value.offset.left).toBeCloseTo(value.native.left, 1)
expect(value.offset.top).toBeCloseTo(value.native.top, 1)
}
expect(observations.map(value => value.scroll)).toEqual([[0, 0], [25, 35], [0, 0]])
await testInfo.attach('monaco-dom-origins', { contentType: 'application/json', body: JSON.stringify(observations) })
})
+1
View File
@@ -26,6 +26,7 @@ test('mobile vConsole shows logs and upstream site notice texts are served uncha
{ path: '/licenses/monaco-editor/language-services/ATTRIBUTION.md', count: 12 },
{ path: '/licenses/monaco-editor/core-origins/ATTRIBUTION.md', count: 3 },
{ path: '/licenses/monaco-editor/core-path/ATTRIBUTION.md', count: 1 },
{ path: '/licenses/monaco-editor/core-dom/ATTRIBUTION.md', count: 1 },
]) {
const attribution = await request.get(path)
expect(attribution.status()).toBe(200)
+22
View File
@@ -9,12 +9,34 @@ import process from 'node:process'
import test from 'node:test'
import { verifyConsoleNoticeSources } from '../scripts/site-vendor/console/notices.ts'
import { verifyMonacoCoreNotices } from '../scripts/site-vendor/monaco/core-origins.ts'
import { domOriginFragments, verifyMonacoDomNotices } from '../scripts/site-vendor/monaco/dom-origins.ts'
import { verifyMonacoPathNotices } from '../scripts/site-vendor/monaco/node-path.ts'
import { verifyMonacoLanguageNoticeArchives, verifyMonacoLanguageNotices } from '../scripts/site-vendor/monaco/notices.ts'
import { generateNotices, writeOrCheckNotices } from '../scripts/site-vendor/notices.ts'
const hash = bytes => createHash('sha256').update(bytes).digest('hex')
test('WinJS-derived DOM helpers keep reference terms without claiming an exact original version', () => {
const original = JSON.parse(fs.readFileSync('scripts/site-vendor/manifest.json', 'utf8'))
assert.doesNotThrow(() => verifyMonacoDomNotices(process.cwd(), original))
const missingAsset = structuredClone(original)
missingAsset.groups.find(group => group.name === 'monaco-editor').components.find(item => item.name.startsWith('WinJS-derived')).assets = []
assert.throws(() => verifyMonacoDomNotices(process.cwd(), missingAsset), /DOM notice binding/)
const missingTerms = structuredClone(original)
const group = missingTerms.groups.find(group => group.name === 'monaco-editor')
group.notices = group.notices.filter(item => !item.target.endsWith('core-dom/LICENSE.txt'))
assert.throws(() => verifyMonacoDomNotices(process.cwd(), missingTerms), /DOM notice/)
})
test('DOM origin declarations reject duplicate or missing blocks and ignore same-named strings', () => {
const source = fs.readFileSync('refactor/baselines/site-vendor/monaco-dom/vscode-dom.txt', 'utf8')
const fragments = domOriginFragments(source)
assert.equal(fragments.size, 6)
assert.deepEqual(domOriginFragments(`${source}\nconst label = 'getTotalWidth';`), fragments)
assert.throws(() => domOriginFragments(`${source}\n${fragments.get('getTotalWidth')}`), /Repeated DOM/)
assert.throws(() => domOriginFragments(source.replace(fragments.get('SizeUtils'), 'const SizeUtils = "same name";')), /Missing or reordered/)
})
test('Node path attribution covers both editor and worker and keeps the original terms', () => {
const original = JSON.parse(fs.readFileSync('scripts/site-vendor/manifest.json', 'utf8'))
assert.doesNotThrow(() => verifyMonacoPathNotices(process.cwd(), original))