Skip to content

Commit 2ccaedd

Browse files
author
Yaikhomba Ningthemcha
committed
Renamed package to node-printer
1 parent a8464e2 commit 2ccaedd

10 files changed

Lines changed: 34 additions & 53 deletions

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @addble/electron-printer
1+
# @addble/node-printer
22

33
**No recompilation required when upgrading Node.js versions, thanks to N-API!** 🎉
44

@@ -9,7 +9,7 @@ Supports following architectures:
99
* Linux - ia32, x64, arm7l, arm64
1010

1111

12-
[![npm version](https://badge.fury.io/js/%40addble%2Felectron-printer.svg)](https://badge.fury.io/js/%40addble%2Felectron-printer)
12+
[![npm version](https://badge.fury.io/js/%40addble%2Fnode-printer.svg)](https://badge.fury.io/js/%40addble%2Fnode-printer)
1313
[![CI & Prebuilds](https://github.com/addble/electron-printer/actions/workflows/ci.yml/badge.svg)](https://github.com/addble/electron-printer/actions/workflows/ci.yml)
1414

1515
> Supports Node.js versions from 8.0.0 onwards, including the latest versions, thanks to the transition to N-API.
@@ -101,6 +101,7 @@ This project is licensed under the MIT License.
101101
### Keywords:
102102

103103
* node-printer
104+
* nodejs-printer
104105
* printer
105106
* electron-printer
106107
* node-addon-api

binding.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
'variables': {
3-
'module_name%': 'electron-printer',
3+
'module_name%': 'node-printer',
44
'module_path%': 'lib'
55
},
66
'targets': [

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ let addon;
33

44
try {
55
// This will load the addon built by `node-gyp build` and copied by the `action_after_build` target in binding.gyp.
6-
addon = require(path.join(__dirname, 'electron-printer.node'));
6+
addon = require(path.join(__dirname, 'node-printer.node'));
77
} catch (err) {
88
// Fallback for development, e.g. when `action_after_build` hasn't run or when using prebuild-install which might place it elsewhere.
9-
addon = require('../build/Release/electron-printer.node');
9+
addon = require('../build/Release/node-printer.node');
1010
}
1111

1212
module.exports.sayMyName = addon.SayMyName

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@addble/electron-printer",
2+
"name": "@addble/node-printer",
33
"description": "Node API (N-API) supported electron.s || node.js printer bindings",
44
"homepage": "https://github.com/addble/electron-printer",
55
"version": "3.0.0-RC1",
@@ -31,7 +31,7 @@
3131
"url": "https://github.com/addble/electron-printer.git"
3232
},
3333
"binary": {
34-
"module_name": "electron-printer",
34+
"module_name": "node-printer",
3535
"module_path": "./lib/",
3636
"host": "https://github.com/addble/electron-printer/releases/download/",
3737
"remote_path": "v{version}"
@@ -43,6 +43,6 @@
4343
],
4444
"devDependencies": {
4545
"@mapbox/node-pre-gyp": "^2.0.0",
46-
"node-pre-gyp-github": "^2.0.0"
46+
"@prebuild/node-pre-gyp-github": "^2.0.0"
4747
}
4848
}

tools/buildElectronLinux.sh

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,12 @@ if [ -z "$VERSION" ]; then
88
exit 1
99
fi
1010

11-
# Build Electron Linux 64bit (x64)
12-
echo "Building for Electron $VERSION on Linux x64..."
13-
node-pre-gyp configure --target=$VERSION --arch=x64 --dist-url=https://electronjs.org/headers --module_name=electron-printer --module_path=../lib/
14-
node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=x64 --build-from-source
11+
declare -a linux_archs=("x64" "ia32" "arm" "arm64")
1512

16-
# Build Electron Linux 32bit (ia32)
17-
echo "Building for Electron $VERSION on Linux ia32..."
18-
node-pre-gyp configure --target=$VERSION --arch=ia32 --dist-url=https://electronjs.org/headers --module_name=electron-printer --module_path=../lib/
19-
node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=ia32 --build-from-source
20-
21-
# Build Electron Linux ARM 32bit (armv7l) for Raspberry Pi 2/3/4 (32-bit OS)
22-
echo "Building for Electron $VERSION on Linux arm..."
23-
node-pre-gyp configure --target=$VERSION --arch=arm --dist-url=https://electronjs.org/headers --module_name=electron-printer --module_path=../lib/
24-
node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=arm --build-from-source
25-
26-
# Build Electron Linux ARM 64bit (arm64) for Raspberry Pi 3/4/5 (64-bit OS)
27-
echo "Building for Electron $VERSION on Linux arm64..."
28-
node-pre-gyp configure --target=$VERSION --arch=arm64 --dist-url=https://electronjs.org/headers --module_name=electron-printer --module_path=../lib/
29-
node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=arm64 --build-from-source
13+
for arch in "${linux_archs[@]}"; do
14+
echo "Building for Electron $VERSION on Linux $arch..."
15+
npx node-pre-gyp configure --target=$VERSION --arch=$arch --dist-url=https://electronjs.org/headers --module_name=node-printer --module_path=../lib/
16+
npx node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=$arch --build-from-source
17+
done
3018

3119
echo "Done."

tools/buildElectronMac.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ if [ -z "$VERSION" ]; then
88
exit 1
99
fi
1010

11-
# Build Electron macOS x64
12-
echo "Building for Electron $VERSION on macOS x64..."
13-
node-pre-gyp configure --target=$VERSION --arch=x64 --dist-url=https://electronjs.org/headers --module_name=electron-printer --module_path=../lib/
14-
node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=x64 --build-from-source
11+
declare -a macos_archs=("x64" "arm64")
1512

16-
# Build Electron macOS arm64 (for Apple Silicon)
17-
echo "Building for Electron $VERSION on macOS arm64..."
18-
node-pre-gyp configure --target=$VERSION --arch=arm64 --dist-url=https://electronjs.org/headers --module_name=electron-printer --module_path=../lib/
19-
node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=arm64 --build-from-source
13+
for arch in "${macos_archs[@]}"; do
14+
echo "Building for Electron $VERSION on macOS $arch..."
15+
npx node-pre-gyp configure --target=$VERSION --arch=$arch --dist-url=https://electronjs.org/headers --module_name=node-printer --module_path=../lib/
16+
npx node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=$arch --build-from-source
17+
done
2018

2119
echo "Done."

tools/buildElectronWindows.ps1

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,14 @@ param (
1212
# Stop script on first error
1313
$ErrorActionPreference = "Stop"
1414

15-
Write-Host "Building Electron Version -> $Version for x64, ia32, and arm64"
15+
Write-Host "Building Electron Version -> $Version"
1616

17-
# Build Electron Windows 64bit
18-
Write-Host "Building for x64..."
19-
npx node-pre-gyp configure --target=$Version --arch=x64 --dist-url=https://electronjs.org/headers --module_name=electron-printer --module_path=../lib/
20-
npx node-pre-gyp build package --runtime=electron --target=$Version --target_arch=x64 --build-from-source
17+
$windows_archs = @("x64", "ia32", "arm64")
2118

22-
# Build Electron Windows 32bit
23-
Write-Host "Building for ia32..."
24-
npx node-pre-gyp configure --target=$Version --arch=ia32 --dist-url=https://electronjs.org/headers --module_name=electron-printer --module_path=../lib/
25-
npx node-pre-gyp build package --runtime=electron --target=$Version --target_arch=ia32 --build-from-source
26-
27-
Write-Host "Building for arm64..."
28-
npx node-pre-gyp configure --target=$Version --arch=arm64 --dist-url=https://electronjs.org/headers --module_name=electron-printer --module_path=../lib/
29-
npx node-pre-gyp build package --runtime=electron --target=$Version --target_arch=arm64 --build-from-source
19+
foreach ($arch in $windows_archs) {
20+
Write-Host "Building for Windows $arch..."
21+
npx node-pre-gyp configure --target=$Version --arch=$arch --dist-url=https://electronjs.org/headers --module_name=node-printer --module_path=../lib/
22+
npx node-pre-gyp build package --runtime=electron --target=$Version --target_arch=$arch --build-from-source
23+
}
3024

3125
Write-Host "Done."

tools/generateReleaseBuildsLinux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ for version in "${node_versions[@]}"; do
3939
echo "Building for Node.js version: $version"
4040
for arch in "${linux_archs[@]}"; do
4141
echo " Building for arch: $arch..."
42-
npx node-pre-gyp configure --target=$version --arch=$arch --module_name=electron-printer
42+
npx node-pre-gyp configure --target=$version --arch=$arch --module_name=node-printer
4343
npx node-pre-gyp build package --target=$version --target_arch=$arch --build-from-source
4444
done
4545
rsync -av "$SOURCE_PATH/build/stage/$PACKAGE_VERSION/" "$SOURCE_PATH/releases/$RELEASE_VERSION/" --remove-source-files
@@ -50,7 +50,7 @@ for version in "${electron_versions[@]}"; do
5050
echo "Building for Electron version: $version"
5151
for arch in "${linux_archs[@]}"; do
5252
echo " Building for arch: $arch..."
53-
npx node-pre-gyp configure --target=$version --arch=$arch --dist-url=https://electronjs.org/headers --module_name=electron-printer
53+
npx node-pre-gyp configure --target=$version --arch=$arch --dist-url=https://electronjs.org/headers --module_name=node-printer
5454
npx node-pre-gyp build package --target=$version --target_arch=$arch --runtime=electron --build-from-source
5555
done
5656
rsync -av "$SOURCE_PATH/build/stage/$PACKAGE_VERSION/" "$SOURCE_PATH/releases/$RELEASE_VERSION/" --remove-source-files

tools/generateReleaseBuildsMac.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ mkdir -p "$SOURCE_PATH/releases/$RELEASE_VERSION"
3535

3636
for version in "${node_versions[@]}"; do
3737
echo "Building for Node.js version: $version..."
38-
npx node-pre-gyp configure --target=$version --module_name=electron-printer
38+
npx node-pre-gyp configure --target=$version --module_name=node-printer
3939
npx node-pre-gyp build package --target=$version --target_arch=x64 --build-from-source
4040
npx node-pre-gyp build package --target=$version --target_arch=arm64 --build-from-source
4141
rsync -av "$SOURCE_PATH/build/stage/$PACKAGE_VERSION/" "$SOURCE_PATH/releases/$RELEASE_VERSION/" --remove-source-files
@@ -44,7 +44,7 @@ done
4444

4545
for version in "${electron_versions[@]}"; do
4646
echo "Building for Electron version: $version..."
47-
npx node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=electron-printer
47+
npx node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node-printer
4848
npx node-pre-gyp build package --target=$version --target_arch=x64 --runtime=electron --build-from-source
4949
npx node-pre-gyp build package --target=$version --target_arch=arm64 --runtime=electron --build-from-source
5050
rsync -av "$SOURCE_PATH/build/stage/$PACKAGE_VERSION/" "$SOURCE_PATH/releases/$RELEASE_VERSION/" --remove-source-files

tools/generateReleaseBuildsWindows.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ foreach ($version in $node_versions) {
4343
Write-Output "Building for node version: $version"
4444
foreach ($arch in $windows_archs) {
4545
Write-Output " Building for arch: $arch..."
46-
npx node-pre-gyp configure --target=$version --arch=$arch --module_name=electron-printer
46+
npx node-pre-gyp configure --target=$version --arch=$arch --module_name=node-printer
4747
npx node-pre-gyp build package --target=$version --target_arch=$arch --build-from-source
4848
}
4949
Copy-Item -Force -Recurse "$SOURCE_PATH\..\build\stage\$PACKAGE_VERSION\*" -Destination "$SOURCE_PATH\..\releases\$RELEASE_VERSION"
@@ -55,7 +55,7 @@ foreach ($version in $electron_versions) {
5555
Write-Output "Building for Electron version: $version"
5656
foreach ($arch in $windows_archs) {
5757
Write-Output " Building for arch: $arch..."
58-
npx node-pre-gyp configure --target=$version --arch=$arch --dist-url=https://electronjs.org/headers --module_name=electron-printer
58+
npx node-pre-gyp configure --target=$version --arch=$arch --dist-url=https://electronjs.org/headers --module_name=node-printer
5959
npx node-pre-gyp build package --target=$version --target_arch=$arch --runtime=electron --build-from-source
6060
}
6161
Copy-Item -Force -Recurse "$SOURCE_PATH\..\build\stage\$PACKAGE_VERSION\*" -Destination "$SOURCE_PATH\..\releases\$RELEASE_VERSION"

0 commit comments

Comments
 (0)