Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
```markdown
# [ANY Experience Gallery](https://gallery.any.coop)

## Contribution
Thank you for your desire to develop Anytype together!

❀️ This project and everyone involved in it is governed by the [Code of Conduct](https://github.com/anyproto/.github/blob/main/docs/CODE_OF_CONDUCT.md).

<!-- πŸ§‘β€πŸ’» Check out our [contributing guide](https://github.com/anyproto/.github/blob/main/docs/CONTRIBUTING.md) to learn about asking questions, creating issues, or submitting pull requests. -->

🫒 For security findings, please email [security@anytype.io](mailto:security@anytype.io) and refer to our [security guide](https://github.com/anyproto/.github/blob/main/docs/SECURITY.md) for more information.

🀝 Follow us on [Github](https://github.com/anyproto) and join the [Contributors Community](https://github.com/orgs/anyproto/discussions).

---
Made by Any β€” a Swiss association πŸ‡¨πŸ‡­

Licensed under [MIT](./LICENSE.md).

```

---

## Enhancements

- **Validation script:** Added `scripts/validate-manifests.js` β€” a small Node.js utility that scans each folder under `experiences/` and checks for a valid `manifest.json` and that the `screenshots/` directory exists and contains at least one file.

### Usage

Run from the repository root with Node.js installed:

```bash
node scripts/validate-manifests.js
```

Exit codes:
- `0` β€” all manifests and screenshots are valid
- `1` β€” one or more issues were found (errors will be printed)

This script helps keep the collection consistent and can be integrated into CI to catch missing or malformed manifests early.
# [ANY Experience Gallery](https://gallery.any.coop)

## Contribution
Expand Down
48 changes: 48 additions & 0 deletions scripts/validate-manifests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');

const root = path.resolve(__dirname, '..');
const experiencesDir = path.join(root, 'experiences');

let errors = [];

if (!fs.existsSync(experiencesDir) || !fs.statSync(experiencesDir).isDirectory()) {
console.error('No experiences directory found at', experiencesDir);
process.exit(1);
}

const entries = fs.readdirSync(experiencesDir, { withFileTypes: true }).filter(d => d.isDirectory());

entries.forEach(dirent => {
const dir = path.join(experiencesDir, dirent.name);
const manifestPath = path.join(dir, 'manifest.json');
if (!fs.existsSync(manifestPath)) {
errors.push(`${dirent.name}: missing manifest.json`);
return;
}
try {
const content = fs.readFileSync(manifestPath, 'utf8');
JSON.parse(content);
} catch (e) {
errors.push(`${dirent.name}: invalid JSON in manifest.json β€” ${e.message}`);
}
const screenshotsDir = path.join(dir, 'screenshots');
if (!fs.existsSync(screenshotsDir) || !fs.statSync(screenshotsDir).isDirectory()) {
errors.push(`${dirent.name}: missing screenshots/ directory`);
} else {
const imgs = fs.readdirSync(screenshotsDir).filter(f => !f.startsWith('.'));
if (imgs.length === 0) {
errors.push(`${dirent.name}: screenshots/ is empty`);
}
}
});

if (errors.length) {
console.error('Validation failed:');
errors.forEach(e => console.error(' -', e));
process.exit(1);
} else {
console.log('All experience manifests and screenshots look good!');
process.exit(0);
}