You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ Install Rust according to https://www.rust-lang.org/tools/install
4
4
5
5
Install [zstd](https://github.com/facebook/zstd). For example, on Ubuntu you need the package `libzstd1`. For Windows, download the appropriate archive from the [releases](https://github.com/facebook/zstd/releases), extract it and add the extracted directory to your PATH.
6
6
7
+
Install [Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
8
+
7
9
```bash
8
10
git clone git@github.com:rage/tmc-langs-rust.git
9
11
cd tmc-langs-rust
@@ -14,8 +16,13 @@ If you have any troubles building the project, please do make an issue!
14
16
15
17
## Testing
16
18
19
+
To run tests for all included projects, run the `run-tests.sh` script.
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ TMC-langs provides an interface that encapsulates everything needed to support a
4
4
5
5
## Documentation
6
6
7
-
Documentation for the latest release is available at https://rage.github.io/tmc-langs-rust
7
+
Documentation for the latest release is available at https://rage.github.io/tmc-langs-rust. Documentation is automatically built and deployed when creating a GitHub release.
8
8
9
9
Additional documentation for other aspects of TMC such as configuration file formats is included in the [docs](./docs) directory.
10
10
@@ -14,6 +14,10 @@ Additional documentation for other aspects of TMC such as configuration file for
14
14
15
15
A "frontend" for tmc-langs. A binary CLI client for TMC-langs for IDEs. Intended to be used programmatically, for a CLI meant for manual use see [tmc-cli-rust](https://github.com/rage/tmc-cli-rust).
16
16
17
+
### bindings/tmc-langs-node
18
+
19
+
Bindings for using tmc-langs from Node.js.
20
+
17
21
### tmc-langs
18
22
19
23
The "backend". A library that provides a convenient API for implementing different frontends. A frontend (such as a CLI) should only depend on this library. The other libraries are considered internal.
Provides bindings to tmc-langs for Node.js. This project was bootstrapped by [create-neon](https://www.npmjs.com/package/create-neon).
4
+
5
+
## TypeScript definitions
6
+
7
+
You can find TypeScript files that can be used with the Node module in the `./ts` directory. `tmc.ts` is the main module which contains a `Tmc` class for using tmc-langs and re-exports the other modules. `generated.d.ts` contains type definitions for the relevant tmc-langs types like `ExercisePackagingConfiguration` and re-exported by `tmc.ts` as `langs`. `functions.d.ts` contains the types for the actual Node module and is wrapped by `tmc.ts`.
8
+
9
+
## Installing tmc-langs-node
10
+
11
+
Installing tmc-langs-node requires a [supported version of Node and Rust](https://github.com/neon-bindings/neon#platform-support).
12
+
13
+
You can install the project with npm. In the project directory, run:
14
+
15
+
```sh
16
+
$ npm install
17
+
```
18
+
19
+
This fully installs the project, including installing any dependencies and running the build.
20
+
21
+
## Building tmc-langs-node
22
+
23
+
If you have already installed the project and only want to run the build, run:
24
+
25
+
```sh
26
+
$ npm run build
27
+
```
28
+
29
+
This command uses the [cargo-cp-artifact](https://github.com/neon-bindings/cargo-cp-artifact) utility to run the Rust build and copy the built library into `./ts/functions.node`.
30
+
31
+
## Deployment
32
+
33
+
Node modules for the supported targets are built and deployed to Google Cloud when creating a GitHub release. The binaries are available at https://download.mooc.fi/tmc-langs-rust/, with each binary following the file name format `tmc-langs-{target}-{version}.node`. For a list of targets see the README at the repository root. For example, The 64-bit Linux binary for version 0.5.0 is available at https://download.mooc.fi/tmc-langs-rust/tmc-langs-x86_64-unknown-linux-gnu-0.5.0.node.
34
+
35
+
### Node module
36
+
37
+
The Node addon—i.e., a binary Node module—generated by building the project. This is the main module for this package, as dictated by the `"main"` key in `package.json`.
38
+
39
+
Under the hood, a [Node addon](https://nodejs.org/api/addons.html) is a [dynamically-linked shared object](https://en.wikipedia.org/wiki/Library_(computing)#Shared_libraries). The `"build"` script produces this file by copying it from within the `target/` directory, which is where the Rust build produces the shared object.
0 commit comments