@servable/tools 1.1.6 → 1.2.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.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "source": "src/index.js",
5
5
  "main": "src/index.js",
6
- "version": "1.1.6",
6
+ "version": "1.2.1",
7
7
  "description": "Servable tools is a utility that builds a feature's manifest and documents it.",
8
8
  "author": "Servable Community",
9
9
  "license": "ISC",
@@ -835,10 +835,31 @@ export default class FeatureLoaderV1_0_0 extends BaseClass {
835
835
  return null
836
836
  }
837
837
 
838
- const data = (await directoryGlob({ path: `${path}/**/*.js` }))
838
+ const data = (await directoryGlob({
839
+ path: `${path}/**/*.js`, globOptions: {
840
+ mark: true,
841
+ ignore: ['**/lib/**']
842
+ }
843
+ }))
844
+ return data
845
+ }
846
+
847
+ async liveQueries() {
848
+ let path = `${this.path}/livequeries`
849
+ if (!(await checkFileExists(path))) {
850
+ return null
851
+ }
852
+
853
+ const data = (await directoryGlob({
854
+ path: `${path}/**/*.js`, globOptions: {
855
+ mark: true,
856
+ ignore: ['**/lib/**']
857
+ }
858
+ }))
839
859
  return data
840
860
  }
841
861
 
862
+
842
863
  async jobFiles() {
843
864
  const cacheKey = 'jobFiles'
844
865
  if (this._valueInCache(cacheKey)) {
@@ -711,12 +711,12 @@ export default class FeatureLoaderV1_1_0 extends BaseClass {
711
711
  return this._valueInCache(cacheKey)
712
712
  }
713
713
  //#TODO
714
- const path = `${this.path}/liveclasses.js`
715
- if (!(await checkFileExists(path))) {
716
- return null
714
+ const main = await this.main()
715
+ if (!main) {
716
+ return []
717
717
  }
718
718
 
719
- return this._importJSDefault({ path, })
719
+ return main.liveClasses
720
720
  }
721
721
 
722
722
  //#region system
@@ -830,7 +830,12 @@ export default class FeatureLoaderV1_1_0 extends BaseClass {
830
830
  return null
831
831
  }
832
832
 
833
- const data = (await directoryGlob({ path: `${path}/**/*.js` }))
833
+ const data = (await directoryGlob({
834
+ path: `${path}/**/*.js`, globOptions: {
835
+ mark: true,
836
+ ignore: ['**/lib/**']
837
+ }
838
+ }))
834
839
  return data
835
840
  }
836
841
 
@@ -840,10 +845,29 @@ export default class FeatureLoaderV1_1_0 extends BaseClass {
840
845
  return null
841
846
  }
842
847
 
843
- const data = (await directoryGlob({ path: `${path}/**/*.js` }))
848
+ const data = (await directoryGlob({
849
+ path: `${path}/**/*.js`, globOptions: {
850
+ mark: true,
851
+ ignore: ['**/lib/**']
852
+ }
853
+ }))
844
854
  return data
845
855
  }
846
856
 
857
+ async liveQueries() {
858
+ let path = `${this.path}/livequeries`
859
+ if (!(await checkFileExists(path))) {
860
+ return null
861
+ }
862
+
863
+ const data = (await directoryGlob({
864
+ path: `${path}/**/*.js`, globOptions: {
865
+ mark: true,
866
+ ignore: ['**/lib/**']
867
+ }
868
+ }))
869
+ return data
870
+ }
847
871
 
848
872
  async jobFiles() {
849
873
  const cacheKey = 'jobFiles'
@@ -7,6 +7,10 @@ export default async ({ features }) => {
7
7
  if (!fn) {
8
8
  return null
9
9
  }
10
+ if (typeof fn !== 'function') {
11
+ return null
12
+ }
13
+
10
14
  return fn()
11
15
  }))).filter(a => a)
12
16
  items = _.uniq(_.flatten(items))