forge-sql-orm 1.0.19 → 1.0.20
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/package.json +2 -2
- package/scripts/forgeSqlCLI.js +0 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "forge-sql-orm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.20",
|
|
4
4
|
"description": "Mikro-ORM integration for Forge-SQL in Atlassian Forge applications.",
|
|
5
5
|
"main": "dist/ForgeSQLORM.js",
|
|
6
6
|
"module": "dist/ForgeSQLORM.mjs",
|
|
@@ -90,6 +90,6 @@
|
|
|
90
90
|
"@forge/sql": "^2.4.0"
|
|
91
91
|
},
|
|
92
92
|
"bin": {
|
|
93
|
-
"forge-sql-orm": "
|
|
93
|
+
"forge-sql-orm": "dist-cli/forgeSqlCLI.js"
|
|
94
94
|
}
|
|
95
95
|
}
|
package/scripts/forgeSqlCLI.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const { execSync } = require("child_process");
|
|
3
|
-
const path = require("path");
|
|
4
|
-
const fs = require("fs");
|
|
5
|
-
const os = require("os");
|
|
6
|
-
|
|
7
|
-
// Get CLI arguments (excluding "node" and script path)
|
|
8
|
-
const args = process.argv.slice(2).join(" ");
|
|
9
|
-
|
|
10
|
-
// Resolve the path to cli.ts (your TypeScript entry file)
|
|
11
|
-
const cliPath = path.resolve(__dirname, "cli.cjs");
|
|
12
|
-
|
|
13
|
-
// Function to run a command
|
|
14
|
-
const runCommand = (cmd) => {
|
|
15
|
-
try {
|
|
16
|
-
execSync(cmd, { stdio: "inherit", shell: true });
|
|
17
|
-
process.exit(0);
|
|
18
|
-
} catch (e) {
|
|
19
|
-
console.error("⚠️ Command execution failed:", e.message);
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
// **1. Check if `ts-node` is globally installed**
|
|
25
|
-
const isGlobalTsNodeInstalled = (() => {
|
|
26
|
-
try {
|
|
27
|
-
execSync("ts-node --version", { stdio: "ignore" }); // Check if `ts-node` runs without error
|
|
28
|
-
return true;
|
|
29
|
-
} catch {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
})();
|
|
33
|
-
|
|
34
|
-
if (isGlobalTsNodeInstalled) {
|
|
35
|
-
console.log("✅ Using global ts-node");
|
|
36
|
-
runCommand(`node -r ts-node/register ${cliPath} ${args}`);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// **2. If not, check for local ts-node**
|
|
40
|
-
if (fs.existsSync(localTsNode)) {
|
|
41
|
-
console.log("✅ Using local ts-node");
|
|
42
|
-
runCommand(`"${localTsNode}" ${cliPath} ${args}`);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// **3. If neither found, fallback to npx**
|
|
46
|
-
console.warn("⚠️ Neither global nor local ts-node found, using npx...");
|
|
47
|
-
runCommand(`npx node -r ts-node/register ${cliPath} ${args}`);
|