Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(licenses): 声明闭包按显式目标平台收集,移动端不再声明构建期原生包 (#499)
zhanghengxd5160a9954e5c
diff --git a/docs/legal/notices/README.md b/docs/legal/notices/README.mdindex ff739be5b4..f78ed5abcc 100644--- a/docs/legal/notices/README.md+++ b/docs/legal/notices/README.md@@ -7,6 +7,8 @@- `desktop-macos.txt`:macOS x64/arm64 桌面安装包。- `desktop-linux.txt`:Linux x64 glibc 桌面安装包。- `mobile-ios.txt` / `mobile-android.txt`:移动端 JS 生产依赖与仓库显式声明的原生 SDK。+ 按 app 实际分发到的设备过滤,不含只在开发机构建期使用的平台可选原生包(这些包的+ JS 主包本身仍在声明内,只是其 `darwin`/`linux`/`win32` 预编译二进制不随 app 分发)。- `*-restricted.txt`:与各产物对应的专有、source-available 或许可待确认组件;不计入开源包数量。- `THIRD-PARTY-RESTRICTED.txt`:上述受限组件的全工程聚合审计表。- `THIRD-PARTY-NOTICES.txt`:上述开源组件的全工程保守聚合声明。@@ -18,6 +20,12 @@阻断 UNKNOWN/UNLICENSED、非法 SPDX 表达式、单一强 copyleft、未锁定 Rust 依赖和未登记的二进制资产。+每个产物闭包都按显式目标平台收集,产物内容不受生成机器上装了哪些平台可选包影响。+生成器判断可选依赖是否存在靠 `node_modules` 里有没有对应目录,而 pnpm 并不保证只+安装 `pnpm.supportedArchitectures` 声明的架构,因此省掉目标平台参数会让声明内容随+生成机器漂移。覆盖全部支持架构的闭包由 `SUPPORTED_TARGETS` 按该字段叉乘得出;新增+闭包时不要省掉目标平台参数。+移动端使用 Expo managed workflow,完整 Pod/Gradle 图只在原生构建阶段产生。因此移动端静态声明会明确标注范围,不能替代发布构建所产生的 `Podfile.lock` 或 Gradle dependencyreport。每次冷更发布仍应留存对应原生依赖报告,后续接入构建机后可将该报告并入 SBOM。diff --git a/docs/legal/notices/THIRD-PARTY-NOTICES.txt b/docs/legal/notices/THIRD-PARTY-NOTICES.txtindex 9188d9016c..1ffc933715 100644--- a/docs/legal/notices/THIRD-PARTY-NOTICES.txt+++ b/docs/legal/notices/THIRD-PARTY-NOTICES.txt@@ -4684,7 +4684,7 @@ SECTION 2: npm packages (1310 packages)- [email protected] — MIT — https://github.com/nearinfinity/node-bplist-parser- [email protected] — MIT — https://github.com/nearinfinity/node-bplist-parser- [email protected] — MIT — https://github.com/juliangruber/brace-expansion-- [email protected] — MIT — https://github.com/juliangruber/brace-expansion+- [email protected] — MIT — https://github.com/juliangruber/brace-expansion- [email protected] — MIT — https://github.com/micromatch/braces- [email protected] — MIT — https://github.com/browserslist/browserslist- [email protected] — Apache-2.0 — https://github.com/facebook/watchman@@ -30937,7 +30937,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.-------------------------------------------------------------------------------[230] Applies to: npm:[email protected]+[230] Applies to: npm:[email protected]------------------------------------------------------------------------------MIT Licensediff --git a/docs/legal/notices/mobile-android.txt b/docs/legal/notices/mobile-android.txtindex 71c09e7b19..58dd36549e 100644--- a/docs/legal/notices/mobile-android.txt+++ b/docs/legal/notices/mobile-android.txt@@ -14,6 +14,7 @@ We are grateful to all open source authors and maintainers.------------------------------------------------------------------------------SCOPE NOTES:- Expo managed 工程的完整 Gradle 闭包在构建时生成;本文件不声称替代具体 APK/AAB 的依赖报告。+ - 不含只在开发机构建期使用、不随 app 分发的平台可选原生包(其 JS 包自身仍已声明)。受限或专有第三方组件不列入开源包数量,另见配套的 THIRD-PARTY-RESTRICTED.txt。Restricted or proprietary components are disclosed in the companion file.@@ -329,7 +330,7 @@ Apache Licenselimitations under the License.==============================================================================-SECTION 2: npm packages (607 packages)+SECTION 2: npm packages (601 packages)==============================================================================- @adobe/[email protected] — MIT — https://github.com/adobe/css-tools@@ -538,7 +539,7 @@ SECTION 2: npm packages (607 packages)- [email protected] — MIT — https://github.com/nearinfinity/node-bplist-creator- [email protected] — MIT — https://github.com/nearinfinity/node-bplist-parser- [email protected] — MIT — https://github.com/nearinfinity/node-bplist-parser-- [email protected] — MIT — https://github.com/juliangruber/brace-expansion+- [email protected] — MIT — https://github.com/juliangruber/brace-expansion- [email protected] — MIT — https://github.com/micromatch/braces- [email protected] — MIT — https://github.com/browserslist/browserslist- [email protected] — Apache-2.0 — https://github.com/facebook/watchman@@ -716,12 +717,6 @@ SECTION 2: npm packages (607 packages)- [email protected] — MIT — https://github.com/sindresorhus/leven- [email protected] — Apache-2.0- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss- [email protected] — MIT — https://github.com/lodash/lodash- [email protected] — MIT — https://github.com/lodash/lodash- [email protected] — MIT — https://github.com/sindresorhus/log-symbols@@ -2708,7 +2703,7 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INOR THE USE OR OTHER DEALINGS IN THE SOFTWARE.-------------------------------------------------------------------------------[50] Applies to: npm:[email protected]+[50] Applies to: npm:[email protected]------------------------------------------------------------------------------MIT License@@ -5614,7 +5609,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.-------------------------------------------------------------------------------[134] Applies to: npm:[email protected], npm:[email protected], npm:[email protected], npm:[email protected], npm:[email protected], npm:[email protected], npm:[email protected]+[134] Applies to: npm:[email protected]------------------------------------------------------------------------------Mozilla Public License Version 2.0==================================diff --git a/docs/legal/notices/mobile-ios.txt b/docs/legal/notices/mobile-ios.txtindex 7b79b0fa6c..3557360415 100644--- a/docs/legal/notices/mobile-ios.txt+++ b/docs/legal/notices/mobile-ios.txt@@ -14,6 +14,7 @@ We are grateful to all open source authors and maintainers.------------------------------------------------------------------------------SCOPE NOTES:- Expo managed 工程的完整 Pod 闭包在构建时生成;本文件不声称替代具体构建产物的 Podfile.lock 审计。+ - 不含只在开发机构建期使用、不随 app 分发的平台可选原生包(其 JS 包自身仍已声明)。受限或专有第三方组件不列入开源包数量,另见配套的 THIRD-PARTY-RESTRICTED.txt。Restricted or proprietary components are disclosed in the companion file.@@ -147,7 +148,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.==============================================================================-SECTION 2: npm packages (607 packages)+SECTION 2: npm packages (601 packages)==============================================================================- @adobe/[email protected] — MIT — https://github.com/adobe/css-tools@@ -356,7 +357,7 @@ SECTION 2: npm packages (607 packages)- [email protected] — MIT — https://github.com/nearinfinity/node-bplist-creator- [email protected] — MIT — https://github.com/nearinfinity/node-bplist-parser- [email protected] — MIT — https://github.com/nearinfinity/node-bplist-parser-- [email protected] — MIT — https://github.com/juliangruber/brace-expansion+- [email protected] — MIT — https://github.com/juliangruber/brace-expansion- [email protected] — MIT — https://github.com/micromatch/braces- [email protected] — MIT — https://github.com/browserslist/browserslist- [email protected] — Apache-2.0 — https://github.com/facebook/watchman@@ -534,12 +535,6 @@ SECTION 2: npm packages (607 packages)- [email protected] — MIT — https://github.com/sindresorhus/leven- [email protected] — Apache-2.0- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss-- [email protected] — MPL-2.0 — https://github.com/parcel-bundler/lightningcss- [email protected] — MIT — https://github.com/lodash/lodash- [email protected] — MIT — https://github.com/lodash/lodash- [email protected] — MIT — https://github.com/sindresorhus/log-symbols@@ -2526,7 +2521,7 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INOR THE USE OR OTHER DEALINGS IN THE SOFTWARE.-------------------------------------------------------------------------------[50] Applies to: npm:[email protected]+[50] Applies to: npm:[email protected]------------------------------------------------------------------------------MIT License@@ -5432,7 +5427,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.-------------------------------------------------------------------------------[134] Applies to: npm:[email protected], npm:[email protected], npm:[email protected], npm:[email protected], npm:[email protected], npm:[email protected], npm:[email protected]+[134] Applies to: npm:[email protected]------------------------------------------------------------------------------Mozilla Public License Version 2.0==================================diff --git a/docs/legal/notices/sbom/desktop-linux.spdx.json b/docs/legal/notices/sbom/desktop-linux.spdx.jsonindex 4a68640731..aa76b7a7db 100644--- a/docs/legal/notices/sbom/desktop-linux.spdx.json+++ b/docs/legal/notices/sbom/desktop-linux.spdx.json@@ -5,7 +5,7 @@"name": "cindy-desktop-linux","documentNamespace": "https://cindy.app/spdx/desktop-linux/71ca5d23b32ae6e9265183d63607f7fc4dc7376308cfffc4cf746d2dc7918531","creationInfo": {- "created": "2026-07-25T09:00:18Z",+ "created": "2026-07-26T02:38:39Z","creators": ["Tool: scripts/generate-third-party-notices.mjs"]diff --git a/docs/legal/notices/sbom/desktop-macos.spdx.json b/docs/legal/notices/sbom/desktop-macos.spdx.jsonindex 42b4e10ed9..2c4ade8809 100644--- a/docs/legal/notices/sbom/desktop-macos.spdx.json+++ b/docs/legal/notices/sbom/desktop-macos.spdx.json@@ -5,7 +5,7 @@"name": "cindy-desktop-macos","documentNamespace": "https://cindy.app/spdx/desktop-macos/3b3da6083be54d1a02f211b384e996fe863f75def512829c90ecda5ee685e5dc","creationInfo": {- "created": "2026-07-25T09:00:18Z",+ "created": "2026-07-26T02:38:39Z","creators": ["Tool: scripts/generate-third-party-notices.mjs"]diff --git a/docs/legal/notices/sbom/desktop-win.spdx.json b/docs/legal/notices/sbom/desktop-win.spdx.jsonindex 82797a1bb5..f3dfaf21f0 100644--- a/docs/legal/notices/sbom/desktop-win.spdx.json+++ b/docs/legal/notices/sbom/desktop-win.spdx.json@@ -5,7 +5,7 @@"name": "cindy-desktop-win","documentNamespace": "https://cindy.app/spdx/desktop-win/a4ceee438b8b55f4ba8a27d4ec3b154cbe5badce74aeaeda93193b7a3499b1e7","creationInfo": {- "created": "2026-07-25T09:00:18Z",+ "created": "2026-07-26T02:38:39Z","creators": ["Tool: scripts/generate-third-party-notices.mjs"]diff --git a/docs/legal/notices/sbom/mobile-android.spdx.json b/docs/legal/notices/sbom/mobile-android.spdx.jsonindex 1050202d75..44b7176c5a 100644--- a/docs/legal/notices/sbom/mobile-android.spdx.json+++ b/docs/legal/notices/sbom/mobile-android.spdx.json@@ -3,9 +3,9 @@"dataLicense": "CC0-1.0","SPDXID": "SPDXRef-DOCUMENT","name": "cindy-mobile-android",- "documentNamespace": "https://cindy.app/spdx/mobile-android/9f845f2d234656d48bca8d491b1ea3a5bd15a79c4fa744be623e71f447ec805e",+ "documentNamespace": "https://cindy.app/spdx/mobile-android/7073bd26a8bec4bc519dddb64ad4dec5f8e3314eeb49284f203d4779b32decd0","creationInfo": {- "created": "2026-07-25T09:00:18Z",+ "created": "2026-07-26T02:38:39Z","creators": ["Tool: scripts/generate-third-party-notices.mjs"]@@ -3535,8 +3535,8 @@},{"name": "brace-expansion",- "SPDXID": "SPDXRef-Package-7beda3a9b7db41eb",- "versionInfo": "5.0.7",+ "SPDXID": "SPDXRef-Package-0f66532ca9b9986b",+ "versionInfo": "5.0.8","downloadLocation": "https://github.com/juliangruber/brace-expansion","filesAnalyzed": false,"licenseConcluded": "MIT",@@ -3546,7 +3546,7 @@{"referenceCategory": "PACKAGE-MANAGER","referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"+ "referenceLocator": "pkg:npm/[email protected]"}]},@@ -6559,108 +6559,6 @@}]},- {- "name": "lightningcss-darwin-arm64",- "SPDXID": "SPDXRef-Package-0f68197d2c532d19",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },- {- "name": "lightningcss-darwin-x64",- "SPDXID": "SPDXRef-Package-654a9c60e340e499",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },- {- "name": "lightningcss-linux-arm64-gnu",- "SPDXID": "SPDXRef-Package-e53a5cf23dfe9fe6",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },- {- "name": "lightningcss-linux-x64-gnu",- "SPDXID": "SPDXRef-Package-3514c4270c99770a",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },- {- "name": "lightningcss-win32-arm64-msvc",- "SPDXID": "SPDXRef-Package-0491f1c7a23201bb",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },- {- "name": "lightningcss-win32-x64-msvc",- "SPDXID": "SPDXRef-Package-c9aa92c5ae5869f4",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },{"name": "lodash.debounce","SPDXID": "SPDXRef-Package-34b2f2c81ad9bbd3",@@ -11395,7 +11293,7 @@{"spdxElementId": "SPDXRef-DOCUMENT","relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-7beda3a9b7db41eb"+ "relatedSpdxElement": "SPDXRef-Package-0f66532ca9b9986b"},{"spdxElementId": "SPDXRef-DOCUMENT",@@ -12282,36 +12180,6 @@"relationshipType": "DESCRIBES","relatedSpdxElement": "SPDXRef-Package-4ae3a8c2073b4202"},- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-0f68197d2c532d19"- },- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-654a9c60e340e499"- },- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-e53a5cf23dfe9fe6"- },- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-3514c4270c99770a"- },- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-0491f1c7a23201bb"- },- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-c9aa92c5ae5869f4"- },{"spdxElementId": "SPDXRef-DOCUMENT","relationshipType": "DESCRIBES",diff --git a/docs/legal/notices/sbom/mobile-ios.spdx.json b/docs/legal/notices/sbom/mobile-ios.spdx.jsonindex 9cf885020f..9615eb1918 100644--- a/docs/legal/notices/sbom/mobile-ios.spdx.json+++ b/docs/legal/notices/sbom/mobile-ios.spdx.json@@ -3,9 +3,9 @@"dataLicense": "CC0-1.0","SPDXID": "SPDXRef-DOCUMENT","name": "cindy-mobile-ios",- "documentNamespace": "https://cindy.app/spdx/mobile-ios/e0ee8e6b570715d064e035b74053200f76167559cc5e539a2a80c25b6d5a7ef0",+ "documentNamespace": "https://cindy.app/spdx/mobile-ios/bcbee371f2714b4c4f18b156d42dd7bfd99ed8e2fd7e7a89d3dd3873c39324cf","creationInfo": {- "created": "2026-07-25T09:00:18Z",+ "created": "2026-07-26T02:38:39Z","creators": ["Tool: scripts/generate-third-party-notices.mjs"]@@ -3535,8 +3535,8 @@},{"name": "brace-expansion",- "SPDXID": "SPDXRef-Package-7beda3a9b7db41eb",- "versionInfo": "5.0.7",+ "SPDXID": "SPDXRef-Package-0f66532ca9b9986b",+ "versionInfo": "5.0.8","downloadLocation": "https://github.com/juliangruber/brace-expansion","filesAnalyzed": false,"licenseConcluded": "MIT",@@ -3546,7 +3546,7 @@{"referenceCategory": "PACKAGE-MANAGER","referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"+ "referenceLocator": "pkg:npm/[email protected]"}]},@@ -6559,108 +6559,6 @@}]},- {- "name": "lightningcss-darwin-arm64",- "SPDXID": "SPDXRef-Package-0f68197d2c532d19",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },- {- "name": "lightningcss-darwin-x64",- "SPDXID": "SPDXRef-Package-654a9c60e340e499",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },- {- "name": "lightningcss-linux-arm64-gnu",- "SPDXID": "SPDXRef-Package-e53a5cf23dfe9fe6",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },- {- "name": "lightningcss-linux-x64-gnu",- "SPDXID": "SPDXRef-Package-3514c4270c99770a",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },- {- "name": "lightningcss-win32-arm64-msvc",- "SPDXID": "SPDXRef-Package-0491f1c7a23201bb",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },- {- "name": "lightningcss-win32-x64-msvc",- "SPDXID": "SPDXRef-Package-c9aa92c5ae5869f4",- "versionInfo": "1.32.0",- "downloadLocation": "https://github.com/parcel-bundler/lightningcss",- "filesAnalyzed": false,- "licenseConcluded": "MPL-2.0",- "licenseDeclared": "MPL-2.0",- "copyrightText": "NOASSERTION",- "externalRefs": [- {- "referenceCategory": "PACKAGE-MANAGER",- "referenceType": "purl",- "referenceLocator": "pkg:npm/[email protected]"- }- ]- },{"name": "lodash.debounce","SPDXID": "SPDXRef-Package-34b2f2c81ad9bbd3",@@ -11395,7 +11293,7 @@{"spdxElementId": "SPDXRef-DOCUMENT","relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-7beda3a9b7db41eb"+ "relatedSpdxElement": "SPDXRef-Package-0f66532ca9b9986b"},{"spdxElementId": "SPDXRef-DOCUMENT",@@ -12282,36 +12180,6 @@"relationshipType": "DESCRIBES","relatedSpdxElement": "SPDXRef-Package-4ae3a8c2073b4202"},- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-0f68197d2c532d19"- },- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-654a9c60e340e499"- },- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-e53a5cf23dfe9fe6"- },- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-3514c4270c99770a"- },- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-0491f1c7a23201bb"- },- {- "spdxElementId": "SPDXRef-DOCUMENT",- "relationshipType": "DESCRIBES",- "relatedSpdxElement": "SPDXRef-Package-c9aa92c5ae5869f4"- },{"spdxElementId": "SPDXRef-DOCUMENT","relationshipType": "DESCRIBES",diff --git a/scripts/__tests__/third-party-notices.test.mjs b/scripts/__tests__/third-party-notices.test.mjsindex fe24b99e9a..541715a84c 100644--- a/scripts/__tests__/third-party-notices.test.mjs+++ b/scripts/__tests__/third-party-notices.test.mjs@@ -84,6 +84,32 @@ test("multi-arch desktop notices describe every architecture they ship with", ()assert.match(linux, /for use with sharp on Linux \(glibc\) 64-bit ARM\./);});+// 移动端安装包不分发构建期工具链的预编译二进制,但这些包的许可义务由其 JS 主包+// 承载,主包必须留在声明里。+test("mobile notices exclude build-time platform binaries but keep their JS packages", () => {+ for (const artifact of ["mobile-ios", "mobile-android"]) {+ const notices = read(`docs/legal/notices/${artifact}.txt`);+ // 覆盖 name-darwin-arm64 与 @scope/darwin-arm64 两种命名形式。+ assert.doesNotMatch(+ notices,+ /^- \S*(?:darwin|linux|win32|musl|freebsd)\S*@/im,+ );+ assert.match(notices, /^- lightningcss@/m);+ }+});++// 闭包必须按显式目标平台收集:collectClosure() 判断可选依赖是否存在只看+// node_modules 里有没有目录,省掉 target 会让产物随生成机器的安装集合漂移。+test("every dependency closure is collected against an explicit target", () => {+ const source = read("scripts/generate-third-party-notices.mjs");+ const untargeted = [...source.matchAll(/collectClosure\(\s*\[[^\]]*\]\s*\)/g)];+ assert.deepEqual(+ untargeted.map((match) => match[0]),+ [],+ "collectClosure() 调用缺少目标平台参数,产物会随本机安装的平台可选包漂移",+ );+});+test("commercial distributions do not resolve forbidden Sustainable Use dependencies", () => {const lockfile = read("pnpm-lock.yaml");assert.doesNotMatch(lockfile, /@codesandbox\/nodebox/);diff --git a/scripts/generate-third-party-notices.mjs b/scripts/generate-third-party-notices.mjsindex 2d32feac7f..08201ebc05 100644--- a/scripts/generate-third-party-notices.mjs+++ b/scripts/generate-third-party-notices.mjs@@ -386,6 +386,50 @@ function mergeClosures(...closures) {};}+/**+ * 由根 package.json 的 `pnpm.supportedArchitectures` 叉乘出的目标平台集合。+ *+ * 覆盖「本仓声明支持的全部架构」而非单一发行产物的闭包必须逐个 target 收集再合并,+ * 不能省掉 target 让 matchesTarget() 一律放行:collectClosure() 判断一个平台可选依赖+ * 是否存在只看 `node_modules` 里有没有对应目录,而实际装出来的集合可能超出+ * supportedArchitectures 的声明(例如 libc 只声明 glibc 时仍装进 musl 变体),产物+ * 内容就会随生成机器漂移。这里不假设包管理器只安装声明过的架构。+ */+function readSupportedTargets() {+ const declared = readJson(path.join(REPO_ROOT, "package.json")).pnpm+ ?.supportedArchitectures;+ for (const axis of ["os", "cpu", "libc"]) {+ const values = declared?.[axis];+ if (!Array.isArray(values) || values.length === 0) {+ throw new Error(+ `pnpm.supportedArchitectures.${axis} must list explicit values in the root package.json`,+ );+ }+ // pnpm 支持 "current" 表示生成机器自身的架构,那会把机器差异重新带回产物。+ if (values.includes("current")) {+ throw new Error(+ `pnpm.supportedArchitectures.${axis} must not use "current": license notices would depend on the generating machine`,+ );+ }+ }+ const targets = [];+ for (const os of declared.os) {+ for (const cpu of declared.cpu) {+ for (const libc of declared.libc) targets.push({ os, cpu, libc });+ }+ }+ return targets;+}++const SUPPORTED_TARGETS = readSupportedTargets();++/** 在全部支持架构上收集闭包并合并,结果与生成机器的安装集合无关。 */+function collectClosureForSupportedTargets(entryDirs) {+ return mergeClosures(+ ...SUPPORTED_TARGETS.map((target) => collectClosure(entryDirs, target)),+ );+}+function cargoExecutable() {const candidate = process.env.USERPROFILE? path.join(process.env.USERPROFILE, ".cargo", "bin", "cargo.exe")@@ -1239,7 +1283,12 @@ if (!fs.existsSync(path.join(path.dirname(CARGO_MANIFEST), "Cargo.lock"))) {);}-const projectNpm = collectClosure([REPO_ROOT, ...discoverWorkspaceDirs()]);+const projectNpm = collectClosureForSupportedTargets([+ REPO_ROOT,+ ...discoverWorkspaceDirs(),+]);+// 桌面三份产物的 target 是各自的实际发行矩阵(如 Windows 只发 x64),刻意不等于+// SUPPORTED_TARGETS——后者是仓库声明支持的全部架构,用于覆盖面更宽的聚合声明。const desktopWinNpm = collectClosure([DESKTOP_DIR], {os: "win32",cpu: "x64",@@ -1252,7 +1301,16 @@ const desktopLinuxNpm = mergeClosures(collectClosure([DESKTOP_DIR], { os: "linux", cpu: "x64", libc: "glibc" }),collectClosure([DESKTOP_DIR], { os: "linux", cpu: "arm64", libc: "glibc" }),);-const mobileNpm = collectClosure([MOBILE_DIR]);+// 移动端产物的 target 是「app 实际分发到的设备」,不是仓库支持的构建架构:+// 移动端 JS 依赖里的平台可选包(lightningcss / @parcel/watcher / @rollup 等预编译+// 二进制)属于开发机上的构建期工具链,不进 iOS bundle 或 APK/AAB。npm 生态里纯 JS+// 包不声明 os/cpu,matchesPackageConstraint() 对未声明的约束一律放行,所以按设备+// target 过滤只会摘掉这些原生变体,包自身(含其许可义务)仍然照常声明。+const mobileIosNpm = collectClosure([MOBILE_DIR], { os: "ios", cpu: "arm64" });+const mobileAndroidNpm = collectClosure([MOBILE_DIR], {+ os: "android",+ cpu: "arm64",+});const cargoClosure = collectCargoClosure();const apacheText =@@ -1306,21 +1364,23 @@ const artifactDefinitions = {],},"mobile-ios": {- closure: mobileNpm,+ closure: mobileIosNpm,manual: buildMobileEntries(apacheText, "ios"),productName: "Cindy mobile application — iOS",description: ["iOS JS 生产依赖及仓库显式声明的原生 SDK/字体组件。"],notes: ["Expo managed 工程的完整 Pod 闭包在构建时生成;本文件不声称替代具体构建产物的 Podfile.lock 审计。",+ "不含只在开发机构建期使用、不随 app 分发的平台可选原生包(其 JS 包自身仍已声明)。",],},"mobile-android": {- closure: mobileNpm,+ closure: mobileAndroidNpm,manual: buildMobileEntries(apacheText, "android"),productName: "Cindy mobile application — Android",description: ["Android JS 生产依赖及仓库显式声明的原生 SDK/字体组件。"],notes: ["Expo managed 工程的完整 Gradle 闭包在构建时生成;本文件不声称替代具体 APK/AAB 的依赖报告。",+ "不含只在开发机构建期使用、不随 app 分发的平台可选原生包(其 JS 包自身仍已声明)。",],},};