deboa 1.1.2 → 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 +3 -2
- 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 -6
- 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/esm/classes/Deboa.js +3 -2
- 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 -6
- 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/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Headers as TarStreamHeader, Pack } from 'tar-stream';
|
|
2
|
-
export interface IAddTarEntriesParams {
|
|
3
|
-
entries: TarStreamHeader[];
|
|
4
|
-
pack: Pack;
|
|
5
|
-
}
|
|
1
|
+
import { Headers as TarStreamHeader, Pack } from 'tar-stream';
|
|
2
|
+
export interface IAddTarEntriesParams {
|
|
3
|
+
entries: TarStreamHeader[];
|
|
4
|
+
pack: Pack;
|
|
5
|
+
}
|
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
import { MaintainerScript } from './MaintainerScript';
|
|
2
|
-
import { Priority } from './Priority';
|
|
3
|
-
import { Section } from './Section';
|
|
4
|
-
/**
|
|
5
|
-
* The descriptions are mostly just shameless copies from the following docs:
|
|
6
|
-
*
|
|
7
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html}
|
|
8
|
-
*
|
|
9
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html}
|
|
10
|
-
*
|
|
11
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
12
|
-
*/
|
|
13
|
-
export interface IControlFileOptions {
|
|
14
|
-
/**
|
|
15
|
-
* Target architecture. Defaults to the current system's architecture.
|
|
16
|
-
*
|
|
17
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-architecture}
|
|
18
|
-
*/
|
|
19
|
-
architecture?: string;
|
|
20
|
-
/**
|
|
21
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html#s-built-using}
|
|
22
|
-
*/
|
|
23
|
-
builtUsing?: string;
|
|
24
|
-
/**
|
|
25
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
26
|
-
*/
|
|
27
|
-
conflicts?: string[];
|
|
28
|
-
/**
|
|
29
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
30
|
-
*/
|
|
31
|
-
depends?: string[];
|
|
32
|
-
/**
|
|
33
|
-
* If set to `yes`, then the package management system will refuse to
|
|
34
|
-
* remove
|
|
35
|
-
* the package (upgrading and replacing it is still possible). The other
|
|
36
|
-
* possible value is `no`, which is the same as not having the field at
|
|
37
|
-
* all.
|
|
38
|
-
*
|
|
39
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-essential}
|
|
40
|
-
*/
|
|
41
|
-
essential?: 'yes' | 'no';
|
|
42
|
-
/**
|
|
43
|
-
* Extended description for the package. Defaults to the value provided for
|
|
44
|
-
* the `shortDescription` option.
|
|
45
|
-
*
|
|
46
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-description}
|
|
47
|
-
*/
|
|
48
|
-
extendedDescription?: string;
|
|
49
|
-
/**
|
|
50
|
-
* URL for this package.
|
|
51
|
-
*
|
|
52
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-homepage}
|
|
53
|
-
*/
|
|
54
|
-
homepage?: string;
|
|
55
|
-
/**
|
|
56
|
-
* The package maintainer's name and email address. The name must come
|
|
57
|
-
* first, then the email address inside angle brackets. **This field is
|
|
58
|
-
* mandatory.**
|
|
59
|
-
*
|
|
60
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-maintainer}
|
|
61
|
-
*/
|
|
62
|
-
maintainer: string;
|
|
63
|
-
/**
|
|
64
|
-
* Path to the scripts you want to execute before/after the system
|
|
65
|
-
* installs/upgrades/removes your package. There are quite a few rules
|
|
66
|
-
* here,
|
|
67
|
-
* so please check
|
|
68
|
-
* {@link
|
|
69
|
-
* https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html} for
|
|
70
|
-
* details.
|
|
71
|
-
*/
|
|
72
|
-
maintainerScripts?: Partial<Record<MaintainerScript, string>>;
|
|
73
|
-
/**
|
|
74
|
-
* Binary package name. Must be at least two characters long and must start
|
|
75
|
-
* with an alphanumeric character. Only lower case letters (a-z), digits
|
|
76
|
-
* (0-9), plus (+) and minus (-) signs, and periods (.) are allowed. **This
|
|
77
|
-
* field is mandatory.**
|
|
78
|
-
*
|
|
79
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source}
|
|
80
|
-
*/
|
|
81
|
-
packageName: string;
|
|
82
|
-
/**
|
|
83
|
-
* See {@link
|
|
84
|
-
* https://www.debian.org/doc/debian-policy/ch-relationships.html} for
|
|
85
|
-
* details.
|
|
86
|
-
*/
|
|
87
|
-
preDepends?: string[];
|
|
88
|
-
/**
|
|
89
|
-
* This field represents how important it is that the user have the package
|
|
90
|
-
* installed. Defaults to `optional`.
|
|
91
|
-
*
|
|
92
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-priority}
|
|
93
|
-
*/
|
|
94
|
-
priority?: Priority;
|
|
95
|
-
/**
|
|
96
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
97
|
-
*/
|
|
98
|
-
recommends?: string[];
|
|
99
|
-
/**
|
|
100
|
-
* This field specifies an application area into which the package has been
|
|
101
|
-
* classified. This is a recommended field.
|
|
102
|
-
*
|
|
103
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-section}
|
|
104
|
-
*/
|
|
105
|
-
section?: Section;
|
|
106
|
-
/**
|
|
107
|
-
* Short, single-line synopsys for the package. Usually ~80 characters.
|
|
108
|
-
* **This field is mandatory.**
|
|
109
|
-
*
|
|
110
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-description}
|
|
111
|
-
*/
|
|
112
|
-
shortDescription: string;
|
|
113
|
-
/**
|
|
114
|
-
* Source package name.
|
|
115
|
-
*
|
|
116
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source}
|
|
117
|
-
*/
|
|
118
|
-
source?: string;
|
|
119
|
-
/**
|
|
120
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
121
|
-
*/
|
|
122
|
-
suggests?: string[];
|
|
123
|
-
/**
|
|
124
|
-
* Version number of the package in the
|
|
125
|
-
* `[epoch:]upstream_version[-debian_revision]` format. See
|
|
126
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-version}
|
|
127
|
-
* for details. **This field is mandatory.**
|
|
128
|
-
*/
|
|
129
|
-
version: string;
|
|
130
|
-
}
|
|
1
|
+
import { MaintainerScript } from './MaintainerScript';
|
|
2
|
+
import { Priority } from './Priority';
|
|
3
|
+
import { Section } from './Section';
|
|
4
|
+
/**
|
|
5
|
+
* The descriptions are mostly just shameless copies from the following docs:
|
|
6
|
+
*
|
|
7
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html}
|
|
8
|
+
*
|
|
9
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html}
|
|
10
|
+
*
|
|
11
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
12
|
+
*/
|
|
13
|
+
export interface IControlFileOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Target architecture. Defaults to the current system's architecture.
|
|
16
|
+
*
|
|
17
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-architecture}
|
|
18
|
+
*/
|
|
19
|
+
architecture?: string;
|
|
20
|
+
/**
|
|
21
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html#s-built-using}
|
|
22
|
+
*/
|
|
23
|
+
builtUsing?: string;
|
|
24
|
+
/**
|
|
25
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
26
|
+
*/
|
|
27
|
+
conflicts?: string[];
|
|
28
|
+
/**
|
|
29
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
30
|
+
*/
|
|
31
|
+
depends?: string[];
|
|
32
|
+
/**
|
|
33
|
+
* If set to `yes`, then the package management system will refuse to
|
|
34
|
+
* remove
|
|
35
|
+
* the package (upgrading and replacing it is still possible). The other
|
|
36
|
+
* possible value is `no`, which is the same as not having the field at
|
|
37
|
+
* all.
|
|
38
|
+
*
|
|
39
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-essential}
|
|
40
|
+
*/
|
|
41
|
+
essential?: 'yes' | 'no';
|
|
42
|
+
/**
|
|
43
|
+
* Extended description for the package. Defaults to the value provided for
|
|
44
|
+
* the `shortDescription` option.
|
|
45
|
+
*
|
|
46
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-description}
|
|
47
|
+
*/
|
|
48
|
+
extendedDescription?: string;
|
|
49
|
+
/**
|
|
50
|
+
* URL for this package.
|
|
51
|
+
*
|
|
52
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-homepage}
|
|
53
|
+
*/
|
|
54
|
+
homepage?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The package maintainer's name and email address. The name must come
|
|
57
|
+
* first, then the email address inside angle brackets. **This field is
|
|
58
|
+
* mandatory.**
|
|
59
|
+
*
|
|
60
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-maintainer}
|
|
61
|
+
*/
|
|
62
|
+
maintainer: string;
|
|
63
|
+
/**
|
|
64
|
+
* Path to the scripts you want to execute before/after the system
|
|
65
|
+
* installs/upgrades/removes your package. There are quite a few rules
|
|
66
|
+
* here,
|
|
67
|
+
* so please check
|
|
68
|
+
* {@link
|
|
69
|
+
* https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html} for
|
|
70
|
+
* details.
|
|
71
|
+
*/
|
|
72
|
+
maintainerScripts?: Partial<Record<MaintainerScript, string>>;
|
|
73
|
+
/**
|
|
74
|
+
* Binary package name. Must be at least two characters long and must start
|
|
75
|
+
* with an alphanumeric character. Only lower case letters (a-z), digits
|
|
76
|
+
* (0-9), plus (+) and minus (-) signs, and periods (.) are allowed. **This
|
|
77
|
+
* field is mandatory.**
|
|
78
|
+
*
|
|
79
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source}
|
|
80
|
+
*/
|
|
81
|
+
packageName: string;
|
|
82
|
+
/**
|
|
83
|
+
* See {@link
|
|
84
|
+
* https://www.debian.org/doc/debian-policy/ch-relationships.html} for
|
|
85
|
+
* details.
|
|
86
|
+
*/
|
|
87
|
+
preDepends?: string[];
|
|
88
|
+
/**
|
|
89
|
+
* This field represents how important it is that the user have the package
|
|
90
|
+
* installed. Defaults to `optional`.
|
|
91
|
+
*
|
|
92
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-priority}
|
|
93
|
+
*/
|
|
94
|
+
priority?: Priority;
|
|
95
|
+
/**
|
|
96
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
97
|
+
*/
|
|
98
|
+
recommends?: string[];
|
|
99
|
+
/**
|
|
100
|
+
* This field specifies an application area into which the package has been
|
|
101
|
+
* classified. This is a recommended field.
|
|
102
|
+
*
|
|
103
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-section}
|
|
104
|
+
*/
|
|
105
|
+
section?: Section;
|
|
106
|
+
/**
|
|
107
|
+
* Short, single-line synopsys for the package. Usually ~80 characters.
|
|
108
|
+
* **This field is mandatory.**
|
|
109
|
+
*
|
|
110
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-description}
|
|
111
|
+
*/
|
|
112
|
+
shortDescription: string;
|
|
113
|
+
/**
|
|
114
|
+
* Source package name.
|
|
115
|
+
*
|
|
116
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-source}
|
|
117
|
+
*/
|
|
118
|
+
source?: string;
|
|
119
|
+
/**
|
|
120
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-relationships.html}
|
|
121
|
+
*/
|
|
122
|
+
suggests?: string[];
|
|
123
|
+
/**
|
|
124
|
+
* Version number of the package in the
|
|
125
|
+
* `[epoch:]upstream_version[-debian_revision]` format. See
|
|
126
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-version}
|
|
127
|
+
* for details. **This field is mandatory.**
|
|
128
|
+
*/
|
|
129
|
+
version: string;
|
|
130
|
+
}
|
|
@@ -1,133 +1,138 @@
|
|
|
1
|
-
import type { Headers as OriginalTarFSHeader } from 'tar-fs';
|
|
2
|
-
import type { Headers as TarStreamHeader } from 'tar-stream';
|
|
3
|
-
import { IControlFileOptions } from './IControlFileOptions';
|
|
4
|
-
declare type TarFSHeader = OriginalTarFSHeader & Pick<TarStreamHeader, 'uname' | 'gname'>;
|
|
5
|
-
/**
|
|
6
|
-
* @property {IDeboa["additionalTarEntries"]} [additionalTarEntries] -
|
|
7
|
-
* Additional entries to be added to the .tar archive. This is useful for
|
|
8
|
-
* creating symlinks on Windows. See the [Headers]{@link TarStreamHeader}
|
|
9
|
-
* interface from tar-stream for more details. Optional.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @property {IDeboa["beforeCreateDesktopEntry"]} [beforeCreateDesktopEntry] -
|
|
13
|
-
* Runs before the desktop entry file is created, allowing you to add more
|
|
14
|
-
* entries or modify the default entries if necessary. This can be a function
|
|
15
|
-
* or a path to a file that has a function as its default export. Check
|
|
16
|
-
* {@link https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html}
|
|
17
|
-
* for more details. Optional.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @property {IDeboa["beforePackage"]} [beforePackage] -
|
|
21
|
-
* Runs after the control file, maintainer scripts and sourceDir contents
|
|
22
|
-
* are copied to the temporary directory and before they're packaged. Receives
|
|
23
|
-
* the temporary directory path as an argument. This can be a function or a
|
|
24
|
-
* path to a file that has a function as its default export. Optional.
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @property {IDeboa["controlFileOptions"]} controlFileOptions -
|
|
28
|
-
* Control file fields.
|
|
29
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html}
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @property {IDeboa["icon"]} [icon] -
|
|
33
|
-
* Path to the image you want to use as your app icon. It is copied to
|
|
34
|
-
* /usr/share/pixmaps. Optional.
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* @property {IDeboa["installationRoot"]} [installationRoot] -
|
|
38
|
-
* Directory your files will be installed to. Defaults to `/usr/lib/${packageName}`.
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* @property {IDeboa["modifyTarHeader"]} [modifyTarHeader] -
|
|
42
|
-
* This callback makes it possible to modify file headers before they're
|
|
43
|
-
* written to the .tar archive, which is useful for setting permissions.
|
|
44
|
-
* This can be a function or a path to a file that has a function as its
|
|
45
|
-
* default export. See the [Headers]{@link TarFSHeader} interface from tar-fs
|
|
46
|
-
* and {@link https://github.com/mafintosh/tar-fs/blob/7ec11cb27f93948193770f32b4d820e2e7195715/README.md}
|
|
47
|
-
* for more details. Optional.
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @property {IDeboa["sourceDir"]} sourceDir -
|
|
51
|
-
* Location of the files you want to package. **This field is mandatory.**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* @property {IDeboa["tarballFormat"]} [tarballFormat] -
|
|
55
|
-
* Sets the format used for storing the files. This impacts the build time
|
|
56
|
-
* and .deb output size. Defaults to `tar.gz`.
|
|
57
|
-
*
|
|
58
|
-
* As a rule of thumb, you can expect the following from each format:
|
|
59
|
-
* - `tar` (no compression): lowest resources usage, faster build time, largest .deb size
|
|
60
|
-
* - `tar.gz` (gzip compression using zlib): low resources usage, good build time, good .deb size
|
|
61
|
-
* - `tar.xz` (xz compression using lzma-native): high resources usage, slowest build time, smallest .deb size
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* @property {IDeboa["targetDir"]} targetDir -
|
|
65
|
-
* Directory where your .deb file will be copied to.
|
|
66
|
-
* **This field is mandatory.**
|
|
67
|
-
*/
|
|
68
|
-
export interface IDeboa {
|
|
69
|
-
/**
|
|
70
|
-
* Additional entries to be added to the .tar archive. This is useful for
|
|
71
|
-
* creating symlinks on Windows. See the [Headers]{@link TarStreamHeader}
|
|
72
|
-
* interface from tar-stream for more details. Optional.
|
|
73
|
-
*/
|
|
74
|
-
additionalTarEntries?: TarStreamHeader[];
|
|
75
|
-
/**
|
|
76
|
-
* Runs before the desktop entry file is created, allowing you to add more
|
|
77
|
-
* entries or modify the default entries if necessary. This can be a function
|
|
78
|
-
* or a path to a file that has a function as its default export. Check
|
|
79
|
-
* {@link https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html}
|
|
80
|
-
* for more details. Optional.
|
|
81
|
-
*/
|
|
82
|
-
beforeCreateDesktopEntry?: string | (<T extends Record<string, string>>(desktopEntries: T) => Promise<T> | T);
|
|
83
|
-
/**
|
|
84
|
-
* Runs after the control file, maintainer scripts and sourceDir contents
|
|
85
|
-
* are copied to the temporary directory and before they're packaged. Receives
|
|
86
|
-
* the temporary directory path as an argument. This can be a function or a
|
|
87
|
-
* path to a file that has a function as its default export. Optional.
|
|
88
|
-
*/
|
|
89
|
-
beforePackage?: string | ((tempDir: string) => Promise<void> | void);
|
|
90
|
-
/**
|
|
91
|
-
* Control file fields.
|
|
92
|
-
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html}
|
|
93
|
-
*/
|
|
94
|
-
controlFileOptions: IControlFileOptions;
|
|
95
|
-
/**
|
|
96
|
-
* Path to the image you want to use as your app icon. It is copied to
|
|
97
|
-
* /usr/share/pixmaps. Optional.
|
|
98
|
-
*/
|
|
99
|
-
icon?: string;
|
|
100
|
-
/**
|
|
101
|
-
* Directory your files will be installed to. Defaults to `/usr/lib/${packageName}`.
|
|
102
|
-
*/
|
|
103
|
-
installationRoot?: string;
|
|
104
|
-
/**
|
|
105
|
-
* This callback makes it possible to modify file headers before they're
|
|
106
|
-
* written to the .tar archive, which is useful for setting permissions.
|
|
107
|
-
* This can be a function or a path to a file that has a function as its
|
|
108
|
-
* default export. See the [Headers]{@link TarFSHeader} interface from tar-fs
|
|
109
|
-
* and {@link https://github.com/mafintosh/tar-fs/blob/7ec11cb27f93948193770f32b4d820e2e7195715/README.md}
|
|
110
|
-
* for more details. Optional.
|
|
111
|
-
*/
|
|
112
|
-
modifyTarHeader?: string | ((header: TarFSHeader) => TarFSHeader);
|
|
113
|
-
/**
|
|
114
|
-
* Location of the files you want to package. **This field is mandatory.**
|
|
115
|
-
*/
|
|
116
|
-
sourceDir: string;
|
|
117
|
-
/**
|
|
118
|
-
* Sets the format used for storing the files. This impacts the build time
|
|
119
|
-
* and .deb output size. Defaults to `tar.gz`.
|
|
120
|
-
*
|
|
121
|
-
* As a rule of thumb, you can expect the following from each format:
|
|
122
|
-
* - `tar` (no compression): lowest resources usage, faster build time, largest .deb size
|
|
123
|
-
* - `tar.gz` (gzip compression using zlib): low resources usage, good build time, good .deb size
|
|
124
|
-
* - `tar.xz` (xz compression using lzma-native): high resources usage, slowest build time, smallest .deb size
|
|
125
|
-
*/
|
|
126
|
-
tarballFormat?: 'tar' | 'tar.gz' | 'tar.xz';
|
|
127
|
-
/**
|
|
128
|
-
* Directory where your .deb file will be copied to.
|
|
129
|
-
* **This field is mandatory.**
|
|
130
|
-
*/
|
|
131
|
-
targetDir: string;
|
|
132
|
-
|
|
133
|
-
|
|
1
|
+
import type { Headers as OriginalTarFSHeader } from 'tar-fs';
|
|
2
|
+
import type { Headers as TarStreamHeader } from 'tar-stream';
|
|
3
|
+
import { IControlFileOptions } from './IControlFileOptions';
|
|
4
|
+
declare type TarFSHeader = OriginalTarFSHeader & Pick<TarStreamHeader, 'uname' | 'gname'>;
|
|
5
|
+
/**
|
|
6
|
+
* @property {IDeboa["additionalTarEntries"]} [additionalTarEntries] -
|
|
7
|
+
* Additional entries to be added to the .tar archive. This is useful for
|
|
8
|
+
* creating symlinks on Windows. See the [Headers]{@link TarStreamHeader}
|
|
9
|
+
* interface from tar-stream for more details. Optional.
|
|
10
|
+
*
|
|
11
|
+
*
|
|
12
|
+
* @property {IDeboa["beforeCreateDesktopEntry"]} [beforeCreateDesktopEntry] -
|
|
13
|
+
* Runs before the desktop entry file is created, allowing you to add more
|
|
14
|
+
* entries or modify the default entries if necessary. This can be a function
|
|
15
|
+
* or a path to a file that has a function as its default export. Check
|
|
16
|
+
* {@link https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html}
|
|
17
|
+
* for more details. Optional.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* @property {IDeboa["beforePackage"]} [beforePackage] -
|
|
21
|
+
* Runs after the control file, maintainer scripts and sourceDir contents
|
|
22
|
+
* are copied to the temporary directory and before they're packaged. Receives
|
|
23
|
+
* the temporary directory path as an argument. This can be a function or a
|
|
24
|
+
* path to a file that has a function as its default export. Optional.
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
* @property {IDeboa["controlFileOptions"]} controlFileOptions -
|
|
28
|
+
* Control file fields.
|
|
29
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html}
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* @property {IDeboa["icon"]} [icon] -
|
|
33
|
+
* Path to the image you want to use as your app icon. It is copied to
|
|
34
|
+
* /usr/share/pixmaps. Optional.
|
|
35
|
+
*
|
|
36
|
+
*
|
|
37
|
+
* @property {IDeboa["installationRoot"]} [installationRoot] -
|
|
38
|
+
* Directory your files will be installed to. Defaults to `/usr/lib/${packageName}`.
|
|
39
|
+
*
|
|
40
|
+
*
|
|
41
|
+
* @property {IDeboa["modifyTarHeader"]} [modifyTarHeader] -
|
|
42
|
+
* This callback makes it possible to modify file headers before they're
|
|
43
|
+
* written to the .tar archive, which is useful for setting permissions.
|
|
44
|
+
* This can be a function or a path to a file that has a function as its
|
|
45
|
+
* default export. See the [Headers]{@link TarFSHeader} interface from tar-fs
|
|
46
|
+
* and {@link https://github.com/mafintosh/tar-fs/blob/7ec11cb27f93948193770f32b4d820e2e7195715/README.md}
|
|
47
|
+
* for more details. Optional.
|
|
48
|
+
*
|
|
49
|
+
*
|
|
50
|
+
* @property {IDeboa["sourceDir"]} sourceDir -
|
|
51
|
+
* Location of the files you want to package. **This field is mandatory.**
|
|
52
|
+
*
|
|
53
|
+
*
|
|
54
|
+
* @property {IDeboa["tarballFormat"]} [tarballFormat] -
|
|
55
|
+
* Sets the format used for storing the files. This impacts the build time
|
|
56
|
+
* and .deb output size. Defaults to `tar.gz`.
|
|
57
|
+
*
|
|
58
|
+
* As a rule of thumb, you can expect the following from each format:
|
|
59
|
+
* - `tar` (no compression): lowest resources usage, faster build time, largest .deb size
|
|
60
|
+
* - `tar.gz` (gzip compression using zlib): low resources usage, good build time, good .deb size
|
|
61
|
+
* - `tar.xz` (xz compression using lzma-native): high resources usage, slowest build time, smallest .deb size
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* @property {IDeboa["targetDir"]} targetDir -
|
|
65
|
+
* Directory where your .deb file will be copied to.
|
|
66
|
+
* **This field is mandatory.**
|
|
67
|
+
*/
|
|
68
|
+
export interface IDeboa {
|
|
69
|
+
/**
|
|
70
|
+
* Additional entries to be added to the .tar archive. This is useful for
|
|
71
|
+
* creating symlinks on Windows. See the [Headers]{@link TarStreamHeader}
|
|
72
|
+
* interface from tar-stream for more details. Optional.
|
|
73
|
+
*/
|
|
74
|
+
additionalTarEntries?: TarStreamHeader[];
|
|
75
|
+
/**
|
|
76
|
+
* Runs before the desktop entry file is created, allowing you to add more
|
|
77
|
+
* entries or modify the default entries if necessary. This can be a function
|
|
78
|
+
* or a path to a file that has a function as its default export. Check
|
|
79
|
+
* {@link https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html}
|
|
80
|
+
* for more details. Optional.
|
|
81
|
+
*/
|
|
82
|
+
beforeCreateDesktopEntry?: string | (<T extends Record<string, string>>(desktopEntries: T) => Promise<T> | T);
|
|
83
|
+
/**
|
|
84
|
+
* Runs after the control file, maintainer scripts and sourceDir contents
|
|
85
|
+
* are copied to the temporary directory and before they're packaged. Receives
|
|
86
|
+
* the temporary directory path as an argument. This can be a function or a
|
|
87
|
+
* path to a file that has a function as its default export. Optional.
|
|
88
|
+
*/
|
|
89
|
+
beforePackage?: string | ((tempDir: string) => Promise<void> | void);
|
|
90
|
+
/**
|
|
91
|
+
* Control file fields.
|
|
92
|
+
* {@link https://www.debian.org/doc/debian-policy/ch-controlfields.html}
|
|
93
|
+
*/
|
|
94
|
+
controlFileOptions: IControlFileOptions;
|
|
95
|
+
/**
|
|
96
|
+
* Path to the image you want to use as your app icon. It is copied to
|
|
97
|
+
* /usr/share/pixmaps. Optional.
|
|
98
|
+
*/
|
|
99
|
+
icon?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Directory your files will be installed to. Defaults to `/usr/lib/${packageName}`.
|
|
102
|
+
*/
|
|
103
|
+
installationRoot?: string;
|
|
104
|
+
/**
|
|
105
|
+
* This callback makes it possible to modify file headers before they're
|
|
106
|
+
* written to the .tar archive, which is useful for setting permissions.
|
|
107
|
+
* This can be a function or a path to a file that has a function as its
|
|
108
|
+
* default export. See the [Headers]{@link TarFSHeader} interface from tar-fs
|
|
109
|
+
* and {@link https://github.com/mafintosh/tar-fs/blob/7ec11cb27f93948193770f32b4d820e2e7195715/README.md}
|
|
110
|
+
* for more details. Optional.
|
|
111
|
+
*/
|
|
112
|
+
modifyTarHeader?: string | ((header: TarFSHeader) => TarFSHeader);
|
|
113
|
+
/**
|
|
114
|
+
* Location of the files you want to package. **This field is mandatory.**
|
|
115
|
+
*/
|
|
116
|
+
sourceDir: string;
|
|
117
|
+
/**
|
|
118
|
+
* Sets the format used for storing the files. This impacts the build time
|
|
119
|
+
* and .deb output size. Defaults to `tar.gz`.
|
|
120
|
+
*
|
|
121
|
+
* As a rule of thumb, you can expect the following from each format:
|
|
122
|
+
* - `tar` (no compression): lowest resources usage, faster build time, largest .deb size
|
|
123
|
+
* - `tar.gz` (gzip compression using zlib): low resources usage, good build time, good .deb size
|
|
124
|
+
* - `tar.xz` (xz compression using lzma-native): high resources usage, slowest build time, smallest .deb size
|
|
125
|
+
*/
|
|
126
|
+
tarballFormat?: 'tar' | 'tar.gz' | 'tar.xz';
|
|
127
|
+
/**
|
|
128
|
+
* Directory where your .deb file will be copied to.
|
|
129
|
+
* **This field is mandatory.**
|
|
130
|
+
*/
|
|
131
|
+
targetDir: string;
|
|
132
|
+
/**
|
|
133
|
+
* Filename without the `.deb` extension. Defaults to
|
|
134
|
+
* `${packageName}_${version}_${architecture}`.
|
|
135
|
+
*/
|
|
136
|
+
targetFileName?: string;
|
|
137
|
+
}
|
|
138
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IWriteToArchive } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* @property {string} outputFile - Path to the output file.
|
|
4
|
-
*/
|
|
5
|
-
export interface IDeboaFromFile extends Pick<IWriteToArchive, 'isARFile'> {
|
|
6
|
-
/** Path to the output file. */
|
|
7
|
-
outputFile: string;
|
|
8
|
-
}
|
|
1
|
+
import { IWriteToArchive } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* @property {string} outputFile - Path to the output file.
|
|
4
|
+
*/
|
|
5
|
+
export interface IDeboaFromFile extends Pick<IWriteToArchive, 'isARFile'> {
|
|
6
|
+
/** Path to the output file. */
|
|
7
|
+
outputFile: string;
|
|
8
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface INormalizeOptionLength {
|
|
2
|
-
fileMode?: string | number;
|
|
3
|
-
fileName: string;
|
|
4
|
-
fileSize: string | number;
|
|
5
|
-
groupID?: string | number;
|
|
6
|
-
ownerID?: string | number;
|
|
7
|
-
timestamp?: string | number;
|
|
8
|
-
}
|
|
1
|
+
export interface INormalizeOptionLength {
|
|
2
|
+
fileMode?: string | number;
|
|
3
|
+
fileName: string;
|
|
4
|
+
fileSize: string | number;
|
|
5
|
+
groupID?: string | number;
|
|
6
|
+
ownerID?: string | number;
|
|
7
|
+
timestamp?: string | number;
|
|
8
|
+
}
|
|
@@ -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';
|