@frontiers-labs/argon 0.4.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.
Files changed (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -0
  3. package/dist/annotations.d.ts +23 -0
  4. package/dist/annotations.d.ts.map +1 -0
  5. package/dist/annotations.js +23 -0
  6. package/dist/annotations.js.map +1 -0
  7. package/dist/codegen/client.d.ts +14 -0
  8. package/dist/codegen/client.d.ts.map +1 -0
  9. package/dist/codegen/client.js +964 -0
  10. package/dist/codegen/client.js.map +1 -0
  11. package/dist/codegen/dts.d.ts +3 -0
  12. package/dist/codegen/dts.d.ts.map +1 -0
  13. package/dist/codegen/dts.js +82 -0
  14. package/dist/codegen/dts.js.map +1 -0
  15. package/dist/codegen/js.d.ts +3 -0
  16. package/dist/codegen/js.d.ts.map +1 -0
  17. package/dist/codegen/js.js +278 -0
  18. package/dist/codegen/js.js.map +1 -0
  19. package/dist/codegen/rust.d.ts +6 -0
  20. package/dist/codegen/rust.d.ts.map +1 -0
  21. package/dist/codegen/rust.js +1076 -0
  22. package/dist/codegen/rust.js.map +1 -0
  23. package/dist/component.d.ts +35 -0
  24. package/dist/component.d.ts.map +1 -0
  25. package/dist/component.js +120 -0
  26. package/dist/component.js.map +1 -0
  27. package/dist/diagnostics.d.ts +20 -0
  28. package/dist/diagnostics.d.ts.map +1 -0
  29. package/dist/diagnostics.js +40 -0
  30. package/dist/diagnostics.js.map +1 -0
  31. package/dist/docs.d.ts +3 -0
  32. package/dist/docs.d.ts.map +1 -0
  33. package/dist/docs.js +42 -0
  34. package/dist/docs.js.map +1 -0
  35. package/dist/error-catalog.d.ts +11 -0
  36. package/dist/error-catalog.d.ts.map +1 -0
  37. package/dist/error-catalog.js +92 -0
  38. package/dist/error-catalog.js.map +1 -0
  39. package/dist/html-attrs.d.ts +2 -0
  40. package/dist/html-attrs.d.ts.map +1 -0
  41. package/dist/html-attrs.js +37 -0
  42. package/dist/html-attrs.js.map +1 -0
  43. package/dist/html.d.ts +41 -0
  44. package/dist/html.d.ts.map +1 -0
  45. package/dist/html.js +188 -0
  46. package/dist/html.js.map +1 -0
  47. package/dist/index.d.ts +3 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +139 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/ir.d.ts +321 -0
  52. package/dist/ir.d.ts.map +1 -0
  53. package/dist/ir.js +243 -0
  54. package/dist/ir.js.map +1 -0
  55. package/dist/jsx.d.ts +31 -0
  56. package/dist/jsx.d.ts.map +1 -0
  57. package/dist/jsx.js +242 -0
  58. package/dist/jsx.js.map +1 -0
  59. package/dist/lower.d.ts +6 -0
  60. package/dist/lower.d.ts.map +1 -0
  61. package/dist/lower.js +1341 -0
  62. package/dist/lower.js.map +1 -0
  63. package/dist/parser.d.ts +3 -0
  64. package/dist/parser.d.ts.map +1 -0
  65. package/dist/parser.js +714 -0
  66. package/dist/parser.js.map +1 -0
  67. package/dist/ssr-subset.d.ts +29 -0
  68. package/dist/ssr-subset.d.ts.map +1 -0
  69. package/dist/ssr-subset.js +119 -0
  70. package/dist/ssr-subset.js.map +1 -0
  71. package/dist/template.d.ts +32 -0
  72. package/dist/template.d.ts.map +1 -0
  73. package/dist/template.js +90 -0
  74. package/dist/template.js.map +1 -0
  75. package/package.json +67 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Argon Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # The Argon TSX-to-Web Components compiler.
2
+
3
+ See the [main README](../README.md) for full documentation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm install -D @frontiers-labs/argon
9
+ ```
10
+
11
+ ## CLI
12
+
13
+ ```bash
14
+ pnpm exec argon compile <input.tsx>... [--js] [--rust] [--out-dir <dir>]
15
+ ```
16
+
17
+ ## API
18
+
19
+ ```tsx
20
+ import { Component } from '@frontiers-labs/argon';
21
+
22
+ // The custom element tag is the kebab-cased function name: <simple-paragraph>.
23
+ export function SimpleParagraph(): Component {
24
+ return <p></p>;
25
+ }
26
+ ```
@@ -0,0 +1,23 @@
1
+ export type Component = string & {
2
+ __component__?: true;
3
+ };
4
+ export declare function css(strings: TemplateStringsArray, ...values: any[]): string;
5
+ export declare function state<T>(initial: T): T;
6
+ export declare function unsafeHtml(html: string): string;
7
+ export interface Ref<T extends Element = Element> {
8
+ readonly current: T | null;
9
+ }
10
+ export declare function ref<T extends Element = Element>(): Ref<T>;
11
+ export declare function onMount(callback: () => void | (() => void)): void;
12
+ export declare function effect(callback: () => void | (() => void)): void;
13
+ declare global {
14
+ namespace JSX {
15
+ type Element = string;
16
+ interface IntrinsicElements {
17
+ [tagName: string]: {
18
+ [attribute: string]: unknown;
19
+ };
20
+ }
21
+ }
22
+ }
23
+ //# sourceMappingURL=annotations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../src/annotations.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,aAAa,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAE1D,wBAAgB,GAAG,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,CAE3E;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAEtC;AAMD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAKD,MAAM,WAAW,GAAG,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IAC9C,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;CAC5B;AAED,wBAAgB,GAAG,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAEzD;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAEjE;AAED,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAEhE;AAKD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,GAAG,CAAC;QACZ,KAAK,OAAO,GAAG,MAAM,CAAC;QACtB,UAAU,iBAAiB;YACzB,CAAC,OAAO,EAAE,MAAM,GAAG;gBAAE,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAA;aAAE,CAAC;SACrD;KACF;CACF"}
@@ -0,0 +1,23 @@
1
+ export function css(strings, ...values) {
2
+ return strings.reduce((result, string, i) => result + string + (values[i] ?? ""), "");
3
+ }
4
+ export function state(initial) {
5
+ return initial;
6
+ }
7
+ // Compile-time marker: interpolate the string as raw HTML instead of escaping
8
+ // it. Identity at runtime — the name carries the audit burden (grep for it the
9
+ // way you would `dangerouslySetInnerHTML`). Only feed it markup you trust or
10
+ // have sanitized; everything else in a text binding is HTML-escaped by default.
11
+ export function unsafeHtml(html) {
12
+ return html;
13
+ }
14
+ export function ref() {
15
+ return { current: null };
16
+ }
17
+ export function onMount(callback) {
18
+ void callback;
19
+ }
20
+ export function effect(callback) {
21
+ void callback;
22
+ }
23
+ //# sourceMappingURL=annotations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations.js","sourceRoot":"","sources":["../src/annotations.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,GAAG,CAAC,OAA6B,EAAE,GAAG,MAAa;IACjE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AACxF,CAAC;AAED,MAAM,UAAU,KAAK,CAAI,OAAU;IACjC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,gFAAgF;AAChF,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,IAAI,CAAC;AACd,CAAC;AASD,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,QAAmC;IACzD,KAAK,QAAQ,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,QAAmC;IACxD,KAAK,QAAQ,CAAC;AAChB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type ModuleIR } from "../ir.js";
2
+ export type JsTarget = "es2020" | "es2022" | "esnext";
3
+ export interface ClientOptions {
4
+ target?: JsTarget;
5
+ sourceMap?: boolean;
6
+ fileName?: string;
7
+ compat03?: boolean;
8
+ }
9
+ export declare function compileClient(module: ModuleIR, opts?: ClientOptions): string;
10
+ export declare function compileClientCore(module: ModuleIR, opts?: ClientOptions): {
11
+ code: string;
12
+ map?: string;
13
+ };
14
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/codegen/client.ts"],"names":[],"mappings":"AAQA,OAAO,EAWL,KAAK,QAAQ,EAKd,MAAM,UAAU,CAAC;AAUlB,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,QAAQ,CAAC;IAElB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAQD,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,GAAE,aAAkB,GAAG,MAAM,CAEhF;AAGD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,GAAE,aAAkB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAqD5G"}