gen-api-types 1.0.9 → 1.0.10

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.
Files changed (2) hide show
  1. package/bin/index.js +6 -2
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -1,8 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { spawn } = require('child_process');
4
- const path = require('path');
3
+ import { spawn } from 'node:child_process';
4
+ import path from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+ import { createRequire } from 'node:module';
5
7
 
8
+ const require = createRequire(import.meta.url);
9
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
6
10
  const args = process.argv.slice(2);
7
11
  const cliPath = path.resolve(__dirname, '../src/cli/index.ts');
8
12
  const tsxCliPath = require.resolve('tsx/cli');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gen-api-types",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "一个自动生成请求接口返回类型的 cli 小工具",
5
5
  "main": "./src/index.ts",
6
6
  "exports": {