From 2d44130a4302009dffe1a9b4899e59dad9f2553a Mon Sep 17 00:00:00 2001 From: suyanhanx Date: Fri, 10 Mar 2023 23:11:56 +0800 Subject: [PATCH] chore(bindings/nodejs): fix missing files to publish Signed-off-by: suyanhanx --- .github/workflows/bindings_nodejs.yml | 3 +++ bindings/nodejs/README.md | 9 +++++---- bindings/nodejs/index.js | 3 +-- bindings/nodejs/npm/darwin-x64/README.md | 3 +++ bindings/nodejs/npm/linux-x64-gnu/README.md | 3 +++ bindings/nodejs/npm/win32-x64-msvc/README.md | 3 +++ bindings/nodejs/package.json | 16 ++++++++++++++++ licenserc.toml | 2 -- 8 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 bindings/nodejs/npm/darwin-x64/README.md create mode 100644 bindings/nodejs/npm/linux-x64-gnu/README.md create mode 100644 bindings/nodejs/npm/win32-x64-msvc/README.md diff --git a/.github/workflows/bindings_nodejs.yml b/.github/workflows/bindings_nodejs.yml index 5af629a5e06d..45b3374ab486 100644 --- a/.github/workflows/bindings_nodejs.yml +++ b/.github/workflows/bindings_nodejs.yml @@ -199,6 +199,9 @@ jobs: - name: Move artifacts run: yarn artifacts + - name: Build to generate main files + run: yarn build + - name: List packages run: ls -R ./npm shell: bash diff --git a/bindings/nodejs/README.md b/bindings/nodejs/README.md index 575e6d1bb2a5..5b4f35a0a37b 100644 --- a/bindings/nodejs/README.md +++ b/bindings/nodejs/README.md @@ -8,15 +8,16 @@ npm install opendal ``` ## Docs -- see [index.d.ts](./index.d.ts) + +see [index.d.ts](./index.d.ts) ## Usage ```javascript -import { Operator, Scheme } from 'opendal' +import { Operator, Scheme } from "opendal"; async function main() { - const op = new Operator(Scheme.Fs, { root: '/tmp' }); + const op = new Operator("fs", { root: "/tmp" }); await op.write("test", "Hello, World!"); const bs = await op.read("test"); console.log(new TextDecoder().decode(bs)); @@ -24,7 +25,7 @@ async function main() { console.log(`contentLength: ${meta.contentLength}`); } -main() +main(); ``` diff --git a/bindings/nodejs/index.js b/bindings/nodejs/index.js index c817db8482d4..a7381491965a 100644 --- a/bindings/nodejs/index.js +++ b/bindings/nodejs/index.js @@ -16,7 +16,6 @@ /// -const { Operator, Scheme } = require('./generated.js') +const { Operator } = require('./generated.js') module.exports.Operator = Operator -module.exports.Scheme = Scheme diff --git a/bindings/nodejs/npm/darwin-x64/README.md b/bindings/nodejs/npm/darwin-x64/README.md new file mode 100644 index 000000000000..800e10ddd0c6 --- /dev/null +++ b/bindings/nodejs/npm/darwin-x64/README.md @@ -0,0 +1,3 @@ +# `@opendal/lib-darwin-x64` + +This is the **x86_64-apple-darwin** binary for `opendal` diff --git a/bindings/nodejs/npm/linux-x64-gnu/README.md b/bindings/nodejs/npm/linux-x64-gnu/README.md new file mode 100644 index 000000000000..0d3c5f300eae --- /dev/null +++ b/bindings/nodejs/npm/linux-x64-gnu/README.md @@ -0,0 +1,3 @@ +# `@opendal/lib-linux-x64-gnu` + +This is the **x86_64-unknown-linux-gnu** binary for `opendal` diff --git a/bindings/nodejs/npm/win32-x64-msvc/README.md b/bindings/nodejs/npm/win32-x64-msvc/README.md new file mode 100644 index 000000000000..3f6282eccdc5 --- /dev/null +++ b/bindings/nodejs/npm/win32-x64-msvc/README.md @@ -0,0 +1,3 @@ +# `@opendal/lib-win32-x64-msvc` + +This is the **x86_64-pc-windows-msvc** binary for `opendal` diff --git a/bindings/nodejs/package.json b/bindings/nodejs/package.json index c76dcccd655f..7215ea9fffa6 100644 --- a/bindings/nodejs/package.json +++ b/bindings/nodejs/package.json @@ -10,6 +10,22 @@ "napi": { "name": "opendal" }, + "keywords": [ + "api", + "fs", + "file system", + "gcs", + "ghac", + "http", + "ipmfs", + "memory", + "obs", + "oss", + "s3", + "storage", + "webdav", + "webhdfs" + ], "files": [ "index.d.ts", "index.js", diff --git a/licenserc.toml b/licenserc.toml index 0d439cc866ca..01c587d7a324 100644 --- a/licenserc.toml +++ b/licenserc.toml @@ -25,8 +25,6 @@ excludes = [ "**/fixtures/**", "tests/data/**", "bindings/nodejs/.npmignore", - "bindings/nodejs/generated.js", - "bindings/nodejs/index.d.ts", "bindings/python/test_requirements.txt", # Env example that doesn't need license.