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.
Files changed (41) hide show
  1. package/dist/cjs/classes/Deboa.js +3 -2
  2. package/dist/cjs/types/classes/Deboa.d.ts +46 -44
  3. package/dist/cjs/types/classes/DeboaFromFile.d.ts +23 -23
  4. package/dist/cjs/types/index.d.ts +4 -4
  5. package/dist/cjs/types/types/IAddTarEntriesParams.d.ts +5 -5
  6. package/dist/cjs/types/types/IControlFileOptions.d.ts +130 -130
  7. package/dist/cjs/types/types/IDeboa.d.ts +138 -133
  8. package/dist/cjs/types/types/IDeboaFromFile.d.ts +8 -8
  9. package/dist/cjs/types/types/INormalizeOptionsLength.d.ts +8 -8
  10. package/dist/cjs/types/types/IWriteFileFromLinesArgs.d.ts +10 -10
  11. package/dist/cjs/types/types/IWriteToArchive.d.ts +19 -19
  12. package/dist/cjs/types/types/MaintainerScript.d.ts +1 -1
  13. package/dist/cjs/types/types/Priority.d.ts +1 -1
  14. package/dist/cjs/types/types/Section.d.ts +1 -1
  15. package/dist/cjs/types/types/index.d.ts +10 -10
  16. package/dist/cjs/types/utils/addTarEntries.d.ts +5 -5
  17. package/dist/cjs/types/utils/changeOwnerToRoot.d.ts +6 -6
  18. package/dist/cjs/types/utils/createFileHeader.d.ts +2 -2
  19. package/dist/cjs/types/utils/writeFileFromLines.d.ts +5 -5
  20. package/dist/cjs/types/utils/writeToArchive.d.ts +5 -5
  21. package/dist/esm/classes/Deboa.js +3 -2
  22. package/dist/esm/types/classes/Deboa.d.ts +46 -44
  23. package/dist/esm/types/classes/DeboaFromFile.d.ts +23 -23
  24. package/dist/esm/types/index.d.ts +4 -4
  25. package/dist/esm/types/types/IAddTarEntriesParams.d.ts +5 -5
  26. package/dist/esm/types/types/IControlFileOptions.d.ts +130 -130
  27. package/dist/esm/types/types/IDeboa.d.ts +138 -133
  28. package/dist/esm/types/types/IDeboaFromFile.d.ts +8 -8
  29. package/dist/esm/types/types/INormalizeOptionsLength.d.ts +8 -8
  30. package/dist/esm/types/types/IWriteFileFromLinesArgs.d.ts +10 -10
  31. package/dist/esm/types/types/IWriteToArchive.d.ts +19 -19
  32. package/dist/esm/types/types/MaintainerScript.d.ts +1 -1
  33. package/dist/esm/types/types/Priority.d.ts +1 -1
  34. package/dist/esm/types/types/Section.d.ts +1 -1
  35. package/dist/esm/types/types/index.d.ts +10 -10
  36. package/dist/esm/types/utils/addTarEntries.d.ts +5 -5
  37. package/dist/esm/types/utils/changeOwnerToRoot.d.ts +6 -6
  38. package/dist/esm/types/utils/createFileHeader.d.ts +2 -2
  39. package/dist/esm/types/utils/writeFileFromLines.d.ts +5 -5
  40. package/dist/esm/types/utils/writeToArchive.d.ts +5 -5
  41. package/package.json +5 -5
@@ -99,6 +99,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
99
99
  /** See {@link IDeboa.sourceDir} */ sourceDir = null;
100
100
  /** See {@link IDeboa.tarballFormat} */ tarballFormat = null;
101
101
  /** See {@link IDeboa.targetDir} */ targetDir = null;
102
+ /** See {@link IDeboa.targetFileName} */ targetFileName = null;
102
103
  #appFolderDestination = null;
103
104
  #controlFolderDestination = null;
104
105
  #dataFolderDestination = null;
@@ -148,7 +149,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
148
149
  }
149
150
  this.#tempDir = _path.default.join(_os.default.tmpdir(), 'deboa_temp');
150
151
  const { architecture , packageName , version } = this.controlFileOptions;
151
- this.#outputFile = _path.default.join(this.targetDir, `${packageName}_${version}_${architecture}.deb`);
152
+ this.#outputFile = _path.default.join(this.targetDir, `${options.targetFileName || `${packageName}_${version}_${architecture}`}.deb`);
152
153
  this.#controlFolderDestination = _path.default.join(this.#tempDir, 'control');
153
154
  this.#dataFolderDestination = _path.default.join(this.#tempDir, 'data');
154
155
  this.#appFolderDestination = _path.default.join(this.#dataFolderDestination, ...options.installationRoot ? [
@@ -166,7 +167,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
166
167
  console.log('Validating options...\n');
167
168
  const { controlFileOptions: { shortDescription , maintainer , packageName , version , } , } = options;
168
169
  if (!packageName) {
169
- throw new Error('The controlFileOptions.`packageName` field is mandatory');
170
+ throw new Error('The `controlFileOptions.packageName` field is mandatory');
170
171
  }
171
172
  if (!version) {
172
173
  throw new Error('The `controlFileOptions.version` field is mandatory');
@@ -1,44 +1,46 @@
1
- /**
2
- * Some useful references:
3
- *
4
- * https://radagast.ca/linux/anatomy_of_a_deb_file.html
5
- * https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ar.html
6
- * https://www.unix.com/man-page/opensolaris/3head/ar.h/
7
- */
8
- import type { IDeboa } from '../types';
9
- /**
10
- * @return IDeboa
11
- */
12
- declare class Deboa implements IDeboa {
13
- #private;
14
- /** See {@link IDeboa.additionalTarEntries} */
15
- additionalTarEntries: IDeboa['additionalTarEntries'];
16
- /** See {@link IDeboa.beforeCreateDesktopEntry} */
17
- beforeCreateDesktopEntry: IDeboa['beforeCreateDesktopEntry'];
18
- /** See {@link IDeboa.beforePackage} */
19
- beforePackage: IDeboa['beforePackage'];
20
- /** See {@link IDeboa.controlFileOptions} */
21
- controlFileOptions: IDeboa['controlFileOptions'];
22
- /** See {@link IDeboa.icon} */
23
- icon: IDeboa['icon'];
24
- /** See {@link IDeboa.modifyTarHeader} */
25
- modifyTarHeader: IDeboa['modifyTarHeader'];
26
- /** See {@link IDeboa.sourceDir} */
27
- sourceDir: IDeboa['sourceDir'];
28
- /** See {@link IDeboa.tarballFormat} */
29
- tarballFormat: IDeboa['tarballFormat'];
30
- /** See {@link IDeboa.targetDir} */
31
- targetDir: IDeboa['targetDir'];
32
- constructor(options: IDeboa);
33
- /**
34
- * Creates the .deb file.
35
- * @return {Promise<string>} outputFile - Absolute path to the generated .deb
36
- */
37
- package(): Promise<string>;
38
- /**
39
- * Checks if the values provided to the hook options are file paths
40
- * and imports the actual functions from them if necessary.
41
- */
42
- loadHooks(): Promise<void>;
43
- }
44
- export { Deboa };
1
+ /**
2
+ * Some useful references:
3
+ *
4
+ * https://radagast.ca/linux/anatomy_of_a_deb_file.html
5
+ * https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ar.html
6
+ * https://www.unix.com/man-page/opensolaris/3head/ar.h/
7
+ */
8
+ import type { IDeboa } from '../types';
9
+ /**
10
+ * @return IDeboa
11
+ */
12
+ declare class Deboa implements IDeboa {
13
+ #private;
14
+ /** See {@link IDeboa.additionalTarEntries} */
15
+ additionalTarEntries: IDeboa['additionalTarEntries'];
16
+ /** See {@link IDeboa.beforeCreateDesktopEntry} */
17
+ beforeCreateDesktopEntry: IDeboa['beforeCreateDesktopEntry'];
18
+ /** See {@link IDeboa.beforePackage} */
19
+ beforePackage: IDeboa['beforePackage'];
20
+ /** See {@link IDeboa.controlFileOptions} */
21
+ controlFileOptions: IDeboa['controlFileOptions'];
22
+ /** See {@link IDeboa.icon} */
23
+ icon: IDeboa['icon'];
24
+ /** See {@link IDeboa.modifyTarHeader} */
25
+ modifyTarHeader: IDeboa['modifyTarHeader'];
26
+ /** See {@link IDeboa.sourceDir} */
27
+ sourceDir: IDeboa['sourceDir'];
28
+ /** See {@link IDeboa.tarballFormat} */
29
+ tarballFormat: IDeboa['tarballFormat'];
30
+ /** See {@link IDeboa.targetDir} */
31
+ targetDir: IDeboa['targetDir'];
32
+ /** See {@link IDeboa.targetFileName} */
33
+ targetFileName: IDeboa['targetFileName'];
34
+ constructor(options: IDeboa);
35
+ /**
36
+ * Creates the .deb file.
37
+ * @return {Promise<string>} outputFile - Absolute path to the generated .deb
38
+ */
39
+ package(): Promise<string>;
40
+ /**
41
+ * Checks if the values provided to the hook options are file paths
42
+ * and imports the actual functions from them if necessary.
43
+ */
44
+ loadHooks(): Promise<void>;
45
+ }
46
+ export { Deboa };
@@ -1,23 +1,23 @@
1
- /// <reference types="node" />
2
- import type { ReadStream } from 'fs';
3
- import type { IWriteToArchive, IDeboaFromFile } from '../types';
4
- /**
5
- * @return IDeboaFromFile
6
- */
7
- export declare class DeboaFromFile implements IDeboaFromFile {
8
- #private;
9
- isARFile: IDeboaFromFile['isARFile'];
10
- outputFile: IDeboaFromFile['outputFile'];
11
- writeStream: IWriteToArchive['writeStream'];
12
- constructor(options: IDeboaFromFile);
13
- /**
14
- * Creates a ReadStream from the input file.
15
- * Useful if you need access to the underlying stream.
16
- */
17
- createReadStream(inputFile: string): Promise<ReadStream>;
18
- writeFromStream(readStream: ReadStream): Promise<void>;
19
- /**
20
- * Writes the input file to the .deb.
21
- */
22
- writeFromFile(inputFile: string): Promise<void>;
23
- }
1
+ /// <reference types="node" />
2
+ import type { ReadStream } from 'fs';
3
+ import type { IWriteToArchive, IDeboaFromFile } from '../types';
4
+ /**
5
+ * @return IDeboaFromFile
6
+ */
7
+ export declare class DeboaFromFile implements IDeboaFromFile {
8
+ #private;
9
+ isARFile: IDeboaFromFile['isARFile'];
10
+ outputFile: IDeboaFromFile['outputFile'];
11
+ writeStream: IWriteToArchive['writeStream'];
12
+ constructor(options: IDeboaFromFile);
13
+ /**
14
+ * Creates a ReadStream from the input file.
15
+ * Useful if you need access to the underlying stream.
16
+ */
17
+ createReadStream(inputFile: string): Promise<ReadStream>;
18
+ writeFromStream(readStream: ReadStream): Promise<void>;
19
+ /**
20
+ * Writes the input file to the .deb.
21
+ */
22
+ writeFromFile(inputFile: string): Promise<void>;
23
+ }
@@ -1,4 +1,4 @@
1
- import { Deboa } from './classes/Deboa';
2
- import { DeboaFromFile } from './classes/DeboaFromFile';
3
- export { Deboa, DeboaFromFile };
4
- export * from './types';
1
+ import { Deboa } from './classes/Deboa';
2
+ import { DeboaFromFile } from './classes/DeboaFromFile';
3
+ export { Deboa, DeboaFromFile };
4
+ export * from './types';
@@ -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
+ }