@cpp.js/package-expat-multithread 2.0.0-beta.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
2
+ Copyright (c) 2001-2022 Expat maintainers
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included
13
+ in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # @cpp.js/package-expat
2
+ **Precompiled expat library built with cpp.js for seamless integration in JavaScript, WebAssembly and React Native projects.**
3
+
4
+ <a href="https://www.npmjs.com/package/@cpp.js/package-expat">
5
+ <img alt="NPM version" src="https://img.shields.io/npm/v/@cpp.js/package-expat?style=for-the-badge" />
6
+ </a>
7
+ <a href="https://github.com/libexpat/libexpat">
8
+ <img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Funpkg.com%2F%40cpp.js%2Fpackage-expat%2Fpackage.json&query=%24.nativeVersion&style=for-the-badge&label=Expat" />
9
+ </a>
10
+ <a href="https://github.com/libexpat/libexpat/blob/master/COPYING">
11
+ <img alt="License" src="https://img.shields.io/npm/l/%40cpp.js%2Fpackage-expat?style=for-the-badge" />
12
+ </a>
13
+
14
+ ## Integration
15
+ Start by installing these package with the following command:
16
+
17
+ ```sh
18
+ npm install @cpp.js/package-expat
19
+ ```
20
+
21
+ To enable the library, modify the cppjs.config.js file as shown below.
22
+ ```diff
23
+ +import expat from '@cpp.js/package-expat/cppjs.config.js';
24
+
25
+ export default {
26
+ dependencies: [
27
+ + expat
28
+ ]
29
+ paths: {
30
+ config: import.meta.url,
31
+ }
32
+ };
33
+ ```
34
+
35
+ ## Usage
36
+ Below are the steps to use the expat in your C++ or JavaScript code.
37
+
38
+ ### Usage in C++ Code
39
+ ```diff
40
+ +#include <expat.h>
41
+
42
+ std::string Native::sample() {
43
+ + return std::string(XML_ExpatVersion());
44
+ }
45
+ ```
46
+
47
+ ## License
48
+ This project includes the precompiled expat library, which is distributed under the [MIT License](https://github.com/libexpat/libexpat/blob/master/COPYING).
49
+
50
+ Expat Homepage: [https://github.com/libexpat/libexpat](https://github.com/libexpat/libexpat)
package/cppjs.build.js ADDED
@@ -0,0 +1,17 @@
1
+ const platformBuild = {
2
+ 'Emscripten-x86_64': ['--enable-shared=no', '--host=wasm32-unknown-emscripten'],
3
+ 'Android-arm64-v8a': ['--enable-static=no', '--host=aarch64-linux-android'],
4
+ 'Android-x86_64': ['--enable-static=no', '--host=x86_64-linux-android'],
5
+ 'iOS-iphoneos': ['--enable-shared=no', '--host=arm-apple-darwin'],
6
+ 'iOS-iphonesimulator': ['--enable-shared=no', '--host=x86_64-apple-darwin'],
7
+ };
8
+
9
+ export default {
10
+ getURL: (version) => `https://github.com/libexpat/libexpat/releases/download/R_${version.replaceAll('.', '_')}/expat-${version}.tar.gz`,
11
+ buildType: 'configure',
12
+ getBuildParams: (platform) => [
13
+ ...(platformBuild[platform] || []),
14
+ '--without-getrandom', '--without-sys-getrandom',
15
+ '--without-xmlwf', '--without-examples', '--without-tests',
16
+ ],
17
+ };
@@ -0,0 +1,14 @@
1
+ import expatWasmMultithread from '@cpp.js/package-expat-wasm-multithread/cppjs.config.js';
2
+ import expatAndroidMultithread from '@cpp.js/package-expat-android-multithread/cppjs.config.js';
3
+ import expatIosMultithread from '@cpp.js/package-expat-ios-multithread/cppjs.config.js';
4
+
5
+ export default {
6
+ dependencies: [
7
+ expatWasmMultithread,
8
+ expatAndroidMultithread,
9
+ expatIosMultithread,
10
+ ],
11
+ paths: {
12
+ config: import.meta.url
13
+ }
14
+ };
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@cpp.js/package-expat-multithread",
3
+ "version": "2.0.0-beta.1",
4
+ "nativeVersion": "2.7.3",
5
+ "description": "This package provides the precompiled Expat XML parser library, built using Cpp.js, for seamless integration into JavaScript, WebAssembly, and React Native projects. It enables fast and efficient parsing of XML data, making it ideal for applications requiring robust XML handling across platforms. Perfect for web, server-side, and mobile development environments.",
6
+ "homepage": "https://github.com/bugra9/cpp.js/tree/main/packages/cppjs-package-expat#readme",
7
+ "repository": "https://github.com/bugra9/cpp.js.git",
8
+ "type": "module",
9
+ "license": "MIT",
10
+ "keywords": [
11
+ "expat",
12
+ "libexpat",
13
+ "cpp.js-package",
14
+ "webassembly",
15
+ "react-native"
16
+ ],
17
+ "devDependencies": {
18
+ "@cpp.js/package-expat-android-multithread": "^2.0.0-beta.1",
19
+ "@cpp.js/package-expat-wasm-multithread": "^2.0.0-beta.1",
20
+ "cpp.js": "^2.0.0-beta.1",
21
+ "@cpp.js/package-expat-ios-multithread": "^2.0.0-beta.1"
22
+ }
23
+ }