Flatten packages structure and rename ctx functions #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Flatten packages structure and rename ctx functions
Summary
This PR makes three main changes to simplify the codebase:
Flattened package structure: Moved all 21 packages from nested category directories to a flat
packages/*structure. Previously packages were organized underpackages/utils/*,packages/security/*,packages/data-types/*, etc. Now all packages live directly underpackages/.Renamed ctx JWT accessor functions: Renamed
ctx.user_id()→ctx.uid()andctx.user_agent()→ctx.uagent()in the jwt-claims package to provide a more succinct API. Added documentation comments to all JWT claim functions in ctx, jwt_public, and jwt_private schemas.Removed unused
jwt_public.current_group_ids()function: Per user request, removed the group_ids function since group/org membership is not handled at the JWT level in this project.Updated workspace configuration files (pnpm-workspace.yaml, pgpm.json) to reflect the simplified flat structure.
Updates since last revision
.github/workflows/ci.yml) to use flat package paths in the test matrix (e.g.,jwt-claimsinstead ofsecurity/jwt-claims)pnpm-lock.yamlto reflect new package locationsjwt_public.current_group_ids()function and all related files (deploy/revert/verify SQL, tests, README documentation)Review & Testing Checklist for Human
schemas/ctx/procedures/user_idtoschemas/ctx/procedures/uid. If there are any existing database deployments, this could cause migration issues.jwt_public.current_group_ids()function was completely removed. Confirm this is desired and no code depends on it.pnpm installand verify all 21 packages are correctly discovered with the new flat structurepnpm testto verify the packages still work after restructuringRecommended test plan:
Notes
packages/jwt-claims/sql/pgpm-jwt-claims--0.15.2.sqlwas updated with the new function names, comments, and group_ids removalLink to Devin run: https://app.devin.ai/sessions/b46e88cf5be04982894f8e94948174e6
Requested by: Dan Lynch (@pyramation)