build(site): [SITE-07] reproduce all console modules and Parcel loader

This commit is contained in:
Harvey Zhao committed 2026-09-15 07:07:18 +08:00
1 parent ba1dbd430f
commit 63e4e8ad92
34 files changed
+1853 -39

No files matched your search

+1
View File
@@ -25,3 +25,4 @@ refactor/baselines/site-vendor/codicons-0.0.26/ATTRIBUTION.txt text eol=lf
refactor/baselines/site-vendor/vconsole-3.15.0/** text eol=lf whitespace=-blank-at-eof
refactor/baselines/site-vendor/console-original.js text eol=lf
refactor/baselines/site-vendor/console-commonjs/** -text whitespace=-trailing-space,cr-at-eol
refactor/baselines/site-vendor/console-esm/** -text whitespace=-trailing-space,cr-at-eol
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) Emotion team and other contributors
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,21 @@
MIT License
Copyright (c) 2017-present Devon Govett
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,21 @@
The MIT License (MIT)
Copyright (c) 2017 Xiaoyi Chen
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,21 @@
MIT License
Copyright (c) 2016-present Glen Maddern and Maximilian Stoiber
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,53 @@
# SITE-07 控制台 100 模块与加载器来源重建
最后 27 个模块使用 18 个官方 npm 归档精确重建;与已有 32+41 项合计,覆盖全部
100 个第三方模块。Parcel 1.12.5 的 prelude 在按其 getExisting 规则去掉末尾分号
后,也与原加载器逐字一致;入口调用和 map trailer 单独核对。来源、成员/编译
哈希、环境、包根与外部边界见[记录](../baselines/console-esm-provenance.json)。
## 关键发现与复现规则
- @emotion/core、styled-base、emotion-theming 的精确来源为 10.3.0;较早候选
版本的 chunk 名、helper 路径和内容不同,不以功能近似通过。
- Babel standalone 7.16.4 提供完整且自包含的历史转换器,避免将旧工具及其
传递依赖混进根工程。React-inspector 5.1.1 使用 ES member;CJS member 不匹配。
- Parcel generate 在压缩前和最终输出前都加全局声明;因此保留 define/process
的两次插入。默认全局声明放在 use strict 前的历史效果也保持,不手改输出。
- styled-components 先执行 typeof-symbol,再单独转换 CommonJS;把两者放在
同一遍会误改新生成的 interop helper。NODE_ENV 固定 production,四项 SC 配置
为 undefined,均来自已固定源码及 Parcel 环境处理规则的精确重建。
- Terser 3.17.0 会修改 options 对象,逐模块复制选项,避免跨模块状态与记录污染。
早期 Babel 插件/传递 helper 缺失只发生在独立缓存探针;后来改用 standalone。
首次读取该较大成员超过 Node 默认输出缓冲,改为固定 8MiB 上限后完整读取并验证
哈希。缺失候选 chunk、错误双引号脚本、序列化被压缩器修改的对象等诊断失败均
未改变生产内容;最终工具坚持归档 SRI、源码与输出字节、闭合依赖的同一检查。
## 工具、测试与许可边界
reconstruction.ts 管理有顺序的转换/环境/全局声明和 prelude;provenance.ts
验证包根、相对映射、完整覆盖以及命名/作用域子路径导入必须指向实际归属包。
reproduce.ts 同时读取三份来源记录,显式 --fetch 下载固定 35 个归档;离线使用
同一缓存。只执行固定历史编译器,未安装依赖、修改 Yarn 锁或执行被比对的库。
最终复现 100/100、Parcel prelude/invocation 和全部跨包依赖通过。单元13/13,
新增转换分阶段、显式环境/全局边界、错误加载器/入口、错误包归属反例;严格
docs-tools TS、相关 lint、build:console --check 通过。原日志位于
refactor/.cache/console-esm-{fetch-rebuild,offline,tests}.log。
最终联网复核两次 ECONNRESET;失败日志 final-fetch 与 final-fetch-second 保留。
补上具体 URL 后确认第二次来自补充许可的 raw 地址,第一次未记录具体请求。
改用同一固定 commit 的 GitHub Contents API 后,最终完整命令100/100通过,日志
为 final-fetch-api;解码内容与已有原文哈希一致,记录 API URL 和 Git blob ID。
下载错误保留具体 URL 与 cause,且保持现有 ES2021 类型检查范围。
新增 17 个归档的 LICENSE 原文及 Parcel LICENSE。styled-components 5.3.3 的
npm 归档缺 LICENSE;从对应 v5.3.3 的固定上游提交
9b3457036cfedf1d5336f654f3171657630a9fd8 取得原文,记录 URL、哈希和缺失原因。
这些不代替内嵌代码署名审查(例如 console-feed 内的 replicator)或实际 notices
分发,故 VENDOR-08 仍 open,SITE-07 仍 doing,任务完成数保持 199/265。
本批没有改站点 JS、公开接口、包入口、版本或锁文件,未重复实际页面测试;上一
任务的浏览器证据对应相同运行时。本检查点不代表远端 CI、手机或发布验收。
回退仅恢复 73 模块的溯源工具/台账并移除新增来源/许可/测试,不影响控制台修复。
维护说明见[模块文档](../../scripts/site-vendor/console/README.md)。独立本地提交,
无推送或发布。
+4 -1
View File
@@ -7,7 +7,7 @@ SITE-07 冻结原始 bundle 和浏览器契约,SITE-CONSOLE-01 已实现自有
- 原文件最后修改于提交 5d6b2f22bc75213ac97cff0bcffa4a1ce2bc786c,2021-11-30。
- 340,306 字节,102 个 Parcel 模块;所有静态依赖表条目都指向该 bundle 内的模块。
- Focm 是自有安装入口,W5CS 是自有 React 控制台视图,其余模块须继续溯源。
- Focm 是自有安装入口,W5CS 是自有 React 控制台视图;其余 100 模块现已精确重建。
- 实际全局包括 React、ReactDOM、consoleLog 和 parcelRequire。React/ReactDOM
均为 17.0.2,styled-components bundle 声明版本 5.3.3。
- console-feed 的 32 个模块现已用官方 3.2.2 归档精确重建,见
@@ -16,6 +16,9 @@ SITE-07 冻结原始 bundle 和浏览器契约,SITE-CONSOLE-01 已实现自有
- React/ReactDOM、scheduler、react-is、Linkify 等 13 个官方归档又精确重建 41 个
模块,累计 73/100;其成员/许可原文、环境变换和剩余 27 个 ID 见
[CommonJS 来源](baselines/console-commonjs-provenance.json)。仍不代表完整许可闭环。
- 最后 27 个模块和 Parcel prelude/invocation 也已精确匹配,见
[ESM 来源](baselines/console-esm-provenance.json)。三份记录共覆盖全部 100 个
第三方模块和跨包依赖。原始锁未找回;内嵌代码署名及完整 notices 仍待验收。
- 原末尾指向不存在的 /index.js.map。原始 bundle 和模块指纹见
[冻结来源](baselines/site-console-inventory.json)。
+1 -1
View File
@@ -653,7 +653,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)
- 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)
- 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)
+7
View File
@@ -1,5 +1,12 @@
# 进度与证据
## SITE-07 控制台 100/100 源码与 Parcel 加载器匹配
最后27模块使用固定归档与分阶段 Babel 转换精确重建,全部100模块、跨包边与
Parcel prelude/invocation通过;单元13/13。补齐新增许可原文与 styled-components
固定上游 LICENSE,见[记录](changes/2026-09-15-SITE-07-console-esm.md)。原锁未恢复,
内嵌署名与完整 notices 分发仍待核查。SITE-07 doing,仍199/265,运行时和锁不变。
## SITE-07 控制台来源扩大到 73/100 模块
新增 13 个官方归档、41 个精确模块及许可原文;联网准备和离线复现均为73/73。
+5 -2
View File
@@ -687,11 +687,14 @@
"scripts/site-vendor/console/provenance.ts",
"scripts/site-vendor/console/reproduce.ts",
"refactor/baselines/console-commonjs-provenance.json",
"refactor/changes/2026-09-15-SITE-07-console-commonjs.md"
"refactor/changes/2026-09-15-SITE-07-console-commonjs.md",
"refactor/baselines/console-esm-provenance.json",
"refactor/changes/2026-09-15-SITE-07-console-esm.md",
"scripts/site-vendor/console/reconstruction.ts"
],
"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": "73/100 vendor module bodies match official archives exactly: console-feed 32 and commonjs components 41. Remaining 27 modules, Parcel wrapper, original full lockfile and complete attribution remain open; runtime unchanged."
"workspaceState": "All 100 vendor module bodies and the Parcel prelude/invocation exactly reproduce from fixed official archives; all cross-package import edges verified. Original full lockfile is not recovered. Complete embedded attribution and public notices remain open; runtime unchanged."
},
{
"id": "SDK-01",
+3 -1
View File
@@ -4492,7 +4492,9 @@
"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"
"changes/2026-09-15-SITE-07-console-commonjs.md",
"baselines/console-esm-provenance.json",
"changes/2026-09-15-SITE-07-console-esm.md"
]
},
{
+23 -3
View File
@@ -1060,8 +1060,8 @@
"owners": [
"SITE-01"
],
"sourceStatus": "Frozen original 340306-byte Parcel bundle e00bbf82bf08c452825690372ded39a9b60f4baf438f0e7ce8300e9bc4629c03 has 102 modules. SITE-CONSOLE-01 replaces only owned Focm/W5CS bodies and removes the missing map trailer. Of the 100 retained vendor modules, 32 console-feed and 41 commonjs modules exactly reproduce from 14 official npm archives with a verified historical transform. The remaining 27, Parcel wrapper and original full lockfile remain unverified; exact source matches do not establish unique installed versions.",
"licenseStatus": "Original notices from console-feed and 13 additional archives preserved verbatim under site-vendor, with checked archive/member hashes. Complete embedded/external component attribution and public console notices remain open.",
"sourceStatus": "Frozen original 340306-byte Parcel bundle e00bbf82bf08c452825690372ded39a9b60f4baf438f0e7ce8300e9bc4629c03 has 102 modules. SITE-CONSOLE-01 replaces only owned Focm/W5CS bodies and removes the missing map trailer. All 100 retained vendor bodies and Parcel loader exactly reproduce from 32 official runtime archives, Babel standalone 7.16.4, Terser 3.17.0 and Parcel 1.12.5 recipes; all package edges verified. This establishes exact source identities, not the original full lockfile or uniquely installed versions.",
"licenseStatus": "Original notices for all 32 runtime archive packages and Parcel preserved; styled-components npm omitted LICENSE, supplemented from matching immutable upstream commit 9b3457036cfedf1d5336f654f3171657630a9fd8. Complete embedded-component attribution and public console notices remain open.",
"upstreamSources": [
"https://registry.npmjs.org/console-feed/-/console-feed-3.2.2.tgz",
"https://registry.npmjs.org/terser/-/terser-3.17.0.tgz",
@@ -1078,7 +1078,27 @@
"https://registry.npmjs.org/is-dom/-/is-dom-1.1.0.tgz",
"https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz",
"https://registry.npmjs.org/is-window/-/is-window-1.0.2.tgz",
"https://registry.npmjs.org/linkifyjs/-/linkifyjs-2.1.9.tgz"
"https://registry.npmjs.org/linkifyjs/-/linkifyjs-2.1.9.tgz",
"https://registry.npmjs.org/@emotion/core/-/core-10.3.0.tgz",
"https://registry.npmjs.org/@emotion/css/-/css-10.0.27.tgz",
"https://registry.npmjs.org/@emotion/cache/-/cache-10.0.29.tgz",
"https://registry.npmjs.org/@emotion/styled/-/styled-10.0.27.tgz",
"https://registry.npmjs.org/@emotion/styled-base/-/styled-base-10.3.0.tgz",
"https://registry.npmjs.org/emotion-theming/-/emotion-theming-10.3.0.tgz",
"https://registry.npmjs.org/styled-components/-/styled-components-5.3.3.tgz",
"https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.3.tgz",
"https://registry.npmjs.org/@emotion/sheet/-/sheet-0.9.4.tgz",
"https://registry.npmjs.org/@emotion/stylis/-/stylis-0.8.5.tgz",
"https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz",
"https://registry.npmjs.org/@emotion/utils/-/utils-0.11.3.tgz",
"https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz",
"https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz",
"https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz",
"https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.16.tgz",
"https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-0.8.8.tgz",
"https://registry.npmjs.org/react-inspector/-/react-inspector-5.1.1.tgz",
"https://registry.npmjs.org/@babel/standalone/-/standalone-7.16.4.tgz",
"https://raw.githubusercontent.com/styled-components/styled-components/9b3457036cfedf1d5336f654f3171657630a9fd8/LICENSE"
],
"upstreamReviewedAt": null,
"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 -2
View File
@@ -57,8 +57,9 @@ output through PowerShell text redirection. No dependency installation is needed
The desktop console's owned TS entry/view and lifecycle now build through
`build:console` / `check:console`; see [console maintenance](console/README.md).
Its other 100 Parcel modules remain frozen pending full provenance and notices.
Its other 100 Parcel modules remain frozen and now reproduce exactly from fixed
archives, including the Parcel loader. Full embedded attribution/notices remain open.
Follow-up: finish Monaco's broader bundled-component notice audit, the console
vendor provenance and remaining fonts/media. Do not upgrade these assets
embedded attribution/notices and remaining fonts/media. Do not upgrade these assets
without verifying globals, AMD/worker paths, CSS, consoleLog and user interaction.
+32 -12
View File
@@ -64,8 +64,9 @@ Historical browser cases intentionally reproduce frozen defects; candidate cases
prove their repairs independently. Unit tests check shared ownership, failed
installation, callback errors, object identity, exact CSS and vendor preservation.
No new dependency is required. Existing esbuild 0.27.7 and TypeScript 5.9.3 provide
generation and structural parsing. Full console dependency provenance and notices
remain SITE-07 / VENDOR-08; this build does not close them. See
generation and structural parsing. All vendor module bodies now have exact
reconstruction evidence; full embedded attribution and notices remain
SITE-07 / VENDOR-08. See
`refactor/console-modernization.md` for contracts and evidence.
## Historical source reconstruction
@@ -76,8 +77,9 @@ Their rebuilt bodies exactly match the frozen bundle. The separate
`console-commonjs-provenance.json` adds 41 exact modules from 13 official archives:
React/ReactDOM, scheduler, object-assign, react-is, prop-types, shallowequal,
process, hoist-non-react-statics, is-dom/is-object/is-window and linkifyjs.
The 27 remaining vendor modules and Parcel wrapper need further provenance; this does not establish a
unique original installed version or recover its missing lockfile.
`console-esm-provenance.json` adds the final 27 modules from 18 archives and the
Parcel 1.12.5 prelude/invocation. All 100 vendor bodies match; this does not
establish unique original installed versions or recover the missing lockfile.
```sh
node scripts/site-vendor/console/reproduce.ts --fetch
@@ -85,24 +87,35 @@ node scripts/site-vendor/console/reproduce.ts
yarn test:site-console
```
The first command downloads 15 pinned npm archives into the dedicated ignored
The first command downloads 35 pinned npm archives into the dedicated ignored
`refactor/.cache/console-feed-reproduction/` directory. The second uses that cache
offline. Both verify SHA-512 SRI, archive SHA-256, source member fingerprints,
compiler bytes, original notice bytes and exact output of all 73 identified
modules. They load Terser 3.17.0 as a historical build
tool with the already installed source-map 0.6.1; they do not install dependencies,
change Yarn or execute the archived console-feed runtime. Canonical Node is required.
compiler bytes, original notice bytes and exact output of all 100 identified
modules. They load Terser 3.17.0 with the installed source-map 0.6.1, and the
self-contained Babel 7.16.4 archive. They do not install dependencies, change Yarn
or execute the archived runtime libraries. Canonical Node is required.
The minification recipe is recovered from Parcel 1.12.5's archive; this proves a
reproducing transform, not that the original author used precisely that Parcel
version. `provenance.ts` separately verifies complete traversal, relative source
mapping and external dependency boundaries. Missing, unreachable, duplicate or
changed evidence fails instead of silently shrinking the comparison. Multiple
package roots are explicit, relative edges must stay in the same archive, and
the remaining module IDs are checked as a complete list. Production entrypoints
all module IDs are covered once. Named/scoped imports must resolve to the
identified package. Production entrypoints
use the pinned-source process.env.NODE_ENV substitution. The process shim's
single process.browser assignment is removed following Parcel's original visitor;
this is checked against exact source/output bytes, not a general JS rewrite.
`reconstruction.ts` owns the ordered Babel stages, explicit historical environment
and Parcel global injection. Most ESM inputs need only CommonJS conversion.
Styled-components needs a separate earlier typeof-symbol pass; combining the
passes also changes newly generated interop helpers and fails exact comparison.
Parcel adds globals before minification and again before final output. Preserve
that sequence, including the observed process/define declarations. Compiler
options are cloned per module because historical Terser mutates them.
`reproduce.ts` orchestrates archives, hashes and all three source groups; normal
site builds continue using the frozen verified vendor boundary.
The archived LICENSE is preserved verbatim with its Facebook attribution under
`refactor/baselines/site-vendor/console-feed-3.2.2-LICENSE.txt`. Do not rewrite it
or infer it covers every embedded/external component. Complete notices remain
@@ -110,5 +123,12 @@ open, including the bundled replicator and remaining dependencies.
The other 13 archives' LICENSE texts are also frozen under
`refactor/baselines/site-vendor/console-commonjs/`, with exact bytes preserved by
Git attributes. They are source evidence; complete site notice delivery still
requires the remaining component review. React-inspector 5.1.1's CJS file did
not match; its ESM conversion remains an investigation, not an accepted source.
requires the remaining component review. The final ESM and Parcel texts live in
`refactor/baselines/site-vendor/console-esm/`. React-inspector 5.1.1's ESM member
is an exact match after historical conversion; its CJS member was a failed
candidate. Styled-components 5.3.3 omits LICENSE in npm; the supplemental original
comes from fixed upstream commit 9b3457036cfedf1d5336f654f3171657630a9fd8.
The fetch command verifies that immutable upstream text through GitHub's Contents
API too (the raw URL had connection resets); both URLs and the blob ID are
recorded, and decoded content must match the same hash. Offline mode checks
the frozen bytes. Full embedded-component attribution remains open.
+13
View File
@@ -84,3 +84,16 @@ export function verifyModules<S extends Source>(modules: Map<string, Module>, so
assert.deepEqual(dependencies, external, 'External dependency boundary changed')
return visited.size
}
export function verifyPackageEdges(modules: Map<string, Module>, owners: { id: string, packageName: string }[]) {
const packages = new Map(owners.map(owner => [owner.id, owner.packageName]))
assert.equal(packages.size, owners.length, 'Duplicate package ownership')
for (const owner of owners) {
const module = modules.get(owner.id)
assert(module, `Unknown owned module: ${owner.id}`)
for (const [request, child] of Object.entries(module.dependencies)) {
const expected = request.startsWith('.') ? owner.packageName : request.split('/').slice(0, request.startsWith('@') ? 2 : 1).join('/')
assert.equal(packages.get(child), expected, `Wrong package for ${owner.id} -> ${request}`)
}
}
}
@@ -0,0 +1,33 @@
import type { Source } from './provenance.ts'
import assert from 'node:assert/strict'
export interface EsmSource extends Source {
archive: string
stages: string[][]
environment: Record<string, string | null>
prefix: string
}
export interface BabelRuntime {
version: string
transform: (source: string, options: { plugins: string[] }) => { code: string }
}
export function reconstructModule(source: string, item: EsmSource, babel: BabelRuntime, minify: (source: string) => string) {
for (const plugins of item.stages) {
assert(plugins.length && plugins.every(name => ['transform-typeof-symbol', 'transform-modules-commonjs'].includes(name)), 'Unexpected historical transform')
source = babel.transform(source, { plugins }).code
}
for (const [name, value] of Object.entries(item.environment)) {
assert(['NODE_ENV', 'REACT_APP_SC_ATTR', 'SC_ATTR', 'REACT_APP_SC_DISABLE_SPEEDY', 'SC_DISABLE_SPEEDY'].includes(name), 'Unexpected historical environment key')
source = source.replaceAll(`process.env.${name}`, value === null ? 'undefined' : JSON.stringify(value))
}
assert(['', 'var define;\n', 'var process = require("process");\n'].includes(item.prefix), 'Unexpected Parcel global injection')
// Parcel generate() adds globals for minification and again for final output.
return item.prefix + minify(item.prefix + source)
}
export function verifyPrelude(bundle: string, prelude: string, footer: string) {
const prefix = prelude.trim().replace(/;$/, '')
assert(bundle.startsWith(`${prefix}({`), 'Parcel prelude differs')
assert(bundle.endsWith(footer), 'Parcel invocation or map trailer differs')
}
+84 -16
View File
@@ -1,12 +1,15 @@
import type { Archive, External, Source } from './provenance.ts'
import type { BabelRuntime, EsmSource } from './reconstruction.ts'
import assert from 'node:assert/strict'
import { Buffer } from 'node:buffer'
import { execFileSync } from 'node:child_process'
import fs from 'node:fs'
import { createRequire } from 'node:module'
import path from 'node:path'
import process from 'node:process'
import { fileURLToPath } from 'node:url'
import { hash, parcelModules, verifyArchive, verifyModules } from './provenance.ts'
import { hash, parcelModules, verifyArchive, verifyModules, verifyPackageEdges } from './provenance.ts'
import { reconstructModule, verifyPrelude } from './reconstruction.ts'
interface CompilerOptions { warnings: boolean, safari10: boolean, mangle: { toplevel: boolean }, output?: { comments: boolean } }
interface Provenance {
@@ -18,30 +21,47 @@ interface Provenance {
}
interface Minifier { minify: (source: string, options: CompilerOptions) => { code?: string, error?: unknown } }
interface CommonSource extends Source { archive: string, transform: 'plain' | 'production' | 'process-browser' }
interface CommonProvenance {
archives: (Archive & { id: string, notices: { source: string, member: string, sha256: string }[] })[]
sources: CommonSource[]
interface Notice { source: string, member: string, sha256: string }
interface SourceGroup<S extends Source> {
archives: (Archive & { id: string, notices: Notice[] })[]
sources: S[]
external: External[]
roots: string[]
compilerOptions: CompilerOptions
unresolvedModules: string[]
}
interface EsmProvenance extends SourceGroup<EsmSource> {
babel: { archive: Archive, member: string, sha256: string, version: string }
parcel: { archive: Archive, prelude: { member: string, sha256: string }, footer: string, notices: Notice[], recipeMembers: { member: string, sha256: string }[] }
supplementalNotices: { url: string, apiUrl?: string, source: string, sha256: string }[]
}
const root = fileURLToPath(new URL('../../../', import.meta.url))
const record: Provenance = JSON.parse(fs.readFileSync(path.join(root, 'refactor/baselines/console-feed-provenance.json'), 'utf8'))
const common: CommonProvenance = JSON.parse(fs.readFileSync(path.join(root, 'refactor/baselines/console-commonjs-provenance.json'), 'utf8'))
const common: SourceGroup<CommonSource> = JSON.parse(fs.readFileSync(path.join(root, 'refactor/baselines/console-commonjs-provenance.json'), 'utf8'))
const esm: EsmProvenance = JSON.parse(fs.readFileSync(path.join(root, 'refactor/baselines/console-esm-provenance.json'), 'utf8'))
assert(process.argv.slice(2).every(arg => arg === '--fetch'), 'Use reproduce.ts [--fetch]')
assert.equal(process.version, `v${fs.readFileSync(path.join(root, '.node-version'), 'utf8').trim()}`, 'Use canonical Node')
const cacheRoot = fs.realpathSync(path.join(root, 'refactor/.cache'))
const cache = path.join(cacheRoot, 'console-feed-reproduction')
fs.mkdirSync(cache, { recursive: true })
assert.equal(fs.realpathSync(cache), cache, 'Reproduction cache must not redirect')
for (const archive of [record.archive, record.compiler.archive, ...common.archives]) {
const target = path.join(cache, `${archive.name}-${archive.version}.tgz`)
async function download(url: string) {
try {
const response = await fetch(url)
assert(response.ok, `HTTP ${response.status}`)
return new Uint8Array(await response.arrayBuffer())
}
catch (cause) {
const error = new Error(`Historical source download failed: ${url}`)
Object.defineProperty(error, 'cause', { value: cause })
throw error
}
}
for (const archive of [record.archive, record.compiler.archive, ...common.archives, ...esm.archives, esm.babel.archive, esm.parcel.archive]) {
const target = path.join(cache, `${encodeURIComponent(archive.name)}-${archive.version}.tgz`)
if (process.argv.includes('--fetch')) {
const response = await fetch(archive.tarball)
assert(response.ok, `Archive request failed: ${response.status}`)
const bytes = new Uint8Array(await response.arrayBuffer())
const bytes = await download(archive.tarball)
verifyArchive(bytes, archive)
fs.writeFileSync(target, bytes)
}
@@ -57,11 +77,18 @@ assert.equal(require('source-map/package.json').version, record.compiler.sourceM
const { minify } = require(compilerPath) as Minifier
const babelBytes = readMember(`${encodeURIComponent(esm.babel.archive.name)}-${esm.babel.archive.version}.tgz`, esm.babel.member)
assert.equal(hash(babelBytes), esm.babel.sha256, 'Babel compiler member changed')
const babelPath = path.join(cache, 'babel.cjs')
fs.writeFileSync(babelPath, babelBytes)
const babel = require(babelPath) as BabelRuntime
assert.equal(babel.version, esm.babel.version, 'Babel version changed')
const frozen = fs.readFileSync(path.join(root, record.frozen.path), 'utf8')
assert.equal(hash(frozen), record.frozen.sha256, 'Frozen console changed')
assert.equal(record.sources.length, 32, 'Incomplete console-feed scope')
function compile(source: string, options: CompilerOptions) {
const result = minify(source, options)
const result = minify(source, structuredClone(options))
if (result.error)
throw result.error
assert(typeof result.code === 'string')
@@ -70,10 +97,11 @@ function compile(source: string, options: CompilerOptions) {
const modules = parcelModules(frozen)
const count = verifyModules(modules, record.sources, record.external, member => readMember('console-feed-3.2.2.tgz', member).toString('utf8'), source => compile(source, record.compiler.options))
assert.equal(common.sources.length, 41, 'Incomplete commonjs scope')
const archiveIds = new Set(common.archives.map(archive => archive.id))
assert.equal(archiveIds.size, common.archives.length, 'Duplicate archives')
for (const archive of common.archives) {
assert.equal(archive.id, `${archive.name}-${archive.version}`, 'Archive ID differs')
const runtimeArchives = [...common.archives, ...esm.archives]
const archiveIds = new Set(runtimeArchives.map(archive => archive.id))
assert.equal(archiveIds.size, runtimeArchives.length, 'Duplicate archives')
for (const archive of runtimeArchives) {
assert.equal(archive.id, `${encodeURIComponent(archive.name)}-${archive.version}`, 'Archive ID differs')
for (const notice of archive.notices) {
const bytes = readMember(`${archive.id}.tgz`, notice.member)
assert.equal(hash(bytes), notice.sha256, 'Upstream notice differs')
@@ -100,4 +128,44 @@ const commonCount = verifyModules(modules, common.sources, common.external, (mem
const identified = new Set([...record.sources, ...common.sources].map(source => source.id))
assert.equal(identified.size, count + commonCount, 'Duplicate identified module')
assert.deepEqual([...modules.keys()].filter(id => !identified.has(id) && !['Focm', 'W5CS'].includes(id)), common.unresolvedModules, 'Unresolved module scope changed')
console.log(JSON.stringify({ exactModules: identified.size, consoleFeed: count, commonjs: commonCount, totalVendorModules: 100, unresolved: common.unresolvedModules.length, licenseClosure: false }))
assert.equal(esm.sources.length, 27, 'Incomplete ESM source scope')
const esmCount = verifyModules(modules, esm.sources, esm.external, (member, item) => {
assert(archiveIds.has(item.archive), 'Unknown ESM source archive')
return readMember(`${item.archive}.tgz`, member).toString('utf8')
}, (source, item) => reconstructModule(source, item, babel, code => compile(code, esm.compilerOptions)), { roots: esm.roots, sourcePrefix: 'package/' })
for (const source of esm.sources) {
assert(!identified.has(source.id), 'Duplicate ESM module')
identified.add(source.id)
}
assert.equal(identified.size, 100, 'Incomplete vendor reconstruction')
assert.deepEqual([...modules.keys()].filter(id => !identified.has(id) && !['Focm', 'W5CS'].includes(id)), esm.unresolvedModules, 'Unresolved ESM scope changed')
assert.equal(esm.unresolvedModules.length, 0, 'Vendor source scope still incomplete')
const archiveNames = new Map(runtimeArchives.map(archive => [archive.id, archive.name]))
verifyPackageEdges(modules, [
...record.sources.map(source => ({ id: source.id, packageName: record.archive.name })),
...[...common.sources, ...esm.sources].map(source => ({ id: source.id, packageName: archiveNames.get(source.archive)! })),
])
const parcelArchive = `${esm.parcel.archive.name}-${esm.parcel.archive.version}.tgz`
const prelude = readMember(parcelArchive, esm.parcel.prelude.member)
assert.equal(hash(prelude), esm.parcel.prelude.sha256, 'Parcel prelude source changed')
verifyPrelude(frozen, prelude.toString('utf8'), esm.parcel.footer)
for (const recipe of esm.parcel.recipeMembers)
assert.equal(hash(readMember(parcelArchive, recipe.member)), recipe.sha256, 'Parcel recipe source changed')
for (const notice of esm.parcel.notices) {
assert.equal(hash(readMember(parcelArchive, notice.member)), notice.sha256, 'Parcel notice source changed')
assert.equal(hash(fs.readFileSync(path.join(root, notice.source))), notice.sha256, 'Frozen Parcel notice changed')
}
for (const notice of esm.supplementalNotices) {
assert.equal(hash(fs.readFileSync(path.join(root, notice.source))), notice.sha256, 'Frozen supplemental notice changed')
if (process.argv.includes('--fetch')) {
let bytes: Uint8Array = await download(notice.apiUrl || notice.url)
if (notice.apiUrl) {
const content: { encoding: string, content: string } = JSON.parse(Buffer.from(bytes).toString('utf8'))
assert.equal(content.encoding, 'base64', 'Unexpected upstream notice encoding')
assert(typeof content.content === 'string', 'Missing upstream notice content')
bytes = Buffer.from(content.content, 'base64')
}
assert.equal(hash(bytes), notice.sha256, 'Upstream supplemental notice changed')
}
}
console.log(JSON.stringify({ exactModules: identified.size, consoleFeed: count, commonjs: commonCount, esm: esmCount, parcelPrelude: true, packageEdges: true, unresolved: 0, licenseClosure: false }))
+40 -1
View File
@@ -7,7 +7,8 @@ import process from 'node:process'
import test from 'node:test'
import ts from 'typescript'
import { generateConsole, moduleRanges, obsoleteMap, upstreamSha256 } from '../scripts/site-vendor/console/build.ts'
import { hash, parcelModules, verifyArchive, verifyModules } from '../scripts/site-vendor/console/provenance.ts'
import { hash, parcelModules, verifyArchive, verifyModules, verifyPackageEdges } from '../scripts/site-vendor/console/provenance.ts'
import { reconstructModule, verifyPrelude } from '../scripts/site-vendor/console/reconstruction.ts'
import { errorArgument } from '../scripts/site-vendor/console/runtime/errors.ts'
import { css } from '../scripts/site-vendor/console/runtime/style.ts'
import { createSubscriptions } from '../scripts/site-vendor/console/runtime/subscriptions.ts'
@@ -235,3 +236,41 @@ test('Console provenance verifies multiple archive roots without merging their r
modules.get('m6b6').dependencies = { './index': 'react' }
assert.throws(() => verifyModules(modules, sources, [], read, code => code, options), /Relative dependency changed archives/)
})
test('Console reconstruction retains separate Babel stages and explicit environment and global boundaries', () => {
const calls = []
const babel = { transform(source, { plugins }) {
calls.push({ source, plugins })
return { code: `${source}|${plugins.join(',')}` }
} }
const item = { stages: [['transform-typeof-symbol'], ['transform-modules-commonjs']], environment: { NODE_ENV: 'production', SC_ATTR: null }, prefix: 'var define;\n' }
const source = 'process.env.NODE_ENV;process.env.SC_ATTR'
const result = reconstructModule(source, item, babel, value => `minified(${value})`)
assert.equal(calls.length, 2)
assert.equal(calls[1].source, `${source}|transform-typeof-symbol`)
assert.equal(result, 'var define;\nminified(var define;\n"production";undefined|transform-typeof-symbol|transform-modules-commonjs)')
assert.throws(() => reconstructModule(source, { ...item, stages: [['unreviewed-plugin']] }, babel, String), /Unexpected historical transform/)
assert.throws(() => reconstructModule(source, { ...item, environment: { UNREVIEWED: 'value' } }, babel, String), /Unexpected historical environment/)
assert.throws(() => reconstructModule(source, { ...item, prefix: 'unreviewed-global' }, babel, String), /Unexpected Parcel global/)
})
test('Console provenance verifies exact Parcel prelude and invocation instead of accepting any wrapper', () => {
const prelude = 'loader=function(){};\n'
const bundle = 'loader=function(){}({modules},{},["Focm"], null)'
verifyPrelude(bundle, prelude, '},{},["Focm"], null)')
assert.throws(() => verifyPrelude(bundle.replace('function()', 'function(changed)'), prelude, '},{},["Focm"], null)'), /prelude differs/)
assert.throws(() => verifyPrelude(bundle.replace('Focm', 'other'), prelude, '},{},["Focm"], null)'), /invocation/)
})
test('Console provenance verifies named and scoped subpath imports against the identified package', () => {
const modules = new Map([
['parent', { id: 'parent', dependencies: { '@babel/runtime/helpers/esm/extends': 'helper', 'react': 'react' } }],
['helper', { id: 'helper', dependencies: {} }],
['react', { id: 'react', dependencies: {} }],
])
const owners = [{ id: 'parent', packageName: 'consumer' }, { id: 'helper', packageName: '@babel/runtime' }, { id: 'react', packageName: 'react' }]
verifyPackageEdges(modules, owners)
assert.throws(() => verifyPackageEdges(modules, owners.slice(0, 2)), /Wrong package/)
assert.throws(() => verifyPackageEdges(modules, [...owners, owners[0]]), /Duplicate package ownership/)
assert.throws(() => verifyPackageEdges(modules, owners.map(owner => ({ ...owner, packageName: owner.id }))), /Wrong package/)
})