Package tweaks

This commit is contained in:
Will Hunt 2021-11-21 13:21:58 +00:00
parent 10c21552e1
commit 175a2c592e
7 changed files with 1913 additions and 63 deletions

2
Cargo.lock generated
View File

@ -37,7 +37,7 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]]
name = "matrix-github"
version = "0.0.1"
version = "0.1.0"
dependencies = [
"napi",
"napi-build",

View File

@ -1,7 +1,7 @@
[package]
name = "matrix-github"
version = "0.0.1"
edition = "2018"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib"]

View File

@ -6,18 +6,17 @@ FROM node:16 AS builder
COPY . /src
WORKDIR /src
RUN apt update && apt install -y rustc cargo git
# RUN rustup-init -y --target x86_64-unknown-linux-gnu
# We need rustup so we have a sensible rust version, the version packed with bullsye is too old
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --target x86_64-unknown-linux-gnu
ENV PATH="/root/.cargo/bin:${PATH}"
# will also build
# Workaround: Need to install esbuild manually https://github.com/evanw/esbuild/issues/462#issuecomment-771328459
RUN yarn --ignore-scripts
# Workaround for https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998232#10
RUN CARGO_NET_GIT_FETCH_WITH_CLI=true yarn build:app:rs --target x86_64-unknown-linux-gnu
RUN node node_modules/esbuild/install.js
RUN yarn build
# Stage 1: The actual container
FROM node:16-alpine
FROM node:16
COPY --from=builder /src/lib/ /bin/matrix-github/
COPY --from=builder /src/public/ /bin/matrix-github/public/

View File

@ -16,9 +16,9 @@ To set up the bridge, simply clone this repository.
then you will need to install the dependencies
```bash
```sh
cd matrix-github
yarn # Or "yarn"
yarn
```
Then you will need to copy the `config.sample.yml` to a new file called `config.yml`. You should fill this in. Pay **close** attention to settings like `passkey` which are required for the bridge to function.

View File

@ -10,6 +10,9 @@
"napi": {
"name": "matrix-github-rs"
},
"engines": {
"node": ">=12"
},
"scripts": {
"build:web": "snowpack build",
"build:app": "tsc --project tsconfig.json",
@ -73,7 +76,7 @@
"eslint": "^7.24.0",
"mini.css": "^3.0.1",
"preact": "^10.5.13",
"snowpack": "^3.2.2",
"snowpack": "^3.8.8",
"tailwind": "^4.0.0",
"ts-node": "^9.1.1",
"typescript": "^4.2.4"

View File

@ -2,7 +2,14 @@
import { JiraIssue } from "./Jira/Types";
// eslint-disable-next-line @typescript-eslint/no-var-requires
const rootModule = require('../lib/matrix-github-rs.node');
let rootModule;
try {
// In production, we expect it co-located
rootModule = require('./matrix-github-rs.node');
} catch (ex) {
// When running under ts-node, it may not be co-located.
rootModule = require('../lib/matrix-github-rs.node');
}
interface FormatUtil {
get_partial_body_for_jira_issue: (issue: JiraIssue) => Record<string, unknown>

1939
yarn.lock

File diff suppressed because it is too large Load Diff