@marko/compiler 5.23.2 → 5.23.3

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.
@@ -14,6 +14,7 @@ class Tag {
14
14
  this.attributes = {};
15
15
  this.transformers = [];
16
16
  this.patternAttributes = [];
17
+ this.types = undefined;
17
18
  }
18
19
 
19
20
  addAttribute(attr) {
@@ -30,6 +30,7 @@ class Taglib {
30
30
  ok(filePath, '"filePath" expected');
31
31
  this.filePath = this.path /* deprecated */ = this.id = filePath;
32
32
  this.dirname = path.dirname(this.filePath);
33
+ this.scriptLang = undefined;
33
34
  this.tags = {};
34
35
  this.migrators = [];
35
36
  this.transformers = [];
@@ -322,6 +322,17 @@ class TagLoader {
322
322
  }
323
323
  }
324
324
 
325
+ /**
326
+ * This property is used by @marko/language-tools (editor tooling)
327
+ * to override the Marko file used when generating the tags exposed
328
+ * typescript / jsdoc types.
329
+ */
330
+ types(value) {
331
+ var tag = this.tag;
332
+ var dirname = this.dirname;
333
+ tag.types = nodePath.resolve(dirname, value);
334
+ }
335
+
325
336
  /**
326
337
  * An Object where each property maps to an attribute definition.
327
338
  * The property key will be the attribute name and the property value
@@ -210,6 +210,12 @@ class TaglibLoader {
210
210
  }
211
211
  }
212
212
  }
213
+ scriptLang(lang) {
214
+ // The "script-lang" property is used to specify the language of embedded scripts (either "js" or "ts").
215
+ // The language tools will prefer the language specified by the "script-lang" if specified.
216
+ // If unspecified the language tools will check for a tsconfig, if one is found then "ts", otherwise we use "js".
217
+ this.taglib.scriptLang = lang;
218
+ }
213
219
  tagsDir(dir) {
214
220
  // The "tags-dir" property is used to supporting scanning
215
221
  // of a directory to discover custom tags. Scanning a directory
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
3
  "description": "Marko template to JS compiler.",
4
- "version": "5.23.2",
4
+ "version": "5.23.3",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/marko/issues/new?template=Bug_report.md",
7
7
  "dependencies": {
@@ -30,7 +30,7 @@
30
30
  "strip-json-comments": "^3.1.1"
31
31
  },
32
32
  "devDependencies": {
33
- "@marko/translator-default": "^5.22.2"
33
+ "@marko/translator-default": "^5.22.3"
34
34
  },
35
35
  "files": [
36
36
  "dist",