juxscript 1.1.9 → 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.
@@ -1,71 +1,20 @@
1
1
  /**
2
- * JUX Configuration File
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
- // Route overrides
11
- export const routeOverrides = {
12
- // 'about': '/about-us',
13
- }
6
+ export const config = {
14
7
 
15
- export default {
16
- // Application settings
17
- appName: 'My JUX App',
18
- autoRoutes: true,
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
- // Fetch configuration
47
- fetchTimeout: 30000, // milliseconds
48
- fetchLog: false, // true, false, or 'errors' for error-only logging
49
-
50
- // Build options
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
+ };
@@ -12,24 +12,24 @@ let rawConfig = {};
12
12
 
13
13
  try {
14
14
  const imported = await import(JUX_CONFIG_PATH);
15
- rawConfig = imported.config || imported.default || {};
15
+ rawConfig = imported.config || {};
16
16
  console.log(`⚙️ Loaded config: ${JUX_CONFIG_PATH}`);
17
17
  } catch (err) {
18
18
  console.warn(`⚠️ No juxconfig.js found, using defaults`);
19
19
  }
20
20
 
21
21
  // ═══════════════════════════════════════════════════════════════
22
- // EXPLODE CONFIG - Handle both old and new structure
22
+ // EXPLODE CONFIG
23
23
  // ═══════════════════════════════════════════════════════════════
24
24
  const directories = {
25
- source: rawConfig.directories?.source || rawConfig.sourceDir || './jux',
26
- distribution: rawConfig.directories?.distribution || rawConfig.distDir || './.jux-dist'
25
+ source: rawConfig.directories?.source || './jux',
26
+ distribution: rawConfig.directories?.distribution || './.jux-dist'
27
27
  };
28
28
 
29
29
  const defaults = {
30
- httpPort: rawConfig.defaults?.httpPort || rawConfig.ports?.http || 3000,
31
- wsPort: rawConfig.defaults?.wsPort || rawConfig.ports?.ws || 3001,
32
- autoRoute: rawConfig.defaults?.autoRoute ?? rawConfig.autoRoutes ?? true
30
+ httpPort: rawConfig.defaults?.httpPort || 3000,
31
+ wsPort: rawConfig.defaults?.wsPort || 3001,
32
+ autoRoute: rawConfig.defaults?.autoRoute ?? true
33
33
  };
34
34
 
35
35
  // Resolve absolute paths
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juxscript",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "type": "module",
5
5
  "description": "A JavaScript UX authorship platform",
6
6
  "main": "index.js",