proca 0.5.6 → 0.6.0

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
@@ -18,7 +18,7 @@ $ npm install -g proca
18
18
  $ proca COMMAND
19
19
  running command...
20
20
  $ proca (--version)
21
- proca/0.5.6 linux-x64 node-v20.12.2
21
+ proca/0.6.0 linux-x64 node-v20.12.2
22
22
  $ proca --help [COMMAND]
23
23
  USAGE
24
24
  $ proca COMMAND
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "proca",
3
3
  "description": "Access the proca api",
4
- "version": "0.5.6",
4
+ "version": "0.6.0",
5
5
  "author": "Xavier",
6
6
  "bin": {
7
7
  "proca": "./proca-cli"
@@ -64,9 +64,6 @@
64
64
  "topicSeparator": " ",
65
65
  "commands": "./src/commands",
66
66
  "helpClass": "./src/hooks/help.mjs",
67
- "hooks": {
68
- "init": "./src/hooks/init.mjs"
69
- },
70
67
  "topics": {
71
68
  "widget": {
72
69
  "description": "widgets (actionPages in the API)"
@@ -3,7 +3,7 @@ import debug from "debug";
3
3
  import { parse as dxid, id } from "dxid";
4
4
  import Table from "easy-table";
5
5
  import fastcsv from "fast-csv";
6
-
6
+ import initHook from "#src/hooks/init.mjs";
7
7
  import { createClient } from "#src/urql.mjs";
8
8
 
9
9
  class ProcaCommand extends Command {
@@ -82,6 +82,13 @@ class ProcaCommand extends Command {
82
82
  }
83
83
  return parsed;
84
84
  }
85
+
86
+ static hooks = {
87
+ init: async (options) => {
88
+ console.log("init hook called", options);
89
+ process.exit(1);
90
+ },
91
+ };
85
92
  async init() {
86
93
  await super.init();
87
94
  const { argv, flags } = await this.parse();
@@ -90,7 +97,9 @@ class ProcaCommand extends Command {
90
97
  if (flags.csv) this.format = "csv";
91
98
 
92
99
  this.debug = debug("proca");
100
+ initHook({ config: this.config });
93
101
  this.procaConfig = this.config.procaConfig; // set up from the hooks/init
102
+ // await this.config.runHook('init', { config: this.config });
94
103
  createClient(this.procaConfig);
95
104
  }
96
105