primate 0.19.0 → 0.19.2

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/README.md CHANGED
@@ -3,3 +3,5 @@
3
3
  This package contains the core framework code.
4
4
 
5
5
  See the [Getting started][getting-started] guide for documentation.
6
+
7
+ [getting-started]: https://primatejs.com/guide/getting-started
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primate",
3
- "version": "0.19.0",
3
+ "version": "0.19.2",
4
4
  "description": "Expressive, minimal and extensible web framework",
5
5
  "homepage": "https://primatejs.com",
6
6
  "bugs": "https://github.com/primatejs/primate/issues",
package/src/app.js CHANGED
@@ -70,6 +70,8 @@ export default async (config, root, log) => {
70
70
  `${type}`.replace(paths.types, "").slice(1, -ending.length),
71
71
  (await import(type)).default,
72
72
  ])));
73
+ Object.keys(types).length === 0
74
+ && errors.EmptyTypeDirectory.warn(log, {root: paths.types});
73
75
  Object.entries(types).some(([name, type]) =>
74
76
  typeof type !== "function" && errors.InvalidType.throw({name}));
75
77
 
@@ -84,8 +86,8 @@ export default async (config, root, log) => {
84
86
  config: root.join("primate.config.js"),
85
87
  });
86
88
 
87
- const hookless = modules.filter(module =>
88
- !Object.keys(module).some(key => Object.keys(hooks).includes(key)));
89
+ const hookless = modules.filter(module => !Object.keys(module).some(key =>
90
+ [...Object.keys(hooks), "load"].includes(key)));
89
91
  hookless.length > 0 && errors.ModuleHasNoHooks.warn(log, {hookless});
90
92
 
91
93
  const {name, version} = await base.up(1).join("package.json").json();
package/src/errors.js CHANGED
@@ -38,6 +38,13 @@ export default Object.fromEntries(Object.entries({
38
38
  level: Logger.Warn,
39
39
  };
40
40
  },
41
+ EmptyTypeDirectory({root}) {
42
+ return {
43
+ message: ["empty type directory"],
44
+ fix: ["populate % with types or remove it", root],
45
+ level: Logger.Warn,
46
+ };
47
+ },
41
48
  ErrorInConfigFile({config, message}) {
42
49
  return {
43
50
  message: ["error in config %", message],