@frankieone/one-sdk 1.7.14-rc → 1.7.14-rc.1

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.
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env node
2
+
3
+ /* eslint-disable no-undef */
4
+ /* eslint-disable no-console */
5
+ import { spawnSync, spawn } from 'node:child_process';
6
+ import os from 'os';
7
+
8
+ const executableName = 'onesdk-cli';
9
+
10
+ const installationPath = () => {
11
+ const errorMsg = 'Failed to find executable path.';
12
+
13
+ const whichCmd = spawnSync('which', [executableName]);
14
+ if (whichCmd.error) {
15
+ console.error(errorMsg, whichCmd.error);
16
+ process.exit(1);
17
+ }
18
+ const whichOutput = whichCmd.stdout.toString().trim();
19
+
20
+ const sedCmd = spawnSync(
21
+ 'sed',
22
+ ['-e', 's|bin/onesdk-cli|lib/node_modules/@frankieone/one-sdk/dist/cli|'],
23
+ { input: whichOutput },
24
+ );
25
+
26
+ if (sedCmd.error) {
27
+ console.error(errorMsg, sedCmd.error);
28
+ process.exit(1);
29
+ }
30
+
31
+ return sedCmd.stdout.toString().trim();
32
+ };
33
+
34
+ const darwinExecutable = (basePath) => {
35
+ const arch = os.arch();
36
+
37
+ switch (arch) {
38
+ case 'arm64':
39
+ return `${basePath}/darwin-arm64/${executableName}`;
40
+
41
+ case 'x64':
42
+ return `${basePath}/darwin-amd64/${executableName}`;
43
+
44
+ default:
45
+ return undefined;
46
+ }
47
+ };
48
+
49
+ const linuxExecutable = (basePath) => {
50
+ const arch = os.arch();
51
+
52
+ switch (arch) {
53
+ case 'arm64':
54
+ return `${basePath}/linux-arm64/${executableName}`;
55
+
56
+ case 'x64':
57
+ return `${basePath}/linux-amd64/${executableName}`;
58
+
59
+ default:
60
+ return undefined;
61
+ }
62
+ };
63
+
64
+ const windowsExecutable = (basePath) => {
65
+ return `${basePath}/windows-amd64/${executableName}.exe`;
66
+ };
67
+
68
+ const executableFile = () => {
69
+ const basePath = installationPath();
70
+ const kernelName = os.type();
71
+
72
+ switch (kernelName) {
73
+ case 'Linux':
74
+ return linuxExecutable(basePath);
75
+
76
+ case 'Darwin':
77
+ return darwinExecutable(basePath);
78
+
79
+ case 'Windows_NT':
80
+ return windowsExecutable(basePath);
81
+
82
+ default:
83
+ return undefined;
84
+ }
85
+ };
86
+
87
+ const executable = executableFile();
88
+ if (!executable) {
89
+ console.error('Unsupported platform.');
90
+ process.exit(1);
91
+ }
92
+
93
+ const args = process.argv.slice(2);
94
+ const child = spawn(executable, args, { stdio: 'inherit' });
95
+
96
+ child.on('error', (err) => {
97
+ console.error('Failed to start child process.', err);
98
+ });
99
+
100
+ child.on('exit', (code, signal) => {
101
+ if (code && code !== 0) {
102
+ console.log('Process exited with code: ' + code);
103
+ }
104
+
105
+ if (!code && signal) {
106
+ console.log('Process exited with signal: ' + signal);
107
+ }
108
+ });
Binary file
Binary file
Binary file
Binary file
package/dist/commit.txt CHANGED
@@ -1 +1 @@
1
- 2d6c164637b115a252230f9e32d5d021928a8146
1
+ 573196d577117cb682e1a718a342076ff63cbadc
@@ -1 +1 @@
1
- { "version": "1.7.14-rc" }
1
+ { "version": "1.7.14-rc.1" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frankieone/one-sdk",
3
- "version": "1.7.14-rc",
3
+ "version": "1.7.14-rc.1",
4
4
  "cliVersion": "0.0.1",
5
5
  "description": "FrankieOne OneSDK",
6
6
  "keywords": [],
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "scripts": {
30
30
  "build": "run-p \"build:umd\" \"build:esm\" \"build:css\" \"build:cli\"",
31
- "build:npm": "run-p \"build:esm\" \"build:css\"",
31
+ "build:npm": "run-p \"build:esm\" \"build:css\" \"build:cli\"",
32
32
  "build:analyze": "EMIT_BUNDLE_ANALYTICS=open npm run build:umd",
33
33
  "build:cjs": "node ./scripts/buildTS.js -c ./tsconfig.modules.json -t cjs",
34
34
  "build:css": "mkdirp dist/esm && cp -r styles dist/esm && npx tailwindcss -o dist/esm/styles/f1-style.css --postcss --minify",