@timokunze/node-printer 0.6.4 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,8 @@ Native bind printers on POSIX and Windows OS from Node.js, electron and node-web
4
4
 
5
5
  [![npm version](https://badge.fury.io/js/@timokunze%2Fnode-printer.svg)](https://www.npmjs.com/package/@timokunze/node-printer) [![Prebuild Binaries and Publish](https://github.com/TimoKunze/node-printer/actions/workflows/prebuild-main.yml/badge.svg)](https://github.com/TimoKunze/node-printer/actions/workflows/prebuild-main.yml)
6
6
 
7
+ > Me (TimoKunze) created this fork to upgrade dependencies since I ran into various issues with current versions of Node and Electron.
8
+
7
9
  > It just works with Node 12 because of @thiagoelg in his [PR](https://github.com/tojocky/node-printer/pull/261)
8
10
 
9
11
  > Prebuild and CI integration courtesy of @ekoeryanto in his [FORK](https://github.com/ekoeryanto/node-printer)
@@ -52,7 +54,7 @@ See [examples](https://github.com/TimoKunze/node-printer/tree/main/examples)
52
54
 
53
55
  ### Contibutors:
54
56
 
55
- * Timo Kunze
57
+ * Timo Kunze, @timokunze
56
58
  * Thiago Lugli, @thiagoelg
57
59
  * Eko Eryanto, @ekoeryanto
58
60
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@timokunze/node-printer",
3
3
  "description": "Node.js printer bindings",
4
- "version": "0.6.4",
4
+ "version": "0.6.6",
5
5
  "homepage": "https://github.com/TimoKunze/node-printer",
6
6
  "author": {
7
7
  "name": "Ion Lupascu",
@@ -18,7 +18,6 @@
18
18
  "url": "git://github.com/TimoKunze/node-printer.git"
19
19
  },
20
20
  "devDependencies": {
21
- "nodeunit": "^0.11.3",
22
21
  "node-gyp": "^10.1.0",
23
22
  "prebuild": "^13.0.0",
24
23
  "node-abi": "^3.62.0",
@@ -32,8 +31,7 @@
32
31
  "apply-patches": "patch-package",
33
32
  "prebuild-all": "prebuild --all --force --strip --verbose --openssl_fips=X",
34
33
  "prebuild": "prebuild",
35
- "rebuild": "node-gyp rebuild",
36
- "test": "nodeunit test"
34
+ "rebuild": "node-gyp rebuild"
37
35
  },
38
36
  "binary": {
39
37
  "module_name": "node_printer",
@@ -76,6 +76,7 @@ namespace{
76
76
  #define STATUS_PRINTER_ADD(value, type) result.insert(std::make_pair(value, type))
77
77
  STATUS_PRINTER_ADD("BUSY", PRINTER_STATUS_BUSY);
78
78
  STATUS_PRINTER_ADD("DOOR-OPEN", PRINTER_STATUS_DOOR_OPEN);
79
+ STATUS_PRINTER_ADD("DRIVER_UPDATE_NEEDED", PRINTER_STATUS_DRIVER_UPDATE_NEEDED);
79
80
  STATUS_PRINTER_ADD("ERROR", PRINTER_STATUS_ERROR);
80
81
  STATUS_PRINTER_ADD("INITIALIZING", PRINTER_STATUS_INITIALIZING);
81
82
  STATUS_PRINTER_ADD("IO-ACTIVE", PRINTER_STATUS_IO_ACTIVE);
@@ -94,6 +95,7 @@ namespace{
94
95
  STATUS_PRINTER_ADD("POWER-SAVE", PRINTER_STATUS_POWER_SAVE);
95
96
  STATUS_PRINTER_ADD("PRINTING", PRINTER_STATUS_PRINTING);
96
97
  STATUS_PRINTER_ADD("PROCESSING", PRINTER_STATUS_PROCESSING);
98
+ STATUS_PRINTER_ADD("SERVER-OFFLINE", PRINTER_STATUS_SERVER_OFFLINE);
97
99
  STATUS_PRINTER_ADD("SERVER-UNKNOWN", PRINTER_STATUS_SERVER_UNKNOWN);
98
100
  STATUS_PRINTER_ADD("TONER-LOW", PRINTER_STATUS_TONER_LOW);
99
101
  STATUS_PRINTER_ADD("USER-INTERVENTION", PRINTER_STATUS_USER_INTERVENTION);
@@ -150,6 +152,7 @@ namespace{
150
152
  #define ATTRIBUTE_PRINTER_ADD(value, type) result.insert(std::make_pair(value, type))
151
153
  ATTRIBUTE_PRINTER_ADD("DIRECT", PRINTER_ATTRIBUTE_DIRECT);
152
154
  ATTRIBUTE_PRINTER_ADD("DO-COMPLETE-FIRST", PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST);
155
+ ATTRIBUTE_PRINTER_ADD("ENABLE-BIDI", PRINTER_ATTRIBUTE_ENABLE_BIDI);
153
156
  ATTRIBUTE_PRINTER_ADD("ENABLE-DEVQ", PRINTER_ATTRIBUTE_ENABLE_DEVQ);
154
157
  ATTRIBUTE_PRINTER_ADD("HIDDEN", PRINTER_ATTRIBUTE_HIDDEN);
155
158
  ATTRIBUTE_PRINTER_ADD("KEEPPRINTEDJOBS", PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS);
@@ -170,6 +173,7 @@ namespace{
170
173
  ATTRIBUTE_PRINTER_ADD("MACHINE", PRINTER_ATTRIBUTE_MACHINE);
171
174
  ATTRIBUTE_PRINTER_ADD("PUSHED-USER", PRINTER_ATTRIBUTE_PUSHED_USER);
172
175
  ATTRIBUTE_PRINTER_ADD("PUSHED-MACHINE", PRINTER_ATTRIBUTE_PUSHED_MACHINE);
176
+ ATTRIBUTE_PRINTER_ADD("TS_GENERIC_DRIVER", PRINTER_ATTRIBUTE_TS_GENERIC_DRIVER);
173
177
  #endif
174
178
  // server 2003
175
179
  #ifdef PRINTER_ATTRIBUTE_TS
package/types/index.d.ts CHANGED
@@ -54,4 +54,6 @@ export interface JobDetails {
54
54
  processingTime: Date;
55
55
  }
56
56
 
57
- export type JobStatus = 'PAUSED' | 'PRINTING' | 'PRINTED' | 'CANCELLED' | 'PENDING' | 'ABORTED';
57
+ export type JobStatus = 'PAUSED' | 'PRINTING' | 'PRINTED' | 'CANCELLED' | 'PENDING' | 'ABORTED';
58
+
59
+ declare module '@timokunze/node-printer';
@@ -1,87 +0,0 @@
1
- name: Prebuild Binaries and Publish
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- jobs:
9
- prebuild-linux:
10
- name: Prebuild Binaries for Linux
11
- runs-on: ubuntu-latest
12
- timeout-minutes: 30
13
- steps:
14
- - name: Setup Dependencies
15
- run: |
16
- sudo apt-get update -y -qq
17
- sudo apt-get install -y g++-multilib gcc-multilib libcups2-dev linux-libc-dev
18
- - uses: actions/setup-node@v4
19
- with:
20
- node-version: 20.x
21
- - uses: actions/checkout@v4
22
- - run: npm i
23
- - name: Prebuild
24
- run: |
25
- npm run apply-patches
26
- npm run prebuild -- --strip --all --arch x64 -u ${{ secrets.PREBUILD_TOKEN }}
27
- prebuild-linux-32:
28
- name: Prebuild Binaries for Linux
29
- runs-on: ubuntu-latest
30
- timeout-minutes: 30
31
- steps:
32
- - name: Setup Dependencies
33
- run: |
34
- sudo dpkg --add-architecture i386
35
- sudo apt-get update -y -qq
36
- sudo apt-get install -y g++-multilib gcc-multilib libcups2-dev libcups2-dev:i386 libc6-dev-i386 linux-libc-dev linux-libc-dev:i386
37
- - uses: actions/setup-node@v4
38
- with:
39
- node-version: 20.x
40
- - uses: actions/checkout@v4
41
- - run: npm i
42
- - name: Prebuild
43
- run: |
44
- npm run apply-patches
45
- npm run prebuild -- --strip --all --arch ia32 -u ${{ secrets.PREBUILD_TOKEN }}
46
- prebuild-macos:
47
- name: Prebuild Binaries for macOS
48
- runs-on: macos-latest
49
- timeout-minutes: 30
50
- steps:
51
- - uses: actions/setup-node@v4
52
- with:
53
- node-version: 20.x
54
- - uses: actions/checkout@v4
55
- - run: npm i
56
- - name: Prebuild
57
- run: |
58
- npm run apply-patches
59
- npm run prebuild -- --strip --all --arch x64 -u ${{ secrets.PREBUILD_TOKEN }}
60
- prebuild-windows:
61
- name: Prebuild Binaries for Windows x64
62
- runs-on: windows-latest
63
- timeout-minutes: 30
64
- steps:
65
- - uses: actions/setup-node@v4
66
- with:
67
- node-version: 20.x
68
- - uses: actions/checkout@v4
69
- - run: npm i
70
- - name: Prebuild
71
- run: |
72
- npm run apply-patches
73
- npm run prebuild -- --strip --all --arch x64 -u ${{ secrets.PREBUILD_TOKEN }}
74
- prebuild-windows-32:
75
- name: Prebuild Binaries for Windows ia32
76
- runs-on: windows-latest
77
- timeout-minutes: 30
78
- steps:
79
- - uses: actions/setup-node@v4
80
- with:
81
- node-version: 20.x
82
- - uses: actions/checkout@v4
83
- - run: npm i
84
- - name: Prebuild
85
- run: |
86
- npm run apply-patches
87
- npm run prebuild -- --strip --all --arch ia32 -u ${{ secrets.PREBUILD_TOKEN }}
@@ -1,85 +0,0 @@
1
- name: Prebuild Binaries
2
-
3
- on:
4
- pull_request:
5
-
6
- jobs:
7
- prebuild-linux:
8
- name: Prebuild Binaries for Linux
9
- runs-on: ubuntu-latest
10
- timeout-minutes: 30
11
- steps:
12
- - name: Setup Dependencies
13
- run: |
14
- sudo apt-get update -y -qq
15
- sudo apt-get install -y g++-multilib gcc-multilib libcups2-dev linux-libc-dev
16
- - uses: actions/setup-node@v4
17
- with:
18
- node-version: 20.x
19
- - uses: actions/checkout@v4
20
- - run: npm i
21
- - name: Prebuild
22
- run: |
23
- npm run apply-patches
24
- npm run prebuild -- --strip --all --arch x64
25
- prebuild-linux-32:
26
- name: Prebuild Binaries for Linux
27
- runs-on: ubuntu-latest
28
- timeout-minutes: 30
29
- steps:
30
- - name: Setup Dependencies
31
- run: |
32
- sudo dpkg --add-architecture i386
33
- sudo apt-get update -y -qq
34
- sudo apt-get install -y g++-multilib gcc-multilib libcups2-dev libcups2-dev:i386 libc6-dev-i386 linux-libc-dev linux-libc-dev:i386
35
- - uses: actions/setup-node@v4
36
- with:
37
- node-version: 20.x
38
- - uses: actions/checkout@v4
39
- - run: npm i
40
- - name: Prebuild
41
- run: |
42
- npm run apply-patches
43
- npm run prebuild -- --strip --all --arch ia32
44
- prebuild-macos:
45
- name: Prebuild Binaries for macOS
46
- runs-on: macos-latest
47
- timeout-minutes: 30
48
- steps:
49
- - uses: actions/setup-node@v4
50
- with:
51
- node-version: 20.x
52
- - uses: actions/checkout@v4
53
- - run: npm i
54
- - name: Prebuild
55
- run: |
56
- npm run apply-patches
57
- npm run prebuild -- --strip --all --arch x64
58
- prebuild-windows:
59
- name: Prebuild Binaries for Windows x64
60
- runs-on: windows-latest
61
- timeout-minutes: 30
62
- steps:
63
- - uses: actions/setup-node@v4
64
- with:
65
- node-version: 20.x
66
- - uses: actions/checkout@v4
67
- - run: npm i
68
- - name: Prebuild
69
- run: |
70
- npm run apply-patches
71
- npm run prebuild -- --strip --all --arch x64
72
- prebuild-windows-32:
73
- name: Prebuild Binaries for Windows ia32
74
- runs-on: windows-latest
75
- timeout-minutes: 30
76
- steps:
77
- - uses: actions/setup-node@v4
78
- with:
79
- node-version: 20.x
80
- - uses: actions/checkout@v4
81
- - run: npm i
82
- - name: Prebuild
83
- run: |
84
- npm run apply-patches
85
- npm run prebuild -- --strip --all --arch ia32
@@ -1,18 +0,0 @@
1
- name: Publish Package to npmjs
2
- on:
3
- release:
4
- types: [published]
5
- workflow_dispatch:
6
- jobs:
7
- build:
8
- runs-on: ubuntu-latest
9
- steps:
10
- - uses: actions/setup-node@v4
11
- with:
12
- node-version: 20.x
13
- registry-url: 'https://registry.npmjs.org'
14
- - uses: actions/checkout@v4
15
- - run: npm ci --ignore-scripts
16
- - run: npm publish --access public
17
- env:
18
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/ChangeLog DELETED
@@ -1,36 +0,0 @@
1
- 2016.09.10, version 0.2.2
2
- * correct memory leak (thanks to @kjlaw89)
3
-
4
- 2015.10.22, version 0.2.1
5
- * corrected printDirect with buffer data for node v4.X (#95)
6
- * corrected segmentation fault from get default printer for node v0.10.X
7
-
8
- 2015.09, version 0.2.0
9
- * added possibility to compile with node v4.X
10
- * various bug/core dumps fix
11
-
12
- 2015.04, version 0.1.2
13
- * posix: new method getPrinterDriverOptions(printerName) to retrieve PPD options
14
- * posix: new method getSelectedPaperSize(printerName) to retrieve the current paper size name
15
- * posix: new parameter `options` added to `printDirect` to set printer options (ex. `fit-to-page`, `media`, etc)
16
- * posix: new function printFile() to print a file
17
-
18
- 2015.03.03, version 0.1.1
19
- * possibility to build for node-webkit with grunt
20
-
21
- 2015.02.26, version 0.1.0
22
- * possibility to load native module for platform/arch: node_module_{platform}_{arch}.node
23
-
24
- 2015.02.24, Version 0.0.5
25
- * added getDefaultPrinterName() method by returning the default printer name
26
- * make printer argument optional in getPrinter() and printDirect. If is missing, will try to print to default printer
27
- * resolve charest of getPrinter() #38
28
- * posix/win32: added more explicit errors
29
- * posix: do not throw error if job status code is not supported
30
-
31
- 2015.01.30, Version 0.0.4
32
- * win: added RPC installed printers in getPrinters #40
33
- * posix: on some devices not all formats are supported, issue #23
34
- * posix: added link settings on build #28
35
- * corrected README.md
36
- * corrected examples
@@ -1,34 +0,0 @@
1
- var printer = require("../lib"),
2
- util = require('util'),
3
- printerName = 'Foxit Reader PDF Printer',
4
- printerFormat = 'TEXT';
5
-
6
- printer.printDirect({
7
- data:"print from Node.JS buffer", // or simple String: "some text"
8
- printer:printerName, // printer name
9
- type: printerFormat, // type: RAW, TEXT, PDF, JPEG, .. depends on platform
10
- options: // supported page sizes may be retrieved using getPrinterDriverOptions, supports CUPS printing options
11
- {
12
- media: 'Letter',
13
- 'fit-to-page': true
14
- },
15
- success:function(jobID){
16
- console.log("sent to printer with ID: "+jobID);
17
- var jobInfo = printer.getJob(printerName, jobID);
18
- console.log("current job info:"+util.inspect(jobInfo, {depth: 10, colors:true}));
19
- if(jobInfo.status.indexOf('PRINTED') !== -1)
20
- {
21
- console.log('too late, already printed');
22
- return;
23
- }
24
- console.log('cancelling...');
25
- var is_ok = printer.setJob(printerName, jobID, 'CANCEL');
26
- console.log("cancelled: "+is_ok);
27
- try{
28
- console.log("current job info:"+util.inspect(printer.getJob(printerName, jobID), {depth: 10, colors:true}));
29
- }catch(err){
30
- console.log('job deleted. err:'+err);
31
- }
32
- },
33
- error:function(err){console.log(err);}
34
- });
@@ -1,15 +0,0 @@
1
- var printer = require("../lib")
2
- , template = "N\nS4\nD15\nq400\nR\nB20,10,0,1,2,30,173,B,\"barcode\"\nP0\n";
3
-
4
- function printZebra(barcode_text, printer_name){
5
- printer.printDirect({data:template.replace(/barcode/, barcode_text)
6
- , printer:printer_name
7
- , type: "RAW"
8
- , success:function(){
9
- console.log("printed: "+barcode_text);
10
- }
11
- , error:function(err){console.log(err);}
12
- });
13
- }
14
-
15
- printZebra("123", "ZEBRA");
@@ -1,4 +0,0 @@
1
- var printer = require("../lib");
2
-
3
- console.log('default printer name: ' + (printer.getDefaultPrinterName() || 'is not defined on your computer'));
4
-
@@ -1,9 +0,0 @@
1
- var printer = require("../lib"),
2
- util = require('util'),
3
- printers = printer.getPrinters();
4
-
5
- printers.forEach(function(iPrinter, i){
6
- console.log('' + i + 'ppd for printer "' + iPrinter.name + '":' + util.inspect(printer.getPrinterDriverOptions(iPrinter.name), {colors:true, depth:10} ));
7
- console.log('\tselected page size:'+ printer.getSelectedPaperSize(iPrinter.name) + '\n');
8
- });
9
-
@@ -1,3 +0,0 @@
1
- var printer = require("../lib"),
2
- util = require('util');
3
- console.log("installed printers:\n"+util.inspect(printer.getPrinters(), {colors:true, depth:10}));
@@ -1,3 +0,0 @@
1
- var printer = require("../lib"),
2
- util = require('util');
3
- console.log("supported formats are:\n"+util.inspect(printer.getSupportedPrintFormats(), {colors:true, depth:10}));
@@ -1,3 +0,0 @@
1
- var printer = require("../lib"), //=require('pritner')
2
- util = require('util');
3
- console.log("supported job commands:\n"+util.inspect(printer.getSupportedJobCommands(), {colors:true, depth:10}));
@@ -1,30 +0,0 @@
1
- // use: node printFile.js [filePath printerName]
2
- var printer = require("../lib"),
3
- filename = process.argv[2] || __filename;
4
-
5
- console.log('platform:', process.platform);
6
- console.log('try to print file: ' + filename);
7
-
8
- if( process.platform != 'win32') {
9
- printer.printFile({filename:filename,
10
- printer: process.env[3], // printer name, if missing then will print to default printer
11
- success:function(jobID){
12
- console.log("sent to printer with ID: "+jobID);
13
- },
14
- error:function(err){
15
- console.log(err);
16
- }
17
- });
18
- } else {
19
- // not yet implemented, use printDirect and text
20
- var fs = require('fs');
21
- printer.printDirect({data:fs.readFileSync(filename),
22
- printer: process.env[3], // printer name, if missing then will print to default printer
23
- success:function(jobID){
24
- console.log("sent to printer with ID: "+jobID);
25
- },
26
- error:function(err){
27
- console.log(err);
28
- }
29
- });
30
- }
@@ -1,37 +0,0 @@
1
- // Windows does not support PDF formats, but you can use imagemagick-native to achieve conversion from PDF to EMF.
2
-
3
- var printer = require("../lib"),
4
- fs = require('fs'),
5
- path = require('path'),
6
- filename = process.argv[2],
7
- printername = process.argv[3];
8
-
9
- if(process.platform == 'win32') {
10
- throw 'Not yet supported for win32'
11
- }
12
-
13
- if(!filename || filename == '-h') {
14
- throw 'PDF file name is missing. Please use the following params: <filename> [printername]'
15
- }
16
-
17
- filename = path.resolve(process.cwd(), filename);
18
- console.log('printing file name ' + filename);
19
-
20
- fs.readFile(filename, function(err, data){
21
- if(err) {
22
- console.error('err:' + err);
23
- return;
24
- }
25
- console.log('data type is: '+typeof(data) + ', is buffer: ' + Buffer.isBuffer(data));
26
- printer.printDirect({
27
- data: data,
28
- type: 'PDF',
29
- success: function(id) {
30
- console.log('printed with id ' + id);
31
- },
32
- error: function(err) {
33
- console.error('error on printing: ' + err);
34
- }
35
- })
36
- });
37
-
@@ -1,52 +0,0 @@
1
- // Windows does not support PDF formats, but you can use imagemagick-native to achieve conversion from PDF to EMF.
2
-
3
- var printer = require("../lib"),
4
- imagemagick, // will be loaded later with proper error.
5
- fs = require('fs'),
6
- filename = process.argv[2],
7
- printername = process.argv[2];
8
-
9
- if(process.platform !== 'win32') {
10
- throw 'This application can be run only on win32 as a demo of print PDF image'
11
- }
12
-
13
- if(!filename) {
14
- throw 'PDF file name is missing. Please use the following params: <filename> [printername]'
15
- }
16
-
17
- try {
18
- imagemagick = require('imagemagick-native');
19
- } catch(e) {
20
- throw 'please install imagemagick-native: `npm install imagemagick-native`'
21
- }
22
-
23
- var data = fs.readFileSync(filename);
24
-
25
- console.log('data: ' + data.toString().substr(0, 20));
26
-
27
- //console.log(imagemagick.identify({srcData: data}));
28
-
29
- // First convert PDF into
30
- imagemagick.convert({
31
- srcData: data,
32
- srcFormat: 'PDF',
33
- format: 'EMF',
34
- }, function(err, buffer) {
35
- if (err) {
36
- throw 'something went wrong on converting to EMF: ' + err;
37
- }
38
-
39
- // Now we have EMF file, send it to printer as EMF format
40
- printer.printDirect({
41
- data: buffer,
42
- type: 'EMF',
43
- success: function(id) {
44
- console.log('printed with id ' + id);
45
- },
46
- error: function(err) {
47
- console.error('error on printing: ' + err);
48
- }
49
- })
50
- })
51
-
52
-
@@ -1,10 +0,0 @@
1
- var printer = require("../lib");
2
-
3
- printer.printDirect({data:"print from Node.JS buffer" // or simple String: "some text"
4
- //, printer:'Foxit Reader PDF Printer' // printer name, if missing then will print to default printer
5
- , type: 'RAW' // type: RAW, TEXT, PDF, JPEG, .. depends on platform
6
- , success:function(jobID){
7
- console.log("sent to printer with ID: "+jobID);
8
- }
9
- , error:function(err){console.log(err);}
10
- });
package/examples/test.pdf DELETED
Binary file
@@ -1,14 +0,0 @@
1
- exports.testLoadLibrary = function(test) {
2
- test.doesNotThrow(function(){
3
- printer = require("../");
4
- });
5
- test.done();
6
- }
7
-
8
- exports.testGetprinters = function(test) {
9
- printer = require("../");
10
- test.equal(typeof(printer.getPrinters()), 'object');
11
- test.done();
12
- }
13
-
14
- // TODO: add more tests
@@ -1,10 +0,0 @@
1
- #!/bin/bash
2
- VERSION=$1
3
-
4
- # # Build Electron Linux 64bit
5
- node-pre-gyp configure --target=$VERSION --arch=x64 --dist-url=https://electronjs.org/headers --module_name=node_printer --module_path=../lib/
6
- node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=x64 --build-from-source
7
-
8
- # #Build Electron Linux 32bit
9
- node-pre-gyp configure --target=$VERSION --arch=ia32 --dist-url=https://electronjs.org/headers --module_name=node_printer --module_path=../lib/
10
- node-pre-gyp build package --runtime=electron --target=$VERSION --target_arch=ia32 --build-from-source
@@ -1,20 +0,0 @@
1
- #
2
- # Usage: buildElectronWindows.ps1 <version>
3
- #
4
-
5
- if ($args.Length -ne 1) {
6
- echo "Must Supply only 1 argument - Version"
7
- return
8
- }
9
-
10
- $version = $args[0]
11
-
12
- echo "Building Electron Version -> $version"
13
-
14
- # Build Electron Windows 64bit
15
- node_modules\.bin\node-pre-gyp.cmd configure --target=$version --arch=x64 --dist-url=https://electronjs.org/headers --module_name=node_printer
16
- node_modules\.bin\node-pre-gyp.cmd build package --runtime=electron --target=$version --target_arch=x64 --build-from-source
17
-
18
- # Build Electron Windows 32bit
19
- node_modules\.bin\node-pre-gyp.cmd configure --target=$version --arch=ia32 --dist-url=https://electronjs.org/headers --module_name=node_printer
20
- node_modules\.bin\node-pre-gyp.cmd build package --runtime=electron --target=$version --target_arch=ia32 --build-from-source
@@ -1,23 +0,0 @@
1
- # Build Win32 64bit
2
- # node_modules\.bin\node-pre-gyp.cmd configure --target=$env:nodejs_version
3
- # node_modules\.bin\node-pre-gyp.cmd build package --target=$env:nodejs_version --target_arch=x64
4
-
5
- # Build Win32 32bit
6
- # node_modules\.bin\node-pre-gyp.cmd configure --target=$env:nodejs_version
7
- # node_modules\.bin\node-pre-gyp.cmd build package --target=$env:nodejs_version --target_arch=ia32
8
-
9
- if ($env:build_electron -ne "true") {
10
- echo "Skipping Electron Build as flag not set"
11
- return
12
- }
13
-
14
- # Build Electron Versions
15
- ./tools/buildElectronWindows.ps1 1.2.8
16
- ./tools/buildElectronWindows.ps1 1.3.8
17
- ./tools/buildElectronWindows.ps1 1.4.6
18
- ./tools/buildElectronWindows.ps1 1.7.12
19
- ./tools/buildElectronWindows.ps1 2.0.18
20
- ./tools/buildElectronWindows.ps1 3.1.13
21
- ./tools/buildElectronWindows.ps1 4.2.10
22
- ./tools/buildElectronWindows.ps1 5.0.10
23
- ./tools/buildElectronWindows.ps1 6.0.7
@@ -1,59 +0,0 @@
1
- #!/bin/bash
2
-
3
- RELEASE_VERSION=$1
4
- PACKAGE_VERSION=$(node -pe "require('./package.json').version")
5
- SOURCE_PATH="${BASH_SOURCE%/*}/.."
6
-
7
- declare -a node_versions=(
8
- "0.10.48"
9
- "0.12.18"
10
- "4.9.1"
11
- "5.9.1"
12
- "6.17.1"
13
- "8.16.1"
14
- "10.16.0"
15
- "11.15.0"
16
- "12.10.0"
17
- )
18
-
19
- declare -a electron_versions=(
20
- "1.2.8"
21
- "1.3.8"
22
- "1.4.6"
23
- "1.7.12"
24
- "2.0.18"
25
- "3.1.13"
26
- "4.2.10"
27
- "5.0.10"
28
- "6.0.7"
29
- )
30
-
31
- # remove old build directory
32
- rm -rf "$SOURCHE_PATH/build" > /dev/null
33
-
34
- # create release path
35
- mkdir -p "$SOURCE_PATH/releases/$RELEASE_VERSION" > /dev/null
36
-
37
- for version in "${node_versions[@]}"
38
- do
39
- echo "Building for node version: $version..."
40
- node-pre-gyp configure --target=$version --module_name=node_printer --silent
41
- node-pre-gyp build package --target=$version --target_arch=x64 --build-from-source --silent
42
- node-pre-gyp configure --target=$version --module_name=node_printer --silent
43
- node-pre-gyp build package --target=$version --target_arch=ia32 --build-from-source --silent
44
- rsync -a -v "$SOURCE_PATH/build/stage/$PACKAGE_VERSION/" "$SOURCE_PATH/releases/$RELEASE_VERSION/" --remove-source-files > /dev/null
45
- echo "Done"
46
- done
47
-
48
- for version in "${electron_versions[@]}"
49
- do
50
- echo "Building for electron version: $version..."
51
- node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent
52
- node-pre-gyp build package --target=$version --target_arch=x64 --runtime=electron --build-from-source --silent
53
- node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent
54
- node-pre-gyp build package --target=$version --target_arch=ia32 --runtime=electron --build-from-source --silent
55
- rsync -a -v "$SOURCE_PATH/build/stage/$PACKAGE_VERSION/" "$SOURCE_PATH/releases/$RELEASE_VERSION/" --remove-source-files > /dev/null
56
- echo "Done"
57
- done
58
-
59
- echo "Finished succesfully!"
@@ -1,63 +0,0 @@
1
- param (
2
- [Parameter(Mandatory=$true)][string]$release
3
- )
4
-
5
- $SOURCE_PATH = split-path -parent $MyInvocation.MyCommand.Definition
6
- $RELEASE_VERSION = $release
7
- $PACKAGE_VERSION = node -pe "require('./package.json').version"
8
-
9
- echo $SOURCE_PATH
10
-
11
- $node_versions = @(
12
- "0.10.48",
13
- "0.12.18",
14
- "4.9.1",
15
- "5.9.1",
16
- "6.17.1",
17
- "8.16.1",
18
- "10.16.0",
19
- "11.15.0",
20
- "12.10.0"
21
- )
22
-
23
- $electron_versions = @(
24
- "1.2.8",
25
- "1.3.8",
26
- "1.4.6",
27
- "1.7.12",
28
- "2.0.18",
29
- "3.1.13",
30
- "4.2.10",
31
- "5.0.10",
32
- "6.0.7"
33
- )
34
-
35
- # remove old build directory
36
- Remove-Item -Recurse -Force $SOURCE_PATH'\..\build' -ErrorAction Ignore | Out-Null
37
-
38
- # create release path
39
- New-Item $SOURCE_PATH'\..\releases\'$RELEASE_VERSION -ItemType Directory -ea 0 | Out-Null
40
-
41
- foreach ($version in $node_versions) {
42
- Write-Output "Building for node version: $version..."
43
- node-pre-gyp configure --target=$version --module_name=node_printer --silent | Out-Null
44
- node-pre-gyp build package --target=$version --target_arch=x64 --build-from-source --silent | Out-Null
45
- node-pre-gyp configure --target=$version --module_name=node_printer --silent | Out-Null
46
- node-pre-gyp build package --target=$version --target_arch=ia32 --build-from-source --silent | Out-Null
47
- Copy-item -Force -Recurse $SOURCE_PATH'\..\build\stage\'$PACKAGE_VERSION\* -Destination $SOURCE_PATH'\..\releases\'$RELEASE_VERSION -ErrorAction Ignore | Out-Null
48
- Remove-Item -Recurse -Force $SOURCE_PATH'\..\build\stage' | Out-Null
49
- Write-Output "Done"
50
- }
51
-
52
- foreach ($version in $electron_versions) {
53
- Write-Output "Building for electron version: $version..."
54
- node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent | Out-Null
55
- node-pre-gyp build package --target=$version --target_arch=x64 --runtime=electron --build-from-source --silent | Out-Null
56
- node-pre-gyp configure --target=$version --dist-url=https://electronjs.org/headers --module_name=node_printer --silent | Out-Null
57
- node-pre-gyp build package --target=$version --target_arch=ia32 --runtime=electron --build-from-source --silent | Out-Null
58
- Copy-item -Force -Recurse $SOURCE_PATH'\..\build\stage\'$PACKAGE_VERSION\* -Destination $SOURCE_PATH'\..\releases\'$RELEASE_VERSION -ErrorAction Ignore | Out-Null
59
- Remove-Item -Recurse -Force $SOURCE_PATH'\..\build\stage' | Out-Null
60
- Write-Output "Done"
61
- }
62
-
63
- Write-Output "Finished succesfully!"
package/tsconfig.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "lib": [
5
- "es6"
6
- ],
7
- "noImplicitAny": true,
8
- "noImplicitThis": true,
9
- "strictFunctionTypes": true,
10
- "strictNullChecks": true,
11
- "baseUrl": "../",
12
- "typeRoots": [
13
- "../"
14
- ],
15
- "types": [],
16
- "noEmit": true,
17
- "forceConsistentCasingInFileNames": true
18
- },
19
- "files": [
20
- "types/index.d.ts",
21
- ]
22
- }