juxscript 1.1.393 → 1.1.395
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/bin/cli.js +9 -9
- package/dist/components/barChart.d.ts +103 -0
- package/dist/components/barChart.d.ts.map +1 -0
- package/dist/components/barChart.js +520 -0
- package/dist/components/barChart.js.map +1 -0
- package/dist/components/c.d.ts.map +1 -1
- package/dist/components/c.js +16 -12
- package/dist/components/c.js.map +1 -1
- package/dist/components/g.d.ts +21 -0
- package/dist/components/g.d.ts.map +1 -0
- package/dist/components/g.js +52 -0
- package/dist/components/g.js.map +1 -0
- package/dist/components/gateway.d.ts +97 -0
- package/dist/components/gateway.d.ts.map +1 -0
- package/dist/components/gateway.js +188 -0
- package/dist/components/gateway.js.map +1 -0
- package/dist/components/lineChart.d.ts +87 -0
- package/dist/components/lineChart.d.ts.map +1 -0
- package/dist/components/lineChart.js +330 -0
- package/dist/components/lineChart.js.map +1 -0
- package/dist/components/pieChart.d.ts +86 -0
- package/dist/components/pieChart.d.ts.map +1 -0
- package/dist/components/pieChart.js +300 -0
- package/dist/components/pieChart.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/primitives/button.d.ts +53 -0
- package/dist/primitives/button.d.ts.map +1 -0
- package/dist/primitives/button.js +170 -0
- package/dist/primitives/button.js.map +1 -0
- package/dist/primitives/c.d.ts +53 -0
- package/dist/primitives/c.d.ts.map +1 -0
- package/dist/primitives/c.js +127 -0
- package/dist/primitives/c.js.map +1 -0
- package/dist/primitives/checkbox.d.ts +92 -0
- package/dist/primitives/checkbox.d.ts.map +1 -0
- package/dist/primitives/checkbox.js +217 -0
- package/dist/primitives/checkbox.js.map +1 -0
- package/dist/primitives/data.d.ts +58 -0
- package/dist/primitives/data.d.ts.map +1 -0
- package/dist/primitives/data.js +131 -0
- package/dist/primitives/data.js.map +1 -0
- package/dist/primitives/grid.d.ts +58 -0
- package/dist/primitives/grid.d.ts.map +1 -0
- package/dist/primitives/grid.js +128 -0
- package/dist/primitives/grid.js.map +1 -0
- package/dist/primitives/include.d.ts +86 -0
- package/dist/primitives/include.d.ts.map +1 -0
- package/dist/primitives/include.js +239 -0
- package/dist/primitives/include.js.map +1 -0
- package/dist/primitives/indexDb.d.ts +80 -0
- package/dist/primitives/indexDb.d.ts.map +1 -0
- package/dist/primitives/indexDb.js +253 -0
- package/dist/primitives/indexDb.js.map +1 -0
- package/dist/primitives/input.d.ts +88 -0
- package/dist/primitives/input.d.ts.map +1 -0
- package/dist/primitives/input.js +216 -0
- package/dist/primitives/input.js.map +1 -0
- package/dist/primitives/link.d.ts +51 -0
- package/dist/primitives/link.d.ts.map +1 -0
- package/dist/primitives/link.js +178 -0
- package/dist/primitives/link.js.map +1 -0
- package/dist/primitives/list.d.ts +66 -0
- package/dist/primitives/list.d.ts.map +1 -0
- package/dist/primitives/list.js +233 -0
- package/dist/primitives/list.js.map +1 -0
- package/dist/primitives/nav.d.ts +64 -0
- package/dist/primitives/nav.d.ts.map +1 -0
- package/dist/primitives/nav.js +236 -0
- package/dist/primitives/nav.js.map +1 -0
- package/dist/primitives/radio.d.ts +58 -0
- package/dist/primitives/radio.d.ts.map +1 -0
- package/dist/primitives/radio.js +135 -0
- package/dist/primitives/radio.js.map +1 -0
- package/dist/primitives/routes.d.ts +15 -0
- package/dist/primitives/routes.d.ts.map +1 -0
- package/dist/primitives/routes.js +34 -0
- package/dist/primitives/routes.js.map +1 -0
- package/dist/primitives/select.d.ts +67 -0
- package/dist/primitives/select.d.ts.map +1 -0
- package/dist/primitives/select.js +160 -0
- package/dist/primitives/select.js.map +1 -0
- package/dist/primitives/style.d.ts +27 -0
- package/dist/primitives/style.d.ts.map +1 -0
- package/dist/primitives/style.js +53 -0
- package/dist/primitives/style.js.map +1 -0
- package/dist/primitives/table.d.ts +83 -0
- package/dist/primitives/table.d.ts.map +1 -0
- package/dist/primitives/table.js +264 -0
- package/dist/primitives/table.js.map +1 -0
- package/dist/primitives/tabs.d.ts +75 -0
- package/dist/primitives/tabs.d.ts.map +1 -0
- package/dist/primitives/tabs.js +263 -0
- package/dist/primitives/tabs.js.map +1 -0
- package/dist/primitives/tag.d.ts +92 -0
- package/dist/primitives/tag.d.ts.map +1 -0
- package/dist/primitives/tag.js +151 -0
- package/dist/primitives/tag.js.map +1 -0
- package/dist/services/db.d.ts +44 -0
- package/dist/services/db.d.ts.map +1 -0
- package/dist/services/db.js +59 -0
- package/dist/services/db.js.map +1 -0
- package/dist/services/email.d.ts +50 -0
- package/dist/services/email.d.ts.map +1 -0
- package/dist/services/email.js +60 -0
- package/dist/services/email.js.map +1 -0
- package/dist/services/s3.d.ts +61 -0
- package/dist/services/s3.d.ts.map +1 -0
- package/dist/services/s3.js +79 -0
- package/dist/services/s3.js.map +1 -0
- package/juxconfig.example.js +7 -0
- package/machinery/build3.js +2 -1
- package/machinery/compiler4.js +2 -0
- package/machinery/serve.js +6 -26
- package/machinery/validate-jux.js +4 -0
- package/package.json +2 -2
- /package/{presets → components}/calendar/calendar-usage.jux +0 -0
- /package/{presets → components}/calendar/calendar.jux +0 -0
- /package/{presets → components}/sidebar/index.jux +0 -0
- /package/{presets → components}/sidebar/usage.jux +0 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* email.ts — Jux email service client
|
|
3
|
+
*
|
|
4
|
+
* JuxEmail establishes connectivity to the `email` downstream service via the
|
|
5
|
+
* ApiGateway backend. It provides a domain-specific API for email operations;
|
|
6
|
+
* every method ultimately delegates to `this.call(path, options)`, which routes
|
|
7
|
+
* through the Jux Gateway transport layer.
|
|
8
|
+
*
|
|
9
|
+
* Usage in a .jux file:
|
|
10
|
+
* const api = await jux.gateway(username, password);
|
|
11
|
+
* const email = api.connect('email');
|
|
12
|
+
*
|
|
13
|
+
* // Inspect service settings (configured sender, templates, limits, etc.)
|
|
14
|
+
* const cfg = await email.settings();
|
|
15
|
+
*
|
|
16
|
+
* // Send a plain-text email
|
|
17
|
+
* await email.send('recipient@example.com', 'Hello', 'Plain-text body');
|
|
18
|
+
*
|
|
19
|
+
* // Send an HTML email
|
|
20
|
+
* await email.send('recipient@example.com', 'Hello', 'Plain text', '<b>HTML body</b>');
|
|
21
|
+
*/
|
|
22
|
+
import { ApiGateway, JuxService, ApiResult, ApiCallOptions } from '../components/gateway.js';
|
|
23
|
+
export declare class JuxEmail extends JuxService {
|
|
24
|
+
constructor(gateway: ApiGateway);
|
|
25
|
+
/**
|
|
26
|
+
* Retrieve the email service settings (configured sender address, available
|
|
27
|
+
* templates, sending limits, etc.).
|
|
28
|
+
*
|
|
29
|
+
* @returns ApiResult where `data` contains the service configuration object.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const cfg = await email.settings();
|
|
33
|
+
* if (cfg.ok) { console.log(cfg.data); }
|
|
34
|
+
*/
|
|
35
|
+
settings(): Promise<ApiResult>;
|
|
36
|
+
/**
|
|
37
|
+
* Send an email through the email downstream service.
|
|
38
|
+
*
|
|
39
|
+
* @param to Recipient email address
|
|
40
|
+
* @param subject Email subject line
|
|
41
|
+
* @param text Plain-text body
|
|
42
|
+
* @param html Optional HTML body (falls back to `text` when omitted)
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* await email.send('user@example.com', 'Welcome!', 'Thanks for joining.');
|
|
46
|
+
*/
|
|
47
|
+
send(to: string, subject: string, text: string, html?: string): Promise<ApiResult>;
|
|
48
|
+
}
|
|
49
|
+
export { ApiCallOptions, ApiResult };
|
|
50
|
+
//# sourceMappingURL=email.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../lib/services/email.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAA2B,MAAM,0BAA0B,CAAC;AAEtH,qBAAa,QAAS,SAAQ,UAAU;gBACxB,OAAO,EAAE,UAAU;IAI/B;;;;;;;;;OASG;IACG,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC;IAIpC;;;;;;;;;;OAUG;IACG,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAM3F;AAKD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* email.ts — Jux email service client
|
|
3
|
+
*
|
|
4
|
+
* JuxEmail establishes connectivity to the `email` downstream service via the
|
|
5
|
+
* ApiGateway backend. It provides a domain-specific API for email operations;
|
|
6
|
+
* every method ultimately delegates to `this.call(path, options)`, which routes
|
|
7
|
+
* through the Jux Gateway transport layer.
|
|
8
|
+
*
|
|
9
|
+
* Usage in a .jux file:
|
|
10
|
+
* const api = await jux.gateway(username, password);
|
|
11
|
+
* const email = api.connect('email');
|
|
12
|
+
*
|
|
13
|
+
* // Inspect service settings (configured sender, templates, limits, etc.)
|
|
14
|
+
* const cfg = await email.settings();
|
|
15
|
+
*
|
|
16
|
+
* // Send a plain-text email
|
|
17
|
+
* await email.send('recipient@example.com', 'Hello', 'Plain-text body');
|
|
18
|
+
*
|
|
19
|
+
* // Send an HTML email
|
|
20
|
+
* await email.send('recipient@example.com', 'Hello', 'Plain text', '<b>HTML body</b>');
|
|
21
|
+
*/
|
|
22
|
+
import { JuxService, _registerServiceFactory } from '../components/gateway.js';
|
|
23
|
+
export class JuxEmail extends JuxService {
|
|
24
|
+
constructor(gateway) {
|
|
25
|
+
super(gateway, 'email');
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve the email service settings (configured sender address, available
|
|
29
|
+
* templates, sending limits, etc.).
|
|
30
|
+
*
|
|
31
|
+
* @returns ApiResult where `data` contains the service configuration object.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const cfg = await email.settings();
|
|
35
|
+
* if (cfg.ok) { console.log(cfg.data); }
|
|
36
|
+
*/
|
|
37
|
+
async settings() {
|
|
38
|
+
return this.call('settings');
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Send an email through the email downstream service.
|
|
42
|
+
*
|
|
43
|
+
* @param to Recipient email address
|
|
44
|
+
* @param subject Email subject line
|
|
45
|
+
* @param text Plain-text body
|
|
46
|
+
* @param html Optional HTML body (falls back to `text` when omitted)
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* await email.send('user@example.com', 'Welcome!', 'Thanks for joining.');
|
|
50
|
+
*/
|
|
51
|
+
async send(to, subject, text, html) {
|
|
52
|
+
return this.call('send', {
|
|
53
|
+
method: 'POST',
|
|
54
|
+
body: { to, subject, text, html },
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Register this service so ApiGateway.connect('email') returns a JuxEmail instance.
|
|
59
|
+
_registerServiceFactory('email', (gw) => new JuxEmail(gw));
|
|
60
|
+
//# sourceMappingURL=email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../lib/services/email.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAc,UAAU,EAA6B,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEtH,MAAM,OAAO,QAAS,SAAQ,UAAU;IACpC,YAAY,OAAmB;QAC3B,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5B,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,QAAQ;QACV,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,IAAI,CAAC,EAAU,EAAE,OAAe,EAAE,IAAY,EAAE,IAAa;QAC/D,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACrB,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;SACpC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,oFAAoF;AACpF,uBAAuB,CAAC,OAAO,EAAE,CAAC,EAAc,EAAE,EAAE,CAAC,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* s3.ts — Jux object-storage service client
|
|
3
|
+
*
|
|
4
|
+
* JuxS3 establishes connectivity to the `storage` downstream service via the
|
|
5
|
+
* ApiGateway backend. It provides a domain-specific API for S3-compatible
|
|
6
|
+
* object storage; every method ultimately delegates to `this.call(path, options)`,
|
|
7
|
+
* which routes through the Jux Gateway transport layer.
|
|
8
|
+
*
|
|
9
|
+
* Usage in a .jux file:
|
|
10
|
+
* const api = await jux.gateway(username, password);
|
|
11
|
+
* const store = api.connect('storage');
|
|
12
|
+
*
|
|
13
|
+
* // Check connectivity
|
|
14
|
+
* await store.health();
|
|
15
|
+
*
|
|
16
|
+
* // Upload an object
|
|
17
|
+
* await store.upload('avatars/user-1.png', imageBytes, 'image/png');
|
|
18
|
+
*
|
|
19
|
+
* // Download an object
|
|
20
|
+
* const file = await store.download('avatars/user-1.png');
|
|
21
|
+
*
|
|
22
|
+
* // List objects under a prefix
|
|
23
|
+
* const list = await store.list('avatars/');
|
|
24
|
+
*
|
|
25
|
+
* // Remove an object
|
|
26
|
+
* await store.remove('avatars/user-1.png');
|
|
27
|
+
*/
|
|
28
|
+
import { ApiGateway, JuxService, ApiResult, ApiCallOptions } from '../components/gateway.js';
|
|
29
|
+
export declare class JuxS3 extends JuxService {
|
|
30
|
+
constructor(gateway: ApiGateway);
|
|
31
|
+
/** Verify connectivity to the storage downstream service. */
|
|
32
|
+
health(): Promise<ApiResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Upload an object to storage.
|
|
35
|
+
*
|
|
36
|
+
* @param key Object key (path within the bucket)
|
|
37
|
+
* @param data Content to upload (string, object, or binary data)
|
|
38
|
+
* @param contentType MIME type (default: 'application/octet-stream')
|
|
39
|
+
*/
|
|
40
|
+
upload(key: string, data: any, contentType?: string): Promise<ApiResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Download an object from storage.
|
|
43
|
+
*
|
|
44
|
+
* @param key Object key to retrieve
|
|
45
|
+
*/
|
|
46
|
+
download(key: string): Promise<ApiResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Remove an object from storage.
|
|
49
|
+
*
|
|
50
|
+
* @param key Object key to delete
|
|
51
|
+
*/
|
|
52
|
+
remove(key: string): Promise<ApiResult>;
|
|
53
|
+
/**
|
|
54
|
+
* List objects in storage, optionally filtered by prefix.
|
|
55
|
+
*
|
|
56
|
+
* @param prefix Optional key prefix to filter results
|
|
57
|
+
*/
|
|
58
|
+
list(prefix?: string): Promise<ApiResult>;
|
|
59
|
+
}
|
|
60
|
+
export { ApiCallOptions, ApiResult };
|
|
61
|
+
//# sourceMappingURL=s3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../lib/services/s3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAA2B,MAAM,0BAA0B,CAAC;AAEtH,qBAAa,KAAM,SAAQ,UAAU;gBACrB,OAAO,EAAE,UAAU;IAI/B,6DAA6D;IACvD,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC;IAIlC;;;;;;OAMG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,GAAE,MAAmC,GAAG,OAAO,CAAC,SAAS,CAAC;IAQ1G;;;;OAIG;IACG,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAI/C;;;;OAIG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAI7C;;;;OAIG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAIlD;AAKD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* s3.ts — Jux object-storage service client
|
|
3
|
+
*
|
|
4
|
+
* JuxS3 establishes connectivity to the `storage` downstream service via the
|
|
5
|
+
* ApiGateway backend. It provides a domain-specific API for S3-compatible
|
|
6
|
+
* object storage; every method ultimately delegates to `this.call(path, options)`,
|
|
7
|
+
* which routes through the Jux Gateway transport layer.
|
|
8
|
+
*
|
|
9
|
+
* Usage in a .jux file:
|
|
10
|
+
* const api = await jux.gateway(username, password);
|
|
11
|
+
* const store = api.connect('storage');
|
|
12
|
+
*
|
|
13
|
+
* // Check connectivity
|
|
14
|
+
* await store.health();
|
|
15
|
+
*
|
|
16
|
+
* // Upload an object
|
|
17
|
+
* await store.upload('avatars/user-1.png', imageBytes, 'image/png');
|
|
18
|
+
*
|
|
19
|
+
* // Download an object
|
|
20
|
+
* const file = await store.download('avatars/user-1.png');
|
|
21
|
+
*
|
|
22
|
+
* // List objects under a prefix
|
|
23
|
+
* const list = await store.list('avatars/');
|
|
24
|
+
*
|
|
25
|
+
* // Remove an object
|
|
26
|
+
* await store.remove('avatars/user-1.png');
|
|
27
|
+
*/
|
|
28
|
+
import { JuxService, _registerServiceFactory } from '../components/gateway.js';
|
|
29
|
+
export class JuxS3 extends JuxService {
|
|
30
|
+
constructor(gateway) {
|
|
31
|
+
super(gateway, 'storage');
|
|
32
|
+
}
|
|
33
|
+
/** Verify connectivity to the storage downstream service. */
|
|
34
|
+
async health() {
|
|
35
|
+
return this.call('health');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Upload an object to storage.
|
|
39
|
+
*
|
|
40
|
+
* @param key Object key (path within the bucket)
|
|
41
|
+
* @param data Content to upload (string, object, or binary data)
|
|
42
|
+
* @param contentType MIME type (default: 'application/octet-stream')
|
|
43
|
+
*/
|
|
44
|
+
async upload(key, data, contentType = 'application/octet-stream') {
|
|
45
|
+
return this.call(`upload/${encodeURIComponent(key)}`, {
|
|
46
|
+
method: 'POST',
|
|
47
|
+
body: data,
|
|
48
|
+
headers: { 'Content-Type': contentType },
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Download an object from storage.
|
|
53
|
+
*
|
|
54
|
+
* @param key Object key to retrieve
|
|
55
|
+
*/
|
|
56
|
+
async download(key) {
|
|
57
|
+
return this.call(`download/${encodeURIComponent(key)}`);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Remove an object from storage.
|
|
61
|
+
*
|
|
62
|
+
* @param key Object key to delete
|
|
63
|
+
*/
|
|
64
|
+
async remove(key) {
|
|
65
|
+
return this.call(`delete/${encodeURIComponent(key)}`, { method: 'DELETE' });
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* List objects in storage, optionally filtered by prefix.
|
|
69
|
+
*
|
|
70
|
+
* @param prefix Optional key prefix to filter results
|
|
71
|
+
*/
|
|
72
|
+
async list(prefix) {
|
|
73
|
+
const path = prefix ? `list/${encodeURIComponent(prefix)}` : 'list';
|
|
74
|
+
return this.call(path);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Register this service so ApiGateway.connect('storage') returns a JuxS3 instance.
|
|
78
|
+
_registerServiceFactory('storage', (gw) => new JuxS3(gw));
|
|
79
|
+
//# sourceMappingURL=s3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.js","sourceRoot":"","sources":["../../lib/services/s3.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAc,UAAU,EAA6B,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEtH,MAAM,OAAO,KAAM,SAAQ,UAAU;IACjC,YAAY,OAAmB;QAC3B,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,GAAW,EAAE,IAAS,EAAE,cAAsB,0BAA0B;QACjF,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,kBAAkB,CAAC,GAAG,CAAC,EAAE,EAAE;YAClD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE;SAC3C,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CAAC,GAAW;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM,CAAC,GAAW;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,kBAAkB,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,IAAI,CAAC,MAAe;QACtB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;QACpE,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CACJ;AAED,mFAAmF;AACnF,uBAAuB,CAAC,SAAS,EAAE,CAAC,EAAc,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
package/juxconfig.example.js
CHANGED
|
@@ -18,6 +18,13 @@ export const config = {
|
|
|
18
18
|
wsPort: 3001,
|
|
19
19
|
},
|
|
20
20
|
|
|
21
|
+
// Jux Proxy connection — URL is injected as __JUX_PROXY_URL__ at build time.
|
|
22
|
+
// Set this to your deployed Jux Proxy server URL.
|
|
23
|
+
// Leave empty ('') to use the same origin as the app (default).
|
|
24
|
+
proxy: {
|
|
25
|
+
url: '',
|
|
26
|
+
},
|
|
27
|
+
|
|
21
28
|
// Precompile: bootstrap .jux files that run before routing.
|
|
22
29
|
// These render into sibling containers of #app at boot time.
|
|
23
30
|
// For CSS/JS injection, use jux.include() inside your .jux files.
|
package/machinery/build3.js
CHANGED
package/machinery/compiler4.js
CHANGED
|
@@ -434,6 +434,8 @@ export class JuxCompiler {
|
|
|
434
434
|
this._validationIssues = [];
|
|
435
435
|
|
|
436
436
|
entry += `\nwindow.__juxSources = ${JSON.stringify(sourceSnapshot)};\n`;
|
|
437
|
+
const proxyUrl = this.config.proxy?.url ?? '';
|
|
438
|
+
entry += `window.__JUX_PROXY_URL__ = ${JSON.stringify(proxyUrl)};\n`;
|
|
437
439
|
|
|
438
440
|
entry += `\n// --- STARTUP ---\n`;
|
|
439
441
|
entry += `window.addEventListener('DOMContentLoaded', async () => {\n`;
|
package/machinery/serve.js
CHANGED
|
@@ -65,6 +65,8 @@ const precompile = {
|
|
|
65
65
|
juxfiles: rawConfig.precompile?.juxfiles || [],
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
+
const proxy = rawConfig.proxy || {};
|
|
69
|
+
|
|
68
70
|
const app = express();
|
|
69
71
|
let lastBuildResult = { success: true, errors: [] };
|
|
70
72
|
|
|
@@ -77,7 +79,8 @@ if (!fs.existsSync(DIST_DIR) || !fs.existsSync(path.join(DIST_DIR, 'index.html')
|
|
|
77
79
|
distDir: DIST_DIR,
|
|
78
80
|
publicDir: directories.public,
|
|
79
81
|
paths,
|
|
80
|
-
precompile
|
|
82
|
+
precompile,
|
|
83
|
+
proxy
|
|
81
84
|
});
|
|
82
85
|
|
|
83
86
|
try {
|
|
@@ -145,30 +148,6 @@ app.get('/__jux_sources.json', (req, res) => {
|
|
|
145
148
|
}
|
|
146
149
|
});
|
|
147
150
|
|
|
148
|
-
// ═══════════════════════════════════════════════════════════════
|
|
149
|
-
// API ROUTES — must come BEFORE static middleware and catch-all
|
|
150
|
-
// ═══════════════════════════════════════════════════════════════
|
|
151
|
-
app.get('/api/test', (req, res) => {
|
|
152
|
-
const fruits = ['apple', 'banana', 'orange', 'mango', 'strawberry', 'grape', 'watermelon', 'pineapple', 'kiwi', 'peach'];
|
|
153
|
-
const randomFruit = fruits[Math.floor(Math.random() * fruits.length)];
|
|
154
|
-
|
|
155
|
-
res.json({
|
|
156
|
-
randomFruit,
|
|
157
|
-
growers: [
|
|
158
|
-
{ id: 1, name: 'Berry Bliss Farm', region: 'Pacific Northwest', specialty: 'blueberry' },
|
|
159
|
-
{ id: 2, name: 'Tropical Sun Orchard', region: 'Hawaii', specialty: 'mango' },
|
|
160
|
-
{ id: 3, name: 'Bramble & Vine', region: 'Willamette Valley', specialty: 'raspberry' }
|
|
161
|
-
],
|
|
162
|
-
harvests: [
|
|
163
|
-
{ id: 1, fruit: 'blueberry', lbs: 1200, growerId: 1, season: 'summer' },
|
|
164
|
-
{ id: 2, fruit: 'raspberry', lbs: 800, growerId: 3, season: 'summer' },
|
|
165
|
-
{ id: 3, fruit: 'mango', lbs: 2400, growerId: 2, season: 'spring' },
|
|
166
|
-
{ id: 4, fruit: 'strawberry', lbs: 1600, growerId: 1, season: 'spring' }
|
|
167
|
-
],
|
|
168
|
-
timestamp: new Date().toISOString()
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
|
|
172
151
|
const hotReloadScript = `
|
|
173
152
|
<script>
|
|
174
153
|
(function() {
|
|
@@ -284,7 +263,8 @@ if (HOT_RELOAD) {
|
|
|
284
263
|
distDir: DIST_DIR,
|
|
285
264
|
publicDir: directories.public,
|
|
286
265
|
paths,
|
|
287
|
-
precompile
|
|
266
|
+
precompile,
|
|
267
|
+
proxy
|
|
288
268
|
});
|
|
289
269
|
|
|
290
270
|
watcher = createWatcher(SRC_DIR, {
|
|
@@ -99,6 +99,10 @@ export function validateJuxFiles(juxDir, packageRoot) {
|
|
|
99
99
|
if (['if', 'for', 'while', 'switch', 'catch', 'return', 'throw', 'new', 'delete', 'typeof', 'void'].includes(name)) continue;
|
|
100
100
|
methods.add(name);
|
|
101
101
|
}
|
|
102
|
+
// Also match async methods: " async methodName("
|
|
103
|
+
for (const m of source.matchAll(/^\s{4}async\s+(\w+)\s*\(/gm)) {
|
|
104
|
+
if (m[1] !== 'constructor' && !m[1].startsWith('_')) methods.add(m[1]);
|
|
105
|
+
}
|
|
102
106
|
for (const m of source.matchAll(/^\s{4}get\s+(\w+)\s*\(/gm)) {
|
|
103
107
|
methods.add(m[1]);
|
|
104
108
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "juxscript",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.395",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A JavaScript UX authorship platform",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dom-structure-map.json",
|
|
25
25
|
"bin",
|
|
26
26
|
"create",
|
|
27
|
-
"
|
|
27
|
+
"components",
|
|
28
28
|
"machinery",
|
|
29
29
|
"juxconfig.example.js",
|
|
30
30
|
"README.md",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|