Skip to content

refactor: align Ring config and infrastructure with Staryl patterns#81

Merged
RedStar071 merged 2 commits into
mainfrom
cursor/allineamento-ring-staryl-6471
Jun 19, 2026
Merged

refactor: align Ring config and infrastructure with Staryl patterns#81
RedStar071 merged 2 commits into
mainfrom
cursor/allineamento-ring-staryl-6471

Conversation

@RedStar071

Copy link
Copy Markdown
Member

Summary

Aligns Ring's configuration layer and project infrastructure with Staryl patterns while preserving Ring's role as the authoritative guild limits store and the existing GET /guilds/:id API contract.

Changes

Centralized guild limits (src/lib/common/limits.ts)

  • Single source of truth for defaults, min/max ranges, bot mappings, and getMappings()
  • Types exported from src/lib/types/limits.ts (StarylLimits, WolfstarLimits, GuildLimits)
  • Eliminates triple duplication across Prisma schema comments, API route, and /config command

Project structure (Staryl-style)

  • New src/lib/common/ and src/lib/types/ with barrel exports
  • Env augmentations moved to src/lib/types/augments.ts
  • Prisma Guild type re-exported from src/lib/setup/prisma.ts
  • New import aliases: #common/*, #types, #types/*
  • tsdown updated with index.ts fallback resolver and dts: true

Package migration

  • @skyra/* v2 → @wolfstar/* v3 across all source files
  • TypeScript upgraded to ~5.9.3

Setup alignment

  • envRun() moved inside setup() with Staryl import order (logger → prisma → fastify)
  • Added setInvite() alongside setRepository("ring")

Dev experience

  • Added compose.dev.yml for local Postgres
  • Updated AGENTS.md and .github/copilot-instructions.md with dev notes and new aliases
  • Updated src/.env template with .env.local guidance and Staryl token pairing

/config get improvement

  • Now shows defaults from LimitDefinitions when no DB row exists (consistent with API behavior)

API contract preserved

GET /guilds/:id response shape and auth flow are unchanged for Staryl compatibility:

  • Staryl token → { maximumYouTubeSubscriptions, maximumTwitchSubscriptions } with defaults 3, 5
  • WolfStar token → 4 filter limit fields with existing defaults

Test plan

  • pnpm prisma:generate
  • pnpm build
  • pnpm lint:fix
  • Limit contract smoke test (defaults, mappings, token resolution)
  • Manual API curl against running instance (requires Postgres + env)
Open in Web Open in Cursor 

- Centralize guild limit definitions in src/lib/common/limits.ts
- Add lib/common and lib/types structure with #common and #types aliases
- Migrate from @skyra/* v2 to @wolfstar/* v3 packages
- Align setup lifecycle with Staryl (env in setup, setInvite, import order)
- Add compose.dev.yml for local Postgres development
- Update AGENTS.md and copilot-instructions with dev notes
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/allineamento-ring-staryl-6471

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 and usage tips.

Combine main's dependency bumps (taze, tsdown, commitlint, eslint, oxlint)
with the feature branch's @wolfstar/* v3 migration and TypeScript 5.9.
@RedStar071 RedStar071 marked this pull request as ready for review June 19, 2026 17:19
@RedStar071 RedStar071 merged commit 3bbd480 into main Jun 19, 2026
8 of 9 checks passed
@RedStar071 RedStar071 deleted the cursor/allineamento-ring-staryl-6471 branch June 19, 2026 17:19
@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":500,"request":{"method":"PATCH","url":"https://api.github.com/repos/wolfstar-project/ring/issues/comments/4751231763","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.6 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- review_stack_entry_start -->\n\n[![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/wolfstar-project/ring/pull/81?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)\n\n<!-- review_stack_entry_end -->\n<!-- This is an auto-generated comment: review in progress by coderabbit.ai -->\n\n> [!NOTE]\n> Currently processing new changes in this PR. This may take a few minutes, please wait...\n> \n> <details>\n> <summary>⚙️ Run configuration</summary>\n> \n> **Configuration used**: Organization UI\n> \n> **Review profile**: ASSERTIVE\n> \n> **Plan**: Pro\n> \n> **Run ID**: `12ad2001-a9ea-40e8-929d-b57322b723bd`\n> \n> </details>\n> \n> <details>\n> <summary>📥 Commits</summary>\n> \n> Reviewing files that changed from the base of the PR and between d93f7b4e513bde5e49013b8cde25b2a2597b8cda and 2a6a755ef63ea0c3c7adc21316b63c50d91df68d.\n> \n> </details>\n> \n> <details>\n> <summary>⛔ Files ignored due to path filters (1)</summary>\n> \n> * `pnpm-lock.yaml` is excluded by `!**/pnpm-lock.yaml`\n> \n> </details>\n> \n> <details>\n> <summary>📒 Files selected for processing (21)</summary>\n> \n> * `.github/copilot-instructions.md`\n> * `AGENTS.md`\n> * `compose.dev.yml`\n> * `package.json`\n> * `prisma/schema.prisma`\n> * `src/.env`\n> * `src/api/routes/guilds/[...id].ts`\n> * `src/commands/config.ts`\n> * `src/lib/common/constants.ts`\n> * `src/lib/common/index.ts`\n> * `src/lib/common/limits.ts`\n> * `src/lib/setup/all.ts`\n> * `src/lib/setup/fastify.ts`\n> * `src/lib/setup/logger.ts`\n> * `src/lib/setup/prisma.ts`\n> * `src/lib/types/augments.ts`\n> * `src/lib/types/index.ts`\n> * `src/lib/types/limits.ts`\n> * `src/locales/en-US/commands/shared.json`\n> * `src/main.ts`\n> * `tsdown.config.ts`\n> \n> </details>\n> \n> ```ascii\n>  ___________________________________________________\n> < What happens in code review stays in code review. >\n>  ---------------------------------------------------\n>   \\\n>    \\   (\\__/)\n>        (•ㅅ•)\n>        /   づ\n> ```\n\n<!-- end of auto-generated comment: review in progress by coderabbit.ai -->\n\n<!-- finishing_touch_checkbox_start -->\n\n<details>\n<summary>✨ Finishing Touches</summary>\n\n<details>\n<summary>📝 Generate docstrings</summary>\n\n- [ ] <!-- {\"checkboxId\": \"7962f53c-55bc-4827-bfbf-6a18da830691\"} --> Create stacked PR\n- [ ] <!-- {\"checkboxId\": \"3e1879ae-f29b-4d0d-8e06-d12b7ba33d98\"} --> Commit on current branch\n\n</details>\n<details>\n<summary>🧪 Generate unit tests (beta)</summary>\n\n- [ ] <!-- {\"checkboxId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Create PR with unit tests\n- [ ] <!-- {\"checkboxId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Commit unit tests in branch `cursor/allineamento-ring-staryl-6471`\n\n</details>\n\n</details>\n\n<!-- finishing_touch_checkbox_end -->\n<!-- tips_start -->\n\n---\n\nThanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=wolfstar-project/ring&utm_content=81)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.\n\n<details>\n<summary>❤️ Share</summary>\n\n- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)\n- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)\n- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)\n- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)\n\n</details>\n\n\n<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>\n\n<!-- tips_end -->"},"request":{"retryCount":3,"signal":{},"retries":3,"retryAfter":16}}}

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.

2 participants