deboa 1.1.1 → 1.2.0
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/dist/cjs/classes/Deboa.js +6 -9
- package/dist/cjs/types/classes/Deboa.d.ts +46 -44
- package/dist/cjs/types/classes/DeboaFromFile.d.ts +23 -23
- package/dist/cjs/types/index.d.ts +4 -4
- package/dist/cjs/types/types/IAddTarEntriesParams.d.ts +5 -5
- package/dist/cjs/types/types/IControlFileOptions.d.ts +130 -130
- package/dist/cjs/types/types/IDeboa.d.ts +138 -133
- package/dist/cjs/types/types/IDeboaFromFile.d.ts +8 -8
- package/dist/cjs/types/types/INormalizeOptionsLength.d.ts +8 -8
- package/dist/cjs/types/types/IWriteFileFromLinesArgs.d.ts +10 -10
- package/dist/cjs/types/types/IWriteToArchive.d.ts +19 -19
- package/dist/cjs/types/types/MaintainerScript.d.ts +1 -1
- package/dist/cjs/types/types/Priority.d.ts +1 -1
- package/dist/cjs/types/types/Section.d.ts +1 -1
- package/dist/cjs/types/types/index.d.ts +10 -10
- package/dist/cjs/types/utils/addTarEntries.d.ts +5 -5
- package/dist/cjs/types/utils/changeOwnerToRoot.d.ts +6 -0
- package/dist/cjs/types/utils/createFileHeader.d.ts +2 -2
- package/dist/cjs/types/utils/writeFileFromLines.d.ts +5 -5
- package/dist/cjs/types/utils/writeToArchive.d.ts +5 -5
- package/dist/cjs/utils/changeOwnerToRoot.js +15 -0
- package/dist/esm/classes/Deboa.js +6 -9
- package/dist/esm/types/classes/Deboa.d.ts +46 -44
- package/dist/esm/types/classes/DeboaFromFile.d.ts +23 -23
- package/dist/esm/types/index.d.ts +4 -4
- package/dist/esm/types/types/IAddTarEntriesParams.d.ts +5 -5
- package/dist/esm/types/types/IControlFileOptions.d.ts +130 -130
- package/dist/esm/types/types/IDeboa.d.ts +138 -133
- package/dist/esm/types/types/IDeboaFromFile.d.ts +8 -8
- package/dist/esm/types/types/INormalizeOptionsLength.d.ts +8 -8
- package/dist/esm/types/types/IWriteFileFromLinesArgs.d.ts +10 -10
- package/dist/esm/types/types/IWriteToArchive.d.ts +19 -19
- package/dist/esm/types/types/MaintainerScript.d.ts +1 -1
- package/dist/esm/types/types/Priority.d.ts +1 -1
- package/dist/esm/types/types/Section.d.ts +1 -1
- package/dist/esm/types/types/index.d.ts +10 -10
- package/dist/esm/types/utils/addTarEntries.d.ts +5 -5
- package/dist/esm/types/utils/changeOwnerToRoot.d.ts +6 -0
- package/dist/esm/types/utils/createFileHeader.d.ts +2 -2
- package/dist/esm/types/utils/writeFileFromLines.d.ts +5 -5
- package/dist/esm/types/utils/writeToArchive.d.ts +5 -5
- package/dist/esm/utils/changeOwnerToRoot.js +10 -0
- package/package.json +11 -5
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @property {string} filePath - Path to the output file.
|
|
3
|
-
* @property {string[]} lines - Lines to be written.
|
|
4
|
-
*/
|
|
5
|
-
export interface IWriteFileFromLinesArgs {
|
|
6
|
-
/** Path to the output file. */
|
|
7
|
-
filePath: string;
|
|
8
|
-
/** Lines to be written. */
|
|
9
|
-
lines: string[];
|
|
10
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @property {string} filePath - Path to the output file.
|
|
3
|
+
* @property {string[]} lines - Lines to be written.
|
|
4
|
+
*/
|
|
5
|
+
export interface IWriteFileFromLinesArgs {
|
|
6
|
+
/** Path to the output file. */
|
|
7
|
+
filePath: string;
|
|
8
|
+
/** Lines to be written. */
|
|
9
|
+
lines: string[];
|
|
10
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import type { ReadStream, WriteStream } from 'fs';
|
|
4
|
-
/**
|
|
5
|
-
* @property {Buffer} header - AR header.
|
|
6
|
-
* @property {boolean} [isARFile] - If true, the .deb-specific sections won't be added to the file.
|
|
7
|
-
* @property {readStream} readStream - ReadStream from the input file.
|
|
8
|
-
* @property {WriteStream} writeStream - WriteStream to the output file.
|
|
9
|
-
*/
|
|
10
|
-
export interface IWriteToArchive {
|
|
11
|
-
/** AR header. */
|
|
12
|
-
header: Buffer;
|
|
13
|
-
/** If true, the .deb-specific sections won't be added to the file. */
|
|
14
|
-
isARFile?: boolean;
|
|
15
|
-
/** ReadStream from the input file. */
|
|
16
|
-
readStream: ReadStream;
|
|
17
|
-
/** WriteStream to the output file. */
|
|
18
|
-
writeStream: WriteStream;
|
|
19
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { ReadStream, WriteStream } from 'fs';
|
|
4
|
+
/**
|
|
5
|
+
* @property {Buffer} header - AR header.
|
|
6
|
+
* @property {boolean} [isARFile] - If true, the .deb-specific sections won't be added to the file.
|
|
7
|
+
* @property {readStream} readStream - ReadStream from the input file.
|
|
8
|
+
* @property {WriteStream} writeStream - WriteStream to the output file.
|
|
9
|
+
*/
|
|
10
|
+
export interface IWriteToArchive {
|
|
11
|
+
/** AR header. */
|
|
12
|
+
header: Buffer;
|
|
13
|
+
/** If true, the .deb-specific sections won't be added to the file. */
|
|
14
|
+
isARFile?: boolean;
|
|
15
|
+
/** ReadStream from the input file. */
|
|
16
|
+
readStream: ReadStream;
|
|
17
|
+
/** WriteStream to the output file. */
|
|
18
|
+
writeStream: WriteStream;
|
|
19
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type MaintainerScript = 'preinst' | 'postinst' | 'prerm' | 'postrm';
|
|
1
|
+
export declare type MaintainerScript = 'preinst' | 'postinst' | 'prerm' | 'postrm';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type Priority = 'required' | 'important' | 'standard' | 'optional';
|
|
1
|
+
export declare type Priority = 'required' | 'important' | 'standard' | 'optional';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare type Section = 'admin' | 'cli-mono' | 'comm' | 'database' | 'debug' | 'devel' | 'doc' | 'editors' | 'education' | 'electronics' | 'embedded' | 'fonts' | 'games' | 'gnome' | 'gnu-r' | 'gnustep' | 'graphics' | 'hamradio' | 'haskell' | 'httpd' | 'interpreters' | 'introspection' | 'java' | 'javascript' | 'kde' | 'kernel' | 'libdevel' | 'libs' | 'lisp' | 'localization' | 'mail' | 'math' | 'metapackages' | 'misc' | 'net' | 'news' | 'ocaml' | 'oldlibs' | 'otherosfs' | 'perl' | 'php' | 'python' | 'ruby' | 'rust' | 'science' | 'shells' | 'sound' | 'tasks' | 'tex' | 'text' | 'utils' | 'vcs' | 'video' | 'web' | 'x11' | 'xfce' | 'zope' | undefined;
|
|
1
|
+
export declare type Section = 'admin' | 'cli-mono' | 'comm' | 'database' | 'debug' | 'devel' | 'doc' | 'editors' | 'education' | 'electronics' | 'embedded' | 'fonts' | 'games' | 'gnome' | 'gnu-r' | 'gnustep' | 'graphics' | 'hamradio' | 'haskell' | 'httpd' | 'interpreters' | 'introspection' | 'java' | 'javascript' | 'kde' | 'kernel' | 'libdevel' | 'libs' | 'lisp' | 'localization' | 'mail' | 'math' | 'metapackages' | 'misc' | 'net' | 'news' | 'ocaml' | 'oldlibs' | 'otherosfs' | 'perl' | 'php' | 'python' | 'ruby' | 'rust' | 'science' | 'shells' | 'sound' | 'tasks' | 'tex' | 'text' | 'utils' | 'vcs' | 'video' | 'web' | 'x11' | 'xfce' | 'zope' | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from './IAddTarEntriesParams';
|
|
2
|
-
export * from './IControlFileOptions';
|
|
3
|
-
export * from './IDeboa';
|
|
4
|
-
export * from './IDeboaFromFile';
|
|
5
|
-
export * from './INormalizeOptionsLength';
|
|
6
|
-
export * from './IWriteFileFromLinesArgs';
|
|
7
|
-
export * from './IWriteToArchive';
|
|
8
|
-
export * from './MaintainerScript';
|
|
9
|
-
export * from './Priority';
|
|
10
|
-
export * from './Section';
|
|
1
|
+
export * from './IAddTarEntriesParams';
|
|
2
|
+
export * from './IControlFileOptions';
|
|
3
|
+
export * from './IDeboa';
|
|
4
|
+
export * from './IDeboaFromFile';
|
|
5
|
+
export * from './INormalizeOptionsLength';
|
|
6
|
+
export * from './IWriteFileFromLinesArgs';
|
|
7
|
+
export * from './IWriteToArchive';
|
|
8
|
+
export * from './MaintainerScript';
|
|
9
|
+
export * from './Priority';
|
|
10
|
+
export * from './Section';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IAddTarEntriesParams } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Adds entries to the .tar archive after all the files are packed.
|
|
4
|
-
*/
|
|
5
|
-
export declare function addTarEntries({ entries, pack, }: IAddTarEntriesParams): Promise<void>;
|
|
1
|
+
import { IAddTarEntriesParams } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Adds entries to the .tar archive after all the files are packed.
|
|
4
|
+
*/
|
|
5
|
+
export declare function addTarEntries({ entries, pack, }: IAddTarEntriesParams): Promise<void>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { IDeboa } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures all files/directories in the .tar archive are owned by root,
|
|
4
|
+
* not by the current user when running on Unix or by a invalid user on Windows.
|
|
5
|
+
*/
|
|
6
|
+
export declare const changeOwnerToRoot: Exclude<IDeboa['modifyTarHeader'], string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { INormalizeOptionLength } from '../types';
|
|
2
|
-
export declare function createFileHeader(options: INormalizeOptionLength): string;
|
|
1
|
+
import { INormalizeOptionLength } from '../types';
|
|
2
|
+
export declare function createFileHeader(options: INormalizeOptionLength): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IWriteFileFromLinesArgs } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a file from a string array.
|
|
4
|
-
*/
|
|
5
|
-
export declare function writeFileFromLines({ filePath, lines, }: IWriteFileFromLinesArgs): Promise<void>;
|
|
1
|
+
import { IWriteFileFromLinesArgs } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a file from a string array.
|
|
4
|
+
*/
|
|
5
|
+
export declare function writeFileFromLines({ filePath, lines, }: IWriteFileFromLinesArgs): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IWriteToArchive } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*/
|
|
5
|
-
export declare function writeToArchive({ header, isARFile, readStream, writeStream, }: IWriteToArchive): Promise<void>;
|
|
1
|
+
import { IWriteToArchive } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export declare function writeToArchive({ header, isARFile, readStream, writeStream, }: IWriteToArchive): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ensures all files/directories in the .tar archive are owned by root,
|
|
3
|
+
* not by the current user when running on Unix or by a invalid user on Windows.
|
|
4
|
+
*/ export const changeOwnerToRoot = (header)=>{
|
|
5
|
+
header.gname = 'root';
|
|
6
|
+
header.uname = 'root';
|
|
7
|
+
header.gid = 0;
|
|
8
|
+
header.uid = 0;
|
|
9
|
+
return header;
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deboa",
|
|
3
3
|
"author": "Erik Moura <erikian@erikian.dev>",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"description": "Create .deb files in any platform with Node.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
7
7
|
"module": "./dist/esm/index.js",
|
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
"require": "./dist/cjs/index.js"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"README.md",
|
|
23
|
+
"package.json"
|
|
24
|
+
],
|
|
19
25
|
"scripts": {
|
|
20
26
|
"build": "rimraf dist && concurrently \"yarn:build:*\"",
|
|
21
27
|
"build:esm": "swc --config-file .swcrc-esm ./src --out-dir dist/esm && tsc -p tsconfig.json",
|
|
@@ -26,10 +32,10 @@
|
|
|
26
32
|
"url": "https://github.com/erikian/deboa.git"
|
|
27
33
|
},
|
|
28
34
|
"dependencies": {
|
|
29
|
-
"fast-folder-size": "^
|
|
35
|
+
"fast-folder-size": "^2.4.0",
|
|
30
36
|
"fs-extra": "^10.1.0",
|
|
31
37
|
"lzma-native": "^8.0.6",
|
|
32
|
-
"tar-fs": "^2.1.
|
|
38
|
+
"tar-fs": "^2.1.4"
|
|
33
39
|
},
|
|
34
40
|
"devDependencies": {
|
|
35
41
|
"@swc/cli": "^0.1.57",
|
|
@@ -42,12 +48,12 @@
|
|
|
42
48
|
"@typescript-eslint/eslint-plugin": "^4.23.0",
|
|
43
49
|
"@typescript-eslint/parser": "^4.23.0",
|
|
44
50
|
"concurrently": "^7.2.2",
|
|
45
|
-
"eslint": "^7.
|
|
51
|
+
"eslint": "^7.32.0",
|
|
46
52
|
"eslint-config-prettier": "^8.3.0",
|
|
47
53
|
"eslint-config-standard": "^16.0.2",
|
|
48
54
|
"eslint-plugin-import": "^2.22.1",
|
|
49
55
|
"eslint-plugin-node": "^11.1.0",
|
|
50
|
-
"eslint-plugin-prettier": "^
|
|
56
|
+
"eslint-plugin-prettier": "^4.2.5",
|
|
51
57
|
"eslint-plugin-promise": "^5.1.0",
|
|
52
58
|
"eslint-plugin-standard": "^5.0.0",
|
|
53
59
|
"prettier": "2.3.0",
|