Skip to content

Commit 051a8b3

Browse files
committed
build: centralize apex tmlanguage and extension-assets config
- Root devDependency @salesforce/apex-tmlanguage; copy grammars from root node_modules - Add extension-assets/syntaxes/apex.configuration.json; wireit copies into apex-log and apex - pr-draft + gus-cli + PR template: GUS WI suffix " - W-XXXXXXXX" in titles - SOQL copy:grammars from root node_modules; apex-log drops packaged soql artifact W-21964610
1 parent 7635bf5 commit 051a8b3

11 files changed

Lines changed: 105 additions & 25 deletions

File tree

.claude/skills/gus-cli/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Interact with Gus (Salesforce Agile Accelerator org) via sf CLI. Requires alias
1616
- Only run `sf data create record` / `sf data update record` after user says yes (or equivalent)
1717
- Answering scope questions (e.g. "just createProject") is not confirmation—still ask
1818
- **Epic selection**: when less than 50% sure which epic a work item belongs in, ask the user
19-
- **IDs vs Names**: `Id` (e.g. `a07...`) is for CLI commands. `Name` (e.g. `W-12345`) is for human display and PR titles as the leading bracket token (`[W-12345] …`) per [pr-draft Title format](../pr-draft/SKILL.md#title-format)—never trailing. NEVER use `Id` in PR titles or descriptions. Always query `Name` after creation.
19+
- **IDs vs Names**: `Id` (e.g. `a07...`) is for CLI commands. `Name` (e.g. `W-12345`) is for human display and PR titles appended as ` - W-12345` at the end per [pr-draft Title format](../pr-draft/SKILL.md#title-format). NEVER use `Id` in PR titles or descriptions. Always query `Name` after creation.
2020

2121
## Prerequisites
2222

@@ -86,7 +86,7 @@ Constraints: File must be single-line (flags-dir treats each line as a separate
8686

8787
**After create:** Always provide the work item link. Format: `https://gus.lightning.force.com/lightning/r/ADM_Work__c/<recordId>/view` (replace `<recordId>` with the Id from the create output, e.g. `a07EE00002V3a8YYAR`). Example: [a07EE00002V3a8YYAR](https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002V3a8YYAR/view).
8888

89-
**CRITICAL:** After creation, you MUST query the `Name` (W-XXXXX) for the leading PR title token `[W-XXXXX]`. The `id` returned by `sf data create` is NOT the `W-XXXXX` name.
89+
**CRITICAL:** After creation, you MUST query the `Name` (W-XXXXX) to append to the PR title as ` - W-XXXXX`. The `id` returned by `sf data create` is NOT the `W-XXXXX` name.
9090
```bash
9191
sf data query --query "SELECT Name FROM ADM_Work__c WHERE Id = '<id_from_create>'" -o gus --json
9292
```

.claude/skills/pr-draft/SKILL.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: pr-draft
3-
description: Draft PRs with leading [W-XXXXXXXX] in titles (never trailing WI), conventional commit-style remainder, GUS refs in body. Use when drafting PRs, PR titles, PR descriptions, opening PRs, or Git2Gus workflows.
3+
description: Draft PRs with trailing " - W-XXXXXXXX" in titles, conventional commit-style before it, GUS refs in body. Use when drafting PRs, PR titles, PR descriptions, opening PRs, or Git2Gus workflows.
44
---
55

66
# PR Draft
@@ -36,13 +36,13 @@ Draft PR titles and bodies per salesforcedx-vscode conventions. Requires a Gus w
3636

3737
## Title format
3838

39-
`[W-XXXXXXXX] type(scope): description`
39+
`type(scope): description - W-XXXXXXXX`
4040

41-
- **Work item first:** The GUS work item must be the leading token in **square brackets** (`[W-21735053]`). This is the `Name` field from GUS, not the Salesforce Record ID (e.g., `a07...`). If you just created the record, query the `Name` first.
41+
- **Work item last:** Append a space, hyphen, space, then the GUS `Name` (` - W-21735053`). This is the `Name` field from GUS, not the Salesforce Record ID (e.g., `a07...`). If you just created the record, query the `Name` first.
4242
- **Types**: feat, fix, docs, style, refactor, perf, test, ci, chore, build
4343
- **Scope**: optional
44-
- Example: `[W-21735053] build(extensions): consolidate apex-tmlanguage via apex-log`
45-
- **Avoid:** trailing WI — `type(scope): description W-21735053`
44+
- Example: `build(extensions): consolidate apex-tmlanguage - W-21735053`
45+
- **Avoid:** leading brackets — `[W-21735053] build(extensions): …`; bare trailing WI without ` - ` `build(extensions): W-21735053`
4646

4747
## Body format
4848

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!--- PR title: [W-XXXXXXXX] <type>(optional scope): <description> — lead with GUS WI in brackets; do not put W-XXXXXXXX at the end. Conventional commits: https://www.conventionalcommits.org/en/v1.0.0/#summary
1+
<!--- PR title: <type>(optional scope): <description> - W-XXXXXXXX — append GUS work item at the end (space, hyphen, space, W-). Conventional commits: https://www.conventionalcommits.org/en/v1.0.0/#summary
22
If this is a feat/fix, add the technical writer as a reviewer to the PR. --->
33

44
### What does this PR do?

docs/libraries.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This project depends on several Salesforce libraries. To develop or debug agains
1212
| [@salesforce/apex-node](https://github.com/forcedotcom/salesforcedx-apex) | [forcedotcom/salesforcedx-apex](https://github.com/forcedotcom/salesforcedx-apex) | [@salesforce/apex-node](https://www.npmjs.com/package/@salesforce/apex-node) |
1313
| [@salesforce/templates](https://github.com/forcedotcom/salesforcedx-templates) | [forcedotcom/salesforcedx-templates](https://github.com/forcedotcom/salesforcedx-templates) | [@salesforce/templates](https://www.npmjs.com/package/@salesforce/templates) |
1414

15-
Related: `@salesforce/apex` (LWC module resolver; repo not in metadata). `@salesforce/apex-tmlanguage` ([forcedotcom/apex-tmLanguage](https://github.com/forcedotcom/apex-tmLanguage)): only `salesforcedx-vscode-apex-log` depends on it; that package's `copy:grammars` writes `apex.tmLanguage` and `soql.tmLanguage` there. In `salesforcedx-vscode-apex`, `compile` depends on `copy:grammars`, which copies those artifacts plus `syntaxes/apex.configuration.json` from apex-log (`vscode:bundle` does not list `copy:grammars` separately). `salesforcedx-vscode-soql` runs its own `copy:grammars` as a Wireit dependency of `vscode:bundle` from apex-log.
15+
Related: `@salesforce/apex` (LWC module resolver; repo not in metadata). `@salesforce/apex-tmlanguage` ([forcedotcom/apex-tmLanguage](https://github.com/forcedotcom/apex-tmLanguage)): **root** `package.json` `devDependencies` only; grammar files are copied from **repo root** `node_modules/@salesforce/apex-tmlanguage/grammars/` in each extension (`../../node_modules/...` from `packages/<name>`). Shared Apex language configuration: **`extension-assets/syntaxes/apex.configuration.json`** (source of truth); `salesforcedx-vscode-apex-log` and `salesforcedx-vscode-apex` copy it into each package’s `syntaxes/` during `copy:grammars`. `salesforcedx-vscode-apex-log` `copy:grammars` also writes `apex.tmLanguage`; SOQL copies `soql.tmLanguage`; Apex copies `apex.tmLanguage` plus that config. In `salesforcedx-vscode-apex`, `compile` depends on `copy:grammars` (`vscode:bundle` does not list `copy:grammars` separately).
1616

1717
## Running Extensions with Local Library Builds
1818

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"comments": {
3+
"lineComment": "//",
4+
"blockComment": [
5+
"/*",
6+
"*/"
7+
]
8+
},
9+
"brackets": [
10+
[
11+
"{",
12+
"}"
13+
],
14+
[
15+
"[",
16+
"]"
17+
],
18+
[
19+
"(",
20+
")"
21+
]
22+
],
23+
"autoClosingPairs": [
24+
[
25+
"{",
26+
"}"
27+
],
28+
[
29+
"[",
30+
"]"
31+
],
32+
[
33+
"(",
34+
")"
35+
],
36+
[
37+
"'",
38+
"'"
39+
],
40+
{
41+
"open": "/**",
42+
"close": " */",
43+
"notIn": [
44+
"string"
45+
]
46+
},
47+
{
48+
"open": "'''",
49+
"close": "'''",
50+
"notIn": [
51+
"string",
52+
"comment"
53+
]
54+
}
55+
],
56+
"surroundingPairs": [
57+
[
58+
"{",
59+
"}"
60+
],
61+
[
62+
"[",
63+
"]"
64+
],
65+
[
66+
"(",
67+
")"
68+
],
69+
[
70+
"'",
71+
"'"
72+
],
73+
[
74+
"'''",
75+
"'''"
76+
]
77+
],
78+
"folding": {
79+
"offSide": true,
80+
"markers": {
81+
"start": "^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)",
82+
"end": "^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)"
83+
}
84+
}
85+
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"@octokit/core": "^5",
3737
"@octokit/webhooks-types": "7.6.1",
3838
"@playwright/test": "^1.49.0",
39+
"@salesforce/apex-tmlanguage": "^2.0.2",
3940
"@salesforce/dev-config": "^4.3.2",
4041
"@salesforce/salesforcedx-vscode-test-tools": "*",
4142
"@secretlint/node": "11.2.5",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
grammars
2+
syntaxes/apex.configuration.json

packages/salesforcedx-vscode-apex-log/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"vscode-uri": "^3.1.0"
3535
},
3636
"devDependencies": {
37-
"@salesforce/apex-tmlanguage": "^2.0.2",
3837
"@salesforce/core": "^8.28.0",
3938
"@salesforce/playwright-vscode-ext": "*",
4039
"esbuild": "0.27.4",
@@ -82,14 +81,14 @@
8281
]
8382
},
8483
"copy:grammars": {
85-
"command": "shx mkdir -p grammars && shx cp ../../node_modules/@salesforce/apex-tmlanguage/grammars/apex.tmLanguage ./grammars/ && shx cp ../../node_modules/@salesforce/apex-tmlanguage/grammars/soql.tmLanguage ./grammars/",
84+
"command": "shx mkdir -p grammars syntaxes && shx rm -f grammars/soql.tmLanguage && shx cp ../../node_modules/@salesforce/apex-tmlanguage/grammars/apex.tmLanguage ./grammars/ && shx cp ../../extension-assets/syntaxes/apex.configuration.json ./syntaxes/",
8685
"files": [
8786
"../../node_modules/@salesforce/apex-tmlanguage/grammars/apex.tmLanguage",
88-
"../../node_modules/@salesforce/apex-tmlanguage/grammars/soql.tmLanguage"
87+
"../../extension-assets/syntaxes/apex.configuration.json"
8988
],
9089
"output": [
9190
"grammars/apex.tmLanguage",
92-
"grammars/soql.tmLanguage"
91+
"syntaxes/apex.configuration.json"
9392
]
9493
},
9594
"vscode:bundle": {

packages/salesforcedx-vscode-apex/package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,10 @@
9292
]
9393
},
9494
"copy:grammars": {
95-
"command": "shx mkdir -p grammars syntaxes && shx cp ../salesforcedx-vscode-apex-log/grammars/apex.tmLanguage ./grammars/ && shx cp ../salesforcedx-vscode-apex-log/syntaxes/apex.configuration.json ./syntaxes/",
96-
"dependencies": [
97-
"../salesforcedx-vscode-apex-log:copy:grammars"
98-
],
95+
"command": "shx mkdir -p grammars syntaxes && shx cp ../../node_modules/@salesforce/apex-tmlanguage/grammars/apex.tmLanguage ./grammars/ && shx cp ../../extension-assets/syntaxes/apex.configuration.json ./syntaxes/",
9996
"files": [
100-
"../salesforcedx-vscode-apex-log/grammars/apex.tmLanguage",
101-
"../salesforcedx-vscode-apex-log/syntaxes/apex.configuration.json"
97+
"../../node_modules/@salesforce/apex-tmlanguage/grammars/apex.tmLanguage",
98+
"../../extension-assets/syntaxes/apex.configuration.json"
10299
],
103100
"output": [
104101
"grammars/apex.tmLanguage",

0 commit comments

Comments
 (0)