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 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) >= 14
8
- - npm (preinstalled) or [yarn](https://classic.yarnpkg.com)
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.readFileSync(packageJsonPath, 'utf-8'));
9
- const name = Object.keys(bin)[1];
8
+ const { bin, version } = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
9
+ const toolName = Object.keys(bin)[1];
10
10
  commander
11
- .name(name)
11
+ .name(toolName)
12
12
  .version(version)
13
- .description(`Copy entries from one JSON file to the other (example: "${name} version")`)
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.readFileSync(packageJsonPath, 'utf-8'));
8
+ const { bin, description, version } = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
9
+ const [toolName] = Object.keys(bin);
9
10
  commander
10
- .name(Object.keys(bin)[0])
11
+ .name(toolName)
11
12
  .version(version)
12
13
  .description(description)
13
14
  .option('-y, --yarn', 'Use yarn for publishing (default: false)')
@@ -1,4 +1,4 @@
1
- export interface packageJson {
2
- [key: string]: string | packageJson;
1
+ export interface PackageJson {
2
+ [key: string]: string | PackageJson;
3
3
  }
4
4
  export declare function copyJson(inputFile: string, outputFile: string, values: string[]): Promise<void>;
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.17.2",
41
- "gitHead": "36492555eb0381ed01b3f1c0c33cb60eaee1da90"
43
+ "version": "1.18.0",
44
+ "gitHead": "b968c846095113cbe57fbdd34e4593a4dea8a1c9"
42
45
  }