@marko/compiler 5.33.8 → 5.34.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.
|
@@ -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
|