@fluixi/template-parser 0.1.0-alpha.3 → 1.0.0-alpha.100

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.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @fluixi/template-parser: the dependency-free foundation for every tool that
3
+ * needs to understand a Fluixi `` html`...` `` template: the compiler, the
4
+ * language server, the TypeScript plugin, and the Biome/formatter plugin.
5
+ *
6
+ * Pipeline: pieces → {@link Reader} (lexing/holes) → {@link parseTemplate}
7
+ * (structure + diagnostics) → Template AST. Downstream, each tool binds the
8
+ * opaque hole slots to its own representation and consumes the AST, the
9
+ * compiler lowers it to codegen IR, the LSP answers completion/hover/rename.
10
+ *
11
+ * The parser never resolves the JS inside `${…}`; it records each hole as an
12
+ * index + span. That is the single seam that keeps this package host-agnostic.
13
+ */
14
+ export * from './ast.cjs';
15
+ export { Reader, type Piece, type HoleToken } from './reader.cjs';
16
+ export { CORE_DIRECTIVES, resolveAttribute, type DirectiveDescriptor, type RawAttribute, } from './directives.cjs';
17
+ export { parseTemplate, type ParserOptions } from './parser.cjs';
18
+ import type { Piece } from './reader.cjs';
19
+ import { type ParserOptions } from './parser.cjs';
20
+ import type { ParseResult, SourceSpan } from './ast.cjs';
21
+ /**
22
+ * Build a piece list from the static string segments of a tagged template
23
+ * (`quasi.strings`), inserting a hole between each pair. Offsets are synthetic
24
+ * (cumulative over the joined text), good enough for standalone parsing and
25
+ * tests. Hosts with real source positions (the compiler, the LSP) should build
26
+ * {@link Piece}s directly so spans map back to the original file.
27
+ */
28
+ export declare function piecesFromStrings(statics: readonly string[]): Piece[];
29
+ /** Convenience: parse directly from static string segments. */
30
+ export declare function parse(statics: readonly string[], opts?: ParserOptions): ParseResult;
31
+ export type { SourceSpan };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @fluixi/template-parser — the dependency-free foundation for every tool that
2
+ * @fluixi/template-parser: the dependency-free foundation for every tool that
3
3
  * needs to understand a Fluixi `` html`...` `` template: the compiler, the
4
4
  * language server, the TypeScript plugin, and the Biome/formatter plugin.
5
5
  *
6
6
  * Pipeline: pieces → {@link Reader} (lexing/holes) → {@link parseTemplate}
7
7
  * (structure + diagnostics) → Template AST. Downstream, each tool binds the
8
- * opaque hole slots to its own representation and consumes the AST — the
8
+ * opaque hole slots to its own representation and consumes the AST, the
9
9
  * compiler lowers it to codegen IR, the LSP answers completion/hover/rename.
10
10
  *
11
11
  * The parser never resolves the JS inside `${…}`; it records each hole as an
@@ -21,7 +21,7 @@ import type { ParseResult, SourceSpan } from './ast.js';
21
21
  /**
22
22
  * Build a piece list from the static string segments of a tagged template
23
23
  * (`quasi.strings`), inserting a hole between each pair. Offsets are synthetic
24
- * (cumulative over the joined text) — good enough for standalone parsing and
24
+ * (cumulative over the joined text), good enough for standalone parsing and
25
25
  * tests. Hosts with real source positions (the compiler, the LSP) should build
26
26
  * {@link Piece}s directly so spans map back to the original file.
27
27
  */
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @fluixi/template-parser — the dependency-free foundation for every tool that
2
+ * @fluixi/template-parser: the dependency-free foundation for every tool that
3
3
  * needs to understand a Fluixi `` html`...` `` template: the compiler, the
4
4
  * language server, the TypeScript plugin, and the Biome/formatter plugin.
5
5
  *
6
6
  * Pipeline: pieces → {@link Reader} (lexing/holes) → {@link parseTemplate}
7
7
  * (structure + diagnostics) → Template AST. Downstream, each tool binds the
8
- * opaque hole slots to its own representation and consumes the AST — the
8
+ * opaque hole slots to its own representation and consumes the AST, the
9
9
  * compiler lowers it to codegen IR, the LSP answers completion/hover/rename.
10
10
  *
11
11
  * The parser never resolves the JS inside `${…}`; it records each hole as an
@@ -19,7 +19,7 @@ import { parseTemplate } from './parser.js';
19
19
  /**
20
20
  * Build a piece list from the static string segments of a tagged template
21
21
  * (`quasi.strings`), inserting a hole between each pair. Offsets are synthetic
22
- * (cumulative over the joined text) — good enough for standalone parsing and
22
+ * (cumulative over the joined text), good enough for standalone parsing and
23
23
  * tests. Hosts with real source positions (the compiler, the LSP) should build
24
24
  * {@link Piece}s directly so spans map back to the original file.
25
25
  */