Skip to content

Commit

Permalink
feat: upgrade dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jul 30, 2023
1 parent b1afb10 commit e94f55a
Show file tree
Hide file tree
Showing 45 changed files with 3,911 additions and 3,698 deletions.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug report
description: Problems with the software
title: "[Bug] "
labels: ["bug"]
title: '[Bug] '
labels: ['bug']
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -67,5 +67,4 @@ body:
- label: I'm willing to submit a PR!
- type: markdown
attributes:
value: "Thanks for completing our form!"

value: 'Thanks for completing our form!'
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ blank_issues_enabled: false
contact_links:
- name: Ask a question or get support
url: https://github.com/Brooooooklyn/Image/discussions/categories/q-a
about: Ask a question or request support for Image
about: Ask a question or request support for Image
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature
description: Add new feature, improve code, and more
labels: [ "enhancement" ]
labels: ['enhancement']
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -41,5 +41,4 @@ body:
- label: I'm willing to submit a PR!
- type: markdown
attributes:
value: "Thanks for completing our form!"

value: 'Thanks for completing our form!'
36 changes: 16 additions & 20 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ env:
APP_NAME: image
MACOSX_DEPLOYMENT_TARGET: '10.13'
SYSTEM_DEPS_DAV1D_BUILD_INTERNAL: 'always'
permissions:
contents: write
id-token: write
'on':
push:
branches:
Expand Down Expand Up @@ -33,7 +36,6 @@ jobs:
build: |
brew install meson
yarn workspace @napi-rs/image build --features with_simd
strip -x packages/*/*.node
- host: windows-latest
build: |
python -m pip install meson
Expand All @@ -45,9 +47,10 @@ jobs:
sudo apt install meson -y
cargo install cargo-xwin
build: |
export XWIN_CACHE_DIR="$(pwd)/.xwin"
export XWIN_ARCH=x86
export CFLAGS="-msse4.2"
export CXXFLAGS="-msse4.2"
export CFLAGS="-mavx2 /FI $(pwd)/.xwin/crt/include/intrin0.h"
export CXXFLAGS="-mavx2 /FI $(pwd)/.xwin/crt/include/intrin0.h"
export CARGO_PROFILE_RELEASE_LTO="false"
yarn workspace @napi-rs/image build --features with_simd --target i686-pc-windows-msvc
target: i686-pc-windows-msvc
Expand All @@ -63,7 +66,7 @@ jobs:
export CFLAGS="-fuse-ld=lld -B/usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/4.8.5 --sysroot=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot" &&
export CXXFLAGS="-stdlib=libc++ -fuse-ld=lld -B/usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/4.8.5 --sysroot=/usr/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/sysroot -L/usr/lib/llvm-15/lib" &&
yarn workspace @napi-rs/image build --features with_simd --target x86_64-unknown-linux-gnu &&
llvm-strip packages/*/*.node
chmod -R 777 target
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
Expand All @@ -77,13 +80,12 @@ jobs:
export LIB_AOM_INCLUDE_PATH=/usr/include/aom/aom &&
export LIB_AOM_PKG_CONFIG_PATH=/usr/lib/pkgconfig &&
yarn workspace @napi-rs/image build --features with_simd &&
strip packages/*/*.node
chmod -R 777 target
- host: macos-latest
target: aarch64-apple-darwin
build: |
brew install meson
yarn workspace @napi-rs/image build --features with_simd
strip -x packages/*/*.node
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
Expand All @@ -93,15 +95,14 @@ jobs:
export CFLAGS="-fuse-ld=lld -mcrc -B/usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/4.8.5 --sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot" &&
export CXXFLAGS="-fuse-ld=lld -mcrc -B/usr/aarch64-unknown-linux-gnu/lib/gcc/aarch64-unknown-linux-gnu/4.8.5 --sysroot=/usr/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot -L/usr/aarch64-unknown-linux-gnu/lib/llvm-15/lib -stdlib=libc++" &&
yarn workspace @napi-rs/image build --features with_simd --target aarch64-unknown-linux-gnu &&
llvm-strip packages/*/*.node
chmod -R 777 target
- host: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
setup: |
sudo apt-get update
sudo apt-get install meson gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
build: |
yarn workspace @napi-rs/image build --features oxipng_libdeflater --zig --zig-link-only
arm-linux-gnueabihf-strip packages/*/*.node
- host: ubuntu-latest
target: aarch64-linux-android
build: |
Expand Down Expand Up @@ -129,7 +130,7 @@ jobs:
unset CXX &&
apk add --update --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing --no-cache aom-dev perl meson &&
yarn workspace @napi-rs/image build --target aarch64-unknown-linux-musl --features with_simd &&
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip packages/*/*.node
chmod -R 777 target
name: stable - ${{ matrix.settings.target }} - node@18
runs-on: ${{ matrix.settings.host }}
env:
Expand All @@ -140,7 +141,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
check-latest: true
cache: yarn
- name: Setup nasm
uses: ilammy/setup-nasm@v1
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
uses: KyleMayes/install-llvm-action@v1
if: ${{ matrix.settings.target == 'i686-pc-windows-msvc' }}
with:
version: '15'
version: '16'
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
Expand Down Expand Up @@ -211,9 +211,7 @@ jobs:
usesh: true
mem: 3000
prepare: |
pkg install -y curl cmake nasm node perl5
curl -qL https://www.npmjs.com/install.sh | sh
npm install --location=global --ignore-scripts yarn
pkg install -y curl cmake nasm node perl5 npm yarn
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain beta
export PATH="/usr/local/cargo/bin:$PATH"
Expand All @@ -233,7 +231,6 @@ jobs:
freebsd-version
yarn install --immutable --mode=skip-build
yarn workspace @napi-rs/image build --features oxipng_libdeflater
strip -x packages/*/*.node
yarn test
rm -rf node_modules
rm -rf target
Expand All @@ -255,8 +252,10 @@ jobs:
settings:
- host: windows-latest
target: x86_64-pc-windows-msvc
# macOS on GitHub Actions does not support avx2
# - host: macos-latest
# target: x86_64-apple-darwin
node:
- '14'
- '16'
- '18'
runs-on: ${{ matrix.settings.host }}
Expand Down Expand Up @@ -292,7 +291,6 @@ jobs:
fail-fast: false
matrix:
node:
- '14'
- '16'
- '18'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -326,7 +324,6 @@ jobs:
fail-fast: false
matrix:
node:
- '14'
- '16'
- '18'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -360,7 +357,6 @@ jobs:
fail-fast: false
matrix:
node:
- '14'
- '16'
- '18'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -401,7 +397,6 @@ jobs:
fail-fast: false
matrix:
node:
- '14'
- '16'
- '18'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -465,6 +460,7 @@ jobs:
- name: Publish
if: "startsWith(github.event.head_commit.message, 'chore(release): publish')"
run: |
npm config set provenance true
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
npx lerna publish from-package --no-verify-access --yes
env:
Expand Down
823 changes: 0 additions & 823 deletions .yarn/releases/yarn-3.3.1.cjs

This file was deleted.

874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.3.1.cjs
yarnPath: .yarn/releases/yarn-3.6.1.cjs
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ members = ["./packages/binding"]
[profile.release]
lto = 'fat'
codegen-units = 1
strip = 'symbols'
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This library support encode/decode these formats:
| TGA || Rgb8, Rgba8, Bgr8, Bgra8, Gray8, GrayA8 |
| OpenEXR | Rgb32F, Rgba32F (no dwa compression) | Rgb32F, Rgba32F (no dwa compression) |
| farbfeld |||
| SVG || |
| SVG || |

See [index.d.ts](./packages/binding/index.d.ts) for API reference.

Expand Down Expand Up @@ -169,14 +169,11 @@ writeFileSync(

console.info(chalk.green('Encoding webp from JPEG with EXIF done'))

writeFileSync(
'output-overlay-png.png',
await new Transformer(PNG).overlay(PNG, 200, 200).png()
)
writeFileSync('output-overlay-png.png', await new Transformer(PNG).overlay(PNG, 200, 200).png())

console.info(chalk.green('Overlay an image done'))

writeFileSync("output-debian.jpeg", await Transformer.fromSvg(SVG, 'rgba(238, 235, 230, .9)').jpeg())
writeFileSync('output-debian.jpeg', await Transformer.fromSvg(SVG, 'rgba(238, 235, 230, .9)').jpeg())

console.info(chalk.green('Encoding jpeg from SVG done'))
```
9 changes: 3 additions & 6 deletions example.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,10 @@ writeFileSync(

console.info(chalk.green('Encoding webp from JPEG with EXIF done'))

writeFileSync(
'output-overlay-png.png',
await new Transformer(PNG).overlay(PNG, 200, 200).png()
)
writeFileSync('output-overlay-png.png', await new Transformer(PNG).overlay(PNG, 200, 200).png())

console.info(chalk.green('Overlay an image done'))

writeFileSync("output-debian.jpeg", await Transformer.fromSvg(SVG, 'rgba(238, 235, 230, .9)').jpeg())
writeFileSync('output-debian.jpeg', await Transformer.fromSvg(SVG, 'rgba(238, 235, 230, .9)').jpeg())

console.info(chalk.green('Encoding jpeg from SVG done'))
console.info(chalk.green('Encoding jpeg from SVG done'))
2 changes: 0 additions & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"packages": ["packages/*"],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "independent",
"command": {
"version": {
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
"website"
],
"devDependencies": {
"@napi-rs/cli": "^2.14.3",
"@napi-rs/cli": "^2.16.2",
"@taplo/cli": "^0.5.2",
"@types/node": "^18.11.18",
"@types/node": "^20.4.5",
"@types/sharp": "^0.31.1",
"ava": "^5.1.0",
"blurhash": "^2.0.4",
"chalk": "^5.2.0",
"electron": "^22.1.0",
"lerna": "^6.3.0",
"ava": "^5.3.1",
"blurhash": "^2.0.5",
"chalk": "^5.3.0",
"electron": "^25.3.2",
"lerna": "^7.1.4",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.1",
"rxjs": "^7.8.0",
"sharp": "^0.31.3",
"typescript": "^4.9.4"
"prettier": "^3.0.0",
"rxjs": "^7.8.1",
"sharp": "^0.32.4",
"typescript": "^5.1.6"
},
"scripts": {
"artifacts": "lerna run artifacts",
Expand Down Expand Up @@ -70,6 +70,6 @@
"pre-commit": "lint-staged && cargo fmt --all"
}
},
"packageManager": "yarn@3.3.1",
"packageManager": "yarn@3.6.1",
"repository": "git@github.com:Brooooooklyn/Image.git"
}
6 changes: 3 additions & 3 deletions packages/binding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ libavif = { version = "0.11", default-features = false, features = [
"codec-aom",
] }
libc = "0.2"
libwebp-sys = { version = "0.8", features = ["avx2", "sse41", "neon"] }
libwebp-sys = { version = "0.9", features = ["avx2", "sse41", "neon"] }
lodepng = "3"
napi = { version = "2", default-features = false, features = ["napi3"] }
napi-derive = { version = "2", default-features = false, features = [
Expand All @@ -51,8 +51,8 @@ once_cell = "1"
png = "0.17"
rexif = "0.7"
rgb = "0.8"
resvg = "0.29"
svgtypes = "0.10"
resvg = "0.35"
svgtypes = "0.11"

[dependencies.oxipng]
default-features = false
Expand Down
7 changes: 2 additions & 5 deletions packages/binding/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,18 +427,15 @@ export const enum ResizeFilterType {
*/
overlay(onTop: Buffer, x: number, y: number): this
```
```ts
import { writeFileSync } from 'fs'

import { Transformer } from '@napi-rs/image'


const imageOutputPng = await new Transformer(PNG).overlay(PNG, 200, 200).png()

writeFileSync(
'output-overlay-png.png',
imageOutputPng
)
writeFileSync('output-overlay-png.png', imageOutputPng)
```
**ResizeFilterType**:
Expand Down
1 change: 0 additions & 1 deletion packages/binding/__test__/transformer.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,3 @@ test('should be able to create transformer from raw rgba pixels', async (t) => {
test('should be able to create transformer from SVG', async (t) => {
await t.notThrowsAsync(() => Transformer.fromSvg(SVG).png())
})

8 changes: 7 additions & 1 deletion packages/binding/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/* tslint:disable */
/* eslint-disable */
/* prettier-ignore */

/* auto-generated by NAPI-RS */

const { existsSync, readFileSync } = require('fs')
const { join } = require('path')

Expand All @@ -11,7 +17,7 @@ function isMusl() {
// For Node 10
if (!process.report || typeof process.report.getReport !== 'function') {
try {
const lddPath = require('child_process').execSync('which ldd').toString().trim();
const lddPath = require('child_process').execSync('which ldd').toString().trim()
return readFileSync(lddPath, 'utf8').includes('musl')
} catch (e) {
return true
Expand Down
4 changes: 2 additions & 2 deletions packages/binding/npm/android-arm-eabi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"repository": "git@github.com:Brooooooklyn/imgquant.git"
}
"repository": "git@github.com:Brooooooklyn/Image.git"
}
4 changes: 2 additions & 2 deletions packages/binding/npm/android-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"repository": "git@github.com:Brooooooklyn/imgquant.git"
}
"repository": "git@github.com:Brooooooklyn/Image.git"
}
Loading

0 comments on commit e94f55a

Please sign in to comment.