@marko/compiler 5.33.8 → 5.34.1

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.
@@ -203,16 +203,16 @@ function parseMarko(file) {
203
203
  currentTag.node.typeArguments = (0, _babelUtils.parseTypeArgs)(
204
204
  file,
205
205
  parser.read(part.value),
206
- part.start,
207
- part.end
206
+ part.value.start,
207
+ part.value.end
208
208
  );
209
209
  },
210
210
  onTagTypeParams(part) {
211
211
  currentBody.node.typeParameters = (0, _babelUtils.parseTypeParams)(
212
212
  file,
213
213
  parser.read(part.value),
214
- part.start,
215
- part.end
214
+ part.value.start,
215
+ part.value.end
216
216
  );
217
217
  },
218
218
  onPlaceholder(part) {
@@ -120,7 +120,7 @@ function find(dirname, registeredTaglibs) {
120
120
  nodePath.join(name, "marko.json")
121
121
  );
122
122
  if (taglibPath) {
123
- var taglib = taglibLoader.loadTaglibFromFile(taglibPath);
123
+ var taglib = taglibLoader.loadTaglibFromFile(taglibPath, true);
124
124
  helper.addTaglib(taglib);
125
125
  }
126
126
  }
@@ -26,9 +26,10 @@ function handleImport(taglib, importedTaglib) {
26
26
  }
27
27
 
28
28
  class Taglib {
29
- constructor(filePath) {
29
+ constructor(filePath, isFromPackageJson) {
30
30
  ok(filePath, '"filePath" expected');
31
31
  this.filePath = this.path /* deprecated */ = this.id = filePath;
32
+ this.isFromPackageJson = isFromPackageJson === true;
32
33
  this.dirname = path.dirname(this.filePath);
33
34
  this.scriptLang = undefined;
34
35
  this.tags = {};
@@ -8,8 +8,8 @@ function loadTaglibFromProps(taglib, taglibProps) {
8
8
  return loaders.loadTaglibFromProps(taglib, taglibProps);
9
9
  }
10
10
 
11
- function loadTaglibFromFile(filePath) {
12
- return loaders.loadTaglibFromFile(filePath);
11
+ function loadTaglibFromFile(filePath, isFromPackageJson) {
12
+ return loaders.loadTaglibFromFile(filePath, isFromPackageJson);
13
13
  }
14
14
 
15
15
  function loadTaglibFromDir(filePath) {
@@ -5,7 +5,7 @@ var loaders = require("./loaders");
5
5
 
6
6
  var ok = require("assert").ok;
7
7
 
8
- function loadFromFile(filePath) {
8
+ function loadFromFile(filePath, isFromPackageJson) {
9
9
  ok(filePath, '"filePath" is required');
10
10
 
11
11
  var taglib = cache.get(filePath);
@@ -13,7 +13,7 @@ function loadFromFile(filePath) {
13
13
  // Only load a taglib once by caching the loaded taglibs using the file
14
14
  // system file path as the key
15
15
  if (!taglib) {
16
- taglib = new types.Taglib(filePath);
16
+ taglib = new types.Taglib(filePath, isFromPackageJson);
17
17
  cache.put(filePath, taglib);
18
18
 
19
19
  var taglibProps = jsonFileReader.readFileSync(filePath);
@@ -252,6 +252,24 @@ class TaglibLoader {
252
252
  }
253
253
  }
254
254
 
255
+ exports(dir) {
256
+ var taglib = this.taglib;
257
+ var path = this.filePath;
258
+ var dirname = this.dirname;
259
+
260
+ if (taglib.isFromPackageJson) {
261
+ taglib.tagsDir = false;
262
+
263
+ scanTagsDir(
264
+ path,
265
+ dirname,
266
+ dir,
267
+ taglib,
268
+ this.dependencyChain.append(`exports`)
269
+ );
270
+ }
271
+ }
272
+
255
273
  taglibImports(imports) {
256
274
  // The "taglib-imports" property allows another taglib to be imported
257
275
  // into this taglib so that the tags defined in the imported taglib
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
- "version": "5.33.8",
3
+ "version": "5.34.1",
4
4
  "description": "Marko template to JS compiler.",
5
5
  "keywords": [
6
6
  "babel",