Skip to content

Commit

Permalink
feat: 升级依赖 (#27)
Browse files Browse the repository at this point in the history
* feat: 修改devcontainer,升级截图库

* feat: 升级依赖

* feat: 修改CI

* feat: release 0.1.5

0.1.5
  • Loading branch information
nashaofu committed Jul 27, 2023
1 parent 5b225fc commit 995ed5f
Show file tree
Hide file tree
Showing 26 changed files with 967 additions and 1,028 deletions.
13 changes: 12 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[target.x86_64-unknown-linux-gnu]
rustflags = ["-L", "native=/usr/lib/x86_64-linux-gnu/"]

[target.aarch64-unknown-linux-gnu]
rustflags = ["-L", "native=/usr/aarch64-unknown-linux-gnu/"]

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]
rustflags = [
"-C",
"target-feature=-crt-static",
"-L",
"native=/usr/lib/",
]
20 changes: 0 additions & 20 deletions .devcontainer/Dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions .devcontainer/build.sh

This file was deleted.

65 changes: 24 additions & 41 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,13 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/typescript-node
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "nodejs-rust",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 18, 16, 14.
// Append -bullseye or -buster to pin to an OS version.
// Use -bullseye variants on local on arm64/Apple Silicon.
"args": {
"VARIANT": "16-bullseye"
}
},
"overrideCommand": false,
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"lldb.executable": "/usr/bin/lldb",
// VS Code don't watch files under ./target
"files.watcherExclude": {
"**/target/**": true
},
"rust-analyzer.checkOnSave.command": "clippy"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"vadimcn.vscode-lldb",
"mutantdino.resourcemonitor",
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml",
"serayuzgur.crates"
]
}
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-18-bullseye",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {},
"ghcr.io/devcontainers/features/rust:1": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
Expand All @@ -44,9 +16,20 @@
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node",
"features": {
"rust": "latest"
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"wengerk.highlight-bad-chars",
"streetsidesoftware.code-spell-checker",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"rust-lang.rust-analyzer",
"foxundermoon.shell-format"
]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
27 changes: 0 additions & 27 deletions .devcontainer/docker-init.sh

This file was deleted.

19 changes: 12 additions & 7 deletions .github/workflows/napi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
build: |-
set -e &&
apt-get update &&
apt-get install libxcb1-dev libxrandr-dev libdbus-1-dev -y &&
apt-get install libxcb1-dev -y &&
yarn build --target x86_64-unknown-linux-gnu &&
strip *.node
- host: ubuntu-latest
Expand All @@ -65,17 +65,24 @@ jobs:
build: |-
set -e &&
apk update &&
apk add libxcb-dev libxrandr-dev dbus-dev &&
apk add libxcb-dev &&
yarn build &&
strip *.node
# - host: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
# build: |-
# set -e &&
# dpkg --add-architecture arm64 &&
# apt-get update &&
# apt-get install libxcb1-dev:arm64 libxrandr-dev:arm64 libdbus-1-dev:arm64 -y &&
# apt-get install libxcb1-dev -y &&
# ln -s /usr/lib/x86_64-linux-gnu/libxcb.so /usr/aarch64-unknown-linux-gnu/lib/libxcb.so &&
# ln -s /usr/lib/x86_64-linux-gnu/libxcb.a /usr/aarch64-unknown-linux-gnu/lib/libxcb.a &&
# ln -s /usr/lib/x86_64-linux-gnu/libxcb.so /usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/libxcb.so &&
# ln -s /usr/lib/x86_64-linux-gnu/libxcb.a /usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/libxcb.a &&
# ln -s /usr/lib/x86_64-linux-gnu/libxcb.so /usr/aarch64-unknown-linux-gnu/lib/gcc/libxcb.so &&
# ln -s /usr/lib/x86_64-linux-gnu/libxcb.a /usr/aarch64-unknown-linux-gnu/lib/gcc/libxcb.a &&
# ln -s /usr/lib/x86_64-linux-gnu/libxcb.so /usr/aarch64-unknown-linux-gnu/libxcb.so &&
# ln -s /usr/lib/x86_64-linux-gnu/libxcb.a /usr/aarch64-unknown-linux-gnu/libxcb.a &&
# rustup target add aarch64-unknown-linux-gnu &&
# rustup toolchain install stable-aarch64-unknown-linux-gnu &&
# yarn build --target aarch64-unknown-linux-gnu &&
Expand All @@ -86,7 +93,7 @@ jobs:
# build: |-
# set -e &&
# apk update &&
# apk add libxcb-dev libxrandr-dev dbus-dev && \
# apk add libxcb-dev libxrandr-dev && \
# rustup target add aarch64-unknown-linux-musl && \
# yarn build --target aarch64-unknown-linux-musl &&
# /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
Expand Down Expand Up @@ -199,8 +206,6 @@ jobs:
# fail-fast: false
# matrix:
# node:
# - "14"
# - "16"
# - "18"
# runs-on: ubuntu-latest
# steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ dist
.AppleDouble
.LSOverride

# Icon must end with two
# Icon must end with two
Icon


Expand Down
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"wengerk.highlight-bad-chars",
"streetsidesoftware.code-spell-checker",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"rust-lang.rust-analyzer",
"foxundermoon.shell-format"
]
}
1,746 changes: 873 additions & 873 deletions .yarn/releases/yarn-3.5.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ crate-type = ["cdylib"]
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
napi = { version = "2.12.0", default-features = false, features = ["napi4"] }
napi-derive = "2.12.2"
screenshots = "0.5.3"
screenshots = "0.7.0"

[build-dependencies]
napi-build = "2.0.1"
Expand Down
1 change: 0 additions & 1 deletion docker/alpine-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ startInBackgroundIfNotRunning() {
}

startInBackgroundIfNotRunning Xvfb ${DISPLAY} -screen 0 ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT}x24 -dpi 96 -listen tcp -ac
startInBackgroundIfNotRunning fluxbox -display ${DISPLAY}

echo $@

Expand Down
6 changes: 1 addition & 5 deletions docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ FROM node:${VERSION}-alpine

# Setup environment variables
ENV DISPLAY=":0" \
VNC_PORT="5900" \
NOVNC_PORT="6080" \
DISPLAY_WIDTH="1280" \
DISPLAY_HEIGHT="720"

COPY alpine-init.sh /usr/local/share/alpine-init.sh

RUN echo "http://dl-3.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories

RUN apk update && \
apk add xvfb fluxbox libxcb libxrandr dbus
apk add xvfb libxcb libxrandr

ENTRYPOINT [ "/usr/local/share/alpine-init.sh" ]

Expand Down
1 change: 0 additions & 1 deletion docker/debian-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ startInBackgroundIfNotRunning() {
}

startInBackgroundIfNotRunning Xvfb ${DISPLAY} -screen 0 ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT}x24 -dpi 96 -listen tcp -ac
startInBackgroundIfNotRunning fluxbox -display ${DISPLAY}

echo $@

Expand Down
14 changes: 5 additions & 9 deletions docker/debian.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
ARG VERSION="18"

FROM node:${VERSION}
FROM node:${VERSION}-slim

# Setup environment variables
ENV DEBIAN_FRONTEND=noninteractive \
DISPLAY=":0" \
VNC_PORT="5900" \
NOVNC_PORT="6080" \
DISPLAY_WIDTH="1280" \
DISPLAY_HEIGHT="720"

COPY debian-init.sh /usr/local/share/debian-init.sh

RUN apt-get update && \
apt-get -y install --no-install-recommends \
xvfb \
fluxbox \
libxcb1 \
libxrandr2 \
libdbus-1-3
apt-get -y install --no-install-recommends xvfb libxcb1 libxrandr2 && \
apt-get autoclean -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

ENTRYPOINT [ "/usr/local/share/debian-init.sh" ]

Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"engines": {
"node": ">= 10"
}
}
}
2 changes: 1 addition & 1 deletion npm/darwin-universal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"engines": {
"node": ">= 10"
}
}
}
2 changes: 1 addition & 1 deletion npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"engines": {
"node": ">= 10"
}
}
}
2 changes: 1 addition & 1 deletion npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"libc": [
"glibc"
]
}
}
2 changes: 1 addition & 1 deletion npm/linux-arm64-musl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"libc": [
"musl"
]
}
}
2 changes: 1 addition & 1 deletion npm/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"libc": [
"glibc"
]
}
}
2 changes: 1 addition & 1 deletion npm/linux-x64-musl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"libc": [
"musl"
]
}
}
2 changes: 1 addition & 1 deletion npm/win32-arm64-msvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"engines": {
"node": ">= 10"
}
}
}
2 changes: 1 addition & 1 deletion npm/win32-ia32-msvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"engines": {
"node": ">= 10"
}
}
}
2 changes: 1 addition & 1 deletion npm/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"engines": {
"node": ">= 10"
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-screenshots",
"version": "0.1.4",
"version": "0.1.5",
"main": "index.js",
"types": "index.d.ts",
"files": [
Expand Down
Loading

0 comments on commit 995ed5f

Please sign in to comment.