meta: backend/native-utils -> backend-rs

This commit is contained in:
naskya 2024-02-12 23:14:23 +09:00
parent 4356099fec
commit fe0bfe31b3
No known key found for this signature in database
GPG Key ID: 712D413B3A9FED5C
146 changed files with 175 additions and 164 deletions

View File

@ -10,7 +10,7 @@ node_modules
report.*.json report.*.json
# Rust # Rust
packages/backend/native-utils/target packages/backend-rs/target
# Cypress # Cypress
cypress/screenshots cypress/screenshots

View File

@ -8,12 +8,12 @@ RUN curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://sh.rust
ENV PATH="/root/.cargo/bin:${PATH}" ENV PATH="/root/.cargo/bin:${PATH}"
# Copy only the cargo dependency-related files first, to cache efficiently # Copy only the cargo dependency-related files first, to cache efficiently
COPY packages/backend/native-utils/Cargo.toml packages/backend/native-utils/Cargo.toml COPY packages/backend-rs/Cargo.toml packages/backend-rs/Cargo.toml
COPY packages/backend/native-utils/Cargo.lock packages/backend/native-utils/Cargo.lock COPY packages/backend-rs/Cargo.lock packages/backend-rs/Cargo.lock
COPY packages/backend/native-utils/src/lib.rs packages/backend/native-utils/src/ COPY packages/backend-rs/src/lib.rs packages/backend-rs/src/
# Install cargo dependencies # Install cargo dependencies
RUN cargo fetch --locked --manifest-path /firefish/packages/backend/native-utils/Cargo.toml RUN cargo fetch --locked --manifest-path /firefish/packages/backend-rs/Cargo.toml
# Copy only the dependency-related files first, to cache efficiently # Copy only the dependency-related files first, to cache efficiently
COPY package.json pnpm*.yaml ./ COPY package.json pnpm*.yaml ./
@ -22,22 +22,22 @@ COPY packages/client/package.json packages/client/package.json
COPY packages/sw/package.json packages/sw/package.json COPY packages/sw/package.json packages/sw/package.json
COPY packages/firefish-js/package.json packages/firefish-js/package.json COPY packages/firefish-js/package.json packages/firefish-js/package.json
COPY packages/megalodon/package.json packages/megalodon/package.json COPY packages/megalodon/package.json packages/megalodon/package.json
COPY packages/backend/native-utils/package.json packages/backend/native-utils/package.json COPY packages/backend-rs/package.json packages/backend-rs/package.json
COPY packages/backend/native-utils/npm/linux-x64-musl/package.json packages/backend/native-utils/npm/linux-x64-musl/package.json COPY packages/backend-rs/npm/linux-x64-musl/package.json packages/backend-rs/npm/linux-x64-musl/package.json
COPY packages/backend/native-utils/npm/linux-arm64-musl/package.json packages/backend/native-utils/npm/linux-arm64-musl/package.json COPY packages/backend-rs/npm/linux-arm64-musl/package.json packages/backend-rs/npm/linux-arm64-musl/package.json
# Configure pnpm, and install dev mode dependencies for compilation # Configure pnpm, and install dev mode dependencies for compilation
RUN corepack enable && corepack prepare pnpm@latest --activate && pnpm i --frozen-lockfile RUN corepack enable && corepack prepare pnpm@latest --activate && pnpm i --frozen-lockfile
# Copy in the rest of the native-utils rust files # Copy in the rest of the rust files
COPY packages/backend/native-utils packages/backend/native-utils/ COPY packages/backend-rs packages/backend-rs/
# Compile native-utils # Compile backend-rs
RUN pnpm run --filter native-utils build RUN pnpm run --filter backend-rs build
# Copy in the rest of the files to compile # Copy in the rest of the files to compile
COPY . ./ COPY . ./
RUN env NODE_ENV=production sh -c "pnpm run --filter '!native-utils' build && pnpm run gulp" RUN env NODE_ENV=production sh -c "pnpm run --filter '!backend-rs' build && pnpm run gulp"
# Trim down the dependencies to only those for production # Trim down the dependencies to only those for production
RUN pnpm i --prod --frozen-lockfile RUN pnpm i --prod --frozen-lockfile
@ -64,7 +64,7 @@ COPY --from=build /firefish/packages/firefish-js/node_modules /firefish/packages
COPY --from=build /firefish/built /firefish/built COPY --from=build /firefish/built /firefish/built
COPY --from=build /firefish/packages/backend/built /firefish/packages/backend/built COPY --from=build /firefish/packages/backend/built /firefish/packages/backend/built
COPY --from=build /firefish/packages/backend/assets/instance.css /firefish/packages/backend/assets/instance.css COPY --from=build /firefish/packages/backend/assets/instance.css /firefish/packages/backend/assets/instance.css
COPY --from=build /firefish/packages/backend/native-utils/built /firefish/packages/backend/native-utils/built COPY --from=build /firefish/packages/backend-rs/built /firefish/packages/backend-rs/built
RUN corepack enable && corepack prepare pnpm@latest --activate RUN corepack enable && corepack prepare pnpm@latest --activate
ENV NODE_ENV=production ENV NODE_ENV=production

View File

@ -1,3 +1,14 @@
# Unreleased
## For systemd users
- `packages/backend/native-utils` can be removed.
- This directory was removed in the repository, but it's not completely removed from your system by `git pull --ff`, because some folders like `packages/backend/native-utils/built` are not tracked by git.
```sh
rm --recursive --force packages/backend/native-utils
```
# v20240206 # v20240206
## For all users ## For all users

View File

@ -3,7 +3,7 @@
This directory contains all of the packages Firefish uses. This directory contains all of the packages Firefish uses.
- `backend`: Main backend code written in TypeScript for NodeJS - `backend`: Main backend code written in TypeScript for NodeJS
- `backend/native-utils`: Backend code written in Rust, bound to NodeJS by [NAPI-RS](https://napi.rs/) - `backend-rs`: Backend code written in Rust, bound to NodeJS by [NAPI-RS](https://napi.rs/)
- `client`: Web interface written in Vue3 and TypeScript - `client`: Web interface written in Vue3 and TypeScript
- `sw`: Web [Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) written in TypeScript - `sw`: Web [Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) written in TypeScript
- `firefish-js`: TypeScript SDK for both backend and client, also published on [NPM](https://www.npmjs.com/package/firefish-js) for public use - `firefish-js`: TypeScript SDK for both backend and client, also published on [NPM](https://www.npmjs.com/package/firefish-js) for public use

View File

@ -196,6 +196,33 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "backend-rs"
version = "0.0.0"
dependencies = [
"async-trait",
"basen",
"cfg-if",
"chrono",
"cuid2",
"derive_more",
"jsonschema",
"napi",
"napi-build",
"napi-derive",
"once_cell",
"parse-display",
"pretty_assertions",
"rand",
"schemars",
"sea-orm",
"serde",
"serde_json",
"thiserror",
"tokio",
"utoipa",
]
[[package]] [[package]]
name = "backtrace" name = "backtrace"
version = "0.3.69" version = "0.3.69"
@ -1319,33 +1346,6 @@ dependencies = [
"libloading", "libloading",
] ]
[[package]]
name = "native-utils"
version = "0.0.0"
dependencies = [
"async-trait",
"basen",
"cfg-if",
"chrono",
"cuid2",
"derive_more",
"jsonschema",
"napi",
"napi-build",
"napi-derive",
"once_cell",
"parse-display",
"pretty_assertions",
"rand",
"schemars",
"sea-orm",
"serde",
"serde_json",
"thiserror",
"tokio",
"utoipa",
]
[[package]] [[package]]
name = "nix" name = "nix"
version = "0.27.1" version = "0.27.1"

View File

@ -1,6 +1,6 @@
[package] [package]
edition = "2021" edition = "2021"
name = "native-utils" name = "backend-rs"
version = "0.0.0" version = "0.0.0"
[features] [features]

View File

@ -0,0 +1,3 @@
# `backend-rs-android-arm-eabi`
This is the **armv7-linux-androideabi** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-android-arm-eabi", "name": "backend-rs-android-arm-eabi",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"android" "android"
@ -7,12 +7,12 @@
"cpu": [ "cpu": [
"arm" "arm"
], ],
"main": "native-utils.android-arm-eabi.node", "main": "backend-rs.android-arm-eabi.node",
"files": [ "files": [
"native-utils.android-arm-eabi.node" "backend-rs.android-arm-eabi.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
} }
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-android-arm64`
This is the **aarch64-linux-android** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-android-arm64", "name": "backend-rs-android-arm64",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"android" "android"
@ -7,12 +7,12 @@
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"main": "native-utils.android-arm64.node", "main": "backend-rs.android-arm64.node",
"files": [ "files": [
"native-utils.android-arm64.node" "backend-rs.android-arm64.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
} }
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-darwin-arm64`
This is the **aarch64-apple-darwin** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-darwin-arm64", "name": "backend-rs-darwin-arm64",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"darwin" "darwin"
@ -7,12 +7,12 @@
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"main": "native-utils.darwin-arm64.node", "main": "backend-rs.darwin-arm64.node",
"files": [ "files": [
"native-utils.darwin-arm64.node" "backend-rs.darwin-arm64.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
} }
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-darwin-universal`
This is the **universal-apple-darwin** binary for `backend-rs`

View File

@ -0,0 +1,15 @@
{
"name": "backend-rs-darwin-universal",
"version": "0.0.0",
"os": [
"darwin"
],
"main": "backend-rs.darwin-universal.node",
"files": [
"backend-rs.darwin-universal.node"
],
"license": "MIT",
"engines": {
"node": ">= 10"
}
}

View File

@ -0,0 +1,3 @@
# `backend-rs-darwin-x64`
This is the **x86_64-apple-darwin** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-darwin-x64", "name": "backend-rs-darwin-x64",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"darwin" "darwin"
@ -7,12 +7,12 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"main": "native-utils.darwin-x64.node", "main": "backend-rs.darwin-x64.node",
"files": [ "files": [
"native-utils.darwin-x64.node" "backend-rs.darwin-x64.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
} }
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-freebsd-x64`
This is the **x86_64-unknown-freebsd** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-freebsd-x64", "name": "backend-rs-freebsd-x64",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"freebsd" "freebsd"
@ -7,12 +7,12 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"main": "native-utils.freebsd-x64.node", "main": "backend-rs.freebsd-x64.node",
"files": [ "files": [
"native-utils.freebsd-x64.node" "backend-rs.freebsd-x64.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
} }
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-linux-arm-gnueabihf`
This is the **armv7-unknown-linux-gnueabihf** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-linux-arm-gnueabihf", "name": "backend-rs-linux-arm-gnueabihf",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"linux" "linux"
@ -7,12 +7,12 @@
"cpu": [ "cpu": [
"arm" "arm"
], ],
"main": "native-utils.linux-arm-gnueabihf.node", "main": "backend-rs.linux-arm-gnueabihf.node",
"files": [ "files": [
"native-utils.linux-arm-gnueabihf.node" "backend-rs.linux-arm-gnueabihf.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
} }
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-linux-arm64-gnu`
This is the **aarch64-unknown-linux-gnu** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-linux-arm64-gnu", "name": "backend-rs-linux-arm64-gnu",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"linux" "linux"
@ -7,9 +7,9 @@
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"main": "native-utils.linux-arm64-gnu.node", "main": "backend-rs.linux-arm64-gnu.node",
"files": [ "files": [
"native-utils.linux-arm64-gnu.node" "backend-rs.linux-arm64-gnu.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@ -18,4 +18,4 @@
"libc": [ "libc": [
"glibc" "glibc"
] ]
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-linux-arm64-musl`
This is the **aarch64-unknown-linux-musl** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-linux-arm64-musl", "name": "backend-rs-linux-arm64-musl",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"linux" "linux"
@ -7,9 +7,9 @@
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"main": "native-utils.linux-arm64-musl.node", "main": "backend-rs.linux-arm64-musl.node",
"files": [ "files": [
"native-utils.linux-arm64-musl.node" "backend-rs.linux-arm64-musl.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@ -18,4 +18,4 @@
"libc": [ "libc": [
"musl" "musl"
] ]
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-linux-x64-gnu`
This is the **x86_64-unknown-linux-gnu** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-linux-x64-gnu", "name": "backend-rs-linux-x64-gnu",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"linux" "linux"
@ -7,9 +7,9 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"main": "native-utils.linux-x64-gnu.node", "main": "backend-rs.linux-x64-gnu.node",
"files": [ "files": [
"native-utils.linux-x64-gnu.node" "backend-rs.linux-x64-gnu.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@ -18,4 +18,4 @@
"libc": [ "libc": [
"glibc" "glibc"
] ]
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-linux-x64-musl`
This is the **x86_64-unknown-linux-musl** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-linux-x64-musl", "name": "backend-rs-linux-x64-musl",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"linux" "linux"
@ -7,9 +7,9 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"main": "native-utils.linux-x64-musl.node", "main": "backend-rs.linux-x64-musl.node",
"files": [ "files": [
"native-utils.linux-x64-musl.node" "backend-rs.linux-x64-musl.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@ -18,4 +18,4 @@
"libc": [ "libc": [
"musl" "musl"
] ]
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-win32-arm64-msvc`
This is the **aarch64-pc-windows-msvc** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-win32-arm64-msvc", "name": "backend-rs-win32-arm64-msvc",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"win32" "win32"
@ -7,12 +7,12 @@
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
"main": "native-utils.win32-arm64-msvc.node", "main": "backend-rs.win32-arm64-msvc.node",
"files": [ "files": [
"native-utils.win32-arm64-msvc.node" "backend-rs.win32-arm64-msvc.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
} }
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-win32-ia32-msvc`
This is the **i686-pc-windows-msvc** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-win32-ia32-msvc", "name": "backend-rs-win32-ia32-msvc",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"win32" "win32"
@ -7,12 +7,12 @@
"cpu": [ "cpu": [
"ia32" "ia32"
], ],
"main": "native-utils.win32-ia32-msvc.node", "main": "backend-rs.win32-ia32-msvc.node",
"files": [ "files": [
"native-utils.win32-ia32-msvc.node" "backend-rs.win32-ia32-msvc.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
} }
} }

View File

@ -0,0 +1,3 @@
# `backend-rs-win32-x64-msvc`
This is the **x86_64-pc-windows-msvc** binary for `backend-rs`

View File

@ -1,5 +1,5 @@
{ {
"name": "native-utils-win32-x64-msvc", "name": "backend-rs-win32-x64-msvc",
"version": "0.0.0", "version": "0.0.0",
"os": [ "os": [
"win32" "win32"
@ -7,12 +7,12 @@
"cpu": [ "cpu": [
"x64" "x64"
], ],
"main": "native-utils.win32-x64-msvc.node", "main": "backend-rs.win32-x64-msvc.node",
"files": [ "files": [
"native-utils.win32-x64-msvc.node" "backend-rs.win32-x64-msvc.node"
], ],
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">= 10" "node": ">= 10"
} }
} }

View File

@ -1,10 +1,10 @@
{ {
"name": "native-utils", "name": "backend-rs",
"version": "0.0.0", "version": "0.0.0",
"main": "built/index.js", "main": "built/index.js",
"types": "built/index.d.ts", "types": "built/index.d.ts",
"napi": { "napi": {
"name": "native-utils", "name": "backend-rs",
"triples": { "triples": {
"additional": [ "additional": [
"aarch64-apple-darwin", "aarch64-apple-darwin",

Some files were not shown because too many files have changed in this diff Show More