Skip to content

chore: align deps, dogfood setup, fix lint:fix, YAML indent - #54

Merged
rjmunro merged 7 commits into
Sofie-Automation:mainfrom
rjmunro:rjmunro/update-self-peerdeps
Jul 27, 2026
Merged

chore: align deps, dogfood setup, fix lint:fix, YAML indent#54
rjmunro merged 7 commits into
Sofie-Automation:mainfrom
rjmunro:rjmunro/update-self-peerdeps

Conversation

@rjmunro

@rjmunro rjmunro commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

About the Contributor

This pull request is posted on behalf of SuperFly.tv.

Type of Contribution

This is a: Code improvement

Current Behaviour

Before this PR:

  • husky and lint-staged were peer dependencies but not explicit devDependencies in this repo, which could lead to environment differences in the local workspace.
  • TypeScript was locked to ~5.7 in dev and peer dependencies.
  • This repo used a narrower, repo-specific lint setup (no package.json "prettier" key, scoped lint targets) rather than the consumer layout produced by sofie-code-standard-preset-setup.
  • The setup script and README documented lint:fix as yarn lint:prettier --write, which expands to prettier --check . --write and does not reliably apply fixes.
  • YAML files were formatted with the same tab-based Prettier settings as code, which is undesirable for YAML.
  • Various markdown and YAML files in this repo did not comply with the enforced style.

New Behaviour

  • Added husky (^9) and lint-staged (^17) explicitly under devDependencies to align with their peer dependency ranges.
  • Bumped TypeScript to ~6.0 under both devDependencies and peerDependencies.
  • Ran sofie-code-standard-preset-setup on this repo to dogfood the consumer layout (husky, lint-staged, standard lint scripts, .editorconfig, etc.).
  • Added .husky/pre-commit running lint-staged.
  • Fixed lint:fix to call lint:prettier:fix instead of passing --write to lint:prettier.
  • Added lint:prettier:fix (prettier --write .) to match the lint:prettier scope (prettier --check .).
  • Applied the same lint:fix / lint:prettier:fix fix in bin/setup.mjs and the README manual-setup / migration docs.
  • Added a Prettier override so *.yaml / *.yml files always use 2-space indentation (code files remain tab-indented with tabWidth: 4).
  • Regenerated yarn.lock.
  • Ran lint:fix on all files in the repo, including markdown and YAML.

Dogfooding note: the setup script sets "prettier": "@sofie-automation/code-standard-preset/prettier.config.mjs" in consumer projects (correct — it resolves via node_modules). In this repo we use "prettier": "./prettier.config.mjs" instead, because the package cannot reference itself through node_modules. yarn lint passes locally with that override.

Testing Instructions

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR
  • Run yarn lint in this repo and confirm it passes (dogfooding with local ./prettier.config.mjs override).
  • Run yarn lint:prettier:fix and confirm YAML files (e.g. .github/workflows/*.yaml) use 2-space indentation.
  • In a consumer project with @sofie-automation/code-standard-preset installed, run yarn sofie-code-standard-preset-setup (or --force on an existing project) and verify package.json contains:
    • "lint:prettier:fix": "prettier --write ."
    • "lint:fix": "yarn lint:eslint --fix && yarn lint:prettier:fix"
  • Run yarn lint:fix in that consumer project and confirm Prettier writes fixes (not just checks).
  • Optionally run setup on a fresh temp project and confirm the generated scripts match the README.

Affected areas

  • sofie-code-standard-preset dev dependency alignment and local dogfooding setup
  • prettier.config.mjs YAML indentation override
  • bin/setup.mjs generated lint scripts for consumer projects
  • README setup / migration documentation

Time Frame

Not urgent.

Other Information

Commits in this PR (will be squashed before merge):

  1. chore: align devDependencies with peerDependencies versions
  2. chore: Update ourselves using setup script
  3. fix(setup): use lint:prettier:fix for lint:fix
  4. Indent YAML with 2 spaces
  5. chore: Format non-code files to match style

Files changed: .github/ISSUE_TEMPLATE/*, .github/PULL_REQUEST_TEMPLATE.md, .husky/pre-commit, CHANGELOG.md, CONTRIBUTING.md, README.md, bin/setup.mjs, package.json, prettier.config.mjs, yarn.lock

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests have been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@rjmunro, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2a494555-19d0-4d51-870f-a19e3a562365

📥 Commits

Reviewing files that changed from the base of the PR and between 40b1356 and 5eff129.

📒 Files selected for processing (3)
  • README.md
  • bin/setup.mjs
  • package.json

Walkthrough

package.json configures Husky, lint-staged, shared Prettier settings, revised lint commands, license validation, and TypeScript 6. The Husky pre-commit hook now runs lint-staged. Setup guidance and repository formatting are also updated.

Changes

Lint tooling and repository formatting

Layer / File(s) Summary
Configure lint tooling and scripts
package.json, prettier.config.mjs
Lint and license validation scripts are updated; Husky and lint-staged are added; TypeScript is upgraded; staged-file checks and YAML-specific Prettier options are configured.
Wire pre-commit and setup scripts
.husky/pre-commit, bin/setup.mjs, README.md
The pre-commit hook invokes lint-staged, while setup scripts and documentation expose the dedicated Prettier fix command.
Normalize repository templates and documentation
.github/ISSUE_TEMPLATE/*, .github/PULL_REQUEST_TEMPLATE.md, CHANGELOG.md, CONTRIBUTING.md
Issue and pull request templates, changelog lists, and contributing guidance receive formatting-only updates.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: julusian, justandras

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title summarizes the main changes: dependency alignment, setup dogfooding, lint:fix changes, and YAML indentation.
Description check ✅ Passed The description matches the PR changes and objectives, including deps, setup scripts, linting, YAML formatting, and docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rjmunro
rjmunro marked this pull request as ready for review June 19, 2026 10:35
@rjmunro
rjmunro requested a review from Julusian June 19, 2026 10:35
@Julusian

Copy link
Copy Markdown
Member

Before this PR, husky and lint-staged were required as peer dependencies, but were not explicitly defined as devDependencies

Well, they aren't currently used by this repository, only expected to be used by consumers of what we publish.

So as far as I can tell, as that adding them as devDependencies does is suppress some peerDependency warnings, and adds some unused devDependencies

Or maybe you wanted to set them up so that this repository is using husky and lint-staged?

Updates peerDependencies and devDependencies to match:
- Upgrade TypeScript compiler version range constraint from ~5.7 to ~6.0 in devDependencies and peerDependencies
- Update lockfile with resolved package additions and structure changes
@rjmunro
rjmunro force-pushed the rjmunro/update-self-peerdeps branch from 5af5a63 to b35328a Compare July 14, 2026 14:54

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 43-48: Update the package.json lint:fix script to invoke
lint:prettier:fix instead of lint:prettier, and ensure lint:prettier:fix runs
Prettier with --write against the intended repository scope, including the root
if appropriate.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a349a9cd-4fff-4732-a9a8-95d9e8273d2b

📥 Commits

Reviewing files that changed from the base of the PR and between 5af5a63 and b35328a.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • .husky/pre-commit
  • package.json

Comment thread package.json Outdated
@rjmunro rjmunro changed the title chore: align devDependencies with peerDependencies versions chore: align deps, dogfood setup, fix lint:fix, YAML indent Jul 15, 2026
@rjmunro
rjmunro requested a review from justandras July 15, 2026 08:36

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@prettier.config.mjs`:
- Around line 30-39: Update the lint-staged glob entries in package.json and the
corresponding README examples to include both yaml and yml alongside css, json,
md, and scss, ensuring staged YAML files are checked by the pre-commit workflow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cca5f31f-d23f-4da3-9a5d-206273c896ce

📥 Commits

Reviewing files that changed from the base of the PR and between b35328a and cb129d3.

📒 Files selected for processing (11)
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/ISSUE_TEMPLATE/other.yml
  • .github/ISSUE_TEMPLATE/question.yml
  • .github/ISSUE_TEMPLATE/rfc.yml
  • .github/PULL_REQUEST_TEMPLATE.md
  • CHANGELOG.md
  • CONTRIBUTING.md
  • README.md
  • bin/setup.mjs
  • package.json
  • prettier.config.mjs

Comment thread prettier.config.mjs
rjmunro added 5 commits July 15, 2026 13:23
* Configure husky and lint-staged
* Simplify / improve scripts in packages.json
- Call lint:prettier:fix from lint:fix instead of passing --write to lint:prettier
- Add lint:prettier:fix script with prettier --write . scope matching lint:prettier
- Update setup script and README to match
@rjmunro
rjmunro force-pushed the rjmunro/update-self-peerdeps branch from 0562d2e to 40b1356 Compare July 15, 2026 12:24
- Align lint-staged with the Prettier YAML override added for 2-space indent
- Update setup script and README examples so consumer projects get the same glob
@rjmunro
rjmunro merged commit ab2d1ba into Sofie-Automation:main Jul 27, 2026
4 checks passed
@rjmunro
rjmunro deleted the rjmunro/update-self-peerdeps branch July 27, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants