@electron-forge/maker-deb 6.0.0-beta.7 → 6.0.0-beta.71

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/src/Config.ts DELETED
@@ -1,127 +0,0 @@
1
- export interface MakerDebConfigOptions {
2
- /**
3
- * Name of the package (e.g. atom), used in the Package field of the control
4
- * specification.
5
- *
6
- * Package names [...] must consist only of lower case letters (a-z), digits
7
- * (0-9), plus (+) and minus (-) signs, and periods (.). They must be at
8
- * least two characters long and must start with an alphanumeric character.
9
- */
10
- name?: string;
11
- /**
12
- * Name of the application (e.g. Atom), used in the Name field of the desktop specification.
13
- */
14
- productName?: string;
15
- /**
16
- * Generic name of the application (e.g. Text Editor), used in the GenericName field of the desktop specification.
17
- */
18
- genericName?: string;
19
- /**
20
- * Short description of the application, used in the Description field of the control specification.
21
- */
22
- description?: string;
23
- /**
24
- * Long description of the application, used in the Description field of the control specification.
25
- */
26
- productDescription?: string;
27
- /**
28
- * Version number of the package, used in the Version field of the control specification.
29
- */
30
- version?: string;
31
- /**
32
- * Revision number of the package, used in the Version field of the control specification.
33
- */
34
- revision?: string;
35
- /**
36
- * Application area into which the package has been classified.
37
- *
38
- * Possible sections. Generated on https://packages.debian.org/unstable/ with:
39
- *
40
- * $$('#content dt a').map(n => {const ss = n.href.split('/'); return `'${ss[ss.length - 2]}'`; }).sort().join(' | ')
41
- */
42
- section?: 'admin' | 'cli-mono' | 'comm' | 'database' | 'debian-installer' | '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' | 'virtual' | 'web' | 'x11' | 'xfce' | 'zope';
43
- /**
44
- * How important is it to have the package installed.
45
- *
46
- * You can read more: https://www.debian.org/doc/debian-policy/#priorities
47
- */
48
- priority?: 'required' | 'important' | 'standard' | 'optional';
49
- /**
50
- * Estimate of the total amount of disk space required to install the named package,
51
- * used in the Installed-Size field of the control specification.
52
- */
53
- size?: number;
54
- /**
55
- * Relationships to other packages, used in the Depends field of the control specification.
56
- */
57
- depends?: string[];
58
- /**
59
- * Relationships to other packages, used in the Recommends field of the control specification.
60
- */
61
- recommends?: string[];
62
- /**
63
- * Relationships to other packages, used in the Suggests field of the control specification.
64
- */
65
- suggests?: string[];
66
- /**
67
- * Relationships to other packages, used in the Enhances field of the control specification.
68
- */
69
- enhances?: string[];
70
- /**
71
- * Relationships to other packages, used in the Pre-Depends field of the control specification.
72
- */
73
- preDepends?: string[];
74
- /**
75
- * Maintainer of the package, used in the Maintainer field of the control specification.
76
- */
77
- maintainer?: string;
78
- /**
79
- * URL of the homepage for the package, used in the Homepage field of the control specification.
80
- */
81
- homepage?: string;
82
- /**
83
- * Relative path to the executable that will act as binary for the application, used in the Exec field of the desktop specification.
84
- *
85
- * Defaults to options.name
86
- */
87
- bin?: string;
88
- /**
89
- * Path to a single image that will act as icon for the application:
90
- */
91
- icon?: string;
92
- /**
93
- * Categories in which the application should be shown in a menu, used in the Categories field of the desktop specification.
94
- *
95
- * Generated on https://specifications.freedesktop.org/menu-spec/latest/apa.html with:
96
- *
97
- * `(${$$('.informaltable tr td:first-child').map(td => `'${td.innerText}'`).join(' | ')})[]`
98
- */
99
- categories?: ('AudioVideo' | 'Audio' | 'Video' | 'Development' | 'Education' | 'Game' | 'Graphics' | 'Network' | 'Office' | 'Science' | 'Settings' | 'System' | 'Utility')[];
100
- /**
101
- * MIME types the application is able to open, used in the MimeType field of the desktop specification.
102
- */
103
- mimeType?: string[];
104
- /**
105
- * You can use these to quieten lintian.
106
- */
107
- lintianOverrides?: string[];
108
- /**
109
- * Path to package maintainer scripts with their corresponding name, used in the installation procedure:
110
- *
111
- * Read More: https://www.debian.org/doc/debian-policy/#package-maintainer-scripts-and-installation-procedure
112
- */
113
- scripts?: {
114
- preinst?: string;
115
- postinst?: string;
116
- prerm?: string;
117
- postrm?: string;
118
- };
119
- /**
120
- * The absolute path to a custom template for the generated FreeDesktop.org desktop entry file.
121
- */
122
- desktopTemplate?: string;
123
- }
124
-
125
- export interface MakerDebConfig {
126
- options?: MakerDebConfigOptions;
127
- }
package/src/MakerDeb.ts DELETED
@@ -1,51 +0,0 @@
1
- import MakerBase, { MakerOptions } from '@electron-forge/maker-base';
2
- import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types';
3
- import path from 'path';
4
-
5
- import { MakerDebConfig } from './Config';
6
-
7
- export function debianArch(nodeArch: ForgeArch) {
8
- switch (nodeArch) {
9
- case 'ia32': return 'i386';
10
- case 'x64': return 'amd64';
11
- case 'armv7l': return 'armhf';
12
- case 'arm': return 'armel';
13
- default: return nodeArch;
14
- }
15
- }
16
-
17
- export default class MakerDeb extends MakerBase<MakerDebConfig> {
18
- name = 'deb';
19
- defaultPlatforms: ForgePlatform[] = ['linux'];
20
-
21
- isSupportedOnCurrentPlatform() {
22
- return this.isInstalled('electron-installer-debian') && process.platform === 'linux';
23
- }
24
-
25
- async make({
26
- dir,
27
- makeDir,
28
- targetArch,
29
- packageJSON,
30
- }: MakerOptions) {
31
- const installer = require('electron-installer-debian');
32
-
33
- const arch = debianArch(targetArch);
34
- const name = (this.config.options || {}).name || packageJSON.name;
35
- const versionedName = `${name}_${packageJSON.version}_${arch}`;
36
- const outPath = path.resolve(makeDir, `${versionedName}.deb`);
37
-
38
- await this.ensureFile(outPath);
39
-
40
- await installer(Object.assign({
41
- options: {},
42
- }, this.config, {
43
- arch,
44
- src: dir,
45
- dest: path.dirname(outPath),
46
- rename: undefined,
47
- }));
48
-
49
- return [outPath];
50
- }
51
- }
@@ -1,100 +0,0 @@
1
- import MakerBase from '@electron-forge/maker-base';
2
-
3
- import { expect } from 'chai';
4
- import path from 'path';
5
- import proxyquire from 'proxyquire';
6
- import { stub, SinonStub } from 'sinon';
7
-
8
- import { MakerDebConfig } from '../src/Config';
9
- import { debianArch } from '../src/MakerDeb';
10
- import { ForgeArch } from '@electron-forge/shared-types';
11
-
12
- class MakerImpl extends MakerBase<MakerDebConfig> { name = 'test'; defaultPlatforms = []; }
13
-
14
- describe('MakerDeb', () => {
15
- let MakerDeb: typeof MakerImpl;
16
- let eidStub: SinonStub;
17
- let ensureFileStub: SinonStub;
18
- let config: MakerDebConfig;
19
- let maker: MakerImpl;
20
- let createMaker: () => void;
21
-
22
- const dir = '/my/test/dir/out';
23
- const makeDir = path.resolve('/foo/bar/make');
24
- const appName = 'My Test App';
25
- const targetArch = process.arch;
26
- const packageJSON = { version: '1.2.3' };
27
-
28
- beforeEach(() => {
29
- ensureFileStub = stub().returns(Promise.resolve());
30
- eidStub = stub().resolves();
31
- config = {};
32
-
33
- MakerDeb = proxyquire.noPreserveCache().noCallThru().load('../src/MakerDeb', {
34
- 'electron-installer-debian': eidStub,
35
- }).default;
36
- createMaker = () => {
37
- maker = new MakerDeb(config, []); // eslint-disable-line
38
- maker.ensureFile = ensureFileStub;
39
- };
40
- createMaker();
41
- });
42
-
43
- it('should pass through correct defaults', async () => {
44
- await (maker.make as any)({ dir, makeDir, appName, targetArch, packageJSON });
45
- const opts = eidStub.firstCall.args[0];
46
- expect(opts).to.deep.equal({
47
- arch: debianArch(process.arch as ForgeArch),
48
- options: {},
49
- src: dir,
50
- dest: makeDir,
51
- rename: undefined,
52
- });
53
- expect(maker.config).to.deep.equal(config);
54
- });
55
-
56
- it('should have config cascade correctly', async () => {
57
- config = {
58
- arch: 'overridden',
59
- options: {
60
- productName: 'Debian',
61
- },
62
- } as any;
63
-
64
- createMaker();
65
-
66
- await (maker.make as any)({ dir, makeDir, appName, targetArch, packageJSON });
67
- const opts = eidStub.firstCall.args[0];
68
- expect(opts).to.deep.equal({
69
- arch: debianArch(process.arch as ForgeArch),
70
- options: {
71
- productName: 'Debian',
72
- },
73
- src: dir,
74
- dest: makeDir,
75
- rename: undefined,
76
- });
77
- });
78
-
79
- describe('debianArch', () => {
80
- it('should convert ia32 to i386', () => {
81
- expect(debianArch('ia32')).to.equal('i386');
82
- });
83
-
84
- it('should convert x64 to amd64', () => {
85
- expect(debianArch('x64')).to.equal('amd64');
86
- });
87
-
88
- it('should convert arm to armel', () => {
89
- expect(debianArch('arm')).to.equal('armel');
90
- });
91
-
92
- it('should convert armv7l to armhf', () => {
93
- expect(debianArch('armv7l')).to.equal('armhf');
94
- });
95
-
96
- it('should leave unknown values alone', () => {
97
- expect(debianArch('foo' as ForgeArch)).to.equal('foo');
98
- });
99
- });
100
- });
package/tsconfig.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "commonjs",
4
- "target": "es6",
5
- "outDir": "dist",
6
- "lib": [
7
- "es6",
8
- "dom",
9
- "es7"
10
- ],
11
- "sourceMap": true,
12
- "rootDir": "src",
13
- "experimentalDecorators": true,
14
- "strict": true,
15
- "esModuleInterop": true,
16
- "declaration": true
17
- },
18
- "exclude": [
19
- "node_modules",
20
- "dist",
21
- "test"
22
- ]
23
- }
package/tslint.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "tslint-config-airbnb",
3
- "rules": {
4
- "no-boolean-literal-compare": false,
5
- "import-name": false,
6
- "align": false,
7
- "variable-name": [true, "ban-keywords", "check-format", "allow-pascal-case"],
8
- "no-this-assignment": [true, { "allow-destructuring": true }],
9
- "max-line-length": false,
10
- "no-parameter-reassignment": false
11
- }
12
- }