@ohos-ports/parcel-watcher-linux-arm-glibc 2.6.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017-present Devon Govett
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @ohos-ports/parcel-watcher-linux-arm-glibc
2
+
3
+ OpenHarmony (arm64) port of the `@parcel/watcher-linux-arm-glibc@2.6.0` platform-specific
4
+ native addon from [parcel-bundler/watcher](https://github.com/parcel-bundler/watcher).
5
+
6
+ The original package ships only a prebuilt 32-bit ARM glibc `watcher.node`, which cannot be
7
+ loaded by the 64-bit arm64 OpenHarmony (musl) Node.js runtime. This port replaces it with a
8
+ `watcher.node` compiled from the upstream v2.6.0 source (Rust/C++ napi addon, inotify backend)
9
+ using the OHOS SDK `aarch64-unknown-linux-ohos` clang toolchain via node-gyp.
10
+
11
+ ## Usage
12
+
13
+ This is a platform-specific binary package consumed by `@parcel/watcher`'s optional dependency
14
+ resolution. It can also be loaded directly:
15
+
16
+ ```js
17
+ const watcher = require('@ohos-ports/parcel-watcher-linux-arm-glibc');
18
+ await watcher.writeSnapshot('/some/dir', '/tmp/snapshot.bin');
19
+ const events = await watcher.getEventsSince('/some/dir', '/tmp/snapshot.bin');
20
+ const subscription = await watcher.subscribe('/some/dir', (err, events) => { ... });
21
+ await subscription.unsubscribe();
22
+ ```
23
+
24
+ Notes for OpenHarmony:
25
+ - No JS wrapper is shipped (like upstream); `subscribe(dir, cb)` works without an `opts` object.
26
+ - The Watchman backend is unavailable (watchman does not exist on OpenHarmony); the default
27
+ inotify backend is used.
28
+
29
+ ## Build
30
+
31
+ Rebuilt natively on OpenHarmony: symbol visibility hidden + linker version script
32
+ (`local.map`) statically binding libc++abi/libunwind from the OHOS NDK, avoiding the
33
+ mixed-unwinder crash caused by harmonybrew node's own statically-linked libc++abi.
34
+ Binary signed with `binary-sign-tool` (selfSign, SHA256withECDSA). All 8 functional
35
+ tests passed (subscribe/unsubscribe inotify events, writeSnapshot, getEventsSince,
36
+ ignorePaths, error paths).
37
+
38
+ See https://github.com/ohos-ports/ohos-ports/tree/main/ports for build scripts and patches.
39
+
40
+ ## License
41
+
42
+ MIT (upstream parcel-bundler/watcher)
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@ohos-ports/parcel-watcher-linux-arm-glibc",
3
+ "version": "2.6.0-beta.0",
4
+ "main": "watcher.node",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/ohos-ports/ohos-ports.git",
8
+ "directory": "ports/@parcel/watcher-linux-arm-glibc/2.6.0"
9
+ },
10
+ "description": "A native C++ Node module for querying and subscribing to filesystem events. Used by Parcel 2.",
11
+ "license": "MIT",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "files": [
16
+ "watcher.node",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "engines": {
21
+ "node": ">= 10.0.0"
22
+ },
23
+ "os": [
24
+ "openharmony"
25
+ ],
26
+ "cpu": [
27
+ "arm64"
28
+ ]
29
+ }
package/watcher.node ADDED
Binary file