@uxland/harmonix-cli 0.0.2 → 0.0.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.
Files changed (2) hide show
  1. package/index.js +7 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -23,6 +23,7 @@ function getConfig() {
23
23
  }
24
24
  }
25
25
  });
26
+ console.log(config)
26
27
  } catch (err) {
27
28
  console.warn("⚠️ Warning: Error reading .harmonixrc:", err.message);
28
29
  }
@@ -33,7 +34,7 @@ function getConfig() {
33
34
 
34
35
  program
35
36
  .command('publish')
36
- .option('--repository <repository>', 'Backend URL (overrides .harmonixrc)', 'https://preproduccio.componentssiscat.hes.catsalut.intranet.gencat.cat/api/plugins/version')
37
+ .option('--registry <registry>', 'Backend URL (overrides .harmonixrc)')
37
38
  .option('--api-key <apiKey>', 'API Key (overrides .harmonixrc)')
38
39
  .action(async (opts) => {
39
40
  try {
@@ -64,9 +65,12 @@ program
64
65
  formData.append("pluginId", pluginId);
65
66
  formData.append('file', fs.createReadStream(filePath));
66
67
 
67
- const repository = opts.repository || config.repository;
68
+ const registry = opts.registry || config.registry;
68
69
  const apiKey = opts.apiKey || config.apiKey;
69
70
 
71
+ if(!registry){
72
+ throw new Error("No registry configured")
73
+ }
70
74
  if(!apiKey){
71
75
  throw new Error("No api key configured")
72
76
  }
@@ -74,8 +78,7 @@ program
74
78
  const headers = {
75
79
  'x-api-key': apiKey
76
80
  };
77
-
78
- const response = await axios.post(repository, formData, { headers });
81
+ const response = await axios.post(registry, formData, { headers });
79
82
 
80
83
  console.log('✅ Plugin published:', response.data);
81
84
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/harmonix-cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "bin": {
5
5
  "harmonix": "index.js"
6
6
  },