@opengis/fastify-table 1.1.3 → 1.1.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/fastify-table",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "type": "module",
5
5
  "description": "core-plugins",
6
6
  "main": "index.js",
@@ -0,0 +1,5 @@
1
+ import userTemplateDir from './userTemplateDir.js';
2
+
3
+ export default function addTemplateDir(dir) {
4
+ userTemplateDir.push(dir);
5
+ }
@@ -4,6 +4,7 @@ import path from 'path';
4
4
  import config from '../../../config.js';
5
5
 
6
6
  import loadTemplatePath from './loadTemplatePath.js';
7
+ import userTemplateDir from './userTemplateDir.js';
7
8
 
8
9
  const cwd = process.cwd();
9
10
 
@@ -20,6 +21,12 @@ export default function getTemplatePath(type) {
20
21
  if (fs.existsSync(moduleDir) && !moduleList.length) {
21
22
  readdirSync(moduleDir).forEach(el => moduleList.push(path.join(moduleDir, el, type)));
22
23
  }
24
+
25
+ // add user template dir
26
+ userTemplateDir.forEach(dr => {
27
+ moduleList.push(path.join(dr, type));
28
+ });
29
+
23
30
  moduleList.push(path.join(cwd, config.templateDir || 'server/templates', type));
24
31
 
25
32
  moduleList.forEach(el => {
@@ -0,0 +1 @@
1
+ export default [];
package/utils.js CHANGED
@@ -2,7 +2,8 @@
2
2
  // between our tests.
3
3
 
4
4
  import getTemplate from './table/controllers/utils/getTemplate.js';
5
+ import addTemplateDir from './table/controllers/utils/addTemplateDir.js';
5
6
  import metaFormat from './table/funcs/metaFormat/index.js';
6
7
 
7
8
  export default null;
8
- export { getTemplate, metaFormat };
9
+ export { getTemplate, metaFormat, addTemplateDir };