Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1f35a77
init napi
MathieuMatiques Jan 24, 2026
75caaad
remove some unwanted things
MathieuMatiques Jan 24, 2026
c2df3ea
remove more stuff
MathieuMatiques Jan 24, 2026
55768fd
bun i hope
MathieuMatiques Jan 24, 2026
df4b1df
remove generated files
MathieuMatiques Jan 24, 2026
61d3780
add the code to napi
MathieuMatiques Jan 24, 2026
50dcf8c
use the napi
MathieuMatiques Jan 24, 2026
4c8773f
can i trigger the workflow?
MathieuMatiques Jan 24, 2026
42f99ce
disable bin for now
MathieuMatiques Jan 24, 2026
a9681e0
fix version updating
MathieuMatiques Jan 24, 2026
4cbe2d6
v1.0.1
MathieuMatiques Jan 24, 2026
9fc6a03
v1.0.2
MathieuMatiques Jan 24, 2026
7f74348
v1.0.3
MathieuMatiques Jan 24, 2026
f1aeb53
fix version updating for real
MathieuMatiques Jan 24, 2026
c1c500d
v1.0.4
MathieuMatiques Jan 24, 2026
8e704d2
fix ci detecting release
MathieuMatiques Jan 24, 2026
f3ebcc3
v1.0.5
MathieuMatiques Jan 24, 2026
0085322
hopefully this fixes publishing
MathieuMatiques Jan 24, 2026
d432c79
v1.0.6
MathieuMatiques Jan 24, 2026
540400a
please publish now
MathieuMatiques Jan 24, 2026
cf1e04a
v1.0.7
MathieuMatiques Jan 24, 2026
f710e75
v1.0.8
MathieuMatiques Jan 24, 2026
2961484
fix publish i hope
MathieuMatiques Jan 24, 2026
92e8534
v1.0.9
MathieuMatiques Jan 24, 2026
01d8b3d
please fix publish auth
MathieuMatiques Jan 24, 2026
20f3981
v1.0.10
MathieuMatiques Jan 24, 2026
4b2ebcd
asdf
MathieuMatiques Jan 24, 2026
954fb53
v1.0.11
MathieuMatiques Jan 24, 2026
6a4fb77
disable windows
MathieuMatiques Jan 24, 2026
f2983cb
qwer
MathieuMatiques Jan 24, 2026
d3ff069
v1.0.12
MathieuMatiques Jan 24, 2026
5183aff
bun publish
MathieuMatiques Jan 24, 2026
4fc3750
v1.0.13
MathieuMatiques Jan 24, 2026
cf3999a
fix
MathieuMatiques Jan 24, 2026
f7b73e3
v1.0.14
MathieuMatiques Jan 24, 2026
197d08c
back to npm publish
MathieuMatiques Jan 24, 2026
060073a
v1.0.15
MathieuMatiques Jan 24, 2026
e844a86
re enable windows
MathieuMatiques Jan 24, 2026
e5210a6
v1.0.16
MathieuMatiques Jan 24, 2026
dbe4c10
fix being commonjs
MathieuMatiques Jan 24, 2026
9a19009
v1.0.17
MathieuMatiques Jan 24, 2026
bf98714
Create dest if it doesn't exist
MathieuMatiques Jan 25, 2026
5ac7f76
Simplify some things, remove unused code, and use fast_image_resize
MathieuMatiques Jan 25, 2026
e72ed14
Remove unused packages
MathieuMatiques Jan 25, 2026
589b2cd
v1.0.18
MathieuMatiques Jan 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors or IDEs
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Generated codes
index.js linguist-detectable=false
index.d.ts linguist-detectable=false
texture-packer.wasi-browser.js linguist-detectable=false
texture-packer.wasi.cjs linguist-detectable=false
wasi-worker-browser.mjs linguist-detectable=false
wasi-worker.mjs linguist-detectable=false
20 changes: 20 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", "group:allNonMajor", ":preserveSemverRanges", ":disablePeerDependencies"],
"labels": ["dependencies"],
"packageRules": [
{
"matchPackageNames": ["@napi/cli", "napi", "napi-build", "napi-derive"],
"addLabels": ["napi-rs"],
"groupName": "napi-rs"
},
{
"matchPackagePatterns": ["^eslint", "^@typescript-eslint"],
"groupName": "linter"
}
],
"commitMessagePrefix": "chore: ",
"commitMessageAction": "bump up",
"commitMessageTopic": "{{depName}} version",
"ignoreDeps": []
}
150 changes: 150 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: CI
env:
DEBUG: napi:*
APP_NAME: texture-packer
MACOSX_DEPLOYMENT_TARGET: "10.13"
CARGO_INCREMENTAL: "1"
on:
push:
branches:
- master
- napi-rs
tags-ignore:
- "**"
paths-ignore:
- "**/*.md"
- LICENSE
- "**/*.gitignore"
- .editorconfig
- docs/**
pull_request: null
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
build: bun run build --target x86_64-apple-darwin
- host: windows-latest
build: bun run build --target x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
build: bun run build --target x86_64-unknown-linux-gnu --use-napi-cross
- host: ubuntu-latest
target: x86_64-unknown-linux-musl
build: bun run build --target x86_64-unknown-linux-musl -x
- host: macos-latest
target: aarch64-apple-darwin
build: bun run build --target aarch64-apple-darwin
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
build: bun run build --target aarch64-unknown-linux-gnu --use-napi-cross
- host: ubuntu-latest
target: aarch64-unknown-linux-musl
build: bun run build --target aarch64-unknown-linux-musl -x
- host: windows-latest
target: aarch64-pc-windows-msvc
build: bun run build --target aarch64-pc-windows-msvc
name: stable - ${{ matrix.settings.target }} - node@22
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v6
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.settings.target }}
- name: Cache cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.napi-rs
.cargo-cache
target/
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
- uses: mlugg/setup-zig@v2
if: ${{ contains(matrix.settings.target, 'musl') }}
with:
version: 0.14.1
- name: Install cargo-zigbuild
uses: taiki-e/install-action@v2
if: ${{ contains(matrix.settings.target, 'musl') }}
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tool: cargo-zigbuild
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build
run: ${{ matrix.settings.build }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: bindings-${{ matrix.settings.target }}
path: |
${{ env.APP_NAME }}.*.node
${{ env.APP_NAME }}.*.wasm
if-no-files-found: error
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
needs:
- build
steps:
- uses: actions/checkout@v6
- name: Setup bun
uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: create npm dirs
run: bun napi create-npm-dirs
- name: Download all artifacts
uses: actions/download-artifact@v7
with:
path: artifacts
- name: Move artifacts
run: bun artifacts
- name: List packages
run: ls -R ./npm
shell: bash
- name: Publish
run: |
# echo "registry=https://registry.npmjs.org/" > .npmrc
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
npm config set registry https://registry.npmjs.org/
# Enable provenance if you're using it (requires the id-token: write permission you already have)
npm config set provenance true

if git log -1 --pretty=%B | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+$";
then
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm publish --access public
elif git log -1 --pretty=%B | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+";
then
# echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> .npmrc
npm publish --tag next --access public
else
echo "Not a release, skipping publish"
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
75 changes: 68 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,68 @@
target
index.node
**/node_modules
**/.DS_Store
npm-debug.log
*cargo.log
cross.log

# Created by https://www.toptal.com/developers/gitignore/api/node
# Edit at https://www.toptal.com/developers/gitignore?templates=node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# End of https://www.toptal.com/developers/gitignore/api/node


#Added by cargo

/target
Cargo.lock

*.node
.pnp.*
/npm
Loading