@uxland/harmonix-cli 0.0.5 → 0.0.6
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 +16 -100
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,113 +1,29 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @uxland/harmonix-cli
|
|
2
2
|
|
|
3
|
-
`harmonix
|
|
4
|
-
|
|
5
|
-
## 🔧 Instal·lació
|
|
6
|
-
|
|
7
|
-
Assegura’t de tenir `node` i `npm` instal·lats. Afegeix `harmonix-cli` com a dependència del teu projecte o de forma global:
|
|
3
|
+
The [Harmonix](https://harmonixframework.dev) command-line tool. Its command, `harmonix publish`, uploads a built plugin to a Plugin Store. It does not build the plugin or change its version: run your build first and set `version` in `package.json` yourself.
|
|
8
4
|
|
|
9
5
|
```bash
|
|
10
|
-
npm install -
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## 🚀 Publicació d’un plugin
|
|
16
|
-
|
|
17
|
-
### Comanda principal
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
harmonix publish
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Aquesa comanda llegeix la informació del `package.json` i puja el fitxer compilat especificat al registry (plugin store) configurat.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## 📁 Estructura requerida
|
|
28
|
-
|
|
29
|
-
### `package.json`
|
|
30
|
-
|
|
31
|
-
El fitxer `package.json` del teu plugin ha de contenir obligatòriament els següents camps:
|
|
32
|
-
|
|
33
|
-
```json
|
|
34
|
-
{
|
|
35
|
-
"name": "plugin-id",
|
|
36
|
-
"version": "1.0.0",
|
|
37
|
-
"module": "dist/plugin.js"
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
- `name`: identificador únic del plugin (id del plugin).
|
|
42
|
-
- `version`: versió que es publicarà.
|
|
43
|
-
- `module`: ruta al fitxer compilat que es pujarà.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## ⚙️ Configuració amb `.harmonixrc`
|
|
48
|
-
|
|
49
|
-
Crea un fitxer `.harmonixrc` a la carpeta arrel del projecte (en cas de monorepo també serveix) amb el següent contingut:
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
registry=https://plugins.harmonix.dev/upload
|
|
53
|
-
apiKey=la_teva_clau_api
|
|
6
|
+
npm install --save-dev @uxland/harmonix-cli
|
|
7
|
+
npm run build
|
|
8
|
+
npx harmonix publish
|
|
54
9
|
```
|
|
55
10
|
|
|
56
|
-
|
|
57
|
-
- `apiKey`: clau API per a l’autenticació.
|
|
58
|
-
|
|
59
|
-
> 🛑 **Important**: El fitxer `.harmonixrc` conté credencials sensibles. No l’incloguis al repositori de codi. Afegeix-lo al `.gitignore`:
|
|
60
|
-
>
|
|
61
|
-
> ```
|
|
62
|
-
> .harmonixrc
|
|
63
|
-
> ```
|
|
64
|
-
|
|
65
|
-
---
|
|
11
|
+
Run it from the plugin folder. From its `package.json` it reads `name` (the plugin id), `version` and `module` (the built file to upload).
|
|
66
12
|
|
|
67
|
-
##
|
|
13
|
+
## Configuration
|
|
68
14
|
|
|
69
|
-
|
|
15
|
+
The registry URL and the API key go in a `.harmonixrc` file, in the plugin folder or any folder above it (one at the root of a monorepo works for all its plugins), or in your home folder:
|
|
70
16
|
|
|
71
|
-
```
|
|
72
|
-
|
|
17
|
+
```ini
|
|
18
|
+
registry=https://your-plugin-store.example.com/upload
|
|
19
|
+
apiKey=your-api-key
|
|
73
20
|
```
|
|
74
21
|
|
|
75
|
-
|
|
76
|
-
- `--api-key`: clau API d’autenticació.
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## 🫠 Errors comuns i solucions
|
|
22
|
+
The `--registry` and `--api-key` options override the file.
|
|
81
23
|
|
|
82
|
-
|
|
83
|
-
| ------------------------------------------ | -------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
84
|
-
| `package.json not found` | No s’ha trobat el fitxer `package.json` a la carpeta actual | Executa `harmonix publish` des de la carpeta del plugin |
|
|
85
|
-
| `'module' field not found in package.json` | Falta el camp `module` al `package.json` | Afegeix "module": "ruta/al/fitxer.js" |
|
|
86
|
-
| `Compiled bundle file not found` | El fitxer indicat al `module` no existeix | Compila el plugin abans de publicar o verifica la ruta |
|
|
87
|
-
| `No registry configured` | No s’ha especificat `registry` ni a `.harmonixrc` ni per línia de comandes | Afegeix `registry=` a `.harmonixrc` o passa `--registry` |
|
|
88
|
-
| `No api key configured` | Falta la clau API (`apiKey`) | Afegeix-la a `.harmonixrc` o passa `--api-key` |
|
|
24
|
+
> `.harmonixrc` contains credentials: never commit it. Projects made with `npm create @uxland/harmonix-plugin@latest` already ignore it.
|
|
89
25
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
## 📖 Ajuda
|
|
93
|
-
|
|
94
|
-
Per veure els comandaments disponibles:
|
|
95
|
-
|
|
96
|
-
```bash
|
|
97
|
-
npx harmonix --help
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
## ✅ Exemple complet
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
npx harmonix publish --registry https://plugins.harmonix.dev/upload --api-key ABC123XYZ
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
O bé, si tens `.harmonixrc` configurat:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
npx harmonix publish
|
|
112
|
-
```
|
|
26
|
+
## Documentation
|
|
113
27
|
|
|
28
|
+
- [This package](https://harmonixframework.dev/docs/packages/cli/): configuration order, the request it sends, errors and exit codes.
|
|
29
|
+
- [Build and publish a plugin](https://harmonixframework.dev/docs/create-plugin/build-and-publish/).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uxland/harmonix-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"bin": {
|
|
5
5
|
"harmonix": "index.js"
|
|
6
6
|
},
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"index.js"
|
|
9
9
|
],
|
|
10
10
|
"main": "index.js",
|
|
11
|
-
"description": "
|
|
11
|
+
"description": "The Harmonix command-line tool: publishes a built plugin to a Plugin Store.",
|
|
12
|
+
"homepage": "https://harmonixframework.dev/docs/packages/cli/",
|
|
12
13
|
"author": "Cristian Payet <cpayet@uxland.cat>",
|
|
13
14
|
"publishConfig": {
|
|
14
15
|
"access": "public"
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
"harmonix"
|
|
20
21
|
],
|
|
21
22
|
"dependencies": {
|
|
22
|
-
"axios": "^1.
|
|
23
|
+
"axios": "^1.12.2",
|
|
23
24
|
"commander": "^9.4.0",
|
|
24
25
|
"form-data": "^4.0.0"
|
|
25
26
|
}
|