Skip to content

Commit 89e57c5

Browse files
committed
Update image package for bundled TypeScript workflow
1 parent 715314b commit 89e57c5

37 files changed

Lines changed: 865 additions & 633 deletions

.github/workflows/build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ jobs:
1818
steps:
1919

2020
- name: Fetch Repository
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
2222
with:
2323
persist-credentials: false
2424

2525
- name: Install Node.js
26-
uses: actions/setup-node@v4
26+
uses: actions/setup-node@v6
2727
with:
28-
node-version: 22.14.0
28+
node-version: 24.13.0
2929
cache: 'npm'
3030

3131
- name: Get Package Version
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: Create Draft Release
3636
id: create_release
37-
uses: softprops/action-gh-release@v2
37+
uses: softprops/action-gh-release@v3
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
with:
@@ -52,14 +52,14 @@ jobs:
5252
steps:
5353

5454
- name: Fetch Repository
55-
uses: actions/checkout@v4
55+
uses: actions/checkout@v6
5656
with:
5757
persist-credentials: false
5858

5959
- name: Install Node.js
60-
uses: actions/setup-node@v4
60+
uses: actions/setup-node@v6
6161
with:
62-
node-version: 22.14.0
62+
node-version: 24.13.0
6363
cache: 'npm'
6464

6565
- name: Install Modules
@@ -74,10 +74,10 @@ jobs:
7474

7575
- name: Pack Files
7676
id: pack-files
77-
run: node -e "require('addon-tools-raub').actionPack()" >> $GITHUB_OUTPUT
77+
run: node -e "require('@node-3d/addon-tools').actionPack()" >> $GITHUB_OUTPUT
7878

7979
- name: Store Binaries
80-
uses: softprops/action-gh-release@v2
80+
uses: softprops/action-gh-release@v3
8181
env:
8282
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8383
with:

.github/workflows/cpplint.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ on:
1212
- master
1313

1414
jobs:
15-
eslint:
15+
cpplint:
1616
name: Cpplint
1717
runs-on: ubuntu-22.04
1818

1919
steps:
2020

2121
- name: Fetch Repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323
with:
2424
persist-credentials: false
2525

2626
- name: Install Node.js
27-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@v6
2828
with:
29-
node-version: 22.14.0
29+
node-version: 24.13.0
3030
cache: 'npm'
3131

3232
- name: Install Modules
@@ -37,5 +37,5 @@ jobs:
3737

3838
- name: Run Cpplint
3939
run: |
40-
node -e "require('addon-tools-raub').cpcpplint()"
40+
node -e "require('@node-3d/addon-tools').cpcpplint()"
4141
cpplint --recursive ./src
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ESLint
1+
name: Lint
22
defaults:
33
run:
44
shell: bash
@@ -12,25 +12,25 @@ on:
1212
- master
1313

1414
jobs:
15-
eslint:
16-
name: ESLint
15+
lint:
16+
name: Lint
1717
runs-on: ubuntu-22.04
1818

1919
steps:
2020

2121
- name: Fetch Repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323
with:
2424
persist-credentials: false
2525

2626
- name: Install Node.js
27-
uses: actions/setup-node@v4
27+
uses: actions/setup-node@v6
2828
with:
29-
node-version: 22.14.0
29+
node-version: 24.13.0
3030
cache: 'npm'
3131

3232
- name: Install Modules
3333
run: npm ci
3434

35-
- name: Run ESLint
36-
run: npm run eslint
35+
- name: Run Lint
36+
run: npm run lint

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
steps:
1515

1616
- name: Fetch Repository
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v6
1818
with:
1919
persist-credentials: false
2020

2121
- name: Install Node.js
22-
uses: actions/setup-node@v4
22+
uses: actions/setup-node@v6
2323
with:
24-
node-version: 22.14.0
24+
node-version: 24.13.0
2525
cache: 'npm'
2626

2727
- name: Get Package Version
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: Create Release
3939
id: create_release
40-
uses: softprops/action-gh-release@v2
40+
uses: softprops/action-gh-release@v3
4141
env:
4242
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4343
with:

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323
steps:
2424

2525
- name: Fetch Repository
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v6
2727
with:
2828
persist-credentials: false
2929

3030
- name: Install Node.js
31-
uses: actions/setup-node@v4
31+
uses: actions/setup-node@v6
3232
with:
33-
node-version: 22.14.0
33+
node-version: 24.13.0
3434
cache: 'npm'
3535

3636
- name: Install Modules

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
.project
66
.vscode
77
node_modules/
8+
.rslib/
9+
dist/
810
src/build/
911
src/node_modules/
1012
bin-*/

README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
This is a part of [Node3D](https://github.com/node-3d) project.
44

5-
[![NPM](https://badge.fury.io/js/image-raub.svg)](https://badge.fury.io/js/image-raub)
6-
[![ESLint](https://github.com/node-3d/image-raub/actions/workflows/eslint.yml/badge.svg)](https://github.com/node-3d/image-raub/actions/workflows/eslint.yml)
7-
[![Test](https://github.com/node-3d/image-raub/actions/workflows/test.yml/badge.svg)](https://github.com/node-3d/image-raub/actions/workflows/test.yml)
8-
[![Cpplint](https://github.com/node-3d/image-raub/actions/workflows/cpplint.yml/badge.svg)](https://github.com/node-3d/image-raub/actions/workflows/cpplint.yml)
5+
[![NPM](https://badge.fury.io/js/%40node-3d%2Fimage.svg)](https://badge.fury.io/js/@node-3d/image)
6+
[![Lint](https://github.com/node-3d/image/actions/workflows/lint.yml/badge.svg)](https://github.com/node-3d/image/actions/workflows/lint.yml)
7+
[![Test](https://github.com/node-3d/image/actions/workflows/test.yml/badge.svg)](https://github.com/node-3d/image/actions/workflows/test.yml)
8+
[![Cpplint](https://github.com/node-3d/image/actions/workflows/cpplint.yml/badge.svg)](https://github.com/node-3d/image/actions/workflows/cpplint.yml)
99

1010
```console
11-
npm i -s image-raub
11+
npm install @node-3d/image
1212
```
1313

1414
Using [FreeImage](http://freeimage.sourceforge.net/), this addon loads images from:
@@ -29,15 +29,15 @@ Additional features:
2929

3030
> Note: this **addon uses N-API**, and therefore is ABI-compatible across different
3131
Node.js versions. Addon binaries are precompiled and **there is no compilation**
32-
step during the `npm i` command.
32+
step during the `npm install` command.
3333

3434

3535
## Image
3636

3737
```js
38-
import Image from 'image-raub';
38+
import { Image } from '@node-3d/image';
3939
const image = new Image('images/test.png'); // relative to CWD
40-
icon.on('load', () => { console.log('data', image.width, image.height, image.data); });
40+
image.on('load', () => { console.log('data', image.width, image.height, image.data); });
4141
```
4242

4343
For loaded images, `image.data` will contain a `Buffer` of `4 * width * height` bytes.
@@ -47,12 +47,10 @@ to a file or use it any other way.
4747
With `Image.fromPixels()` it is possible to generate new images from scratch by providing
4848
your own data buffer.
4949

50-
See [TS declarations](/index.d.ts) for more details.
51-
5250

5351
### Set window icon
5452

55-
Compatible with [glfw-raub](https://github.com/node-3d/glfw-raub) `window.icon` property.
53+
Compatible with [@node-3d/glfw](https://github.com/node-3d/glfw) `window.icon` property.
5654

5755
```js
5856
const icon = new Image();
@@ -69,7 +67,7 @@ available as a `Buffer`, containing the whole pixel data, and `image.width`/`ima
6967
contain the dimensions.
7068

7169
```js
72-
const Image = require('image-raub');
70+
import { Image } from '@node-3d/image';
7371
const image = new Image();
7472
// Web-style onload
7573
image.onload = () => {
@@ -106,4 +104,3 @@ const img = Image.fromPixels(screen.w, screen.h, 32, storage.data);
106104

107105
img.save(`${Date.now()}.jpg`);
108106
```
109-

core.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

eslint.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)