finish integrating node bindings into core repository

don't ignore core sourcefiles,
prevented npm installation on architectures with no prebuild
don't run lint checks on windows
github actions don't like double quotes apparently
minimize node.js CI
update ubuntu runner to 22.04
README: update link to node bindings source
simplify link in readme
node: fix crash with invalid account id
(throw error when getContext failed)
fix typo in readme
remove node specific changelog
change prebuild machine back to ubuntu 18.04
move package.json to root level to include rust source in npm package
change path in m1 patch
github action to upload to download.delta.chat/node/ on tag
try build with ubuntu 20.04
Update node/README.md
try building it with newer ubuntu because it wants glibc 2.33
fix path for prebuildify script
throw error when instanciating a wrapper class on `null`
(Context, Message, Chat, ChatList and so on)
try fix selecting the right cache
to fix the strange glibc bug
also revert back ubuntu version to 18.04
also bump package.json version with release script
fix paths since we moved around package.json
github action: fix path
document npm release - it's so much easier now!
there are no PR checks to post to if this action is executed on a tag
github action: fix artifact names
fix paths? wtf do I know, it's 3AM and I'm drunk
fix syntax error
don't upload preview if action is run on tag
is the tag ID an empty string or null?
node-package github action is done so far
also include scripts in package
only publish docs on push to master branch
actually bump package.json version in set_core_version script
prettify package.json
fix test - we don't really need to assert that
remove unnecessary ls statement from github action
This commit is contained in:
missytake
2022-05-05 15:54:46 +02:00
committed by Simon Laux
parent b238c7e743
commit c9beaa2aa1
25 changed files with 246 additions and 1977 deletions

View File

@@ -1,19 +1,17 @@
# deltachat-node
> node.js bindings for [`deltachat-core-rust`][deltachat-core-rust]
> node.js bindings for [`deltachat-core-rust`](..)
[![npm](https://img.shields.io/npm/v/deltachat-node.svg)](https://www.npmjs.com/package/deltachat-node)
![Node version](https://img.shields.io/node/v/deltachat-node.svg)
[![Coverage Status](https://coveralls.io/repos/github/deltachat/deltachat-node/badge.svg)](https://coveralls.io/github/deltachat/deltachat-node)
[![dependencies](https://david-dm.org/deltachat/deltachat-node.svg)](https://david-dm.org/deltachat/deltachat-node)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-prettier-brightgreen.svg)](https://prettier.io)
`deltachat-node` primarily aims to offer two things:
- A high level JavaScript api with syntactic sugar
- A low level c binding api around [`deltachat-core-rust`][deltachat-core-rust]
- A low level c binding api around [`deltachat-core-rust`](..)
This code used to live at [`deltachat-node`][deltachat-node].
This code used to live at [`deltachat-node`](https://github.com/deltachat/deltachat-node)
## Table of Contents
@@ -31,13 +29,13 @@ This code used to live at [`deltachat-node`][deltachat-node].
## Install
By default the installation will build try to use the bundled prebuilds in the
npm package. If this fails it falls back to compile `deltachat-core-rust` from
npm package. If this fails it falls back to compile `../deltachat-core-rust` from
this repository, using `scripts/rebuild-core.js`.
To install from npm use:
```
npm install deltchat-node
npm install deltachat-node
```
## Dependencies
@@ -53,11 +51,15 @@ If you want to build from source, make sure that you have `rustup` installed.
You can either use `npm install deltachat-node --build-from-source` to force
building from source or clone this repository and follow this steps:
1. `git clone https://github.com/deltachat/deltachat-node.git`
2. `cd deltachat-node`
1. `git clone https://github.com/deltachat/deltachat-core-rust.git`
2. `cd deltachat-core-rust`
3. `npm i`
4. `npm run build`
> Our `package.json` file is located in the root directory of this repository,
> not inside this folder. (We need this in order to include the rust source
> code in the npm package.)
### Use build-from-source in deltachat-desktop
If you want to use the manually built node bindings in the desktop client (for
@@ -73,15 +75,15 @@ deltachat-desktop's package.json. You need to change
```
diff --git i/package.json w/package.json
index d3fb3f23..b6ee6b7f 100644
index 45893894..5154512c 100644
--- i/package.json
+++ w/package.json
@@ -83,7 +83,7 @@
"application-config": "^1.0.1",
"classnames": "^2.3.1",
"debounce": "^1.2.0",
- "deltachat-node": "1.77.1",
+ "deltachat-node": "file:../deltachat-core-rust/node",
- "deltachat-node": "1.79.3",
+ "deltachat-node": "file:../deltachat-core-rust/",
"emoji-js-clean": "^4.0.0",
"emoji-mart": "^3.0.1",
"emoji-regex": "^9.2.2",
@@ -218,17 +220,8 @@ We have the following scripts for building, testing and coverage:
The following steps are needed to make a release:
1. Update `CHANGELOG.md` (and run `npm run hallmark` to adjust markdown)
- Add release changelog in top section
- Also adjust links to github prepare links at the end of the file
2. Bump version number in package.json
3. Commit the changed files, commit message should be similiar to `Prepare node-bindings npm release`
4. Tag the release with `git tag -a v1.0.0-foo.number`
5. Push to github with `git push origin master --tags`
6. Wait until `Make Package` github action is completed
7. Download `deltachat-node.tgz` from the github release and run `npm publish deltachat-node.tgz` to publish it to npm. You probably need write rights to npm.
1. Wait until `pack-module` github action is completed
2. Run `npm publish https://download.delta.chat/node/deltachat-node-v1.x.x.tar.gz` to publish it to npm. You probably need write rights to npm.
## License