Skip to content

Commit c868b39

Browse files
bthosbthos
andauthored
chore: update validation processes in documentation and scripts (#9)
- Replace `npm run build` with `npm run validate-plugins` in CONTRIBUTING.md and README.md to streamline plugin validation steps. - Clarify that CI will automatically handle registry building and validation upon PR submission. - Update various scripts and workflows to reflect the new validation commands and improve clarity for contributors. Signed-off-by: bthos <el.mogul@outlook.es> Co-authored-by: bthos <el.mogul@outlook.es>
1 parent e63afa0 commit c868b39

File tree

7 files changed

+49
-20
lines changed

7 files changed

+49
-20
lines changed

.github/workflows/validate-manifest.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@ jobs:
3939
- name: Check for duplicates
4040
run: npm run check-duplicates
4141

42-
- name: Build and validate registry
42+
- name: Build registry
43+
run: npm run build
44+
45+
- name: Validate registry
4346
run: npm run validate

.github/workflows/validate-registry.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ jobs:
3838
run: |
3939
npm run validate-plugins
4040
41-
- name: Build and validate registry
41+
- name: Build registry
42+
run: |
43+
npm run build
44+
45+
- name: Validate registry
4246
run: |
4347
npm run validate
4448

CONTRIBUTING.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ Before submitting, validate your entry:
150150
5. **Verify author is present**: The `author` field is required and cannot be empty
151151
6. **Verify repository URL**: Ensure the GitHub repository exists and is accessible
152152
7. **Check for duplicates**: Ensure no other plugin has the same `{author}/{id}` combination
153-
8. **Build and validate**: Run `npm run build && npm run validate` to ensure everything works
153+
8. **Validate your plugin**: Run `npm run validate-plugins` to check your plugin.json file
154+
- CI will automatically build the registry and validate it when you submit a PR
155+
- You can optionally run `npm run validate-all` for a full local check (includes building registry), but it's not required
154156

155157
### Step 5: Install Git Hooks (Optional but Recommended)
156158

@@ -167,15 +169,18 @@ This will:
167169

168170
### Step 6: Submit Pull Request
169171

170-
1. **Validate your changes:**
172+
1. **Validate your plugin:**
171173
```bash
172-
npm run validate-all
174+
npm run validate-plugins
173175
```
174176

175-
This will:
176-
- Validate individual plugin files
177+
This checks your plugin.json file. CI will automatically:
178+
- Validate schema files
179+
- Validate all plugin files
177180
- Build the registry from plugins
178-
- Validate the registry against the schema
181+
- Validate the built registry against the schema
182+
183+
**Optional**: Run `npm run validate-all` for a full local check (builds and validates registry locally), but CI does this automatically.
179184

180185
2. **Commit your changes** (with DCO sign-off):
181186
```bash
@@ -214,7 +219,7 @@ To update your plugin entry:
214219
1. For **metadata changes** (description, tags, etc.): edit `plugin.json` in the version directory (e.g. `plugins/d/developer-name/example-plugin/1.0.0/plugin.json`).
215220
2. For a **new version**: create a new version directory (e.g. `plugins/d/developer-name/example-plugin/1.1.0/`) and add a new `plugin.json` there.
216221
3. Do not change the `author` field or move the plugin to a different author path without coordination.
217-
4. Run `npm run validate-all`, then commit and submit a pull request. Do **not** commit `registry.json` (CI regenerates it).
222+
4. Run `npm run validate-plugins` to check your plugin.json, then commit and submit a pull request. Do **not** commit `registry.json` (CI regenerates it automatically).
218223

219224
## Plugin Verification
220225

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ Each plugin's `plugin.json` follows the schema defined in `schemas/manifest.sche
9191
npm run create-plugin
9292
```
9393
This will guide you through all required fields and create the correct structure automatically.
94-
4. **Commit and create a Pull Request** (see [CONTRIBUTING.md](CONTRIBUTING.md) for details)
94+
4. **Validate your plugin**:
95+
```bash
96+
npm run validate-plugins
97+
```
98+
5. **Commit and create a Pull Request** (see [CONTRIBUTING.md](CONTRIBUTING.md) for details)
99+
- CI will automatically build and validate the registry when you submit a PR
95100

96101
### Manual Process
97102

@@ -107,7 +112,8 @@ To add your plugin manually:
107112
- `id` matches the plugin directory name (e.g. `jira-integration`)
108113
- `author` matches the author directory when normalized (e.g. "John Doe" → "john-doe")
109114
- `latest_version` or directory name is semver (e.g. `1.0.0`)
110-
7. **Run `npm run validate-all`** then submit a pull request
115+
7. **Validate your plugin**: Run `npm run validate-plugins` to check your plugin.json
116+
8. **Submit a pull request** (CI will automatically build and validate the registry)
111117

112118
**Example**: Plugin "jira-integration" by "John Doe", version 1.0.0:
113119
- Path: `plugins/j/john-doe/jira-integration/1.0.0/plugin.json`
@@ -193,6 +199,8 @@ The Time Tracker application discovers plugins through:
193199

194200
## Local Development
195201

202+
**Note**: This section covers commands for repository maintainers. Plugin contributors only need `npm run validate-plugins` to check their plugin.json - CI handles the rest automatically.
203+
196204
### Setup
197205

198206
```bash
@@ -211,15 +219,21 @@ This will guide you through all required fields and create the correct directory
211219

212220
### Building the Registry
213221

222+
**Note**: Plugin contributors don't need to build the registry - CI does this automatically. The commands below are for repository maintainers.
223+
214224
Build `registry.json` from individual plugin files:
215225

216226
```bash
217227
npm run build
218228
```
219229

230+
**Note**: The `build` script generates/updates `registry.json`. Use `npm run validate` to check an existing `registry.json` without modifying it.
231+
220232
### Validation
221233

222-
Validate schema files (manifest + registry) against JSON Schema draft 2020-12:
234+
**For plugin contributors**: Run `npm run validate-plugins` to check your plugin.json file. CI will handle building and validating the registry automatically.
235+
236+
**For repository maintainers**: Full validation commands:
223237

224238
```bash
225239
npm run validate-schemas
@@ -231,18 +245,20 @@ Validate individual plugin files:
231245
npm run validate-plugins
232246
```
233247

234-
Validate the aggregated registry (builds registry first):
248+
Validate the aggregated registry (requires registry.json to exist - run `npm run build` first):
235249

236250
```bash
237251
npm run validate
238252
```
239253

240-
Validate everything (plugins + registry):
254+
Validate everything (schemas, plugins, build registry, and validate registry):
241255

242256
```bash
243257
npm run validate-all
244258
```
245259

260+
This runs: `validate-schemas``validate-plugins``build``validate`
261+
246262
Check for duplicate plugin IDs:
247263

248264
```bash

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"main": "registry.json",
66
"scripts": {
77
"build": "node scripts/build-registry.js",
8-
"validate": "npm run build && node scripts/validate.js",
8+
"validate": "node scripts/validate.js",
99
"validate-plugins": "node scripts/validate-plugins.js",
1010
"validate-schemas": "node scripts/validate-schemas.js",
11-
"validate-all": "npm run validate-schemas && npm run validate-plugins && npm run validate",
11+
"validate-all": "npm run validate-schemas && npm run validate-plugins && npm run build && npm run validate",
1212
"format": "node scripts/format.js",
1313
"check-duplicates": "node scripts/check-duplicates.js",
1414
"create-plugin": "node scripts/create-plugin.js",

plugins/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ plugins/
3535
1. Normalize your author name and determine the first letter.
3636
2. Create `plugins/{letter}/{normalized-author}/{plugin-id}/{version}/`.
3737
3. Add `plugin.json` with `id`, `author`, `latest_version` (matching the version directory), and other required fields.
38-
4. Run `npm run validate-all` from the repository root.
38+
4. Validate your plugin: Run `npm run validate-plugins` from the repository root.
39+
- CI will automatically build and validate the registry when you submit a PR
3940

4041
## Example
4142

scripts/create-plugin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ async function createPlugin() {
203203
console.log(`\n📁 Location: plugins/${firstLetter}/${normalizedAuthor}/${pluginId}/${latestVersion}/plugin.json`);
204204
console.log('\n📝 Next steps:');
205205
console.log(' 1. Review the created plugin.json file');
206-
console.log(' 2. Run: npm run validate-all');
207-
console.log(' 3. Run: npm run build');
208-
console.log(' 4. Commit and create a Pull Request');
206+
console.log(' 2. Run: npm run validate-plugins');
207+
console.log(' 3. Commit and create a Pull Request');
209208
console.log('\n💡 Tip: You can add icon.png, screenshot.png, or README.md to the plugin directory.');
209+
console.log(' Note: CI will automatically build and validate the registry when you submit a PR.');
210210

211211
rl.close();
212212
} catch (error) {

0 commit comments

Comments
 (0)