seedfast 1.23.14 → 1.23.16

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/index.js +9 -16
  2. package/package.json +26 -12
package/index.js CHANGED
@@ -1,18 +1,11 @@
1
1
  #!/usr/bin/env node
2
- const { execFileSync } = require('child_process');
3
2
  const path = require('path');
4
- const os = require('os');
5
-
6
- const platform = os.platform();
7
- const arch = os.arch();
8
-
9
- let pkg;
10
- if (platform === 'darwin' && arch === 'x64') pkg = 'seedfast_darwin_amd64';
11
- else if (platform === 'darwin' && arch === 'arm64') pkg = 'seedfast_darwin_arm64';
12
- else if (platform === 'linux' && arch === 'x64') pkg = 'seedfast_linux_amd64';
13
- else if (platform === 'linux' && arch === 'arm64') pkg = 'seedfast_linux_arm64';
14
- else if (platform === 'win32' && arch === 'x64') pkg = 'seedfast_windows_amd64';
15
- else { console.error(`Unsupported platform: ${platform}-${arch}`); process.exit(1); }
16
-
17
- const bin = path.join(__dirname, 'node_modules', pkg, platform === 'win32' ? 'seedfast.exe' : 'seedfast');
18
- execFileSync(bin, process.argv.slice(2), { stdio: 'inherit' });
3
+ const child_process = require('child_process');
4
+ const mapping = { darwin_x64: { name: [ 'seedfast_darwin_amd64' ], bin: 'seedfast' }, win32_x64: { name: [ 'seedfast_windows_amd64' ], bin: 'seedfast.exe' }, linux_x64: { name: [ 'seedfast_linux_amd64' ], bin: 'seedfast' }, linux_arm64: { name: [ 'seedfast_linux_arm64' ], bin: 'seedfast' }, darwin_arm64: { name: [ 'seedfast_darwin_arm64' ], bin: 'seedfast' } };
5
+ const definition = mapping[process.platform + '_' + process.arch];
6
+ const packageJsonPath = require.resolve(path.join(...definition.name, 'package.json'));
7
+ const packagePath = path.join(path.dirname(packageJsonPath), definition.bin);
8
+ child_process.spawn(packagePath, process.argv.splice(2), {
9
+ stdio: 'inherit',
10
+ env: process.env,
11
+ });
package/package.json CHANGED
@@ -1,21 +1,35 @@
1
1
  {
2
2
  "name": "seedfast",
3
- "version": "1.23.14",
4
- "description": "AI-powered PostgreSQL database seeding tool",
5
- "keywords": ["postgresql", "database", "seeding", "testing", "ai"],
3
+ "version": "1.23.16",
6
4
  "bin": {
7
- "seedfast": "./index.js"
5
+ "seedfast": "index.js"
6
+ },
7
+ "optionalDependencies": {
8
+ "seedfast_darwin_amd64": "1.23.16",
9
+ "seedfast_windows_amd64": "1.23.16",
10
+ "seedfast_linux_amd64": "1.23.16",
11
+ "seedfast_linux_arm64": "1.23.16",
12
+ "seedfast_darwin_arm64": "1.23.16"
8
13
  },
14
+ "os": [
15
+ "darwin",
16
+ "win32",
17
+ "linux"
18
+ ],
19
+ "cpu": [
20
+ "x64",
21
+ "arm64"
22
+ ],
23
+ "files": [
24
+ "README.md",
25
+ "LICENSE"
26
+ ],
27
+ "keywords": [
28
+ "postgresql,database,seeding,testing,ai"
29
+ ],
30
+ "description": "AI-powered PostgreSQL database seeding tool",
9
31
  "repository": {
10
32
  "type": "git",
11
33
  "url": "https://github.com/argon-it/seedfast-cli"
12
- },
13
- "license": "MIT",
14
- "optionalDependencies": {
15
- "seedfast_darwin_amd64": "1.23.14",
16
- "seedfast_darwin_arm64": "1.23.14",
17
- "seedfast_linux_amd64": "1.23.14",
18
- "seedfast_linux_arm64": "1.23.14",
19
- "seedfast_windows_amd64": "1.23.14"
20
34
  }
21
35
  }