juxscript 1.1.8 → 1.1.10
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/juxconfig.example.js +13 -64
- package/machinery/build3.js +2 -1
- package/package.json +1 -1
package/juxconfig.example.js
CHANGED
|
@@ -1,71 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* JUX
|
|
3
|
-
*
|
|
4
|
-
* This file is optional. JUX works out-of-the-box with sensible defaults.
|
|
5
|
-
* Customize only if you need to change default behavior.
|
|
6
|
-
*
|
|
7
|
-
* Copy this file to your project root as 'juxconfig.js' to customize.
|
|
2
|
+
* JUX PROJECT CONFIGURATION
|
|
3
|
+
* This file defines the environment, routing, and behavior of your JUX application.
|
|
8
4
|
*/
|
|
9
5
|
|
|
10
|
-
|
|
11
|
-
export const routeOverrides = {
|
|
12
|
-
// 'about': '/about-us',
|
|
13
|
-
}
|
|
6
|
+
export const config = {
|
|
14
7
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// Directories
|
|
20
|
-
sourceDir: 'jux',
|
|
21
|
-
distDir: '.jux-dist',
|
|
22
|
-
|
|
23
|
-
// External services - used by jux.fetch and jux.fetch.serviceClient()
|
|
24
|
-
// Each service becomes available as a baseUrl for fetch requests
|
|
25
|
-
//
|
|
26
|
-
// Usage in components:
|
|
27
|
-
// const db = jux.fetch.serviceClient('database');
|
|
28
|
-
// const { data } = await db.fetch('/users').send();
|
|
29
|
-
//
|
|
30
|
-
// // Or directly:
|
|
31
|
-
// const { data } = await jux.fetch('/users')
|
|
32
|
-
// .header('Authorization', 'Bearer token')
|
|
33
|
-
// .send();
|
|
34
|
-
services: {
|
|
35
|
-
database: 'http://localhost:4000/api/db',
|
|
36
|
-
auth: 'http://localhost:4000/api/auth',
|
|
37
|
-
monday: 'http://api.rxtrail.monday.com/api/'
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
// Dev server ports
|
|
41
|
-
ports: {
|
|
42
|
-
http: 3000,
|
|
43
|
-
ws: 3001
|
|
8
|
+
// Project Folder Structure declaration
|
|
9
|
+
directories: {
|
|
10
|
+
source: './jux', // Where your .jux files live
|
|
11
|
+
distribution: './.jux-dist', // Where build artifacts go
|
|
44
12
|
},
|
|
45
13
|
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
build: {
|
|
52
|
-
minify: false,
|
|
53
|
-
sourcemap: true
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
// Bootstrap functions (run on startup)
|
|
57
|
-
// Perfect place to initialize services and auth
|
|
58
|
-
bootstrap: [
|
|
59
|
-
// Example: Setup fetch with service configuration
|
|
60
|
-
// async function initFetch() {
|
|
61
|
-
// await jux.fetch.setupConfig();
|
|
62
|
-
// console.log('✅ Fetch configured');
|
|
63
|
-
// },
|
|
64
|
-
|
|
65
|
-
// Example: Initialize authentication
|
|
66
|
-
// async function initAuth() {
|
|
67
|
-
// console.log('🔐 Initializing auth...');
|
|
68
|
-
// },
|
|
69
|
-
]
|
|
70
|
-
};
|
|
14
|
+
// Application Defaults
|
|
15
|
+
defaults: {
|
|
16
|
+
httpPort: 3000,
|
|
17
|
+
wsPort: 3001,
|
|
18
|
+
}
|
|
71
19
|
|
|
20
|
+
};
|
package/machinery/build3.js
CHANGED
|
@@ -11,7 +11,8 @@ const JUX_CONFIG_PATH = path.resolve(PROJECT_ROOT, 'juxconfig.js');
|
|
|
11
11
|
let rawConfig = {};
|
|
12
12
|
|
|
13
13
|
try {
|
|
14
|
-
|
|
14
|
+
const imported = await import(JUX_CONFIG_PATH);
|
|
15
|
+
rawConfig = imported.config || {};
|
|
15
16
|
console.log(`⚙️ Loaded config: ${JUX_CONFIG_PATH}`);
|
|
16
17
|
} catch (err) {
|
|
17
18
|
console.warn(`⚠️ No juxconfig.js found, using defaults`);
|