pmcf 1.54.6 → 1.54.8
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/bin/pmcf-package +21 -8
- package/package.json +2 -2
- package/src/cmd.mjs +6 -1
- package/types/cmd.d.mts +1 -0
package/bin/pmcf-package
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { readFile, mkdtemp } from "node:fs/promises";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
5
6
|
import { packageDirectory } from "pkg-dir";
|
|
6
7
|
import {
|
|
7
8
|
FileContentProvider,
|
|
@@ -12,35 +13,47 @@ import { prepare } from "../src/cmd.mjs";
|
|
|
12
13
|
|
|
13
14
|
const { root, args, options } = await prepare();
|
|
14
15
|
|
|
16
|
+
if (!options.output) {
|
|
17
|
+
options.output = await mkdtemp(tmpdir());
|
|
18
|
+
}
|
|
19
|
+
|
|
15
20
|
const pkgDir = await packageDirectory({ cwd: options.root });
|
|
16
21
|
const pkg = JSON.parse(await readFile(join(pkgDir, "package.json"), "utf8"));
|
|
17
22
|
|
|
18
|
-
const publishingDetails = createPublishingDetails(options.publish,
|
|
19
|
-
...process.env
|
|
20
|
-
});
|
|
23
|
+
const publishingDetails = createPublishingDetails(options.publish, process.env);
|
|
21
24
|
|
|
22
25
|
for (const name of args) {
|
|
23
26
|
const object = await root.load(name);
|
|
24
27
|
const stagingDir = join(options.output, object.fullName);
|
|
25
28
|
const { properties } = await object.preparePackage(stagingDir);
|
|
26
29
|
|
|
30
|
+
//properties.verbose = true;
|
|
27
31
|
properties.version = pkg.version;
|
|
28
32
|
properties.license = pkg.license;
|
|
29
33
|
console.log(properties);
|
|
30
34
|
|
|
31
35
|
const output = new ARCH(properties);
|
|
32
|
-
const sources = new FileContentProvider({ base: stagingDir})[
|
|
36
|
+
const sources = new FileContentProvider({ base: stagingDir })[
|
|
37
|
+
Symbol.asyncIterator
|
|
38
|
+
]();
|
|
39
|
+
|
|
40
|
+
const destination = await mkdtemp(
|
|
41
|
+
join(options.output, output.constructor.name)
|
|
42
|
+
);
|
|
43
|
+
console.log(destination);
|
|
33
44
|
|
|
34
45
|
const artifact = await output.create(sources, [], publishingDetails, {
|
|
35
46
|
...options,
|
|
36
|
-
destination
|
|
47
|
+
destination
|
|
37
48
|
});
|
|
38
49
|
|
|
50
|
+
console.log(artifact);
|
|
51
|
+
|
|
52
|
+
/*
|
|
39
53
|
await Promise.all(
|
|
40
54
|
publishingDetails.map(publishDetail =>
|
|
41
55
|
output.publish(artifact, publishDetail, output.properties)
|
|
42
56
|
)
|
|
43
57
|
);
|
|
44
|
-
|
|
45
|
-
console.log(artifact);
|
|
58
|
+
*/
|
|
46
59
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmcf",
|
|
3
|
-
"version": "1.54.
|
|
3
|
+
"version": "1.54.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"pkg-dir": "^8.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^22.13.
|
|
46
|
+
"@types/node": "^22.13.9",
|
|
47
47
|
"ava": "^6.2.0",
|
|
48
48
|
"c8": "^10.1.3",
|
|
49
49
|
"documentation": "^14.0.3",
|
package/src/cmd.mjs
CHANGED
|
@@ -6,6 +6,11 @@ export async function prepare() {
|
|
|
6
6
|
const { values, positionals } = parseArgs({
|
|
7
7
|
args: argv.slice(2),
|
|
8
8
|
options: {
|
|
9
|
+
verbose: {
|
|
10
|
+
type: "boolean",
|
|
11
|
+
short: "v",
|
|
12
|
+
default: false
|
|
13
|
+
},
|
|
9
14
|
root: {
|
|
10
15
|
type: "string",
|
|
11
16
|
short: "r",
|
|
@@ -14,7 +19,7 @@ export async function prepare() {
|
|
|
14
19
|
output: {
|
|
15
20
|
type: "string",
|
|
16
21
|
short: "o",
|
|
17
|
-
|
|
22
|
+
// default: cwd()
|
|
18
23
|
}
|
|
19
24
|
},
|
|
20
25
|
allowPositionals: true
|