Public monorepo for reusable Logto developer tools.
Goals:
- Build tools in a public repo with fast local iteration.
- Integrate tools into website with minimal adaptation.
Current tool: JWT decoder/encoder (@logto/tools-jwt-decoder).
This repo contains:
- Reusable tool packages.
- Shared UI and i18n infrastructure.
- A
dev-appthat simulates real website integration.
Engineering rules are aligned with website as much as possible:
pnpmworkspace- Husky + lint-staged
- commitlint (conventional commits)
@silverhand/*lint/format/TS configs
tools/
packages/
i18nova/ # shared i18n runtime + language definitions + React bindings
jwt-decoder/ # tool package (library)
dev-app/ # local host app for development and integration validation
Design principles:
- Keep tools self-contained but integration-ready.
- Use shared UI/styling from
@logto/website-ui-foundation. - Use shared
i18novalanguage/runtime across all tools. - Treat
dev-appas the reference host app.
- Host app provides the real upper
I18NovaProviderand owns language state. - Tool package exports its own locale resources (for example
jwtDecoderResources) as SSOT. - Host app loads/merges tool resources into its i18n store.
- Host app passes resolved i18n methods (
t,getObject,currentLanguage,direction) to tool root. - Tool internals consume those methods through a shared tool bridge context from
@logto/tools-i18nova.
This mirrors the website integration pattern.
Requirements:
- Node.js
^22.0.0 - pnpm
^10.0.0
Install:
pnpm installRun dev app:
pnpm --filter @logto/tools-dev-app devWorkspace checks:
pnpm lint
pnpm stylelint
pnpm typecheck
pnpm test
pnpm buildUse this flow for any new tool (for example saml-decoder).
- Scaffold package
- Create
packages/<tool-name>. - Add scripts:
precommit,build,lint,stylelint,typecheck,test. - Reuse lint/TS/style config pattern from existing packages.
- Define public API
- Export top-level component from
src/index.ts. - Support optional
className. - Define a tool i18n bridge prop (
i18n) and keep provider ownership in the host app.
- Add i18n
- Add locale files under
src/locales. - Export tool namespace/resources from the tool package.
- Use shared language list/types and bridge helpers from
@logto/tools-i18nova. - Avoid hardcoded user-facing strings in component code.
- Reuse shared UI
- Use
@logto/website-ui-foundation. - Keep tool-specific composition local to each tool package.
- Keep tool business logic inside the tool package.
- Integrate in
dev-app
- Add route metadata in
packages/dev-app/src/routes/index.ts:id,path,titleKey,descriptionKey
- Add page route component and locale entries.
- Ensure topbar/home entries are generated from route metadata (no duplicated mappings).
- Validate
- Run package-level checks for the new tool and
dev-app. - Run workspace-level checks before merge.
When attaching a tool to website pages:
- Keep website i18n provider as the only top-level source of language state.
- Load tool resources into website i18n by locale.
- Build tool
i18nbridge from website i18n hooks and pass it to the tool root component. - Keep page-level layout/background in host page; tools expose
classNamefor adaptation.