From 763ef79e2062568cd397b59e3f7b3ed6e1de36f1 Mon Sep 17 00:00:00 2001 From: Sibelius Seraphini Date: Sun, 27 Aug 2023 09:59:04 -0300 Subject: [PATCH 1/5] feat(node): use latest version of node-gyp, see #2 --- .gitignore | 2 ++ package.json | 83 ++++++++++++++++++++++++++-------------------------- 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index 7860cc7c..b7328b70 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ prebuilds/ *.node *.swp *.log + +.vscode diff --git a/package.json b/package.json index 6cb6e694..ddf9cf8b 100644 --- a/package.json +++ b/package.json @@ -2,69 +2,70 @@ "name": "@grandchef/node-printer", "description": "Node.js printer bindings", "version": "0.7.1", - "main": "./lib/printer", - "exports": { - ".": "./lib/printer.js", - "./build": "./build.js" + "author": { + "name": "Ion Lupascu", + "url": "http://program-support.co.uk/", + "email": "ionlupascu@gmail.com" }, - "scripts": { - "apply-patches": "patch-package", - "install": "prebuild-install || node-gyp rebuild", - "prebuild": "prebuild", - "rebuild": "node-gyp rebuild", - "test": "nodeunit test" + "binary": { + "module_name": "node_printer", + "module_path": "./lib/binding", + "host": "https://github.com/grandchef/node-printer/releases/download/", + "remote_path": "v{version}" }, + "contributors": [ + "Thiago Lugli ", + "Eko Eryanto ", + "Francimar Alves " + ], "dependencies": { "@mapbox/node-pre-gyp": "^1.0.9", "nan": "^2.15.0", "prebuild-install": "^7.0.1" }, "devDependencies": { - "@commitlint/cli": "^11.0.0", - "@commitlint/config-conventional": "^11.0.0", - "eslint": "^7.11.0", - "eslint-config-egg": "^8.1.2", - "husky": "^4.3.0", - "lint-staged": "^10.4.2", + "@commitlint/cli": "^17.7.1", + "@commitlint/config-conventional": "^17.7.0", + "eslint": "^8.48.0", + "eslint-config-egg": "^12.2.1", + "husky": "^8.0.3", + "lint-staged": "^14.0.1", "node-abi": "^3.8.0", "nodeunit": "*", - "patch-package": "^6.4.7", + "patch-package": "^8.0.0", "prebuild": "^11.0.4", - "prebuild-ci": "^4.0.0" - }, - "engines": { - "node": ">= 4.0.0" - }, - "binary": { - "module_name": "node_printer", - "module_path": "./lib/binding", - "host": "https://github.com/grandchef/node-printer/releases/download/", - "remote_path": "v{version}" + "prebuild-ci": "^4.0.0", + "node-gyp": "^9.4.0" }, "directories": { "example": "examples", "lib": "lib", "test": "test" }, - "repository": { - "type": "git", - "url": "https://github.com/grandchef/node-printer.git" + "engines": { + "node": ">= 4.0.0" + }, + "exports": { + ".": "./lib/printer.js", + "./build": "./build.js" }, "keywords": [ "native", "node", "printer" ], - "types": "types/index.d.ts", - "author": { - "name": "Ion Lupascu", - "url": "http://program-support.co.uk/", - "email": "ionlupascu@gmail.com" + "license": "MIT", + "main": "./lib/printer", + "repository": { + "type": "git", + "url": "https://github.com/grandchef/node-printer.git" }, - "contributors": [ - "Thiago Lugli ", - "Eko Eryanto ", - "Francimar Alves " - ], - "license": "MIT" + "scripts": { + "apply-patches": "patch-package", + "install": "prebuild-install || node-gyp rebuild", + "prebuild": "prebuild", + "rebuild": "node-gyp rebuild", + "test": "nodeunit test" + }, + "types": "types/index.d.ts" } From 0eb4c2427a3acc039fd99bf3390a1ea754621a7a Mon Sep 17 00:00:00 2001 From: Sibelius Seraphini Date: Mon, 28 Aug 2023 16:24:04 -0300 Subject: [PATCH 2/5] fix(electron): fix latest version of electron, fix #2, fix #4 --- binding.gyp | 2 +- package.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index 57508434..7f7beeaf 100644 --- a/binding.gyp +++ b/binding.gyp @@ -61,7 +61,7 @@ "-stdlib=libc++" ], 'xcode_settings': { - "OTHER_CPLUSPLUSFLAGS":["-std=c++14", "-stdlib=libc++"], + "OTHER_CPLUSPLUSFLAGS":["-std=c++17", "-stdlib=libc++"], "OTHER_LDFLAGS": ["-stdlib=libc++"], "MACOSX_DEPLOYMENT_TARGET": "10.7", }, diff --git a/package.json b/package.json index ddf9cf8b..e883a7ad 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,9 @@ "prebuild-ci": "^4.0.0", "node-gyp": "^9.4.0" }, + "resolutions": { + "node-gyp": "^9.4.0" + }, "directories": { "example": "examples", "lib": "lib", From 66177be875dfbc0db3c9f5da20c7e8c6185c9a15 Mon Sep 17 00:00:00 2001 From: Sibelius Seraphini Date: Wed, 30 Aug 2023 10:11:03 -0300 Subject: [PATCH 3/5] fix(patch): fix patch --- package.json | 13 ++++++++----- ...ode-abi+3.24.0.patch => node-abi+3.47.0.patch} | 15 ++++++++------- 2 files changed, 16 insertions(+), 12 deletions(-) rename patches/{node-abi+3.24.0.patch => node-abi+3.47.0.patch} (83%) diff --git a/package.json b/package.json index e883a7ad..6d33bfb3 100644 --- a/package.json +++ b/package.json @@ -31,14 +31,11 @@ "husky": "^8.0.3", "lint-staged": "^14.0.1", "node-abi": "^3.8.0", + "node-gyp": "^9.4.0", "nodeunit": "*", "patch-package": "^8.0.0", "prebuild": "^11.0.4", - "prebuild-ci": "^4.0.0", - "node-gyp": "^9.4.0" - }, - "resolutions": { - "node-gyp": "^9.4.0" + "prebuild-ci": "^4.0.0" }, "directories": { "example": "examples", @@ -63,6 +60,12 @@ "type": "git", "url": "https://github.com/grandchef/node-printer.git" }, + "resolutions": { + "node-gyp": "^9.4.0" + }, + "overrides": { + "node-gyp": "^9.4.0" + }, "scripts": { "apply-patches": "patch-package", "install": "prebuild-install || node-gyp rebuild", diff --git a/patches/node-abi+3.24.0.patch b/patches/node-abi+3.47.0.patch similarity index 83% rename from patches/node-abi+3.24.0.patch rename to patches/node-abi+3.47.0.patch index efb26541..34b0b499 100644 --- a/patches/node-abi+3.24.0.patch +++ b/patches/node-abi+3.47.0.patch @@ -1,5 +1,5 @@ diff --git a/node_modules/node-abi/abi_registry.json b/node_modules/node-abi/abi_registry.json -index f4f1bf7..41bd3d0 100644 +index ed55679..bce4775 100644 --- a/node_modules/node-abi/abi_registry.json +++ b/node_modules/node-abi/abi_registry.json @@ -52,7 +52,7 @@ @@ -11,11 +11,10 @@ index f4f1bf7..41bd3d0 100644 "lts": false, "future": false, "abi": "102" -@@ -199,19 +199,5 @@ - "lts": false, +@@ -217,20 +217,6 @@ "runtime": "electron", "target": "19.0.0-alpha.1" -- }, + }, - { - "abi": "107", - "future": false, @@ -25,9 +24,11 @@ index f4f1bf7..41bd3d0 100644 - }, - { - "abi": "109", -- "future": true, +- "future": false, - "lts": false, - "runtime": "electron", - "target": "21.0.0-alpha.1" - } - ] +- }, + { + "abi": "110", + "future": false, From 6c888d84d23f0c6d2cc8825de6d10745c57f4e5c Mon Sep 17 00:00:00 2001 From: Sibelius Seraphini Date: Wed, 30 Aug 2023 10:49:27 -0300 Subject: [PATCH 4/5] fix(binding): add openssl_fips variable to fix build --- binding.gyp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binding.gyp b/binding.gyp index 7f7beeaf..44c51b8c 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,7 +1,8 @@ { "variables": { "module_name%": "node_printer", - "module_path%": "lib/binding" + "module_path%": "lib/binding", + "openssl_fips": "" }, 'targets': [ { From 942b0c7adb2feec21d33991312ce7be849445e01 Mon Sep 17 00:00:00 2001 From: Sibelius Seraphini Date: Wed, 30 Aug 2023 18:09:24 -0300 Subject: [PATCH 5/5] feat(update): update actions --- .github/workflows/prebuild-main.yml | 18 +++++++++--------- .github/workflows/prebuild-pr.yml | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/prebuild-main.yml b/.github/workflows/prebuild-main.yml index 4b9cf879..bfe3a015 100644 --- a/.github/workflows/prebuild-main.yml +++ b/.github/workflows/prebuild-main.yml @@ -16,10 +16,10 @@ jobs: sudo dpkg --add-architecture i386 sudo apt-get update -y -qq sudo apt-get install -y g++-multilib gcc-multilib libcups2-dev libcups2-dev:i386 libc6-dev-i386 linux-libc-dev linux-libc-dev:i386 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: 16.x - - uses: actions/checkout@v1 + node-version: 20.x + - uses: actions/checkout@v3 - run: npm i - name: Prebuild run: | @@ -31,10 +31,10 @@ jobs: runs-on: macos-latest timeout-minutes: 30 steps: - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: 16.x - - uses: actions/checkout@v1 + node-version: 20.x + - uses: actions/checkout@v3 - run: npm i - name: Prebuild run: | @@ -45,10 +45,10 @@ jobs: runs-on: windows-2019 timeout-minutes: 30 steps: - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: 16.x - - uses: actions/checkout@v1 + node-version: 20.x + - uses: actions/checkout@v3 - run: npm i - name: Prebuild run: | diff --git a/.github/workflows/prebuild-pr.yml b/.github/workflows/prebuild-pr.yml index 92ea33e5..79208d0a 100644 --- a/.github/workflows/prebuild-pr.yml +++ b/.github/workflows/prebuild-pr.yml @@ -14,10 +14,10 @@ jobs: sudo dpkg --add-architecture i386 sudo apt-get update -y -qq sudo apt-get install -y g++-multilib gcc-multilib libcups2-dev libcups2-dev:i386 libc6-dev-i386 linux-libc-dev linux-libc-dev:i386 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: 16.x - - uses: actions/checkout@v1 + node-version: 20.x + - uses: actions/checkout@v3 - run: npm i - name: Prebuild run: | @@ -29,10 +29,10 @@ jobs: runs-on: macos-latest timeout-minutes: 30 steps: - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: 16.x - - uses: actions/checkout@v1 + node-version: 20.x + - uses: actions/checkout@v3 - run: npm i - name: Prebuild run: | @@ -43,10 +43,10 @@ jobs: runs-on: windows-2019 timeout-minutes: 30 steps: - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: 16.x - - uses: actions/checkout@v1 + node-version: 20.x + - uses: actions/checkout@v3 - run: npm i - name: Prebuild run: |