-
Notifications
You must be signed in to change notification settings - Fork 439
feat(metadata): move Apex trigger creation to metadata extension W-21671104 #7028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mshanemc
wants to merge
65
commits into
develop
Choose a base branch
from
sm/trigger-templates
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+552
−368
Open
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
543a726
feat: more apex templates, move to metadata ext
mshanemc f0a6fac
ci: require nls for quickpick valdiation and descriptions
mshanemc 73a9f8a
refactor: less dead code
mshanemc 2c64ee2
chore: dead code removal
mshanemc b61c4db
fix: don't show lwc command without a project
mshanemc 650129c
test: wait for apex test to finish via notification
mshanemc a04ea76
test: clear channel between single/all
mshanemc 3e5ca17
Merge remote-tracking branch 'origin/develop' into sm/unify-create-ap…
mshanemc 218b069
Merge branch 'sm/apex-test-e2e-stability' into sm/unify-create-apex-c…
mshanemc 8e491dc
Merge remote-tracking branch 'origin/develop' into sm/unify-create-ap…
mshanemc 37b414b
test: make sure apex class create is hidden when not project
mshanemc 73ddf76
test: don't refer to removed code
mshanemc 08343d8
refactor: move trigger to metadata, runs on web
mshanemc 8f1acf3
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc 82821ee
refactor: no placeholder on create commands
mshanemc c4f6a5d
refactor: share code for templates commands
mshanemc 8598dbe
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc d68464f
Merge remote-tracking branch 'origin/develop' into sm/unify-create-ap…
mshanemc 8f585c8
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc a333363
chore: casing
daphne-sfdc 07207ae
chore: casing fix and lockfile
mshanemc e65f559
docs: how to fix automatically next time
mshanemc e213381
docs: more skills linking
mshanemc 8c48640
test: soql e2e make sure command is ready first
mshanemc f25ad37
test: soql activation pause
mshanemc 706e0ee
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc af659c0
refactor: shared overwrite check and prompt-cancellation pattern
mshanemc f4c072a
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc 472dede
ci: verify hooks don't run when AI doesn't make edits
mshanemc d51ad2e
refactor: deduplication and renaming
mshanemc db18545
refactor: no vscode-utils
mshanemc a8a59e1
Merge remote-tracking branch 'origin/develop' into sm/unify-create-ap…
mshanemc 93ea8ba
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc 1d74e11
refactor: open from vscode promise
mshanemc a8248c1
docs: rename and skill stuff
mshanemc 54b3538
chore: model cleanup, shared dupe-check
mshanemc da93a40
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc 33b0070
refactor: apply patterns to apex script creations
mshanemc 8e84d96
chore: extra label
mshanemc 755e713
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc c9aa4ea
refactor: choose output dir for apex scripts
mshanemc cf49de8
test: e2e adjustments for "chose path" on apex script
mshanemc 8470167
refactor: dedupe the "choose another folder" option
mshanemc a4ff4e2
refactor: promptService naming
mshanemc 9aac679
Merge remote-tracking branch 'origin/develop' into sm/unify-create-ap…
mshanemc 99ad78e
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc 5bbfef8
refactor: apex test gen with shared services
mshanemc 22a1937
refactor: consistent cwd via uri
mshanemc bbd1762
test: e2e adjustments for "pick folder on test class create"
mshanemc 0f26912
docs: wireit rule
mshanemc 2d3e57f
docs: wireit rule
mshanemc fc3bca6
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc 31b7ade
Merge remote-tracking branch 'origin/develop' into sm/unify-create-ap…
mshanemc 828e0f2
Merge remote-tracking branch 'origin/sm/unify-create-apex-class' into…
mshanemc 7459b8b
Merge remote-tracking branch 'origin/develop' into sm/trigger-templates
mshanemc 02bd954
refactor: message sharing for class/trigger
mshanemc 1f975fe
refactor: consistent uri handling
mshanemc 4d49d5a
refactor: consistent directory picker
mshanemc 4b045cd
Merge remote-tracking branch 'origin/develop' into sm/trigger-templates
mshanemc 90abebf
refactor: helper cleanup
mshanemc 4528492
revert: move soql changes to soql-without-utils branch
mshanemc d8c3132
chore: lockfile, lint
mshanemc bb37da0
refactor: conslidate api template api logic
mshanemc db70302
refactor: templates copy/load once
mshanemc 5e5b798
Merge remote-tracking branch 'origin/develop' into sm/trigger-templates
mshanemc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
102 changes: 102 additions & 0 deletions
102
.claude/skills/services-extension-consumption/references/prompts.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # VS Code Prompts | ||
|
|
||
| Best practices for `quickPick` and `quickInput` in Effect-TS. | ||
|
|
||
| ## PromptService | ||
|
|
||
| ### `considerUndefinedAsCancellation` | ||
|
|
||
| Converts `undefined` (Esc) or empty strings to `UserCancellationError`. | ||
|
|
||
| ```typescript | ||
| const choice = | ||
| yield * | ||
| Effect.promise(() => vscode.window.showQuickPick(['a', 'b'])).pipe( | ||
| Effect.flatMap(promptService.considerUndefinedAsCancellation) | ||
| ); | ||
| ``` | ||
|
|
||
| ### `ensureMetadataOverwriteOrThrow` | ||
|
|
||
| Checks file existence; prompts for overwrite. Fails with `UserCancellationError` on cancel. | ||
|
|
||
| ```typescript | ||
| yield * promptService.ensureMetadataOverwriteOrThrow({ uris }); | ||
| ``` | ||
|
|
||
| ## Handling Cancellations | ||
|
|
||
| ### `UserCancellationError` | ||
|
|
||
| `Schema.TaggedError` for silent exits. | ||
|
|
||
| - **Silent**: `registerCommandWithLayer/Runtime` catch this and return `Effect.void` (no UI error). | ||
| - **Messages**: Only set `message` for trace/log details. | ||
|
|
||
| ```typescript | ||
| // Silent exit | ||
| return yield * new UserCancellationError(); | ||
|
|
||
| // Exit with log context | ||
| return yield * new UserCancellationError({ message: 'User cancelled overwrite' }); | ||
| ``` | ||
|
|
||
| ## Pattern: Wrapping Promises | ||
|
|
||
| Always wrap VS Code prompt promises in `Effect.promise`. | ||
|
|
||
| ```typescript | ||
| const promptForTemplate = Effect.fn('promptForTemplate')(function* () { | ||
| const api = yield* (yield* ExtensionProviderService).getServicesApi; | ||
| const promptService = yield* api.services.PromptService; | ||
|
|
||
| return yield* Effect.promise(() => | ||
| vscode.window.showQuickPick( | ||
| [ | ||
| { label: 'DefaultApexClass', description: '...' }, | ||
| { label: 'ApexException', description: '...' } | ||
| ], | ||
| { placeHolder: 'Select template' } | ||
| ) | ||
| ).pipe( | ||
| Effect.flatMap(promptService.considerUndefinedAsCancellation), | ||
| Effect.map(choice => choice.label) | ||
| ); | ||
| }); | ||
| ``` | ||
|
|
||
| ## Template Helpers | ||
|
|
||
| Use `sfTemplateProjectHelpers.ts` for metadata generation. | ||
|
|
||
| ### `promptForApexTypeName` | ||
|
|
||
| Validates Apex names. | ||
|
|
||
| ```typescript | ||
| const className = | ||
| yield * | ||
| promptForApexTypeName({ | ||
| prompt: nls.localize('apex_class_name_prompt') | ||
| }); | ||
| ``` | ||
|
|
||
| - prompt text uses `apex_class_name_prompt` | ||
| - built-in validation strings: `apex_name_empty_error`, `apex_name_format_error`, `apex_class_name_max_length_error`, `apex_name_cannot_be_default` | ||
| - supply `messages` with localized overrides if you need custom copy or translations | ||
|
|
||
| ### `promptForOutputDir` | ||
|
|
||
| Selects metadata package folder (apex classes/triggers, etc.). | ||
|
|
||
| ```typescript | ||
| const outputDirUri = yield * promptForOutputDir(project, 'classes', 'Select output directory'); | ||
| ``` | ||
|
|
||
| ### `getApiVersion` | ||
|
|
||
| Waterfall: `sfdx-project.json` → connection → fallback. | ||
|
|
||
| ```typescript | ||
| const apiVersion = yield * getApiVersion(project); | ||
| ``` |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/usr/bin/env bash | ||
| # afterFileEdit hook: mark that an edit occurred in this session. | ||
| # We use CURSOR_TRACE_ID to distinguish sessions. | ||
|
|
||
| if [ -n "$CURSOR_TRACE_ID" ]; then | ||
| touch "/tmp/cursor_edit_${CURSOR_TRACE_ID}" | ||
| echo "[afterFileEdit] marked session ${CURSOR_TRACE_ID} as dirty" >&2 | ||
| fi | ||
| exit 0 | ||
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,8 +7,7 @@ | |
|
|
||
| export const messages = { | ||
| create_script_name_empty_error: 'Script name cannot be empty', | ||
| create_script_name_format_error: | ||
| 'Name must start with a letter and contain only letters, numbers, and underscores', | ||
| create_script_name_format_error: 'Name must start with a letter and contain only letters, numbers, and underscores', | ||
| create_script_name_prompt: 'Enter script name', | ||
| log_get_no_logs: 'No Apex debug logs found', | ||
| log_get_pick_log: 'Select an Apex debug log to open', | ||
|
|
@@ -50,6 +49,5 @@ export const messages = { | |
| exec_anon_success: 'Anonymous Apex executed successfully', | ||
| open_log: 'Open Log', | ||
| create_script_output_dir_prompt: 'Select the target directory', | ||
| create_script_output_dir_default_description: '(default)', | ||
| create_script_custom_output_directory: 'Choose a Custom Directory' | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a bunch of this is now in a shared fn in services |
||
| create_script_output_dir_default_description: '(default)' | ||
| } as const; | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the goal of the stuff in this hooks folder is to not run the
verifierstuff when there's no file edits;this makes is possible to to plan/ask/etc while in a broken state and to cancel AI things when it goes down the wrong road without it trying to fix things.