@nexushub/client 0.8.9 → 1.1.0

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 CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@nexushub/client",
3
3
  "private": false,
4
- "version": "0.8.9",
5
- "description": "The God-Tier NexusHub SDK",
4
+ "version": "1.1.0",
5
+ "description": "GN-Apex zero-config production runtime SDK",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",
8
8
  "module": "./dist/index.js",
@@ -45,16 +45,15 @@
45
45
  "scripts": {
46
46
  "build": "tsup && npm run build --prefix ../app/studio",
47
47
  "dev": "tsup src/index.ts tools/cli.ts --format esm,cjs --dts --watch",
48
- "test": "jest",
49
- "test:coverage": "jest --coverage",
50
- "test:debug": "jest --verbose --no-coverage",
51
- "test:unit": "jest src/__tests__/*.test.ts",
52
- "test:integration": "jest src/__tests__/integration/*.test.ts",
53
- "coverage": "jest --coverage --coverageDirectory=coverage",
54
- "coverage:html": "jest --coverage --coverageDirectory=coverage --coverageReporters=html",
55
- "coverage:ci": "jest --coverage --coverageDirectory=coverage --coverageReporters=text-lcov | coveralls",
48
+ "test": "jest --config jest.config.cjs",
49
+ "test:coverage": "jest --config jest.config.cjs --coverage",
50
+ "test:debug": "jest --config jest.config.cjs --verbose --no-coverage",
51
+ "test:unit": "jest --config jest.config.cjs src/__tests__/*.test.ts",
52
+ "test:integration": "jest --config jest.config.cjs src/__tests__/integration/*.test.ts",
53
+ "coverage": "jest --config jest.config.cjs --coverage --coverageDirectory=coverage",
54
+ "coverage:html": "jest --config jest.config.cjs --coverage --coverageDirectory=coverage --coverageReporters=html",
56
55
  "lint": "eslint src --ext .ts,.tsx",
57
- "test:watch": "jest --watch",
56
+ "test:watch": "jest --config jest.config.cjs --watch",
58
57
  "prepublishOnly": "npm run build",
59
58
  "type-check": "tsc --noEmit"
60
59
  },
@@ -65,10 +64,20 @@
65
64
  "content",
66
65
  "headless",
67
66
  "nextjs",
68
- "sdk"
67
+ "sdk",
68
+ "gnapex",
69
+ "zero-config",
70
+ "runtime"
69
71
  ],
70
72
  "author": "Jom Irish - NexusHub",
71
73
  "license": "MIT",
74
+ "dependencies": {
75
+ "dotenv": "^17.2.3",
76
+ "lucide-react": "^1.21.0",
77
+ "node-fetch": "^3.3.2",
78
+ "socket.io-client": "^4.8.3",
79
+ "web-vitals": "^5.1.0"
80
+ },
72
81
  "devDependencies": {
73
82
  "@eslint/eslintrc": "^3",
74
83
  "@testing-library/jest-dom": "^6.9.1",
@@ -82,31 +91,24 @@
82
91
  "@types/semver": "^7.7.1",
83
92
  "@typescript-eslint/eslint-plugin": "^8.50.1",
84
93
  "@typescript-eslint/parser": "^8.50.1",
85
- "eslint": "^9",
86
- "eslint-config-next": "16.1.1",
87
- "jest": "^30.2.0",
88
- "jest-environment-jsdom": "^30.2.0",
89
- "next": "^16.1.1",
90
- "ts-jest": "^29.4.6",
91
- "tsup": "^8.5.1",
92
- "typescript": "^5.9.3"
93
- },
94
- "dependencies": {
95
94
  "chalk": "^5.6.2",
96
95
  "cli-table3": "^0.6.5",
97
96
  "commander": "^14.0.2",
98
- "dotenv": "^17.2.3",
99
97
  "esbuild": "^0.28.1",
98
+ "eslint": "^9",
99
+ "eslint-config-next": "16.1.1",
100
100
  "figlet": "^1.11.0",
101
101
  "fs-extra": "^11.3.3",
102
102
  "gradient-string": "^3.0.0",
103
103
  "inquirer": "^14.0.2",
104
- "lucide-react": "^1.21.0",
105
- "node-fetch": "^3.3.2",
104
+ "jest": "^30.2.0",
105
+ "jest-environment-jsdom": "^30.2.0",
106
+ "next": "^16.1.1",
106
107
  "ora": "^9.0.0",
107
108
  "semver": "^7.8.5",
108
- "socket.io-client": "^4.8.3",
109
- "web-vitals": "^5.1.0",
109
+ "ts-jest": "^29.4.6",
110
+ "tsup": "^8.5.1",
111
+ "typescript": "^5.9.3",
110
112
  "wrangler": "^4.105.0"
111
113
  },
112
114
  "peerDependencies": {
@@ -1,53 +0,0 @@
1
- // src/config.ts
2
- var DEFAULT_API_URL = "https://gnapex.gnexus.co.tz";
3
- var DEFAULT_ANALYTICS_URL = "https://sentry.gnexus.co.tz";
4
- var LOCAL_NEST_URL = "https://gnapex.gnexus.co.tz";
5
- var LOCAL_RUST_URL = "https://sentry.gnexus.co.tz";
6
- var getEnvConfig = () => {
7
- const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
8
- const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
9
- const NEXT_PUBLIC_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_API_URL : void 0;
10
- const NODE_ID = typeof process !== "undefined" ? process.env.NEXUS_PROJECT_ID : void 0;
11
- const NODE_KEY = typeof process !== "undefined" ? process.env.NEXUS_API_KEY : void 0;
12
- const NODE_URL = typeof process !== "undefined" ? process.env.NEXUS_API_URL : void 0;
13
- const NODE_ENV = typeof process !== "undefined" ? process.env.NODE_ENV : "production";
14
- const isDev = NODE_ENV === "development" || typeof window !== "undefined" && window.location.hostname === "localhost";
15
- const projectId = NEXT_PUBLIC_ID ?? NODE_ID;
16
- const apiKey = NEXT_PUBLIC_KEY ?? NODE_KEY;
17
- const apiUrl = NEXT_PUBLIC_URL ?? NODE_URL ?? (isDev ? LOCAL_NEST_URL : DEFAULT_API_URL);
18
- const analyticsUrl = apiUrl.includes("localhost") ? LOCAL_RUST_URL : DEFAULT_ANALYTICS_URL;
19
- return {
20
- projectId,
21
- apiKey,
22
- apiUrl,
23
- analyticsUrl
24
- };
25
- };
26
- var mergeConfigs = (base, override) => {
27
- const mergedApiUrl = override.apiUrl || base.apiUrl || DEFAULT_API_URL;
28
- const mergedAnalyticsUrl = override.analyticsUrl || base.analyticsUrl || (mergedApiUrl.includes("localhost") ? LOCAL_RUST_URL : DEFAULT_ANALYTICS_URL);
29
- return {
30
- ...base,
31
- ...override,
32
- apiUrl: mergedApiUrl,
33
- analyticsUrl: mergedAnalyticsUrl,
34
- projectId: override.projectId || base.projectId,
35
- apiKey: override.apiKey || base.apiKey
36
- };
37
- };
38
- var getFullConfig = (partialConfig) => {
39
- const envConfig = getEnvConfig();
40
- return mergeConfigs(envConfig, partialConfig || {});
41
- };
42
- var validateConfig = (config) => {
43
- const errors = [];
44
- if (!config.projectId) errors.push("Missing projectId");
45
- if (!config.apiUrl) errors.push("Missing apiUrl");
46
- return errors;
47
- };
48
-
49
- export {
50
- getEnvConfig,
51
- getFullConfig,
52
- validateConfig
53
- };
@@ -1,53 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }// src/config.ts
2
- var DEFAULT_API_URL = "https://gnapex.gnexus.co.tz";
3
- var DEFAULT_ANALYTICS_URL = "https://sentry.gnexus.co.tz";
4
- var LOCAL_NEST_URL = "https://gnapex.gnexus.co.tz";
5
- var LOCAL_RUST_URL = "https://sentry.gnexus.co.tz";
6
- var getEnvConfig = () => {
7
- const NEXT_PUBLIC_ID = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_ID : void 0;
8
- const NEXT_PUBLIC_KEY = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_KEY : void 0;
9
- const NEXT_PUBLIC_URL = typeof process !== "undefined" ? process.env.NEXT_PUBLIC_NEXUS_API_URL : void 0;
10
- const NODE_ID = typeof process !== "undefined" ? process.env.NEXUS_PROJECT_ID : void 0;
11
- const NODE_KEY = typeof process !== "undefined" ? process.env.NEXUS_API_KEY : void 0;
12
- const NODE_URL = typeof process !== "undefined" ? process.env.NEXUS_API_URL : void 0;
13
- const NODE_ENV = typeof process !== "undefined" ? process.env.NODE_ENV : "production";
14
- const isDev = NODE_ENV === "development" || typeof window !== "undefined" && window.location.hostname === "localhost";
15
- const projectId = _nullishCoalesce(NEXT_PUBLIC_ID, () => ( NODE_ID));
16
- const apiKey = _nullishCoalesce(NEXT_PUBLIC_KEY, () => ( NODE_KEY));
17
- const apiUrl = _nullishCoalesce(_nullishCoalesce(NEXT_PUBLIC_URL, () => ( NODE_URL)), () => ( (isDev ? LOCAL_NEST_URL : DEFAULT_API_URL)));
18
- const analyticsUrl = apiUrl.includes("localhost") ? LOCAL_RUST_URL : DEFAULT_ANALYTICS_URL;
19
- return {
20
- projectId,
21
- apiKey,
22
- apiUrl,
23
- analyticsUrl
24
- };
25
- };
26
- var mergeConfigs = (base, override) => {
27
- const mergedApiUrl = override.apiUrl || base.apiUrl || DEFAULT_API_URL;
28
- const mergedAnalyticsUrl = override.analyticsUrl || base.analyticsUrl || (mergedApiUrl.includes("localhost") ? LOCAL_RUST_URL : DEFAULT_ANALYTICS_URL);
29
- return {
30
- ...base,
31
- ...override,
32
- apiUrl: mergedApiUrl,
33
- analyticsUrl: mergedAnalyticsUrl,
34
- projectId: override.projectId || base.projectId,
35
- apiKey: override.apiKey || base.apiKey
36
- };
37
- };
38
- var getFullConfig = (partialConfig) => {
39
- const envConfig = getEnvConfig();
40
- return mergeConfigs(envConfig, partialConfig || {});
41
- };
42
- var validateConfig = (config) => {
43
- const errors = [];
44
- if (!config.projectId) errors.push("Missing projectId");
45
- if (!config.apiUrl) errors.push("Missing apiUrl");
46
- return errors;
47
- };
48
-
49
-
50
-
51
-
52
-
53
- exports.getEnvConfig = getEnvConfig; exports.getFullConfig = getFullConfig; exports.validateConfig = validateConfig;