@marko/compiler 5.39.5 → 5.39.7

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.
@@ -319,7 +319,7 @@ function resolveMarkoFile(file, filename) {
319
319
  const idCache = new WeakMap();
320
320
  const templateIdHashOpts = { outputLength: 5 };
321
321
  function getTemplateId(opts, request, child) {
322
- const id = (0, _path.relative)(ROOT, request);
322
+ const id = (0, _path.relative)(ROOT, request).replace(/[^a-zA-Z0-9_$./-]/g, "/");
323
323
  const optimize = typeof opts === "object" ? opts.optimize : opts;
324
324
 
325
325
  if (optimize) {
@@ -50,7 +50,7 @@ function getAllDependencyNames(pkg) {
50
50
  return Object.keys(map);
51
51
  }
52
52
 
53
- function find(dirname, registeredTaglibs) {
53
+ function find(dirname, registeredTaglibs, tagDiscoveryDirs) {
54
54
  var found = findCache[dirname];
55
55
  if (found) {
56
56
  return found;
@@ -92,10 +92,14 @@ function find(dirname, registeredTaglibs) {
92
92
  }
93
93
 
94
94
  if (!taglib || taglib.tagsDir === undefined) {
95
- const componentsPath = nodePath.join(curDirname, "components");
96
-
97
- if (existsSync(componentsPath) && !excludedDirs[componentsPath]) {
98
- helper.addTaglib(taglibLoader.loadTaglibFromDir(curDirname));
95
+ for (const tagDiscoveryDir of tagDiscoveryDirs) {
96
+ const componentsPath = nodePath.join(curDirname, tagDiscoveryDir);
97
+
98
+ if (existsSync(componentsPath) && !excludedDirs[componentsPath]) {
99
+ helper.addTaglib(
100
+ taglibLoader.loadTaglibFromDir(curDirname, tagDiscoveryDir)
101
+ );
102
+ }
99
103
  }
100
104
  }
101
105
  }
@@ -45,7 +45,11 @@ function buildLookup(dirname, requestedTranslator, onError) {
45
45
  }
46
46
 
47
47
  runAndCatchErrors(() => {
48
- taglibsForDir = _finder2.default.find(dirname, taglibsForDir);
48
+ taglibsForDir = _finder2.default.find(
49
+ dirname,
50
+ taglibsForDir,
51
+ translator.tagDiscoveryDirs
52
+ );
49
53
  }, onError);
50
54
 
51
55
  const cacheKey = taglibsForDir.
@@ -12,8 +12,8 @@ function loadTaglibFromFile(filePath, isFromPackageJson) {
12
12
  return loaders.loadTaglibFromFile(filePath, isFromPackageJson);
13
13
  }
14
14
 
15
- function loadTaglibFromDir(filePath) {
16
- return loaders.loadTaglibFromDir(filePath);
15
+ function loadTaglibFromDir(filePath, tagDiscoveryDir) {
16
+ return loaders.loadTaglibFromDir(filePath, tagDiscoveryDir);
17
17
  }
18
18
 
19
19
  function clearCache() {
@@ -5,10 +5,10 @@ var DependencyChain = require("./DependencyChain");
5
5
  var scanTagsDir = require("./scanTagsDir");
6
6
  var types = require("./types");
7
7
 
8
- function loadFromDir(dir) {
8
+ function loadFromDir(dir, tagDiscoveryDir) {
9
9
  ok(dir, '"dir" is required');
10
10
 
11
- var componentsPath = nodePath.join(dir, "components");
11
+ var componentsPath = nodePath.join(dir, tagDiscoveryDir);
12
12
  var taglib = cache.get(componentsPath);
13
13
 
14
14
  // Only load a taglib once by caching the loaded taglibs using the file
@@ -19,7 +19,7 @@ function loadFromDir(dir) {
19
19
  scanTagsDir(
20
20
  componentsPath,
21
21
  dir,
22
- "components",
22
+ tagDiscoveryDir,
23
23
  taglib,
24
24
  new DependencyChain([componentsPath])
25
25
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
- "version": "5.39.5",
3
+ "version": "5.39.7",
4
4
  "description": "Marko template to JS compiler.",
5
5
  "keywords": [
6
6
  "babel",
@@ -86,7 +86,7 @@
86
86
  "source-map-support": "^0.5.21"
87
87
  },
88
88
  "devDependencies": {
89
- "marko": "^5.37.5"
89
+ "marko": "^5.37.8"
90
90
  },
91
91
  "publishConfig": {
92
92
  "access": "public"