Repository navigation
Update SDK tutorial steps to current SDK APIs - #137
Merged
Merged
Conversation
- Use `toward: { table }` for relations; `toward: { type }` is deprecated
since SDK 2.6.0
- Fix closeProject's "already closed" check to test CLOSED instead of
CANCELED
- Require a logged-in user to call closeProject, which removes the
`tailor generate` warning about anonymous resolver access
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The build-from-scratch SDK steps already pin
@tailor-platform/sdk2.32.0 (#135), but the code still used a deprecated API and had a logic bug incloseProject.toward: { table }(all 4 steps).toward: { type }has been deprecated since SDK 2.6.0 (codemodv3/relation-toward-table). This also matches the published tutorial.closeProject(steps 03 and 04). It compared the status to"CANCELED", but the resolver sets projects to"CLOSED", so closing a project a second time re-ran the transaction instead of returning "Project is already closed." The published tutorial already checks"CLOSED".closeProjectnow requires a logged-in user (steps 03 and 04). Without apermission,tailor generatewarned that anonymous callers could reach the resolver. AresolverPermissionLoggedInpolicy is added next to the existing permission helpers insrc/common/permission.ts.Testing
Run locally in each of step-01 to step-04, with the same commands as CI:
npm ci,npm run generate(no warnings now),npm run typecheck,npm run lint,npm run format:check: all pass@typescript-eslint/no-deprecatedrun ad hoc oversrcandtailor.config.ts: no findings (before this change: 2 per step)Follow-ups (not in this PR)
tailor-platform/docs,docs/tutorials/develop-from-scratch/step-04.md) passes a string to the webhookurl. On SDK 2.32.0 that fails bothtailor generate(DEFINITION_INVALID: operation.url) andtsc, because the SDK expects a function, as this repo uses.@typescript-eslint/no-deprecatedwith typed linting in the steps' ESLint config so CI catches future deprecations.🤖 Generated with Claude Code