publish-flat 1.17.2 → 1.18.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/README.md +2 -2
- package/dist/cli-copy.js +5 -5
- package/dist/cli.js +4 -3
- package/dist/copyJson.d.ts +2 -2
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ Publish your project flattened. No more `dist` in `require('project/dist/Options
|
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
|
-
- [Node.js](https://nodejs.org)
|
|
8
|
-
- npm (preinstalled) or [yarn](https://
|
|
7
|
+
- [Node.js](https://nodejs.org)
|
|
8
|
+
- npm (preinstalled) or [yarn](https://yarnpkg.com)
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
package/dist/cli-copy.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { program as commander } from 'commander';
|
|
5
5
|
import { copyJson } from './copyJson.js';
|
|
6
6
|
const __dirname = import.meta.dirname;
|
|
7
7
|
const packageJsonPath = path.join(__dirname, '../package.json');
|
|
8
|
-
const { bin, version } = JSON.parse(fs.
|
|
9
|
-
const
|
|
8
|
+
const { bin, version } = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
|
|
9
|
+
const toolName = Object.keys(bin)[1];
|
|
10
10
|
commander
|
|
11
|
-
.name(
|
|
11
|
+
.name(toolName)
|
|
12
12
|
.version(version)
|
|
13
|
-
.description(`Copy entries from one JSON file to the other (example: "${
|
|
13
|
+
.description(`Copy entries from one JSON file to the other (example: "${toolName} version")`)
|
|
14
14
|
.option('-i, --input <file>', 'Set the input JSON file', './package.json')
|
|
15
15
|
.option('-o, --output <file>', 'Set the output JSON file', '../package.json')
|
|
16
16
|
.parse(process.argv);
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import fs from 'node:fs';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { program as commander } from 'commander';
|
|
5
5
|
import { PublishFlat } from './PublishFlat.js';
|
|
6
6
|
const __dirname = import.meta.dirname;
|
|
7
7
|
const packageJsonPath = path.join(__dirname, '../package.json');
|
|
8
|
-
const { bin, description, version } = JSON.parse(fs.
|
|
8
|
+
const { bin, description, version } = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
|
|
9
|
+
const [toolName] = Object.keys(bin);
|
|
9
10
|
commander
|
|
10
|
-
.name(
|
|
11
|
+
.name(toolName)
|
|
11
12
|
.version(version)
|
|
12
13
|
.description(description)
|
|
13
14
|
.option('-y, --yarn', 'Use yarn for publishing (default: false)')
|
package/dist/copyJson.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"tsx": "4.21.0",
|
|
19
19
|
"typescript": "5.9.3"
|
|
20
20
|
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">= 21"
|
|
23
|
+
},
|
|
21
24
|
"files": [
|
|
22
25
|
"dist"
|
|
23
26
|
],
|
|
@@ -37,6 +40,6 @@
|
|
|
37
40
|
"start": "tsx src/cli.ts"
|
|
38
41
|
},
|
|
39
42
|
"type": "module",
|
|
40
|
-
"version": "1.
|
|
41
|
-
"gitHead": "
|
|
43
|
+
"version": "1.18.0",
|
|
44
|
+
"gitHead": "b968c846095113cbe57fbdd34e4593a4dea8a1c9"
|
|
42
45
|
}
|