npm-pkgbuild 13.0.19 → 13.0.21
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 +23 -8
- package/package.json +24 -18
- package/src/content/content-provider.mjs +1 -1
- package/src/extract-from-package.mjs +2 -2
- package/src/npm-pkgbuild-cli.mjs +2 -2
- package/src/output/arch.mjs +5 -0
- package/src/output/buildah.mjs +3 -0
- package/src/output/debian.mjs +3 -0
- package/src/output/oci.mjs +3 -0
- package/src/output/packager.mjs +1 -0
- package/src/publish.mjs +1 -5
- package/src/util.mjs +3 -3
- package/types/content/content-provider.d.mts +17 -0
- package/types/content/file-content-provider.d.mts +11 -0
- package/types/content/nft-content-provider.d.mts +12 -0
- package/types/content/node-modules-content-provider.d.mts +10 -0
- package/types/content/npm-pack-content-provider.d.mts +12 -0
- package/types/extract-from-package.d.mts +70 -0
- package/types/module.d.mts +14 -0
- package/types/npm-pkgbuild-cli.d.mts +2 -0
- package/types/npm-shrink.d.mts +4 -0
- package/types/output/arch.d.mts +120 -0
- package/types/output/buildah.d.mts +6 -0
- package/types/output/debian.d.mts +106 -0
- package/types/output/docker.d.mts +28 -0
- package/types/output/oci.d.mts +11 -0
- package/types/output/packager.d.mts +53 -0
- package/types/output/rpm.d.mts +89 -0
- package/types/package.d.mts +6 -0
- package/types/publish.d.mts +19 -0
- package/types/util.d.mts +54 -0
- package/types/utis.d.mts +6 -0
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
[](https://www.npmjs.com/package/npm-pkgbuild)
|
|
2
2
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
3
|
+
[](https://typescriptlang.org)
|
|
3
4
|
[](https://bundlejs.com/?q=npm-pkgbuild)
|
|
4
5
|
[](https://npmjs.org/package/npm-pkgbuild)
|
|
5
6
|
[](https://github.com/arlac77/npm-pkgbuild/issues)
|
|
@@ -127,10 +128,12 @@ See [mf-hosting](https://www.npmjs.com/package/mf-hosting) or [mf-hosting-fronte
|
|
|
127
128
|
* [fields](#fields-1)
|
|
128
129
|
* [fields](#fields-2)
|
|
129
130
|
* [fields](#fields-3)
|
|
131
|
+
* [BUILDAH](#buildah)
|
|
130
132
|
* [hookMapping](#hookmapping)
|
|
131
133
|
* [hookMapping](#hookmapping-1)
|
|
132
|
-
* [
|
|
133
|
-
* [
|
|
134
|
+
* [DEBIAN](#debian)
|
|
135
|
+
* [prepare](#prepare)
|
|
136
|
+
* [Parameters](#parameters-10)
|
|
134
137
|
* [Field](#field)
|
|
135
138
|
* [Properties](#properties-5)
|
|
136
139
|
* [Packager](#packager)
|
|
@@ -163,7 +166,7 @@ Source of package content.
|
|
|
163
166
|
|
|
164
167
|
List all entries.
|
|
165
168
|
|
|
166
|
-
Returns **
|
|
169
|
+
Returns **AsyncIterable\<ContentEntry>** all entries
|
|
167
170
|
|
|
168
171
|
## FileContentProvider
|
|
169
172
|
|
|
@@ -220,9 +223,9 @@ Extract shell functions from a given text.
|
|
|
220
223
|
|
|
221
224
|
### Parameters
|
|
222
225
|
|
|
223
|
-
* `source` **
|
|
226
|
+
* `source` **AsyncIterable<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** 
|
|
224
227
|
|
|
225
|
-
Returns **
|
|
228
|
+
Returns **AsyncIterable<[FunctionDecl](#functiondecl)>** 
|
|
226
229
|
|
|
227
230
|
## fieldProvider
|
|
228
231
|
|
|
@@ -250,7 +253,7 @@ Destination paths a generated without leading '/' (as for entry names too).
|
|
|
250
253
|
|
|
251
254
|
### Parameters
|
|
252
255
|
|
|
253
|
-
* `source` **
|
|
256
|
+
* `source` **AsyncIterable\<ContentEntry>** 
|
|
254
257
|
* `destinationDirectory` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
255
258
|
* `expander` **[Expander](#expander)** (optional, default `v=>v`)
|
|
256
259
|
|
|
@@ -332,6 +335,12 @@ well known package properties
|
|
|
332
335
|
|
|
333
336
|
* **See**: <https://rpm-packaging-guide.github.io>
|
|
334
337
|
|
|
338
|
+
## BUILDAH
|
|
339
|
+
|
|
340
|
+
**Extends DOCKER**
|
|
341
|
+
|
|
342
|
+
Use buildah @see <https://buildah.io>
|
|
343
|
+
|
|
335
344
|
## hookMapping
|
|
336
345
|
|
|
337
346
|
map install hook named from arch to deb
|
|
@@ -340,9 +349,15 @@ map install hook named from arch to deb
|
|
|
340
349
|
|
|
341
350
|
map install hook named from arch to rpm
|
|
342
351
|
|
|
343
|
-
##
|
|
352
|
+
## DEBIAN
|
|
344
353
|
|
|
345
|
-
|
|
354
|
+
**Extends Packager**
|
|
355
|
+
|
|
356
|
+
Create .deb packages
|
|
357
|
+
|
|
358
|
+
### prepare
|
|
359
|
+
|
|
360
|
+
#### Parameters
|
|
346
361
|
|
|
347
362
|
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
348
363
|
* `variant` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-pkgbuild",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.21",
|
|
4
4
|
"publishConfig": {
|
|
5
|
-
"access": "public"
|
|
5
|
+
"access": "public",
|
|
6
|
+
"provenance": true
|
|
6
7
|
},
|
|
8
|
+
"types": "./types/module.d.mts",
|
|
7
9
|
"exports": {
|
|
8
|
-
".":
|
|
10
|
+
".": {
|
|
11
|
+
"default": "./src/module.mjs",
|
|
12
|
+
"types": "./types/module.d.mts"
|
|
13
|
+
}
|
|
9
14
|
},
|
|
10
15
|
"description": "create ArchLinux, RPM and Debian packages from npm packages",
|
|
11
16
|
"keywords": [
|
|
@@ -34,53 +39,54 @@
|
|
|
34
39
|
"npm-pkgbuild": "src/npm-pkgbuild-cli.mjs"
|
|
35
40
|
},
|
|
36
41
|
"scripts": {
|
|
42
|
+
"prepare": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs --rootDir src",
|
|
37
43
|
"test": "npm run test:ava",
|
|
38
44
|
"test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
|
|
39
45
|
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
|
|
40
46
|
"docs": "documentation readme --section=API ./src/**/*.mjs",
|
|
41
47
|
"lint": "npm run lint:docs && npm run lint:tsc",
|
|
42
48
|
"lint:docs": "documentation lint ./src/**/*.mjs",
|
|
43
|
-
"lint:tsc": "tsc --allowJs --checkJs --noEmit -t esnext -m esnext --moduleResolution nodenext ./src
|
|
49
|
+
"lint:tsc": "tsc --allowJs --checkJs --noEmit -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs",
|
|
44
50
|
"tsc:types": "tsc -d --allowJs --declarationDir dist --emitDeclarationOnly ./src/extract-from-package.mjs"
|
|
45
51
|
},
|
|
46
52
|
"dependencies": {
|
|
47
|
-
"@npmcli/arborist": "^7.
|
|
48
|
-
"@vercel/nft": "^0.26.
|
|
49
|
-
"aggregate-async-iterator": "^1.
|
|
50
|
-
"commander": "^
|
|
53
|
+
"@npmcli/arborist": "^7.4.0",
|
|
54
|
+
"@vercel/nft": "^0.26.4",
|
|
55
|
+
"aggregate-async-iterator": "^1.2.0",
|
|
56
|
+
"commander": "^12.0.0",
|
|
51
57
|
"compare-versions": "^6.1.0",
|
|
52
58
|
"content-entry": "^6.0.0",
|
|
53
59
|
"content-entry-filesystem": "^6.0.0",
|
|
54
60
|
"content-entry-transform": "^1.4.29",
|
|
55
61
|
"execa": "^8.0.1",
|
|
56
62
|
"expression-expander": "^7.1.3",
|
|
57
|
-
"globby": "^14.0.
|
|
63
|
+
"globby": "^14.0.1",
|
|
58
64
|
"ini": "^4.1.0",
|
|
59
|
-
"iterable-string-interceptor": "^2.
|
|
60
|
-
"key-value-transformer": "^3.
|
|
65
|
+
"iterable-string-interceptor": "^2.3.1",
|
|
66
|
+
"key-value-transformer": "^3.2.2",
|
|
61
67
|
"npm-package-walker": "^6.2.4",
|
|
62
68
|
"npm-packlist": "^8.0.2",
|
|
63
69
|
"pacote": "^17.0.6",
|
|
64
70
|
"pkg-dir": "^8.0.0",
|
|
65
71
|
"tar-stream": "^3.1.7",
|
|
66
|
-
"uti": "^8.
|
|
72
|
+
"uti": "^8.4.0"
|
|
67
73
|
},
|
|
68
74
|
"devDependencies": {
|
|
69
|
-
"@types/node": "^20.11.
|
|
70
|
-
"ava": "^6.1.
|
|
75
|
+
"@types/node": "^20.11.24",
|
|
76
|
+
"ava": "^6.1.2",
|
|
71
77
|
"c8": "^9.1.0",
|
|
72
78
|
"documentation": "^14.0.3",
|
|
73
|
-
"semantic-release": "^23.0.
|
|
79
|
+
"semantic-release": "^23.0.2",
|
|
74
80
|
"stream-buffers": "^3.0.2",
|
|
75
81
|
"typescript": "^5.3.3"
|
|
76
82
|
},
|
|
77
83
|
"engines": {
|
|
78
|
-
"node": ">=20.11.
|
|
84
|
+
"node": ">=20.11.1",
|
|
79
85
|
"bun": ">=1.0"
|
|
80
86
|
},
|
|
81
87
|
"repository": {
|
|
82
88
|
"type": "git",
|
|
83
|
-
"url": "https://github.com/arlac77/npm-pkgbuild"
|
|
89
|
+
"url": "git+https://github.com/arlac77/npm-pkgbuild.git"
|
|
84
90
|
},
|
|
85
91
|
"bugs": {
|
|
86
92
|
"url": "https://github.com/arlac77/npm-pkgbuild/issues"
|
|
@@ -89,7 +95,7 @@
|
|
|
89
95
|
"template": {
|
|
90
96
|
"inheritFrom": [
|
|
91
97
|
"arlac77/template-arlac77-github",
|
|
92
|
-
"arlac77/template-
|
|
98
|
+
"arlac77/template-javascript-component",
|
|
93
99
|
"arlac77/template-typescript"
|
|
94
100
|
]
|
|
95
101
|
}
|
|
@@ -52,7 +52,7 @@ const entryAttributeNames = ["owner", "group", "mode"];
|
|
|
52
52
|
/**
|
|
53
53
|
* Delivers ContentProviders from pkgbuild.content definition.
|
|
54
54
|
* @param {Object} content from pkgbuild.content
|
|
55
|
-
* @returns {
|
|
55
|
+
* @returns {Iterable<ContentProvider>}
|
|
56
56
|
*/
|
|
57
57
|
function* content2Sources(content, dir) {
|
|
58
58
|
for (const [destination, definitions] of Object.entries(content)) {
|
|
@@ -108,7 +108,7 @@ function* content2Sources(content, dir) {
|
|
|
108
108
|
* @param {string} [options.dir] where to look for package.json
|
|
109
109
|
* @param {boolean} [options.verbose] log
|
|
110
110
|
* @param {Object} env as delared in process.env
|
|
111
|
-
* @returns {
|
|
111
|
+
* @returns {AsyncIterable<PackageDefinition>}
|
|
112
112
|
*/
|
|
113
113
|
export async function* extractFromPackage(options = {}, env = {}) {
|
|
114
114
|
const variants = {};
|
package/src/npm-pkgbuild-cli.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { program } from "commander";
|
|
5
|
+
import { program, Option } from "commander";
|
|
6
6
|
import { createExpressionTransformer } from "content-entry-transform";
|
|
7
7
|
import { UTIController } from "uti";
|
|
8
8
|
import { utf8StreamOptions } from "./util.mjs";
|
|
@@ -49,7 +49,7 @@ program
|
|
|
49
49
|
)
|
|
50
50
|
.option("-m --meta <dir>", "meta directory", (c, a) => a.concat([c]), [])
|
|
51
51
|
.addOption(
|
|
52
|
-
new
|
|
52
|
+
new Option(
|
|
53
53
|
"--publish <url...>",
|
|
54
54
|
"publishing urls (or directories) of the package"
|
|
55
55
|
)
|
package/src/output/arch.mjs
CHANGED
package/src/output/buildah.mjs
CHANGED
package/src/output/debian.mjs
CHANGED
package/src/output/oci.mjs
CHANGED
package/src/output/packager.mjs
CHANGED
package/src/publish.mjs
CHANGED
|
@@ -58,15 +58,11 @@ export async function publish(fileName, destination, properties, logger=console.
|
|
|
58
58
|
|
|
59
59
|
if (!response.ok) {
|
|
60
60
|
throw new Error(
|
|
61
|
-
`Unable to publish to ${url}: ${response.statusText}(${response.
|
|
61
|
+
`Unable to publish to ${url}: ${response.statusText}(${response.status})`
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
/*
|
|
68
|
-
console.log(`#<CI>publish ${fileName}`);
|
|
69
|
-
*/
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
export function preparePublish(publish = [], env = {}) {
|
package/src/util.mjs
CHANGED
|
@@ -61,8 +61,8 @@ export function decodePassword(password) {
|
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* Extract shell functions from a given text.
|
|
64
|
-
* @param {
|
|
65
|
-
* @return {
|
|
64
|
+
* @param {AsyncIterable<string>} source
|
|
65
|
+
* @return {AsyncIterable<FunctionDecl>}
|
|
66
66
|
*/
|
|
67
67
|
export async function* extractFunctions(source) {
|
|
68
68
|
let name;
|
|
@@ -173,7 +173,7 @@ export function fieldProvider(properties, fields) {
|
|
|
173
173
|
/**
|
|
174
174
|
* Copy content from source into destinationDirectory.
|
|
175
175
|
* Destination paths a generated without leading '/' (as for entry names too).
|
|
176
|
-
* @param {
|
|
176
|
+
* @param {AsyncIterable<ContentEntry>} source
|
|
177
177
|
* @param {string} destinationDirectory
|
|
178
178
|
* @param {Expander} expander
|
|
179
179
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source of package content.
|
|
3
|
+
* @property {string} dir
|
|
4
|
+
* @property {Transformer[]} transformer
|
|
5
|
+
*/
|
|
6
|
+
export class ContentProvider {
|
|
7
|
+
constructor(definitions: any, entryProperties: any);
|
|
8
|
+
transformers: any[];
|
|
9
|
+
entryProperties: any;
|
|
10
|
+
dir: any;
|
|
11
|
+
baseProperties: {};
|
|
12
|
+
/**
|
|
13
|
+
* List all entries.
|
|
14
|
+
* @return {AsyncIterable<ContentEntry>} all entries
|
|
15
|
+
*/
|
|
16
|
+
[Symbol.asyncIterator](): AsyncIterable<ContentEntry>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content provided form the file system.
|
|
3
|
+
* @param {Object|string} definitions
|
|
4
|
+
* @param {string|string[]} definitions.pattern
|
|
5
|
+
* @param {string} definitions.base base directory where to find the files
|
|
6
|
+
*/
|
|
7
|
+
export class FileContentProvider extends ContentProvider {
|
|
8
|
+
definitions: any;
|
|
9
|
+
[Symbol.asyncIterator](): AsyncGenerator<any, void, unknown>;
|
|
10
|
+
}
|
|
11
|
+
import { ContentProvider } from "./content-provider.mjs";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content provided form the file system.
|
|
3
|
+
* @param {Object|string} definitions
|
|
4
|
+
* @param {string|string[]} definitions.pattern
|
|
5
|
+
* @param {string} definitions.base base directory where to find the files
|
|
6
|
+
*/
|
|
7
|
+
export class NFTContentProvider extends ContentProvider {
|
|
8
|
+
static get description(): string;
|
|
9
|
+
definitions: any;
|
|
10
|
+
[Symbol.asyncIterator](): AsyncGenerator<any, void, unknown>;
|
|
11
|
+
}
|
|
12
|
+
import { ContentProvider } from "./content-provider.mjs";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content from node_modules
|
|
3
|
+
*
|
|
4
|
+
* @property {boolean} withoutDevelpmentDependencies
|
|
5
|
+
*/
|
|
6
|
+
export class NodeModulesContentProvider extends ContentProvider {
|
|
7
|
+
static get description(): string;
|
|
8
|
+
[Symbol.asyncIterator](): AsyncGenerator<any, void, unknown>;
|
|
9
|
+
}
|
|
10
|
+
import { ContentProvider } from "./content-provider.mjs";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content from npm pack.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} definitions
|
|
5
|
+
* @param {Object} entryProperties to be set for each entry
|
|
6
|
+
* @property {string} dir
|
|
7
|
+
*/
|
|
8
|
+
export class NPMPackContentProvider extends ContentProvider {
|
|
9
|
+
static get description(): string;
|
|
10
|
+
[Symbol.asyncIterator](): AsyncGenerator<any, void, unknown>;
|
|
11
|
+
}
|
|
12
|
+
import { ContentProvider } from "./content-provider.mjs";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} PackageDefinition
|
|
3
|
+
* @property {Object} properties values describing the package attributes
|
|
4
|
+
* @property {ContentProvider[]} sources content providers
|
|
5
|
+
* @property {Object} dependencies
|
|
6
|
+
* @property {Object} output package type
|
|
7
|
+
* @property {Object} variant identifier of the variant
|
|
8
|
+
* @property {string} variant.name name of the variant
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Extract package definition from package.json.
|
|
12
|
+
* - for each architecture deliver a new result
|
|
13
|
+
* - if no architecture is given one result set is provided nethertheless
|
|
14
|
+
* - architectures are taken from cpu (node arch ids) and from pkgbuild.arch (raw arch ids)
|
|
15
|
+
* - architecture given in a variant definition are used to restrict the set of avaliable architectures
|
|
16
|
+
* @param {Object} options
|
|
17
|
+
* @param {string} [options.dir] where to look for package.json
|
|
18
|
+
* @param {boolean} [options.verbose] log
|
|
19
|
+
* @param {Object} env as delared in process.env
|
|
20
|
+
* @returns {AsyncIterable<PackageDefinition>}
|
|
21
|
+
*/
|
|
22
|
+
export function extractFromPackage(options?: {
|
|
23
|
+
dir?: string;
|
|
24
|
+
verbose?: boolean;
|
|
25
|
+
}, env?: any): AsyncIterable<PackageDefinition>;
|
|
26
|
+
/**
|
|
27
|
+
* All content providers
|
|
28
|
+
*/
|
|
29
|
+
export const allInputs: (typeof NPMPackContentProvider)[];
|
|
30
|
+
/**
|
|
31
|
+
* All output formats
|
|
32
|
+
*/
|
|
33
|
+
export const allOutputs: (typeof OCI | typeof DOCKER)[];
|
|
34
|
+
export namespace npmArchMapping {
|
|
35
|
+
let arm64: string;
|
|
36
|
+
let arm: string;
|
|
37
|
+
let mips: string;
|
|
38
|
+
let mipsel: string;
|
|
39
|
+
let ppc: string;
|
|
40
|
+
let s390: string;
|
|
41
|
+
let s390x: string;
|
|
42
|
+
let ia32: string;
|
|
43
|
+
let x64: string;
|
|
44
|
+
let ppc64: string;
|
|
45
|
+
}
|
|
46
|
+
export type PackageDefinition = {
|
|
47
|
+
/**
|
|
48
|
+
* values describing the package attributes
|
|
49
|
+
*/
|
|
50
|
+
properties: any;
|
|
51
|
+
/**
|
|
52
|
+
* content providers
|
|
53
|
+
*/
|
|
54
|
+
sources: ContentProvider[];
|
|
55
|
+
dependencies: any;
|
|
56
|
+
/**
|
|
57
|
+
* package type
|
|
58
|
+
*/
|
|
59
|
+
output: any;
|
|
60
|
+
/**
|
|
61
|
+
* identifier of the variant
|
|
62
|
+
*/
|
|
63
|
+
variant: {
|
|
64
|
+
name: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
import { NPMPackContentProvider } from "./content/npm-pack-content-provider.mjs";
|
|
68
|
+
import { OCI } from "./output/oci.mjs";
|
|
69
|
+
import { DOCKER } from "./output/docker.mjs";
|
|
70
|
+
import { ContentProvider } from "./content/content-provider.mjs";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./util.mjs";
|
|
2
|
+
export * from "./publish.mjs";
|
|
3
|
+
export * from "./extract-from-package.mjs";
|
|
4
|
+
export * from "./content/content-provider.mjs";
|
|
5
|
+
export * from "./content/file-content-provider.mjs";
|
|
6
|
+
export * from "./content/node-modules-content-provider.mjs";
|
|
7
|
+
export * from "./content/npm-pack-content-provider.mjs";
|
|
8
|
+
export * from "./content/nft-content-provider.mjs";
|
|
9
|
+
export * from "./output/debian.mjs";
|
|
10
|
+
export * from "./output/rpm.mjs";
|
|
11
|
+
export * from "./output/arch.mjs";
|
|
12
|
+
export * from "./output/oci.mjs";
|
|
13
|
+
export * from "./output/docker.mjs";
|
|
14
|
+
export * from "./output/packager.mjs";
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {Object} KeyValueTransformOptions
|
|
3
|
+
* Options to describe key value pair separated by an equal sign '='
|
|
4
|
+
*/
|
|
5
|
+
export const pkgKeyValuePairOptions: any;
|
|
6
|
+
export class ARCH extends Packager {
|
|
7
|
+
static get description(): string;
|
|
8
|
+
static get fileNameExtension(): string;
|
|
9
|
+
static get fields(): {
|
|
10
|
+
Maintainer: {
|
|
11
|
+
alias: string;
|
|
12
|
+
type: string;
|
|
13
|
+
prefix: string;
|
|
14
|
+
};
|
|
15
|
+
pkgname: {
|
|
16
|
+
alias: string;
|
|
17
|
+
type: string;
|
|
18
|
+
mandatory: boolean;
|
|
19
|
+
};
|
|
20
|
+
pkgver: {
|
|
21
|
+
alias: string;
|
|
22
|
+
type: string;
|
|
23
|
+
mandatory: boolean;
|
|
24
|
+
};
|
|
25
|
+
pkgrel: {
|
|
26
|
+
alias: string;
|
|
27
|
+
type: string;
|
|
28
|
+
default: number;
|
|
29
|
+
mandatory: boolean;
|
|
30
|
+
};
|
|
31
|
+
epoch: {
|
|
32
|
+
type: string;
|
|
33
|
+
default: number;
|
|
34
|
+
};
|
|
35
|
+
pkgdesc: {
|
|
36
|
+
alias: string;
|
|
37
|
+
type: string;
|
|
38
|
+
mandatory: boolean;
|
|
39
|
+
};
|
|
40
|
+
url: {
|
|
41
|
+
alias: string;
|
|
42
|
+
type: string;
|
|
43
|
+
};
|
|
44
|
+
license: {
|
|
45
|
+
type: string;
|
|
46
|
+
mandatory: boolean;
|
|
47
|
+
};
|
|
48
|
+
install: {
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
changelog: {
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
54
|
+
source: {
|
|
55
|
+
type: string;
|
|
56
|
+
};
|
|
57
|
+
validpgpkeys: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
noextract: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
cksums: {
|
|
64
|
+
type: string;
|
|
65
|
+
};
|
|
66
|
+
md5sums: {
|
|
67
|
+
type: string;
|
|
68
|
+
};
|
|
69
|
+
sha1sums: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
sha256sums: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
sha384sums: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
sha512sums: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
groups: {
|
|
82
|
+
type: string;
|
|
83
|
+
};
|
|
84
|
+
arch: {
|
|
85
|
+
default: string[];
|
|
86
|
+
mandatory: boolean;
|
|
87
|
+
type: string;
|
|
88
|
+
};
|
|
89
|
+
backup: {
|
|
90
|
+
type: string;
|
|
91
|
+
};
|
|
92
|
+
depends: {
|
|
93
|
+
type: string;
|
|
94
|
+
};
|
|
95
|
+
makedepends: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
checkdepends: {
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
optdepends: {
|
|
102
|
+
type: string;
|
|
103
|
+
};
|
|
104
|
+
conflicts: {
|
|
105
|
+
type: string;
|
|
106
|
+
};
|
|
107
|
+
provides: {
|
|
108
|
+
type: string;
|
|
109
|
+
};
|
|
110
|
+
replaces: {
|
|
111
|
+
type: string;
|
|
112
|
+
};
|
|
113
|
+
options: {
|
|
114
|
+
type: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
static prepare(options?: {}, variant?: {}): Promise<boolean>;
|
|
118
|
+
get packageFileName(): string;
|
|
119
|
+
}
|
|
120
|
+
import { Packager } from "./packager.mjs";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create .deb packages
|
|
3
|
+
*/
|
|
4
|
+
export class DEBIAN extends Packager {
|
|
5
|
+
static get description(): string;
|
|
6
|
+
static get fileNameExtension(): string;
|
|
7
|
+
static get fields(): {
|
|
8
|
+
Package: {
|
|
9
|
+
alias: string;
|
|
10
|
+
type: string;
|
|
11
|
+
mandatory: boolean;
|
|
12
|
+
};
|
|
13
|
+
Version: {
|
|
14
|
+
alias: string;
|
|
15
|
+
type: string;
|
|
16
|
+
mandatory: boolean;
|
|
17
|
+
};
|
|
18
|
+
Maintainer: {
|
|
19
|
+
alias: string;
|
|
20
|
+
type: string;
|
|
21
|
+
mandatory: boolean;
|
|
22
|
+
};
|
|
23
|
+
Description: {
|
|
24
|
+
alias: string;
|
|
25
|
+
type: string;
|
|
26
|
+
mandatory: boolean;
|
|
27
|
+
};
|
|
28
|
+
Section: {
|
|
29
|
+
alias: string;
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
Priority: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
Essential: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
Origin: {
|
|
39
|
+
type: string;
|
|
40
|
+
};
|
|
41
|
+
Architecture: {
|
|
42
|
+
alias: string;
|
|
43
|
+
type: string;
|
|
44
|
+
default: string;
|
|
45
|
+
mandatory: boolean;
|
|
46
|
+
};
|
|
47
|
+
Homepage: {
|
|
48
|
+
alias: string;
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
Bugs: {
|
|
52
|
+
alias: string;
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
Depends: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
"Pre-Depends": {
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
"Build-Depends": {
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
"Build-Depends-Indep": {
|
|
65
|
+
type: string;
|
|
66
|
+
};
|
|
67
|
+
"Build-Depends-Arch": {
|
|
68
|
+
type: string;
|
|
69
|
+
};
|
|
70
|
+
Recommends: {
|
|
71
|
+
type: string;
|
|
72
|
+
};
|
|
73
|
+
Suggests: {
|
|
74
|
+
type: string;
|
|
75
|
+
};
|
|
76
|
+
Provides: {
|
|
77
|
+
type: string;
|
|
78
|
+
};
|
|
79
|
+
Breaks: {
|
|
80
|
+
type: string;
|
|
81
|
+
};
|
|
82
|
+
Replaces: {
|
|
83
|
+
type: string;
|
|
84
|
+
};
|
|
85
|
+
Source: {
|
|
86
|
+
alias: string;
|
|
87
|
+
type: string;
|
|
88
|
+
};
|
|
89
|
+
Uploaders: {
|
|
90
|
+
mandatory: boolean;
|
|
91
|
+
};
|
|
92
|
+
"Installed-Size": {};
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* @param {Object} options
|
|
96
|
+
* @param {Object} variant
|
|
97
|
+
* @param {string} variant.arch
|
|
98
|
+
* @return {Promise<boolean>}
|
|
99
|
+
*/
|
|
100
|
+
static prepare(options: any, variant: {
|
|
101
|
+
arch: string;
|
|
102
|
+
}): Promise<boolean>;
|
|
103
|
+
get packageFileName(): string;
|
|
104
|
+
hookFiles(properties: any): AsyncGenerator<any, void, unknown>;
|
|
105
|
+
}
|
|
106
|
+
import { Packager } from "./packager.mjs";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class DOCKER extends Packager {
|
|
2
|
+
static get description(): string;
|
|
3
|
+
static get fields(): {
|
|
4
|
+
name: {
|
|
5
|
+
type: string;
|
|
6
|
+
mandatory: boolean;
|
|
7
|
+
set: (value: any) => any;
|
|
8
|
+
};
|
|
9
|
+
version: {
|
|
10
|
+
type: string;
|
|
11
|
+
mandatory: boolean;
|
|
12
|
+
};
|
|
13
|
+
description: {
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
author: {
|
|
17
|
+
alias: string;
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
workdir: {
|
|
21
|
+
type: string;
|
|
22
|
+
default: string;
|
|
23
|
+
mandatory: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
execute(sources: any, transformer: any, dependencies: any, options: any, expander?: (v: any) => any): Promise<string>;
|
|
27
|
+
}
|
|
28
|
+
import { Packager } from "./packager.mjs";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Low level OCI compatible packager
|
|
3
|
+
*/
|
|
4
|
+
export class OCI extends Packager {
|
|
5
|
+
static get description(): string;
|
|
6
|
+
static get fileNameExtension(): string;
|
|
7
|
+
static prepare(options: any, variant: any): Promise<boolean>;
|
|
8
|
+
get packageFileName(): string;
|
|
9
|
+
execute(sources: any, transformer: any, dependencies: any, options: any, expander?: (v: any) => any): Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
import { Packager } from "./packager.mjs";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} Field
|
|
3
|
+
* @property {string} alias interchangeable field name
|
|
4
|
+
* @property {string} type
|
|
5
|
+
* @property {any} default
|
|
6
|
+
* @property {boolean} mandatory
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Base Packager
|
|
10
|
+
* @param {Object} properties
|
|
11
|
+
*/
|
|
12
|
+
export class Packager {
|
|
13
|
+
static get fields(): {};
|
|
14
|
+
/**
|
|
15
|
+
* @return {Object}
|
|
16
|
+
*/
|
|
17
|
+
static get workspaceLayout(): any;
|
|
18
|
+
/**
|
|
19
|
+
* @param {Object} options
|
|
20
|
+
* @param {Object} variant
|
|
21
|
+
* @return {Promise<boolean>}
|
|
22
|
+
*/
|
|
23
|
+
static prepare(options: any, variant: any): Promise<boolean>;
|
|
24
|
+
constructor(properties: any);
|
|
25
|
+
get fileNameExtension(): any;
|
|
26
|
+
get fields(): any;
|
|
27
|
+
get properties(): any;
|
|
28
|
+
prepareExecute(options: any): Promise<{
|
|
29
|
+
properties: any;
|
|
30
|
+
destination: any;
|
|
31
|
+
tmpdir: string;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Create tmp directory.
|
|
35
|
+
* @return {Promise<string>} directory path
|
|
36
|
+
*/
|
|
37
|
+
get tmpdir(): Promise<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Execute package generation.
|
|
40
|
+
* @return {Promise<string>} location of the resulting package
|
|
41
|
+
*/
|
|
42
|
+
execute(sources: any, transformer: any, dependencies: any, options: any, expander: any): Promise<string>;
|
|
43
|
+
#private;
|
|
44
|
+
}
|
|
45
|
+
export type Field = {
|
|
46
|
+
/**
|
|
47
|
+
* interchangeable field name
|
|
48
|
+
*/
|
|
49
|
+
alias: string;
|
|
50
|
+
type: string;
|
|
51
|
+
default: any;
|
|
52
|
+
mandatory: boolean;
|
|
53
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export function requiresFromDependencies(dependencies: any): string[];
|
|
2
|
+
/**
|
|
3
|
+
* produce rpm packages
|
|
4
|
+
*/
|
|
5
|
+
export class RPM extends Packager {
|
|
6
|
+
static get description(): string;
|
|
7
|
+
static get fileNameExtension(): string;
|
|
8
|
+
static get fields(): {
|
|
9
|
+
Name: {
|
|
10
|
+
alias: string;
|
|
11
|
+
type: string;
|
|
12
|
+
mandatory: boolean;
|
|
13
|
+
};
|
|
14
|
+
Summary: {
|
|
15
|
+
alias: string;
|
|
16
|
+
type: string;
|
|
17
|
+
mandatory: boolean;
|
|
18
|
+
};
|
|
19
|
+
License: {
|
|
20
|
+
alias: string;
|
|
21
|
+
type: string;
|
|
22
|
+
mandatory: boolean;
|
|
23
|
+
};
|
|
24
|
+
Version: {
|
|
25
|
+
alias: string;
|
|
26
|
+
type: string;
|
|
27
|
+
mandatory: boolean;
|
|
28
|
+
};
|
|
29
|
+
Release: {
|
|
30
|
+
alias: string;
|
|
31
|
+
type: string;
|
|
32
|
+
default: number;
|
|
33
|
+
mandatory: boolean;
|
|
34
|
+
};
|
|
35
|
+
Source0: {
|
|
36
|
+
alias: string;
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
Group: {
|
|
40
|
+
alias: string;
|
|
41
|
+
type: string;
|
|
42
|
+
};
|
|
43
|
+
Packager: {
|
|
44
|
+
alias: string;
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
Vendor: {
|
|
48
|
+
alias: string;
|
|
49
|
+
type: string;
|
|
50
|
+
};
|
|
51
|
+
BuildArch: {
|
|
52
|
+
alias: string;
|
|
53
|
+
default: string;
|
|
54
|
+
type: string;
|
|
55
|
+
mandatory: boolean;
|
|
56
|
+
};
|
|
57
|
+
URL: {
|
|
58
|
+
alias: string;
|
|
59
|
+
type: string;
|
|
60
|
+
};
|
|
61
|
+
Requires: {
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
Obsoletes: {
|
|
65
|
+
type: string;
|
|
66
|
+
};
|
|
67
|
+
Conflicts: {
|
|
68
|
+
type: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
static get workspaceLayout(): {
|
|
72
|
+
named: {
|
|
73
|
+
staging: string;
|
|
74
|
+
};
|
|
75
|
+
others: string[];
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Check for rpmbuild presence.
|
|
79
|
+
* @param {Object} options
|
|
80
|
+
* @param {Object} variant
|
|
81
|
+
* @param {string} variant.arch
|
|
82
|
+
* @returns {Promise<boolean>} true when rpmbuild executable is present
|
|
83
|
+
*/
|
|
84
|
+
static prepare(options: any, variant: {
|
|
85
|
+
arch: string;
|
|
86
|
+
}): Promise<boolean>;
|
|
87
|
+
get packageFileName(): string;
|
|
88
|
+
}
|
|
89
|
+
import { Packager } from "./packager.mjs";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function analysePublish(publish: any, properties: any): any;
|
|
2
|
+
export function publish(fileName: any, destination: any, properties: any, logger?: {
|
|
3
|
+
(...data: any[]): void;
|
|
4
|
+
(message?: any, ...optionalParams: any[]): void;
|
|
5
|
+
}): Promise<void>;
|
|
6
|
+
export function preparePublish(publish?: any[], env?: {}): ({
|
|
7
|
+
url: any;
|
|
8
|
+
user: any;
|
|
9
|
+
password: string;
|
|
10
|
+
} | {
|
|
11
|
+
username?: any;
|
|
12
|
+
password?: string;
|
|
13
|
+
url: string;
|
|
14
|
+
user?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
url: any;
|
|
17
|
+
user?: undefined;
|
|
18
|
+
password?: undefined;
|
|
19
|
+
})[];
|
package/types/util.d.mts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export function filterOutUnwantedDependencies(): ([name, version]: [any, any]) => boolean;
|
|
2
|
+
export function mergeDependencies(a: any, b: any): {};
|
|
3
|
+
/**
|
|
4
|
+
* Decode a password
|
|
5
|
+
* @param {string} password
|
|
6
|
+
* @returns {string} plaintext password
|
|
7
|
+
*/
|
|
8
|
+
export function decodePassword(password: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {Object} FunctionDecl
|
|
11
|
+
* @property {string} name
|
|
12
|
+
* @property {string[]} body
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Extract shell functions from a given text.
|
|
16
|
+
* @param {AsyncIterable<string>} source
|
|
17
|
+
* @return {AsyncIterable<FunctionDecl>}
|
|
18
|
+
*/
|
|
19
|
+
export function extractFunctions(source: AsyncIterable<string>): AsyncIterable<FunctionDecl>;
|
|
20
|
+
export function quote(v: any, qc?: string): any;
|
|
21
|
+
export function asArray(o: any): any[];
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} properties
|
|
25
|
+
* @param {Object} fields
|
|
26
|
+
* @returns {Function}
|
|
27
|
+
*/
|
|
28
|
+
export function fieldProvider(properties: any, fields: any): Function;
|
|
29
|
+
/**
|
|
30
|
+
* @typedef {Function} Expander
|
|
31
|
+
* @param {string} path
|
|
32
|
+
* @return {string}
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Copy content from source into destinationDirectory.
|
|
36
|
+
* Destination paths a generated without leading '/' (as for entry names too).
|
|
37
|
+
* @param {AsyncIterable<ContentEntry>} source
|
|
38
|
+
* @param {string} destinationDirectory
|
|
39
|
+
* @param {Expander} expander
|
|
40
|
+
*/
|
|
41
|
+
export function copyEntries(source: AsyncIterable<ContentEntry>, destinationDirectory: string, expander?: Expander): AsyncGenerator<ContentEntry, void, unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* @type {Object}
|
|
44
|
+
* @property {BufferEncoding} encoding
|
|
45
|
+
*/
|
|
46
|
+
export const utf8StreamOptions: any;
|
|
47
|
+
export namespace packageNameMapping {
|
|
48
|
+
let node: string;
|
|
49
|
+
}
|
|
50
|
+
export type FunctionDecl = {
|
|
51
|
+
name: string;
|
|
52
|
+
body: string[];
|
|
53
|
+
};
|
|
54
|
+
export type Expander = Function;
|