Skip to content

Commit 0d59e30

Browse files
authored
feat: Rename package to binary-info and fix release (#15)
Release-As: 1.0.0
1 parent 4291ef0 commit 0d59e30

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

.github/workflows/release-please.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
token: ${{ steps.get-token.outputs.token }}
1919
release-type: node
20-
package-name: "@netlify/@netlify/zip-it-and-ship-it"
20+
package-name: "@netlify/binary-info"
2121
- uses: actions/checkout@v3
2222
if: ${{ steps.release.outputs.release_created }}
2323
- run:
@@ -28,9 +28,9 @@ jobs:
2828
node-version: "*"
2929
registry-url: "https://registry.npmjs.org"
3030
if: ${{ steps.release.outputs.release_created }}
31-
- run: wasm-pack build --target nodejs --release
31+
- run: wasm-pack build --target nodejs --release --scope=netlify
3232
if: ${{ steps.release.outputs.release_created }}
33-
- run: wasm-pack publish
33+
- run: wasm-pack publish --access public
3434
if: ${{ steps.release.outputs.release_created }}
3535
env:
3636
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "elf-cam"
2+
name = "binary-info"
33
version = "0.1.1"
44
authors = ["David Calavera <[email protected]>"]
55
edition = "2018"
6-
repository = "https://github.com/netlify/elf-cam"
6+
repository = "https://github.com/netlify/binary-info"
77
license = "Apache 2"
8-
description = "elf-cam is a WebAssembly(WASM) module to extract very specific information from binary files built for Linux, also known as ELF files."
8+
description = "binary-info is a WebAssembly(WASM) module to extract very specific information from binary files."
99

1010
[lib]
1111
crate-type = ["cdylib", "rlib"]

README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
## Introduction
22

3-
elf-cam is a WebAssembly(WASM) module to extract very specific information from binary files built for Linux, also known as ELF files.
3+
@netlify/binary-info is a WebAssembly(WASM) module to extract very specific
4+
information from binary files.
45

5-
It's used by other Netlify projects to detect Go and Rust binaries built for Netlify Functions.
6+
It's used by other Netlify projects to detect Go and Rust binaries built for
7+
Netlify Functions and its architecture and platform .
68

79
## Usage
810

911
```js
1012
import { readFile } = require("fs");
11-
import * as elf from "elf-cam";
13+
import { detect, Runtime }from "@netlify/binary-info";
1214

1315
const buffer = await readFile(path);
1416
try {
15-
const runtime = elf.detect(buffer);
16-
switch (runtime) {
17-
case elf.Runtime.Go: console.log("Go binary file"); break;
18-
case elf.Runtime.Rust: console.log("Rust binary file"); break;
17+
const info = elf.detect(buffer);
18+
switch (info.runtime) {
19+
case Runtime.Go: console.log("Go binary file"); break;
20+
case Runtime.Rust: console.log("Rust binary file"); break;
1921
default: console.log("Unknown binary file");
2022
}
2123
} catch (error) {
@@ -28,11 +30,5 @@ try {
2830
### 🛠️ Build with `wasm-pack build`
2931

3032
```
31-
wasm-pack build --target nodejs --release
32-
```
33-
34-
### 🎁 Publish to NPM with `wasm-pack publish`
35-
36-
```
37-
wasm-pack publish
33+
wasm-pack build --target nodejs --release --scope=netlify
3834
```

0 commit comments

Comments
 (0)