diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fdb9cc5..d8c0ce7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -21,6 +21,6 @@ jobs: - name: upload img uses: actions/upload-artifact@v4 with: - name: out + name: libcurl path: client/out/* compression-level: 9 \ No newline at end of file diff --git a/README.md b/README.md index f26369b..4c2bbd2 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ sudo apt install make cmake emscripten autoconf automake libtool pkg-config wget The build script will generate `client/out/libcurl.js` as well as `client/out/libcurl_module.mjs`, which is an ES6 module. You can supply the following arguments to the build script to control the build: - `release` - Use all optimizations. - `single_file` - Include the WASM binary in the outputted JS using base64. - +- `all` - Build twice, once normally, and once as a single file. ## Javascript API: diff --git a/client/npm/package.json b/client/npm/package.json new file mode 100644 index 0000000..16d300c --- /dev/null +++ b/client/npm/package.json @@ -0,0 +1,19 @@ +{ + "name": "libcurl.js", + "version": "0.1.0", + "description": "An experimental port of libcurl to WebAssembly for use in the browser.", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ading2210/libcurl.js.git" + }, + "author": "ading2210", + "license": "AGPL-3.0-or-later", + "bugs": { + "url": "https://github.com/ading2210/libcurl.js/issues" + }, + "homepage": "https://github.com/ading2210/libcurl.js" +} diff --git a/client/publish.sh b/client/publish.sh new file mode 100755 index 0000000..1287029 --- /dev/null +++ b/client/publish.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +#publish libcurl.js as an npm package +#run build.sh first + +cp npm/* out +cp ../README.md out +cd out +npm publish \ No newline at end of file diff --git a/client/tools/all_deps.sh b/client/tools/all_deps.sh index d3b857c..6e0cebd 100755 --- a/client/tools/all_deps.sh +++ b/client/tools/all_deps.sh @@ -24,12 +24,12 @@ fi if [ ! -d $BROTLI_PREFIX ]; then tools/brotli.sh fi -if [ ! -d $CURL_PREFIX ]; then - tools/curl.sh -fi if [ ! -d $NGHTTP2_PREFIX ]; then tools/nghttp2.sh fi +if [ ! -d $CURL_PREFIX ]; then + tools/curl.sh +fi cp -r $OPENSSL_PREFIX/* $CURL_PREFIX cp -r $CJSON_PREFIX/* $CURL_PREFIX