@dashnex/cli 0.5.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.
- package/README.md +35 -0
- package/bin/dashnex +4 -0
- package/dist/cli.js +162 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.js +12 -0
- package/dist/client.js.map +1 -0
- package/dist/commands/create.js +134 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/delete.js +51 -0
- package/dist/commands/delete.js.map +1 -0
- package/dist/commands/index.js +68 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/login.js +262 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.js +16 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/pull.js +102 -0
- package/dist/commands/pull.js.map +1 -0
- package/dist/commands/push.js +108 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/version.js +10 -0
- package/dist/commands/version.js.map +1 -0
- package/dist/commands/whoami.js +52 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/dashnex.json.js +5 -0
- package/dist/dashnex.json.js.map +1 -0
- package/dist/lib/api.js +23 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/debug.js +45 -0
- package/dist/lib/debug.js.map +1 -0
- package/dist/package.json.js +15 -0
- package/dist/package.json.js.map +1 -0
- package/dist/server.js +12 -0
- package/dist/server.js.map +1 -0
- package/dist/services/auth.js +116 -0
- package/dist/services/auth.js.map +1 -0
- package/package.json +63 -0
package/dist/lib/api.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const getApiBase = () => {
|
|
2
|
+
return process.env.NEXT_PUBLIC_DASHNEX_API_DOMAIN || "https://api.dashnex.com";
|
|
3
|
+
};
|
|
4
|
+
const getBusinessApiBase = () => {
|
|
5
|
+
return process.env.DASHNEX_BUSINESS_API_URL || "https://api.business.dashnex.com";
|
|
6
|
+
};
|
|
7
|
+
const apiFetch = async (url, options = {}) => {
|
|
8
|
+
const response = await fetch(url, {
|
|
9
|
+
...options,
|
|
10
|
+
headers: {
|
|
11
|
+
"Content-Type": "application/json",
|
|
12
|
+
...options.headers
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const body = await response.json().catch(() => ({}));
|
|
16
|
+
return { response, body };
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
apiFetch,
|
|
20
|
+
getApiBase,
|
|
21
|
+
getBusinessApiBase
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sources":["../../src/lib/api.ts"],"sourcesContent":["const getApiBase = (): string => {\n return process.env.NEXT_PUBLIC_DASHNEX_API_DOMAIN || \"https://api.dashnex.com\";\n};\n\nconst getBusinessApiBase = (): string => {\n return process.env.DASHNEX_BUSINESS_API_URL || \"https://api.business.dashnex.com\";\n};\n\nconst apiFetch = async (\n url: string,\n options: RequestInit = {}\n): Promise<{ response: Response; body: Record<string, unknown> }> => {\n const response = await fetch(url, {\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n ...options.headers,\n },\n });\n const body = (await response.json().catch(() => ({}))) as Record<string, unknown>;\n return { response, body };\n};\n\nexport { getApiBase, getBusinessApiBase, apiFetch };\n"],"names":[],"mappings":"AAAA,MAAM,aAAa,MAAc;AAC/B,SAAO,QAAQ,IAAI,kCAAkC;AACvD;AAEA,MAAM,qBAAqB,MAAc;AACvC,SAAO,QAAQ,IAAI,4BAA4B;AACjD;AAEA,MAAM,WAAW,OACf,KACA,UAAuB,OAC4C;AACnE,QAAM,WAAW,MAAM,MAAM,KAAK;AAAA,IAChC,GAAG;AAAA,IACH,SAAS;AAAA,MACP,gBAAgB;AAAA,MAChB,GAAG,QAAQ;AAAA,IAAA;AAAA,EACb,CACD;AACD,QAAM,OAAQ,MAAM,SAAS,KAAA,EAAO,MAAM,OAAO,CAAA,EAAG;AACpD,SAAO,EAAE,UAAU,KAAA;AACrB;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
const isSensitiveKey = (key) => {
|
|
3
|
+
const k = key.toLowerCase();
|
|
4
|
+
return k.includes("token") || k.includes("password") || k === "auth_code";
|
|
5
|
+
};
|
|
6
|
+
const sanitizeForLog = (obj) => {
|
|
7
|
+
if (obj === null || typeof obj !== "object") return obj;
|
|
8
|
+
if (Array.isArray(obj)) {
|
|
9
|
+
return obj.map(sanitizeForLog);
|
|
10
|
+
}
|
|
11
|
+
const result = {};
|
|
12
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
13
|
+
if (isSensitiveKey(key)) {
|
|
14
|
+
result[key] = "[REDACTED]";
|
|
15
|
+
} else {
|
|
16
|
+
result[key] = sanitizeForLog(value);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
const debug = (msg) => {
|
|
22
|
+
if (process.env.DEBUG) {
|
|
23
|
+
console.log(chalk.dim(msg));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const debugJson = (label, body) => {
|
|
27
|
+
if (process.env.DEBUG) {
|
|
28
|
+
const sanitized = sanitizeForLog(body);
|
|
29
|
+
console.log(chalk.dim(`${label}: ${JSON.stringify(sanitized, null, 2)}`));
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const debugError = (error) => {
|
|
33
|
+
if (process.env.DEBUG && error instanceof Error) {
|
|
34
|
+
console.log(chalk.dim(`Error: ${error.message}`));
|
|
35
|
+
if (error.stack) {
|
|
36
|
+
console.log(chalk.dim(`Stack: ${error.stack}`));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
debug,
|
|
42
|
+
debugError,
|
|
43
|
+
debugJson
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=debug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.js","sources":["../../src/lib/debug.ts"],"sourcesContent":["import chalk from \"chalk\";\n\nconst isSensitiveKey = (key: string): boolean => {\n const k = key.toLowerCase();\n return k.includes(\"token\") || k.includes(\"password\") || k === \"auth_code\";\n};\n\nconst sanitizeForLog = (obj: unknown): unknown => {\n if (obj === null || typeof obj !== \"object\") return obj;\n if (Array.isArray(obj)) {\n return obj.map(sanitizeForLog);\n }\n const result: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj as Record<string, unknown>)) {\n if (isSensitiveKey(key)) {\n result[key] = \"[REDACTED]\";\n } else {\n result[key] = sanitizeForLog(value);\n }\n }\n return result;\n};\n\nexport const debug = (msg: string): void => {\n if (process.env.DEBUG) {\n console.log(chalk.dim(msg));\n }\n};\n\nexport const debugJson = (label: string, body: unknown): void => {\n if (process.env.DEBUG) {\n const sanitized = sanitizeForLog(body);\n console.log(chalk.dim(`${label}: ${JSON.stringify(sanitized, null, 2)}`));\n }\n};\n\nexport const debugError = (error: unknown): void => {\n if (process.env.DEBUG && error instanceof Error) {\n console.log(chalk.dim(`Error: ${error.message}`));\n if (error.stack) {\n console.log(chalk.dim(`Stack: ${error.stack}`));\n }\n }\n};\n"],"names":[],"mappings":";AAEA,MAAM,iBAAiB,CAAC,QAAyB;AAC/C,QAAM,IAAI,IAAI,YAAA;AACd,SAAO,EAAE,SAAS,OAAO,KAAK,EAAE,SAAS,UAAU,KAAK,MAAM;AAChE;AAEA,MAAM,iBAAiB,CAAC,QAA0B;AAChD,MAAI,QAAQ,QAAQ,OAAO,QAAQ,SAAU,QAAO;AACpD,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,IAAI,IAAI,cAAc;AAAA,EAC/B;AACA,QAAM,SAAkC,CAAA;AACxC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,GAA8B,GAAG;AACzE,QAAI,eAAe,GAAG,GAAG;AACvB,aAAO,GAAG,IAAI;AAAA,IAChB,OAAO;AACL,aAAO,GAAG,IAAI,eAAe,KAAK;AAAA,IACpC;AAAA,EACF;AACA,SAAO;AACT;AAEO,MAAM,QAAQ,CAAC,QAAsB;AAC1C,MAAI,QAAQ,IAAI,OAAO;AACrB,YAAQ,IAAI,MAAM,IAAI,GAAG,CAAC;AAAA,EAC5B;AACF;AAEO,MAAM,YAAY,CAAC,OAAe,SAAwB;AAC/D,MAAI,QAAQ,IAAI,OAAO;AACrB,UAAM,YAAY,eAAe,IAAI;AACrC,YAAQ,IAAI,MAAM,IAAI,GAAG,KAAK,KAAK,KAAK,UAAU,WAAW,MAAM,CAAC,CAAC,EAAE,CAAC;AAAA,EAC1E;AACF;AAEO,MAAM,aAAa,CAAC,UAAyB;AAClD,MAAI,QAAQ,IAAI,SAAS,iBAAiB,OAAO;AAC/C,YAAQ,IAAI,MAAM,IAAI,UAAU,MAAM,OAAO,EAAE,CAAC;AAChD,QAAI,MAAM,OAAO;AACf,cAAQ,IAAI,MAAM,IAAI,UAAU,MAAM,KAAK,EAAE,CAAC;AAAA,IAChD;AAAA,EACF;AACF;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const name = "@dashnex/cli";
|
|
2
|
+
const version = "0.5.1";
|
|
3
|
+
const description = "Command-line interface for DashNex framework";
|
|
4
|
+
const packageJson = {
|
|
5
|
+
name,
|
|
6
|
+
version,
|
|
7
|
+
description
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
packageJson as default,
|
|
11
|
+
description,
|
|
12
|
+
name,
|
|
13
|
+
version
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=package.json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import packageJson from "./package.json.js";
|
|
2
|
+
import dashnexConfig from "./dashnex.json.js";
|
|
3
|
+
const server = {
|
|
4
|
+
name: packageJson.name,
|
|
5
|
+
version: packageJson.version,
|
|
6
|
+
description: packageJson.description,
|
|
7
|
+
...dashnexConfig
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
server as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sources":["../src/server.ts"],"sourcesContent":["\nimport { ModuleConfig } from '@dashnex/types';\n\nimport packageJson from '../package.json' with { type: \"json\" };\nimport dashnexConfig from '../dashnex.json' with { type: \"json\" };\n\nexport default {\n name: packageJson.name,\n version: packageJson.version,\n description: packageJson.description,\n ...dashnexConfig,\n} as ModuleConfig;\n"],"names":[],"mappings":";;AAMA,MAAA,SAAe;AAAA,EACX,MAAM,YAAY;AAAA,EAClB,SAAS,YAAY;AAAA,EACrB,aAAa,YAAY;AAAA,EACzB,GAAG;AACP;"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { debug, debugJson, debugError } from "../lib/debug.js";
|
|
5
|
+
import { getApiBase, apiFetch } from "../lib/api.js";
|
|
6
|
+
const findDashnexPath = async (startDir) => {
|
|
7
|
+
let dir = path.resolve(startDir);
|
|
8
|
+
while (true) {
|
|
9
|
+
const candidate = path.join(dir, ".dashnex");
|
|
10
|
+
if (await fs.pathExists(candidate)) return candidate;
|
|
11
|
+
const parent = path.dirname(dir);
|
|
12
|
+
if (parent === dir) return null;
|
|
13
|
+
dir = parent;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const validateTokenAndRefreshIfNeeded = async (token, refreshToken, dashnexPath, config) => {
|
|
17
|
+
debug(`GET ${getApiBase()}/users/v1/`);
|
|
18
|
+
try {
|
|
19
|
+
const { response, body } = await apiFetch(`${getApiBase()}/users/v1/`, {
|
|
20
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
21
|
+
});
|
|
22
|
+
debug(`Response: ${response.status}`);
|
|
23
|
+
debugJson("Users response", body);
|
|
24
|
+
if (response.ok) {
|
|
25
|
+
const data = body;
|
|
26
|
+
if (typeof data.name === "string" && config.businessId) {
|
|
27
|
+
debug(`Token valid, Already logged in as ${data.name}`);
|
|
28
|
+
return {
|
|
29
|
+
token,
|
|
30
|
+
businessId: config.businessId,
|
|
31
|
+
userName: data.name
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (!refreshToken) {
|
|
36
|
+
debug("Token invalid, no refreshToken available");
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
debug(`POST ${getApiBase()}/auth/v1/token/refresh`);
|
|
40
|
+
const { response: refreshResponse, body: refreshBody } = await apiFetch(
|
|
41
|
+
`${getApiBase()}/auth/v1/token/refresh`,
|
|
42
|
+
{
|
|
43
|
+
method: "POST",
|
|
44
|
+
body: JSON.stringify({ refreshToken })
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
debug(`Response: ${refreshResponse.status}`);
|
|
48
|
+
debugJson("Refresh response", refreshBody);
|
|
49
|
+
if (!refreshResponse.ok) {
|
|
50
|
+
debug("Token refresh failed");
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const refreshData = refreshBody;
|
|
54
|
+
if (!refreshData.token || !refreshData.refreshToken) {
|
|
55
|
+
debug("Refresh response missing tokens");
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const updatedConfig = await fs.readJson(dashnexPath);
|
|
59
|
+
updatedConfig.token = refreshData.token;
|
|
60
|
+
updatedConfig.refreshToken = refreshData.refreshToken;
|
|
61
|
+
await fs.writeJson(dashnexPath, updatedConfig, { spaces: 2 });
|
|
62
|
+
debug("Updated .dashnex with new tokens, retrying session check");
|
|
63
|
+
return validateTokenAndRefreshIfNeeded(
|
|
64
|
+
refreshData.token,
|
|
65
|
+
refreshData.refreshToken,
|
|
66
|
+
dashnexPath,
|
|
67
|
+
{ ...updatedConfig, token: refreshData.token, refreshToken: refreshData.refreshToken }
|
|
68
|
+
);
|
|
69
|
+
} catch (error) {
|
|
70
|
+
debugError(error);
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const ensureLoggedIn = async (options = {}) => {
|
|
75
|
+
const { exitOnFailure = true, dashnexPath: customPath } = options;
|
|
76
|
+
const dashnexPath = customPath ?? await findDashnexPath(process.cwd());
|
|
77
|
+
if (!dashnexPath || !await fs.pathExists(dashnexPath)) {
|
|
78
|
+
debug(".dashnex not found");
|
|
79
|
+
if (exitOnFailure) {
|
|
80
|
+
console.error(chalk.red("Please run 'npx dashnex login' to authenticate."));
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
let config;
|
|
86
|
+
try {
|
|
87
|
+
config = await fs.readJson(dashnexPath);
|
|
88
|
+
} catch {
|
|
89
|
+
debug(".dashnex parse failed");
|
|
90
|
+
if (exitOnFailure) {
|
|
91
|
+
console.error(chalk.red("Please run 'npx dashnex login' to authenticate."));
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
const { token, refreshToken, businessId } = config;
|
|
97
|
+
if (!token) {
|
|
98
|
+
debug(".dashnex missing token");
|
|
99
|
+
if (exitOnFailure) {
|
|
100
|
+
console.error(chalk.red("Please run 'npx dashnex login' to authenticate."));
|
|
101
|
+
process.exit(1);
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const result = await validateTokenAndRefreshIfNeeded(token, refreshToken, dashnexPath, config);
|
|
106
|
+
if (result) return result;
|
|
107
|
+
if (exitOnFailure) {
|
|
108
|
+
console.error(chalk.red("Please run 'npx dashnex login' to authenticate."));
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
};
|
|
113
|
+
export {
|
|
114
|
+
ensureLoggedIn
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sources":["../../src/services/auth.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport { debug, debugJson, debugError } from \"../lib/debug.js\";\nimport { getApiBase, apiFetch } from \"../lib/api.js\";\n\ninterface DashnexConfig {\n token?: string;\n refreshToken?: string;\n businessId?: string;\n}\n\nexport interface EnsureLoggedInResult {\n token: string;\n businessId: string;\n userName?: string;\n}\n\nexport interface EnsureLoggedInOptions {\n exitOnFailure?: boolean;\n dashnexPath?: string;\n}\n\nconst findDashnexPath = async (startDir: string): Promise<string | null> => {\n let dir = path.resolve(startDir);\n while (true) {\n const candidate = path.join(dir, \".dashnex\");\n if (await fs.pathExists(candidate)) return candidate;\n const parent = path.dirname(dir);\n if (parent === dir) return null;\n dir = parent;\n }\n};\n\nconst validateTokenAndRefreshIfNeeded = async (\n token: string,\n refreshToken: string | undefined,\n dashnexPath: string,\n config: DashnexConfig\n): Promise<EnsureLoggedInResult | null> => {\n debug(`GET ${getApiBase()}/users/v1/`);\n try {\n const { response, body } = await apiFetch(`${getApiBase()}/users/v1/`, {\n headers: { Authorization: `Bearer ${token}` },\n });\n debug(`Response: ${response.status}`);\n debugJson(\"Users response\", body);\n\n if (response.ok) {\n const data = body as { id?: string; name?: string };\n if (typeof data.name === \"string\" && config.businessId) {\n debug(`Token valid, Already logged in as ${data.name}`);\n return {\n token,\n businessId: config.businessId,\n userName: data.name,\n };\n }\n }\n\n if (!refreshToken) {\n debug(\"Token invalid, no refreshToken available\");\n return null;\n }\n\n debug(`POST ${getApiBase()}/auth/v1/token/refresh`);\n const { response: refreshResponse, body: refreshBody } = await apiFetch(\n `${getApiBase()}/auth/v1/token/refresh`,\n {\n method: \"POST\",\n body: JSON.stringify({ refreshToken }),\n }\n );\n debug(`Response: ${refreshResponse.status}`);\n debugJson(\"Refresh response\", refreshBody);\n\n if (!refreshResponse.ok) {\n debug(\"Token refresh failed\");\n return null;\n }\n\n const refreshData = refreshBody as { token?: string; refreshToken?: string };\n if (!refreshData.token || !refreshData.refreshToken) {\n debug(\"Refresh response missing tokens\");\n return null;\n }\n\n const updatedConfig = (await fs.readJson(dashnexPath)) as DashnexConfig;\n updatedConfig.token = refreshData.token;\n updatedConfig.refreshToken = refreshData.refreshToken;\n await fs.writeJson(dashnexPath, updatedConfig, { spaces: 2 });\n debug(\"Updated .dashnex with new tokens, retrying session check\");\n\n return validateTokenAndRefreshIfNeeded(\n refreshData.token,\n refreshData.refreshToken,\n dashnexPath,\n { ...updatedConfig, token: refreshData.token, refreshToken: refreshData.refreshToken }\n );\n } catch (error) {\n debugError(error);\n return null;\n }\n};\n\nexport const ensureLoggedIn = async (\n options: EnsureLoggedInOptions = {}\n): Promise<EnsureLoggedInResult | null> => {\n const { exitOnFailure = true, dashnexPath: customPath } = options;\n const dashnexPath = customPath ?? (await findDashnexPath(process.cwd()));\n\n if (!dashnexPath || !(await fs.pathExists(dashnexPath))) {\n debug(\".dashnex not found\");\n if (exitOnFailure) {\n console.error(chalk.red(\"Please run 'npx dashnex login' to authenticate.\"));\n process.exit(1);\n }\n return null;\n }\n\n let config: DashnexConfig;\n try {\n config = (await fs.readJson(dashnexPath)) as DashnexConfig;\n } catch {\n debug(\".dashnex parse failed\");\n if (exitOnFailure) {\n console.error(chalk.red(\"Please run 'npx dashnex login' to authenticate.\"));\n process.exit(1);\n }\n return null;\n }\n\n const { token, refreshToken, businessId } = config;\n if (!token) {\n debug(\".dashnex missing token\");\n if (exitOnFailure) {\n console.error(chalk.red(\"Please run 'npx dashnex login' to authenticate.\"));\n process.exit(1);\n }\n return null;\n }\n\n const result = await validateTokenAndRefreshIfNeeded(token, refreshToken, dashnexPath, config);\n if (result) return result;\n\n if (exitOnFailure) {\n console.error(chalk.red(\"Please run 'npx dashnex login' to authenticate.\"));\n process.exit(1);\n }\n return null;\n};\n"],"names":[],"mappings":";;;;;A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AA,IAChB;AACA,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,MAAM,gCAAgC,OAAO,cAAc,aAAa,MAAM;AAC7F,MAAI,OAAQ,QAAO;AAEnB,MAAI,eAAe;AACjB,YAAQ,MAAM,MAAM,IAAI,iDAAiD,CAAC;AAC1E,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO;AACT;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/package",
|
|
3
|
+
"name": "@dashnex/cli",
|
|
4
|
+
"version": "0.5.1",
|
|
5
|
+
"description": "Command-line interface for DashNex framework",
|
|
6
|
+
"homepage": "https://dashnex.io",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"dashnex": "bin/dashnex"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/server.d.ts",
|
|
14
|
+
"default": "./dist/server.js"
|
|
15
|
+
},
|
|
16
|
+
"./client": {
|
|
17
|
+
"types": "./dist/client.d.ts",
|
|
18
|
+
"default": "./dist/client.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"dashnex",
|
|
23
|
+
"cli"
|
|
24
|
+
],
|
|
25
|
+
"author": "Dashnex Team",
|
|
26
|
+
"license": "UNLICENSED",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"adm-zip": "^0.5.16",
|
|
29
|
+
"chalk": "^5.6.2",
|
|
30
|
+
"commander": "^14.0.3",
|
|
31
|
+
"dotenv": "^17.2.4",
|
|
32
|
+
"fs-extra": "^11.3.3",
|
|
33
|
+
"ignore": "^7.0.5",
|
|
34
|
+
"inquirer": "^13.2.2"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@dashnex/types": "^0.5.2",
|
|
38
|
+
"@types/adm-zip": "^0.5.7",
|
|
39
|
+
"@types/fs-extra": "^11.0.4",
|
|
40
|
+
"@types/inquirer": "^9.0.9",
|
|
41
|
+
"@types/node": "^25.2.3",
|
|
42
|
+
"eslint": "^9.39.2",
|
|
43
|
+
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
44
|
+
"terser": "^5.46.0",
|
|
45
|
+
"typescript": "^5.9.3",
|
|
46
|
+
"vite": "^7.3.1",
|
|
47
|
+
"vite-plugin-dts": "^4.5.4",
|
|
48
|
+
"vitest": "^4.0.18"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"registry": "https://registry.npmjs.org/"
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"dist",
|
|
56
|
+
"bin"
|
|
57
|
+
],
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "vite build",
|
|
60
|
+
"dev": "vite build --watch --mode development",
|
|
61
|
+
"test": "vitest run"
|
|
62
|
+
}
|
|
63
|
+
}
|