XL-Zhao-23 commented on issue #13517:
URL: https://github.com/apache/skywalking/issues/13517#issuecomment-3443413518
The concept of **version name hijacking** is new to me, so I tried to
understand it in the context of npm. It seems that npm actually combines both
approaches: it has a **native concept** of platform support while also using a
form of **name-based platform** differentiation.
In npm’s `package.json`, each subpackage can specify `os` and `cpu` fields,
which is the native way npm recognizes platform constraints. At the same time,
each platform-specific implementation is published as a separate package, for
example:
```json
"node_modules/@parcel/watcher": {
"version": "2.5.1",
"optionalDependencies": {
"@parcel/watcher-android-arm64": "2.5.1",
"@parcel/watcher-darwin-arm64": "2.5.1",
"@parcel/watcher-darwin-x64": "2.5.1",
"@parcel/watcher-linux-x64-glibc": "2.5.1",
"@parcel/watcher-win32-x64": "2.5.1"
}
}
```
The main package `@parcel/watcher` acts as an **abstract package**, which
references the platform-specific packages by name. Each of these subpackages
also defines the `os` and `cpu` fields, for example:
```json
"node_modules/@parcel/watcher-android-arm64": {
"version": "2.5.1",
"os": ["android"],
"cpu": ["arm64"],
"optional": true
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]