@ohos-ports/swc-html-openharmony-arm64 1.16.2-beta.2 → 1.16.2-beta.3

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/README.md CHANGED
@@ -1,10 +1,3 @@
1
- # `@ohos-ports/swc-html-openharmony-arm64`
1
+ # `@swc/html-linux-arm64-gnu`
2
2
 
3
- HarmonyOS (OpenHarmony) aarch64 native binding for `@swc/html` — super-fast HTML minifier.
4
-
5
- This package contains the prebuilt NAPI binary `swc-html.openharmony-arm64.node`,
6
- compiled from the [swc-project/swc](https://github.com/swc-project/swc) sources
7
- (`binding_html_node` crate) for `aarch64-unknown-linux-ohos` and signed for OpenHarmony.
8
-
9
- This is an [ohos-ports](https://github.com/ohos-ports/ohos-ports) repackaging of
10
- `@swc/html-linux-arm64-musl` (musl variant merged into a single `openharmony` package).
3
+ This is the **aarch64-unknown-linux-gnu** binary for `@swc/html`
package/index.js ADDED
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /* auto-generated by NAPI-RS (modified for openharmony platform support)
3
+ *
4
+ * HarmonyOS (openharmony) loader for the @swc/html NAPI binding.
5
+ * The native binary `swc-html.openharmony-arm64-gnu.node` was compiled from
6
+ * the swc-project/swc source tree (bindings/binding_html_node) targeting
7
+ * aarch64-unknown-linux-ohos.
8
+ *
9
+ * NOTE: `openharmony` is a first-class platform branch here — it is NOT
10
+ * mapped onto `linux`. On openharmony/arm64 the ohos-built binary is loaded;
11
+ * every other platform combination is rejected with a clear error because
12
+ * this package only ships the openharmony-arm64-gnu binding.
13
+ */
14
+
15
+ function requireNative() {
16
+ if (process.platform === "openharmony") {
17
+ if (process.arch === "arm64") {
18
+ try {
19
+ return require("./swc-html.openharmony-arm64-gnu.node");
20
+ } catch (e) {
21
+ throw new Error(
22
+ `Failed to load openharmony-arm64-gnu native binding: ${e && e.message}`
23
+ );
24
+ }
25
+ } else {
26
+ throw new Error(
27
+ `Unsupported architecture on openharmony: ${process.arch}`
28
+ );
29
+ }
30
+ }
31
+ throw new Error(
32
+ `Unsupported OS: ${process.platform}, architecture: ${process.arch}. ` +
33
+ `This package only provides the openharmony-arm64-gnu binding.`
34
+ );
35
+ }
36
+
37
+ const nativeBinding = requireNative();
38
+
39
+ module.exports.minify = nativeBinding.minify;
40
+ module.exports.minifyFragment = nativeBinding.minifyFragment;
41
+ module.exports.minifyFragmentSync = nativeBinding.minifyFragmentSync;
42
+ module.exports.minifySync = nativeBinding.minifySync;
package/package.json CHANGED
@@ -1,24 +1,26 @@
1
1
  {
2
2
  "name": "@ohos-ports/swc-html-openharmony-arm64",
3
- "version": "1.16.2-beta.2",
3
+ "version": "1.16.2-beta.3",
4
4
  "os": [
5
5
  "openharmony"
6
6
  ],
7
7
  "cpu": [
8
8
  "arm64"
9
9
  ],
10
- "main": "swc-html.openharmony-arm64.node",
10
+ "main": "index.js",
11
11
  "files": [
12
- "swc-html.openharmony-arm64.node"
12
+ "index.js",
13
+ "swc-html.openharmony-arm64-gnu.node"
13
14
  ],
14
- "description": "Super-fast HTML minifier (OpenHarmony arm64 prebuilt binding)",
15
+ "description": "Super-fast HTML minifier",
15
16
  "keywords": [
16
17
  "swcpack",
17
18
  "babel",
18
19
  "typescript",
19
20
  "rust",
20
21
  "webpack",
21
- "tsc"
22
+ "tsc",
23
+ "openharmony"
22
24
  ],
23
25
  "author": "강동윤 <kdy1997.dev@gmail.com>",
24
26
  "homepage": "https://swc.rs",
@@ -33,7 +35,7 @@
33
35
  "repository": {
34
36
  "type": "git",
35
37
  "url": "git+https://github.com/ohos-ports/ohos-ports.git",
36
- "directory": "ports/swc-html/1.16.2"
38
+ "directory": "ports/swc-html-openharmony-arm64/1.16.2"
37
39
  },
38
40
  "bugs": {
39
41
  "url": "https://github.com/ohos-ports/ohos-ports/issues"
Binary file