@leonid-shutov/uncommonjs 1.0.0-alpha.2 → 1.0.0-alpha.3

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.
@@ -9,10 +9,11 @@ const { loadDir, loadFile } = require('./loader.js');
9
9
 
10
10
  const getDefaultApplicationPath = () => path.join(process.cwd(), 'application');
11
11
 
12
- const readLayers = (applicationPath) =>
12
+ const readLayers = async (applicationPath) =>
13
13
  fsp
14
14
  .readFile(path.join(applicationPath, '.layers'), 'utf8')
15
- .then((data) => data.split(/[\r\n\s]+/).filter((s) => s.length !== 0));
15
+ .then((data) => data.split(/[\r\n\s]+/).filter((s) => s.length !== 0))
16
+ .catch(() => fsp.readdir(applicationPath));
16
17
 
17
18
  const loader = (context) => (layer) => {
18
19
  if (layer.endsWith('.js')) return loadFile(context, context, layer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leonid-shutov/uncommonjs",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.3",
4
4
  "author": "Leonid Shutov <leonid.shutov.main@gmail.com>",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/leonid-shutov/uncommonjs#readme",