Skip to content

Commit

Permalink
Adds more developer documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
vpetersson committed Dec 7, 2024
1 parent 7d77591 commit 438046c
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,25 @@ Control playlist visibility dynamically:
npm install
```

2. Configure your Screenly API key:
2. Set up pre-commit hooks:

* Get your API key from [Screenly Settings](
https://app.screenlyapp.com/settings/api-keys
)
* When setting up the Zapier integration, you'll be prompted to enter this
API key
```bash
# Install husky and lint-staged
npm install -D husky lint-staged

# Initialize husky
npm run prepare

# Add pre-commit hook
npx husky add .husky/pre-commit "npm test && npm run lint"

# Install linting tools
npm install -D eslint prettier markdownlint-cli
```

3. Configure your Screenly API key:
* Get your API key from [Screenly Settings](https://app.screenlyapp.com/settings/api-keys)
* When setting up the Zapier integration, you'll be prompted to enter this API key

### Available Scripts

Expand All @@ -260,6 +272,7 @@ The project uses several tools to ensure code quality:
* **Jest** - For testing
* **Husky** - For git hooks
* **lint-staged** - For running checks on staged files
* **markdownlint** - For markdown formatting

These run automatically on commit, but you can also run them manually:

Expand All @@ -272,10 +285,20 @@ npm run format # Fix code formatting

Pre-commit hooks are set up to:

* Run unit tests
* Lint JavaScript files
* Format code with Prettier
* Check markdown formatting
* Run tests

The hooks are configured in:

* `.husky/pre-commit` - Hook scripts
* `package.json` - lint-staged configuration
* `.eslintrc.js` - ESLint rules
* `.prettierrc` - Prettier configuration
* `.markdownlint.json` - Markdown linting rules

### Visual Testing

Visual tests are automatically run in CI and generate screenshots of:
Expand Down Expand Up @@ -318,5 +341,3 @@ These tests are skipped locally to avoid environment-specific issues.
### License

See [LICENSE](LICENSE) file for details.

```</rewritten_file>

0 comments on commit 438046c

Please sign in to comment.