@glint/ember-tsc 1.5.0 → 1.6.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 (136) hide show
  1. package/package.json +14 -3
  2. package/src/environment-ember-template-imports/-private/environment/index.ts +48 -20
  3. package/types/-private/dsl/globals.d.ts +316 -1
  4. package/types/-private/intrinsics/array-hash.d.ts +17 -0
  5. package/types/-private/intrinsics/comparison.d.ts +36 -0
  6. package/types/-private/intrinsics/element.d.ts +14 -0
  7. package/types/-private/intrinsics/truth-convert.d.ts +86 -0
  8. package/types/-private/intrinsics/truth-helpers.d.ts +32 -0
  9. package/lib/cli/run-volar-tsc.d.ts +0 -2
  10. package/lib/cli/run-volar-tsc.d.ts.map +0 -1
  11. package/lib/cli/run-volar-tsc.js +0 -32
  12. package/lib/cli/run-volar-tsc.js.map +0 -1
  13. package/lib/config/config.d.ts +0 -15
  14. package/lib/config/config.d.ts.map +0 -1
  15. package/lib/config/config.js +0 -21
  16. package/lib/config/config.js.map +0 -1
  17. package/lib/config/environment.d.ts +0 -26
  18. package/lib/config/environment.d.ts.map +0 -1
  19. package/lib/config/environment.js +0 -96
  20. package/lib/config/environment.js.map +0 -1
  21. package/lib/config/index.d.ts +0 -24
  22. package/lib/config/index.d.ts.map +0 -1
  23. package/lib/config/index.js +0 -37
  24. package/lib/config/index.js.map +0 -1
  25. package/lib/config/loader.d.ts +0 -28
  26. package/lib/config/loader.d.ts.map +0 -1
  27. package/lib/config/loader.js +0 -121
  28. package/lib/config/loader.js.map +0 -1
  29. package/lib/config/types.cjs +0 -3
  30. package/lib/config/types.cjs.map +0 -1
  31. package/lib/config/types.d.cts +0 -60
  32. package/lib/config/types.d.cts.map +0 -1
  33. package/lib/environment-ember-template-imports/-private/environment/common.d.ts +0 -13
  34. package/lib/environment-ember-template-imports/-private/environment/common.d.ts.map +0 -1
  35. package/lib/environment-ember-template-imports/-private/environment/common.js +0 -2
  36. package/lib/environment-ember-template-imports/-private/environment/common.js.map +0 -1
  37. package/lib/environment-ember-template-imports/-private/environment/index.d.ts +0 -3
  38. package/lib/environment-ember-template-imports/-private/environment/index.d.ts.map +0 -1
  39. package/lib/environment-ember-template-imports/-private/environment/index.js +0 -76
  40. package/lib/environment-ember-template-imports/-private/environment/index.js.map +0 -1
  41. package/lib/environment-ember-template-imports/-private/environment/preprocess.d.ts +0 -4
  42. package/lib/environment-ember-template-imports/-private/environment/preprocess.d.ts.map +0 -1
  43. package/lib/environment-ember-template-imports/-private/environment/preprocess.js +0 -42
  44. package/lib/environment-ember-template-imports/-private/environment/preprocess.js.map +0 -1
  45. package/lib/environment-ember-template-imports/-private/environment/transform.d.ts +0 -4
  46. package/lib/environment-ember-template-imports/-private/environment/transform.d.ts.map +0 -1
  47. package/lib/environment-ember-template-imports/-private/environment/transform.js +0 -134
  48. package/lib/environment-ember-template-imports/-private/environment/transform.js.map +0 -1
  49. package/lib/index.d.ts +0 -7
  50. package/lib/index.d.ts.map +0 -1
  51. package/lib/index.js +0 -6
  52. package/lib/index.js.map +0 -1
  53. package/lib/plugins/g-compiler-errors.d.ts +0 -12
  54. package/lib/plugins/g-compiler-errors.d.ts.map +0 -1
  55. package/lib/plugins/g-compiler-errors.js +0 -58
  56. package/lib/plugins/g-compiler-errors.js.map +0 -1
  57. package/lib/plugins/g-component-hover.d.ts +0 -24
  58. package/lib/plugins/g-component-hover.d.ts.map +0 -1
  59. package/lib/plugins/g-component-hover.js +0 -135
  60. package/lib/plugins/g-component-hover.js.map +0 -1
  61. package/lib/plugins/g-template-tag-symbols.d.ts +0 -11
  62. package/lib/plugins/g-template-tag-symbols.d.ts.map +0 -1
  63. package/lib/plugins/g-template-tag-symbols.js +0 -48
  64. package/lib/plugins/g-template-tag-symbols.js.map +0 -1
  65. package/lib/plugins/utils.d.ts +0 -25
  66. package/lib/plugins/utils.d.ts.map +0 -1
  67. package/lib/plugins/utils.js +0 -63
  68. package/lib/plugins/utils.js.map +0 -1
  69. package/lib/transform/diagnostics/augmentation.d.ts +0 -4
  70. package/lib/transform/diagnostics/augmentation.d.ts.map +0 -1
  71. package/lib/transform/diagnostics/augmentation.js +0 -249
  72. package/lib/transform/diagnostics/augmentation.js.map +0 -1
  73. package/lib/transform/diagnostics/index.d.ts +0 -5
  74. package/lib/transform/diagnostics/index.d.ts.map +0 -1
  75. package/lib/transform/diagnostics/index.js +0 -2
  76. package/lib/transform/diagnostics/index.js.map +0 -1
  77. package/lib/transform/index.d.ts +0 -4
  78. package/lib/transform/index.d.ts.map +0 -1
  79. package/lib/transform/index.js +0 -2
  80. package/lib/transform/index.js.map +0 -1
  81. package/lib/transform/template/code-features.d.ts +0 -30
  82. package/lib/transform/template/code-features.d.ts.map +0 -1
  83. package/lib/transform/template/code-features.js +0 -26
  84. package/lib/transform/template/code-features.js.map +0 -1
  85. package/lib/transform/template/glimmer-ast-mapping-tree.d.ts +0 -80
  86. package/lib/transform/template/glimmer-ast-mapping-tree.d.ts.map +0 -1
  87. package/lib/transform/template/glimmer-ast-mapping-tree.js +0 -132
  88. package/lib/transform/template/glimmer-ast-mapping-tree.js.map +0 -1
  89. package/lib/transform/template/inlining/index.d.ts +0 -16
  90. package/lib/transform/template/inlining/index.d.ts.map +0 -1
  91. package/lib/transform/template/inlining/index.js +0 -21
  92. package/lib/transform/template/inlining/index.js.map +0 -1
  93. package/lib/transform/template/inlining/tagged-strings.d.ts +0 -8
  94. package/lib/transform/template/inlining/tagged-strings.d.ts.map +0 -1
  95. package/lib/transform/template/inlining/tagged-strings.js +0 -140
  96. package/lib/transform/template/inlining/tagged-strings.js.map +0 -1
  97. package/lib/transform/template/map-template-contents.d.ts +0 -121
  98. package/lib/transform/template/map-template-contents.d.ts.map +0 -1
  99. package/lib/transform/template/map-template-contents.js +0 -287
  100. package/lib/transform/template/map-template-contents.js.map +0 -1
  101. package/lib/transform/template/rewrite-module.d.ts +0 -22
  102. package/lib/transform/template/rewrite-module.d.ts.map +0 -1
  103. package/lib/transform/template/rewrite-module.js +0 -265
  104. package/lib/transform/template/rewrite-module.js.map +0 -1
  105. package/lib/transform/template/scope-stack.d.ts +0 -13
  106. package/lib/transform/template/scope-stack.d.ts.map +0 -1
  107. package/lib/transform/template/scope-stack.js +0 -28
  108. package/lib/transform/template/scope-stack.js.map +0 -1
  109. package/lib/transform/template/template-to-typescript.d.ts +0 -19
  110. package/lib/transform/template/template-to-typescript.d.ts.map +0 -1
  111. package/lib/transform/template/template-to-typescript.js +0 -1125
  112. package/lib/transform/template/template-to-typescript.js.map +0 -1
  113. package/lib/transform/template/transformed-module.d.ts +0 -111
  114. package/lib/transform/template/transformed-module.d.ts.map +0 -1
  115. package/lib/transform/template/transformed-module.js +0 -287
  116. package/lib/transform/template/transformed-module.js.map +0 -1
  117. package/lib/transform/util.d.ts +0 -7
  118. package/lib/transform/util.d.ts.map +0 -1
  119. package/lib/transform/util.js +0 -15
  120. package/lib/transform/util.js.map +0 -1
  121. package/lib/volar/ember-language-plugin.d.ts +0 -14
  122. package/lib/volar/ember-language-plugin.d.ts.map +0 -1
  123. package/lib/volar/ember-language-plugin.js +0 -91
  124. package/lib/volar/ember-language-plugin.js.map +0 -1
  125. package/lib/volar/gts-virtual-code.d.ts +0 -83
  126. package/lib/volar/gts-virtual-code.d.ts.map +0 -1
  127. package/lib/volar/gts-virtual-code.js +0 -210
  128. package/lib/volar/gts-virtual-code.js.map +0 -1
  129. package/lib/volar/language-server.d.ts +0 -2
  130. package/lib/volar/language-server.d.ts.map +0 -1
  131. package/lib/volar/language-server.js +0 -180
  132. package/lib/volar/language-server.js.map +0 -1
  133. package/lib/volar/script-snapshot.d.ts +0 -17
  134. package/lib/volar/script-snapshot.d.ts.map +0 -1
  135. package/lib/volar/script-snapshot.js +0 -24
  136. package/lib/volar/script-snapshot.js.map +0 -1
@@ -1,132 +0,0 @@
1
- /**
2
- * In cases where we're unable to parse a template, we still want to
3
- * be able to hold a placeholder mapping so that we can respond sensibly
4
- * to offset transformation queries. This class acts as a standin for
5
- * the proper AST node we were unable to obtain in such cases.
6
- */
7
- export class ParseError {
8
- constructor() {
9
- this.type = 'ParseError';
10
- }
11
- }
12
- /**
13
- * The Glimmer AST uses `TextNode` for both string arg values on elements
14
- * and for top-level text content floating in the DOM itself. Since we
15
- * want to treat the two differently (namely, string args may have useful
16
- * completion suggestions but plain text doesn't), we use a stand-in
17
- * node for the latter.
18
- */
19
- export class TextContent {
20
- constructor() {
21
- this.type = 'TextContent';
22
- }
23
- }
24
- /**
25
- * This node represents the root of an embedded template, including
26
- * the surrounding `<template>...</template>` boilerplate that designates
27
- * the surrounded contents as a template.
28
- */
29
- export class TemplateEmbedding {
30
- constructor() {
31
- this.type = 'TemplateEmbedding';
32
- }
33
- }
34
- /**
35
- * A `MappingTree` maintains a hierarchy of mappings between ranges of
36
- * locations in original and transformed source strings. These mappings
37
- * are naturally hierarchical due to the tree structure of the underlying
38
- * code.
39
- *
40
- * For instance, given an expression like `{{foo.bar}}` in a template, a
41
- * corresponding expression in TypeScript might be `foo?.bar`. The individual
42
- * identifiers `foo` and `bar` map directly to one another, but the full
43
- * expressions do as well. By maintaining a full hierarchy of these mappings,
44
- * we can always report diagnostics in the template at roughly the same
45
- * level of granularity as TS itself uses when reporting on the transformed
46
- * output.
47
- */
48
- export default class GlimmerASTMappingTree {
49
- constructor(transformedRange, originalRange, children = [], sourceNode, codeInformation) {
50
- this.transformedRange = transformedRange;
51
- this.originalRange = originalRange;
52
- this.children = children;
53
- this.sourceNode = sourceNode;
54
- this.codeInformation = codeInformation;
55
- this.parent = null;
56
- children.forEach((child) => (child.parent = this));
57
- }
58
- /**
59
- * Returns the mapping corresponding to the smallest span in the transformed source
60
- * that contains the given range, or `null` if that range doesn't fall within
61
- * this mapping tree.
62
- */
63
- narrowestMappingForTransformedRange(range) {
64
- if (range.start < this.transformedRange.start || range.end > this.transformedRange.end) {
65
- return null;
66
- }
67
- for (let child of this.children) {
68
- let mapping = child.narrowestMappingForTransformedRange(range);
69
- if (mapping) {
70
- return mapping;
71
- }
72
- }
73
- return this;
74
- }
75
- /**
76
- * Returns the mapping corresponding to the smallest span in the original source
77
- * that contains the given range, or `null` if that range doesn't fall within
78
- * this mapping tree.
79
- */
80
- narrowestMappingForOriginalRange(range) {
81
- if (range.start < this.originalRange.start || range.end > this.originalRange.end) {
82
- return null;
83
- }
84
- for (let child of this.children) {
85
- let mapping = child.narrowestMappingForOriginalRange(range);
86
- if (mapping) {
87
- return mapping;
88
- }
89
- }
90
- return this;
91
- }
92
- /**
93
- * Returns all mappings that exactly match the provided range.
94
- */
95
- exactMappingsForOriginalRange(range) {
96
- const results = [];
97
- if (range.start < this.originalRange.start || range.end > this.originalRange.end) {
98
- return results;
99
- }
100
- if (range.start == this.originalRange.start && range.end == this.originalRange.end) {
101
- results.push(this);
102
- }
103
- for (let child of this.children) {
104
- results.push(...child.exactMappingsForOriginalRange(range));
105
- }
106
- return results;
107
- }
108
- toDebugString(options) {
109
- let { originalSource, transformedSource, indent = '| ' } = options;
110
- let { sourceNode, originalRange, transformedRange, children } = this;
111
- let hbsStart = options.originalStart + originalRange.start;
112
- let hbsEnd = options.originalStart + originalRange.end;
113
- let tsStart = options.transformedStart + transformedRange.start;
114
- let tsEnd = options.transformedStart + transformedRange.end;
115
- let lines = [];
116
- lines.push(`${indent}Mapping: ${sourceNode.type}`);
117
- lines.push(`${indent}${` hbs(${hbsStart}:${hbsEnd}):`.padEnd(15)}${this.getSourceRange(originalSource, originalRange)}`);
118
- lines.push(`${indent}${` ts(${tsStart}:${tsEnd}):`.padEnd(15)}${this.getSourceRange(transformedSource, transformedRange)}`);
119
- lines.push(indent);
120
- for (let child of children) {
121
- lines.push(child.toDebugString({ ...options, indent: indent + '| ' }));
122
- }
123
- if (children.length) {
124
- lines.push(indent);
125
- }
126
- return lines.map((line) => line.trimEnd()).join('\n');
127
- }
128
- getSourceRange(source, range) {
129
- return source.slice(range.start, range.end).trim().replace(/\n/g, '\\n').replace(/\r/g, '\\r');
130
- }
131
- }
132
- //# sourceMappingURL=glimmer-ast-mapping-tree.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"glimmer-ast-mapping-tree.js","sourceRoot":"","sources":["../../../src/transform/template/glimmer-ast-mapping-tree.ts"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IAAvB;QACkB,SAAI,GAAG,YAAY,CAAC;IACtC,CAAC;CAAA;AAED;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IAAxB;QACkB,SAAI,GAAG,aAAa,CAAC;IACvC,CAAC;CAAA;AAED;;;;GAIG;AACH,MAAM,OAAO,iBAAiB;IAA9B;QACkB,SAAI,GAAG,mBAAmB,CAAC;IAC7C,CAAC;CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;IAGxC,YACS,gBAAuB,EACvB,aAAoB,EACpB,WAAyC,EAAE,EAC3C,UAAyB,EACzB,eAAiC;QAJjC,qBAAgB,GAAhB,gBAAgB,CAAO;QACvB,kBAAa,GAAb,aAAa,CAAO;QACpB,aAAQ,GAAR,QAAQ,CAAmC;QAC3C,eAAU,GAAV,UAAU,CAAe;QACzB,oBAAe,GAAf,eAAe,CAAkB;QAPnC,WAAM,GAAiC,IAAI,CAAC;QASjD,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACI,mCAAmC,CAAC,KAAY;QACrD,IAAI,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,CAAC;YACvF,OAAO,IAAI,CAAC;QACd,CAAC;QAED,KAAK,IAAI,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChC,IAAI,OAAO,GAAG,KAAK,CAAC,mCAAmC,CAAC,KAAK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,QAAQ,CAAC,MAAM,EAAE,CAAC;YACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC;QAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;IAEO,cAAc,CAAC,MAAc,EAAE,KAAY;QACjD,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACjG,CAAC;CACF"}
@@ -1,16 +0,0 @@
1
- import type ts from 'typescript';
2
- import { CorrelatedSpan, Directive, TransformError } from '../transformed-module.js';
3
- import { TSLib } from '../../util.js';
4
- export type PartialCorrelatedSpan = Omit<CorrelatedSpan, 'transformedStart' | 'transformedLength'>;
5
- export type CorrelatedSpansResult = {
6
- errors: Array<TransformError>;
7
- directives: Array<Directive>;
8
- partialSpans: Array<PartialCorrelatedSpan>;
9
- };
10
- /**
11
- * Given an AST node for an embedded template, determines whether it's embedded
12
- * within a class in such a way that that class should be treated as its backing
13
- * value.
14
- */
15
- export declare function isEmbeddedInClass(ts: TSLib, node: ts.Node): boolean;
16
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transform/template/inlining/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,cAAc,EAAE,kBAAkB,GAAG,mBAAmB,CAAC,CAAC;AAEnG,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9B,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7B,YAAY,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAenE"}
@@ -1,21 +0,0 @@
1
- /**
2
- * Given an AST node for an embedded template, determines whether it's embedded
3
- * within a class in such a way that that class should be treated as its backing
4
- * value.
5
- */
6
- export function isEmbeddedInClass(ts, node) {
7
- let current = node;
8
- do {
9
- // TODO: this should likely actually filter on whether the template appears in a
10
- // static block or property definition, but just "am I in a class body" is the
11
- // current status quo and has been ok so far.
12
- if (ts.isHeritageClause(current)) {
13
- return false;
14
- }
15
- if (ts.isClassLike(current)) {
16
- return true;
17
- }
18
- } while ((current = current.parent));
19
- return false;
20
- }
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/transform/template/inlining/index.ts"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAS,EAAE,IAAa;IACxD,IAAI,OAAO,GAAmB,IAAI,CAAC;IACnC,GAAG,CAAC;QACF,gFAAgF;QAChF,8EAA8E;QAC9E,6CAA6C;QAC7C,IAAI,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;YACjC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC,QAAQ,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE;IAErC,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,8 +0,0 @@
1
- import { GlintEmitMetadata } from '@glint/ember-tsc/config-types';
2
- import type ts from 'typescript';
3
- import { GlintEnvironment } from '../../../config/index.js';
4
- import { TSLib } from '../../util.js';
5
- import { SourceFile } from '../transformed-module.js';
6
- import { CorrelatedSpansResult } from './index.js';
7
- export declare function calculateTaggedTemplateSpans(ts: TSLib, node: ts.TaggedTemplateExpression, meta: GlintEmitMetadata | undefined, script: SourceFile, environment: GlintEnvironment): CorrelatedSpansResult;
8
- //# sourceMappingURL=tagged-strings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tagged-strings.d.ts","sourceRoot":"","sources":["../../../../src/transform/template/inlining/tagged-strings.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAIlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAU,KAAK,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAoB,UAAU,EAAkB,MAAM,0BAA0B,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAA4C,MAAM,YAAY,CAAC;AAE7F,wBAAgB,4BAA4B,CAC1C,EAAE,EAAE,KAAK,EACT,IAAI,EAAE,EAAE,CAAC,wBAAwB,EACjC,IAAI,EAAE,iBAAiB,GAAG,SAAS,EACnC,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,gBAAgB,GAC5B,qBAAqB,CAsFvB"}
@@ -1,140 +0,0 @@
1
- import { assert } from '../../util.js';
2
- import { templateToTypescript } from '../template-to-typescript.js';
3
- import { isEmbeddedInClass } from './index.js';
4
- export function calculateTaggedTemplateSpans(ts, node, meta, script, environment) {
5
- let directives = [];
6
- let errors = [];
7
- let partialSpans = [];
8
- let tag = node.tag;
9
- if (!ts.isIdentifier(tag)) {
10
- return { errors, directives, partialSpans };
11
- }
12
- let importedBindings = collectImportedBindings(ts, tag.getSourceFile());
13
- let info = resolveTagInfo(importedBindings, tag, environment);
14
- if (info) {
15
- assert(ts.isNoSubstitutionTemplateLiteral(node.template), 'No interpolated values in template strings');
16
- let { typesModule, globals } = info.tagConfig;
17
- let template = node.template.rawText ?? node.template.text;
18
- // environment-specific transforms may emit templateLocation in meta, in
19
- // which case we use that. Otherwise we use the reported location from the
20
- // node itself (which is presumably correct because no transform has messed
21
- // with it).
22
- let templateLocation = meta?.templateLocation ?? {
23
- start: node.getStart(),
24
- end: node.getEnd(),
25
- contentStart: node.template.getStart() + 1,
26
- contentEnd: node.template.getEnd() - 1,
27
- };
28
- let embeddingSyntax = {
29
- prefix: script.contents.slice(templateLocation.start, templateLocation.contentStart),
30
- suffix: script.contents.slice(templateLocation.contentEnd, templateLocation.end),
31
- };
32
- let preamble = [];
33
- if (!info.importedBinding.synthetic) {
34
- preamble.push(`${tag.text};`);
35
- }
36
- let specialForms = collectSpecialForms(importedBindings, info.tagConfig.specialForms ?? {});
37
- let transformedTemplate = templateToTypescript(template, {
38
- typesModule: typesModule,
39
- meta,
40
- preamble,
41
- globals,
42
- embeddingSyntax,
43
- specialForms,
44
- backingValue: isEmbeddedInClass(ts, node) ? 'this' : undefined,
45
- useJsDoc: environment.isUntypedScript(script.filename),
46
- });
47
- for (let { message, location } of transformedTemplate.errors) {
48
- if (location) {
49
- errors.push({
50
- source: script,
51
- message,
52
- location: addOffset(location, templateLocation.start),
53
- });
54
- }
55
- else {
56
- errors.push({
57
- source: script,
58
- message,
59
- location: {
60
- start: tag.getStart(),
61
- end: tag.getEnd(),
62
- },
63
- });
64
- }
65
- }
66
- if (transformedTemplate.result) {
67
- partialSpans.push({
68
- originalFile: script,
69
- originalStart: templateLocation.start,
70
- originalLength: templateLocation.end - templateLocation.start,
71
- insertionPoint: templateLocation.start,
72
- transformedSource: transformedTemplate.result.code,
73
- glimmerAstMapping: transformedTemplate.result.mapping,
74
- });
75
- }
76
- }
77
- return { errors, directives, partialSpans };
78
- }
79
- function addOffset(location, offset) {
80
- return {
81
- start: location.start + offset,
82
- end: location.end + offset,
83
- };
84
- }
85
- function collectSpecialForms(importedBindings, config) {
86
- let specialForms = { ...config.globals };
87
- if (config.imports) {
88
- for (let [name, { specifier, source }] of Object.entries(importedBindings)) {
89
- let formForImport = config.imports[source]?.[specifier];
90
- if (formForImport) {
91
- specialForms[name] = formForImport;
92
- }
93
- }
94
- }
95
- return specialForms;
96
- }
97
- function resolveTagInfo(importedBindings, tag, environment) {
98
- let importedBinding = importedBindings[tag.text];
99
- if (!importedBinding) {
100
- return;
101
- }
102
- for (let [importSource, tags] of Object.entries(environment.getConfiguredTemplateTags())) {
103
- for (let [importSpecifier, tagConfig] of Object.entries(tags)) {
104
- if (importSource === importedBinding.source &&
105
- importSpecifier === importedBinding.specifier) {
106
- return { importedBinding, tagConfig };
107
- }
108
- }
109
- }
110
- }
111
- function collectImportedBindings(ts, sourceFile) {
112
- let result = {};
113
- for (let statement of sourceFile.statements) {
114
- if (ts.isImportDeclaration(statement)) {
115
- assert(ts.isStringLiteral(statement.moduleSpecifier));
116
- let { importClause } = statement;
117
- if (!importClause)
118
- continue;
119
- let synthetic = statement.pos === statement.end;
120
- if (importClause.name) {
121
- result[importClause.name.text] = {
122
- specifier: 'default',
123
- source: statement.moduleSpecifier.text,
124
- synthetic,
125
- };
126
- }
127
- if (importClause.namedBindings && ts.isNamedImports(importClause.namedBindings)) {
128
- for (let binding of importClause.namedBindings.elements) {
129
- result[binding.name.text] = {
130
- specifier: binding.propertyName?.text ?? binding.name.text,
131
- source: statement.moduleSpecifier.text,
132
- synthetic,
133
- };
134
- }
135
- }
136
- }
137
- }
138
- return result;
139
- }
140
- //# sourceMappingURL=tagged-strings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tagged-strings.js","sourceRoot":"","sources":["../../../../src/transform/template/inlining/tagged-strings.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,MAAM,EAAS,MAAM,eAAe,CA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YAEhD,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC;gBACtB,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;oBAC/B,SAAS,EAAE,SAAS;oBACpB,MAAM,EAAE,SAAS,CAAC,eAAe,CAAC,IAAI;oBACtC,SAAS;iBACV,CAAC;YACJ,CAAC;YAED,IAAI,YAAY,CAAC,aAAa,IAAI,EAAE,CAAC,cAAc,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,CAAC;gBAChF,KAAK,IAAI,OAAO,IAAI,YAAY,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;oBACxD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;wBAC1B,SAAS,EAAE,OAAO,CAAC,YAAY,EAAE,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI;wBAC1D,MAAM,EAAE,SAAS,CAAC,eAAe,CAAC,IAAI;wBACtC,SAAS;qBACV,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,121 +0,0 @@
1
- import { AST } from '@glimmer/syntax';
2
- import { CodeInformation } from '@volar/language-server/node.js';
3
- import GlimmerASTMappingTree, { MappingSource } from './glimmer-ast-mapping-tree.js';
4
- import { Directive, DirectiveKind, Range } from './transformed-module.js';
5
- /**
6
- * @glimmer/syntax parses identifiers as strings. Aside from meaning
7
- * we often have to reverse engineer location information for them
8
- * by hand, it also means we can't treat mappings from identifiers
9
- * consistently with how we treat mappings from other AST nodes.
10
- *
11
- * This class just gives us a uniform way to store identifiers
12
- * or other nodes as the `source` for a mapping.
13
- */
14
- export declare class Identifier {
15
- readonly name: string;
16
- readonly type = "Identifier";
17
- constructor(name: string);
18
- }
19
- export type Mapper = {
20
- /**
21
- * Given a @glimmer/syntax AST node, returns the corresponding start
22
- * and end offsets of that node in the original source.
23
- */
24
- rangeForNode: (node: AST.Node, span?: AST.Node['loc']) => Range;
25
- /**
26
- * Given a 0-based line number, returns the corresponding start and
27
- * end offsets for that line.
28
- */
29
- rangeForLine: (line: number) => Range;
30
- /**
31
- * Captures the existence of a directive specified by the given source
32
- * node and affecting the given range of text.
33
- */
34
- directive: (type: DirectiveKind, commentNode: AST.CommentStatement | AST.MustacheCommentStatement, location: Range, areaOfEffect: Range) => void;
35
- /**
36
- * Emits placeholder `ts-expect-error`s for corresponding `@glint-expect-error` directives.
37
- * This is called at the end of the template transformation to ensure that we're at a
38
- * top-level / statement-level point in the transformed code, which is a requirement for
39
- * the `ts-expect-error` placeholder diagnostics to be emitted.
40
- */
41
- emitDirectivePlaceholders: () => void;
42
- /**
43
- * Records an error at the given location.
44
- */
45
- error: (message: string, location: Range) => void;
46
- /** Emit a newline in the transformed source */
47
- newline(): void;
48
- /** Increase the indent level for future emitted content */
49
- indent(): void;
50
- /** Decrease the indent level for future emitted content */
51
- dedent(): void;
52
- /** Append the given raw text to the transformed source */
53
- text(value: string): void;
54
- /**
55
- * Append the given raw text to the transformed source, creating
56
- * a 0-length mapping for it in the output.
57
- */
58
- synthetic(value: string): void;
59
- /**
60
- * Essentially the inverse of `emit.synthetic`, this notes the
61
- * presence of a template AST node at a given location while not
62
- * emitting anything in the resulting TS translation.
63
- */
64
- nothing(node: AST.Node, source?: MappingSource): void;
65
- /**
66
- * Append the given value to the transformed source, mapping
67
- * that span back to the given offset in the original source.
68
- */
69
- identifier(value: string, hbsOffset: number, hbsLength?: number): void;
70
- /**
71
- * Map all content emitted in the given callback to the span
72
- * corresponding to the given AST node in the original source.
73
- */
74
- forNode(node: AST.Node, callback: () => void, codeFeaturesForNode?: CodeInformation): void;
75
- forNodeWithSpan(node: AST.Node, span: AST.Node['loc'], callback: () => void, codeFeaturesForNode?: CodeInformation): void;
76
- };
77
- type LocalDirective = Omit<Directive, 'source'>;
78
- /** The result of rewriting a template */
79
- export type RewriteResult = {
80
- /**
81
- * Any errors discovered during rewriting, along with their location
82
- * in terms of the original source.
83
- */
84
- errors: Array<{
85
- message: string;
86
- location: Range | undefined;
87
- }>;
88
- /**
89
- * The source code and a `MappingTree` resulting from rewriting a
90
- * template. If the template contains unrecoverable syntax errors,
91
- * this may be undefined.
92
- */
93
- result?: {
94
- code: string;
95
- directives: Array<LocalDirective>;
96
- mapping: GlimmerASTMappingTree;
97
- };
98
- };
99
- /**
100
- * Syntax surrounding the contents of a template that marks it as
101
- * embedded within the surrounding context, like the `hbs` tag and
102
- * backticks on a tagged string or the `<template>` markers in a
103
- * `.gts`/`.gjs` file.
104
- */
105
- export type EmbeddingSyntax = {
106
- prefix: string;
107
- suffix: string;
108
- };
109
- export type MapTemplateContentsOptions = {
110
- embeddingSyntax: EmbeddingSyntax;
111
- };
112
- /**
113
- * Given the text of a handlebars template (either standalone .hbs file, or the contents
114
- * of an embedded `<template>...</template>` within a .gts file), invokes the given callback
115
- * with a set of tools to emit mapped contents corresponding to
116
- * that template, tracking the text emitted in order to provide
117
- * a mapping of ranges in the input to ranges in the output.
118
- */
119
- export declare function mapTemplateContents(template: string, { embeddingSyntax }: MapTemplateContentsOptions, callback: (ast: AST.Template | null, mapper: Mapper) => void): RewriteResult;
120
- export {};
121
- //# sourceMappingURL=map-template-contents.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"map-template-contents.d.ts","sourceRoot":"","sources":["../../../src/transform/template/map-template-contents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAc,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGjE,OAAO,qBAAqB,EAAE,EAC5B,aAAa,EAEd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAE1E;;;;;;;;GAQG;AACH,qBAAa,UAAU;aAEc,IAAI,EAAE,MAAM;IAD/C,SAAgB,IAAI,gBAAgB;gBACD,IAAI,EAAE,MAAM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