enact-cli 1.0.3 → 1.0.5
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/dist/index.js +26 -11
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import { createRequire } from "node:module";
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -7758,9 +7759,22 @@ var $visitAsync = visit.visitAsync;
|
|
|
7758
7759
|
|
|
7759
7760
|
// src/utils/help.ts
|
|
7760
7761
|
var import_picocolors3 = __toESM(require_picocolors(), 1);
|
|
7762
|
+
import { readFileSync } from "fs";
|
|
7763
|
+
import { join } from "path";
|
|
7764
|
+
var __dirname = "/Users/keithgroves/projects/keithagroves/enact-project/enact-cli/src/utils";
|
|
7765
|
+
function getVersion() {
|
|
7766
|
+
try {
|
|
7767
|
+
const packageJsonPath = join(__dirname, "../../package.json");
|
|
7768
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
7769
|
+
return packageJson.version || "0.1.0";
|
|
7770
|
+
} catch (error) {
|
|
7771
|
+
return "0.1.0";
|
|
7772
|
+
}
|
|
7773
|
+
}
|
|
7761
7774
|
function showHelp() {
|
|
7775
|
+
const version = getVersion();
|
|
7762
7776
|
console.log(`
|
|
7763
|
-
${import_picocolors3.default.bold("Enact CLI")} ${import_picocolors3.default.dim(
|
|
7777
|
+
${import_picocolors3.default.bold("Enact CLI")} ${import_picocolors3.default.dim(`v${version}`)}
|
|
7764
7778
|
${import_picocolors3.default.dim("A CLI tool for managing and publishing Enact tools")}
|
|
7765
7779
|
|
|
7766
7780
|
${import_picocolors3.default.bold("Usage:")}
|
|
@@ -7790,7 +7804,8 @@ ${import_picocolors3.default.bold("More Help:")}
|
|
|
7790
7804
|
`);
|
|
7791
7805
|
}
|
|
7792
7806
|
function showVersion() {
|
|
7793
|
-
|
|
7807
|
+
const version = getVersion();
|
|
7808
|
+
console.log(`enact-cli v${version}`);
|
|
7794
7809
|
}
|
|
7795
7810
|
function showPublishHelp() {
|
|
7796
7811
|
console.log(`
|
|
@@ -7815,11 +7830,11 @@ ${import_picocolors3.default.bold("Examples:")}
|
|
|
7815
7830
|
|
|
7816
7831
|
// src/utils/config.ts
|
|
7817
7832
|
import { homedir } from "os";
|
|
7818
|
-
import { join } from "path";
|
|
7833
|
+
import { join as join2 } from "path";
|
|
7819
7834
|
import { existsSync } from "fs";
|
|
7820
7835
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
7821
|
-
var CONFIG_DIR =
|
|
7822
|
-
var CONFIG_FILE =
|
|
7836
|
+
var CONFIG_DIR = join2(homedir(), ".enact");
|
|
7837
|
+
var CONFIG_FILE = join2(CONFIG_DIR, "config.json");
|
|
7823
7838
|
async function ensureConfig() {
|
|
7824
7839
|
if (!existsSync(CONFIG_DIR)) {
|
|
7825
7840
|
await mkdir(CONFIG_DIR, { recursive: true });
|
|
@@ -7871,7 +7886,7 @@ async function getDefaultUrl() {
|
|
|
7871
7886
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
7872
7887
|
import { existsSync as existsSync2 } from "fs";
|
|
7873
7888
|
import { readFile as readFile2, writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
|
|
7874
|
-
import { join as
|
|
7889
|
+
import { join as join3 } from "path";
|
|
7875
7890
|
import { homedir as homedir2 } from "os";
|
|
7876
7891
|
import { createServer } from "http";
|
|
7877
7892
|
import { parse } from "url";
|
|
@@ -8166,8 +8181,8 @@ function createEnactApiClient(baseUrl, supabaseUrl) {
|
|
|
8166
8181
|
|
|
8167
8182
|
// src/commands/auth.ts
|
|
8168
8183
|
var execAsync = promisify(exec);
|
|
8169
|
-
var CONFIG_DIR2 =
|
|
8170
|
-
var AUTH_FILE =
|
|
8184
|
+
var CONFIG_DIR2 = join3(homedir2(), ".enact");
|
|
8185
|
+
var AUTH_FILE = join3(CONFIG_DIR2, "auth.json");
|
|
8171
8186
|
var DEFAULT_SERVER = "https://enact.tools";
|
|
8172
8187
|
async function handleAuthCommand(args, options) {
|
|
8173
8188
|
if (options.help || !args[0]) {
|
|
@@ -8758,10 +8773,10 @@ function validateEnactFile(value) {
|
|
|
8758
8773
|
var import_picocolors6 = __toESM(require_picocolors(), 1);
|
|
8759
8774
|
import { existsSync as existsSync4 } from "fs";
|
|
8760
8775
|
import { readFile as readFile4, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises";
|
|
8761
|
-
import { join as
|
|
8776
|
+
import { join as join4 } from "path";
|
|
8762
8777
|
import { homedir as homedir3 } from "os";
|
|
8763
|
-
var CONFIG_DIR3 =
|
|
8764
|
-
var CONFIG_FILE2 =
|
|
8778
|
+
var CONFIG_DIR3 = join4(homedir3(), ".enact");
|
|
8779
|
+
var CONFIG_FILE2 = join4(CONFIG_DIR3, "config.json");
|
|
8765
8780
|
async function handleRemoteCommand(args, options) {
|
|
8766
8781
|
if (options.help || !args[0]) {
|
|
8767
8782
|
console.log(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "enact-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "Official CLI for the Enact Protocol - package, secure, and discover AI tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"LICENSE"
|
|
14
14
|
],
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "bun build ./src/index.ts --outdir ./dist --target node",
|
|
16
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target node && echo '#!/usr/bin/env node' | cat - ./dist/index.js > temp && mv temp ./dist/index.js && chmod +x ./dist/index.js",
|
|
17
17
|
"prepublishOnly": "npm run build",
|
|
18
18
|
"start": "bun ./dist/index.js",
|
|
19
19
|
"dev": "bun run --watch src/index.ts",
|
|
@@ -61,4 +61,4 @@
|
|
|
61
61
|
"picocolors": "^1.1.1",
|
|
62
62
|
"yaml": "^2.8.0"
|
|
63
63
|
}
|
|
64
|
-
}
|
|
64
|
+
}
|