@ohah/hwpjs 0.1.0-rc.1
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/Hwpjs.podspec +27 -0
- package/LICENSE +21 -0
- package/README.md +87 -0
- package/android/CMakeLists.txt +50 -0
- package/android/build.gradle +110 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/rs/craby/hwpjs/HwpjsPackage.kt +59 -0
- package/android/src/main/jni/OnLoad.cpp +22 -0
- package/android/src/main/jni/include/CrabySignals.h +53 -0
- package/android/src/main/jni/include/cxx.h +1150 -0
- package/android/src/main/jni/include/ffi.rs.h +1041 -0
- package/android/src/main/jni/libs/arm64-v8a/libhwpjs-prebuilt.a +0 -0
- package/android/src/main/jni/libs/arm64-v8a/libreactnative-prebuilt.a +0 -0
- package/android/src/main/jni/libs/armeabi-v7a/libhwpjs-prebuilt.a +0 -0
- package/android/src/main/jni/libs/armeabi-v7a/libreactnative-prebuilt.a +0 -0
- package/android/src/main/jni/libs/x86/libhwpjs-prebuilt.a +0 -0
- package/android/src/main/jni/libs/x86/libreactnative-prebuilt.a +0 -0
- package/android/src/main/jni/libs/x86_64/libhwpjs-prebuilt.a +0 -0
- package/android/src/main/jni/libs/x86_64/libreactnative-prebuilt.a +0 -0
- package/android/src/main/jni/src/ffi.rs.cc +1179 -0
- package/android/stubs/CMakeLists.txt +31 -0
- package/android/stubs/Hwpjs_stub.cpp +9 -0
- package/android/stubs/Hwpjs_stub.h +12 -0
- package/cpp/CrabyUtils.hpp +91 -0
- package/cpp/CxxHwpjsModule.cpp +125 -0
- package/cpp/CxxHwpjsModule.hpp +53 -0
- package/cpp/bridging-generated.hpp +158 -0
- package/dist/browser.js +1 -0
- package/dist/hwpjs-napi.wasi-browser.js +61 -0
- package/dist/hwpjs-napi.wasi.cjs +113 -0
- package/dist/hwpjs.wasi-browser.js +61 -0
- package/dist/hwpjs.wasi.cjs +113 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +577 -0
- package/dist/react-native/index.cjs +40 -0
- package/dist/react-native/index.cjs.map +1 -0
- package/dist/react-native/index.d.cts +22 -0
- package/dist/react-native/index.d.mts +22 -0
- package/dist/react-native/index.mjs +40 -0
- package/dist/react-native/index.mjs.map +1 -0
- package/dist/wasi-worker-browser.mjs +32 -0
- package/dist/wasi-worker.mjs +63 -0
- package/ios/HwpjsModuleProvider.mm +47 -0
- package/ios/framework/libhwpjs.xcframework/Info.plist +44 -0
- package/ios/framework/libhwpjs.xcframework/ios-arm64/libhwpjs-prebuilt.a +0 -0
- package/ios/framework/libhwpjs.xcframework/ios-arm64_x86_64-simulator/libhwpjs-prebuilt.a +0 -0
- package/ios/framework/libreactnative.xcframework/Info.plist +44 -0
- package/ios/framework/libreactnative.xcframework/ios-arm64/libreactnative-prebuilt.a +0 -0
- package/ios/framework/libreactnative.xcframework/ios-arm64_x86_64-simulator/libreactnative-prebuilt.a +0 -0
- package/ios/include/CrabySignals.h +53 -0
- package/ios/include/cxx.h +1150 -0
- package/ios/include/ffi.rs.h +1041 -0
- package/ios/src/ffi.rs.cc +1179 -0
- package/package.json +147 -0
- package/react-native.config.js +24 -0
package/package.json
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ohah/hwpjs",
|
|
3
|
+
"version": "0.1.0-rc.1",
|
|
4
|
+
"description": "HWP parser for Node.js, Web, and React Native",
|
|
5
|
+
"main": "./dist/browser.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"react-native": {
|
|
10
|
+
"types": "./dist/react-native/index.d.mts",
|
|
11
|
+
"default": "./dist/react-native/index.mjs"
|
|
12
|
+
},
|
|
13
|
+
"browser": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"default": "./dist/browser.js"
|
|
16
|
+
},
|
|
17
|
+
"node": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"default": "./dist/browser.js",
|
|
22
|
+
"types": "./dist/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+ssh://git@github.com/ohah/hwpjs.git"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"author": "ohah <bookyoon173@gmail.com>",
|
|
32
|
+
"homepage": "https://ohah.github.io/hwpjs",
|
|
33
|
+
"keywords": [
|
|
34
|
+
"napi-rs",
|
|
35
|
+
"NAPI",
|
|
36
|
+
"N-API",
|
|
37
|
+
"Rust",
|
|
38
|
+
"node-addon",
|
|
39
|
+
"node-addon-api",
|
|
40
|
+
"react-native",
|
|
41
|
+
"ios",
|
|
42
|
+
"android",
|
|
43
|
+
"hwp"
|
|
44
|
+
],
|
|
45
|
+
"files": [
|
|
46
|
+
"index.d.ts",
|
|
47
|
+
"index.js",
|
|
48
|
+
"browser.js",
|
|
49
|
+
"dist",
|
|
50
|
+
"android",
|
|
51
|
+
"ios",
|
|
52
|
+
"cpp",
|
|
53
|
+
"*.podspec",
|
|
54
|
+
"react-native.config.js",
|
|
55
|
+
"!ios/build",
|
|
56
|
+
"!android/build",
|
|
57
|
+
"!android/gradle",
|
|
58
|
+
"!android/gradlew",
|
|
59
|
+
"!android/gradlew.bat",
|
|
60
|
+
"!android/local.properties",
|
|
61
|
+
"!**/__tests__",
|
|
62
|
+
"!**/__fixtures__",
|
|
63
|
+
"!**/__mocks__",
|
|
64
|
+
"!**/.*"
|
|
65
|
+
],
|
|
66
|
+
"napi": {
|
|
67
|
+
"binaryName": "hwpjs",
|
|
68
|
+
"targets": [
|
|
69
|
+
"x86_64-pc-windows-msvc",
|
|
70
|
+
"x86_64-apple-darwin",
|
|
71
|
+
"i686-pc-windows-msvc",
|
|
72
|
+
"aarch64-apple-darwin",
|
|
73
|
+
"aarch64-pc-windows-msvc",
|
|
74
|
+
"x86_64-unknown-linux-gnu",
|
|
75
|
+
"wasm32-wasip1-threads"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
"engines": {
|
|
79
|
+
"node": ">= 12.22.0 < 13 || >= 14.17.0 < 15 || >= 15.12.0 < 16 || >= 16.0.0"
|
|
80
|
+
},
|
|
81
|
+
"publishConfig": {
|
|
82
|
+
"registry": "https://registry.npmjs.org/",
|
|
83
|
+
"access": "public"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"napi": "napi new",
|
|
87
|
+
"artifacts": "napi artifacts --output-dir dist --build-output-dir dist",
|
|
88
|
+
"bench": "node --import @oxc-node/core/register benchmark/bench.ts",
|
|
89
|
+
"prepare:target-link": "bun run scripts/create-target-link.ts",
|
|
90
|
+
"build:node:windows-x64": "napi build --platform --target x86_64-pc-windows-msvc --release --package hwpjs-napi --output-dir dist --cross-compile",
|
|
91
|
+
"build:node:windows-x86": "napi build --platform --target i686-pc-windows-msvc --release --package hwpjs-napi --output-dir dist --cross-compile",
|
|
92
|
+
"build:node:windows-arm64": "napi build --platform --target aarch64-pc-windows-msvc --release --package hwpjs-napi --output-dir dist --cross-compile",
|
|
93
|
+
"build:node:macos-x64": "napi build --platform --target x86_64-apple-darwin --release --package hwpjs-napi --output-dir dist",
|
|
94
|
+
"build:node:macos-arm64": "napi build --platform --target aarch64-apple-darwin --release --package hwpjs-napi --output-dir dist",
|
|
95
|
+
"build:node:linux-x64": "napi build --platform --target x86_64-unknown-linux-gnu --release --package hwpjs-napi --output-dir dist --use-cross",
|
|
96
|
+
"build:react-native": "craby build && tsdown",
|
|
97
|
+
"build:web:wasm": "napi build --target wasm32-wasip1-threads --release --package hwpjs-napi --output-dir dist",
|
|
98
|
+
"build:node": "bun run build:node:windows-x64 && bun run build:node:windows-x86 && bun run build:node:windows-arm64 && bun run build:node:macos-x64 && bun run build:node:macos-arm64 && bun run build:web:wasm && bun run build:node:linux-x64",
|
|
99
|
+
"build:node:all": "bun run build:node:windows-x64 || true && bun run build:node:windows-x86 || true && bun run build:node:windows-arm64 || true && bun run build:node:macos-x64 || true && bun run build:node:macos-arm64 || true && bun run build:web:wasm || true && bun run build:node:linux-x64",
|
|
100
|
+
"build": "bun run build:node && bun run build:react-native",
|
|
101
|
+
"prepare:artifacts": "napi create-npm-dirs",
|
|
102
|
+
"postbuild:node:all": "bun run scripts/rename-wasm.ts",
|
|
103
|
+
"postprepublishOnly": "bun run scripts/cleanup-root.ts",
|
|
104
|
+
"build:release": "bun run build:node:all && bun run postbuild:node:all && bun run prepare:artifacts && bun run artifacts && bun run prepublishOnly",
|
|
105
|
+
"prepublishOnly": "napi prepublish -t npm --dry-run --no-gh-release",
|
|
106
|
+
"release": "bash scripts/releash.sh",
|
|
107
|
+
"publish:npm": "bash scripts/publish.sh",
|
|
108
|
+
"publish:npm:next": "bash scripts/publish.sh --tag next",
|
|
109
|
+
"publish:npm:latest": "bash scripts/publish.sh --tag latest",
|
|
110
|
+
"test": "bun test",
|
|
111
|
+
"version": "napi version",
|
|
112
|
+
"typecheck": "tsc --noEmit",
|
|
113
|
+
"crabygen:codegen": "crabygen codegen",
|
|
114
|
+
"crabygen:build": "crabygen build",
|
|
115
|
+
"craby:build": "craby build",
|
|
116
|
+
"craby:clean": "craby clean"
|
|
117
|
+
},
|
|
118
|
+
"devDependencies": {
|
|
119
|
+
"@emnapi/core": "^1.5.0",
|
|
120
|
+
"@emnapi/runtime": "^1.5.0",
|
|
121
|
+
"@napi-rs/cli": "^3.2.0",
|
|
122
|
+
"@oxc-node/core": "^0.0.34",
|
|
123
|
+
"craby-modules": "^0.1.0-rc.2",
|
|
124
|
+
"@react-native-community/cli-types": "^20.0.2",
|
|
125
|
+
"@taplo/cli": "^0.7.0",
|
|
126
|
+
"@tybys/wasm-util": "^0.10.0",
|
|
127
|
+
"chalk": "^5.6.2",
|
|
128
|
+
"crabygen": "^0.1.0-rc.2",
|
|
129
|
+
"npm-run-all2": "^8.0.4",
|
|
130
|
+
"react": "19.1.1",
|
|
131
|
+
"react-native": "0.82.1",
|
|
132
|
+
"tinybench": "^5.0.1",
|
|
133
|
+
"tsdown": "^0.16.8",
|
|
134
|
+
"@types/bun": "latest",
|
|
135
|
+
"@types/node": "^20.0.0",
|
|
136
|
+
"typescript": "^5.9.3"
|
|
137
|
+
},
|
|
138
|
+
"optionalDependencies": {
|
|
139
|
+
"@ohah/hwpjs-win32-x64-msvc": "0.1.0-rc.1",
|
|
140
|
+
"@ohah/hwpjs-darwin-x64": "0.1.0-rc.1",
|
|
141
|
+
"@ohah/hwpjs-win32-ia32-msvc": "0.1.0-rc.1",
|
|
142
|
+
"@ohah/hwpjs-darwin-arm64": "0.1.0-rc.1",
|
|
143
|
+
"@ohah/hwpjs-win32-arm64-msvc": "0.1.0-rc.1",
|
|
144
|
+
"@ohah/hwpjs-linux-x64-gnu": "0.1.0-rc.1",
|
|
145
|
+
"@ohah/hwpjs-wasm32-wasi": "0.1.0-rc.1"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see docs https://github.com/react-native-community/cli/blob/main/docs/dependencies.md
|
|
3
|
+
* @type {import('@react-native-community/cli-types').UserDependencyConfig}
|
|
4
|
+
*/
|
|
5
|
+
module.exports = {
|
|
6
|
+
dependency: {
|
|
7
|
+
platforms: {
|
|
8
|
+
android: {
|
|
9
|
+
/**
|
|
10
|
+
* Configured by Craby. DO NOT EDIT.
|
|
11
|
+
*
|
|
12
|
+
* Craby builds artifacts using its own CMakeLists, making the CMakeLists generated during AutoLinking unnecessary.
|
|
13
|
+
* The C++ implementation serves as a no-op and is not actually used.
|
|
14
|
+
*
|
|
15
|
+
* However, React Native autolinking does not support linking only the `PackageList` without a CMakeLists file.
|
|
16
|
+
* To address this, I provide stub files that do not interfere with autolinking behavior.
|
|
17
|
+
*/
|
|
18
|
+
cmakeListsPath: 'stubs/CMakeLists.txt',
|
|
19
|
+
libraryName: 'Hwpjs_stub',
|
|
20
|
+
},
|
|
21
|
+
ios: {},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|