@salesforce/templates 66.10.3 → 66.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/lib/generators/apexClassGenerator.js +9 -2
  2. package/lib/generators/apexClassGenerator.js.map +1 -1
  3. package/lib/generators/uiBundleGenerator.d.ts +1 -0
  4. package/lib/generators/uiBundleGenerator.js +13 -0
  5. package/lib/generators/uiBundleGenerator.js.map +1 -1
  6. package/lib/i18n/i18n.d.ts +1 -0
  7. package/lib/i18n/i18n.js +1 -0
  8. package/lib/i18n/i18n.js.map +1 -1
  9. package/lib/templates/apexclass/Batchable.cls +15 -0
  10. package/lib/templates/apexclass/Queueable.cls +13 -0
  11. package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/package-lock.json +1173 -1126
  12. package/lib/templates/project/reactinternalapp/CHANGELOG.md +65 -0
  13. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package-lock.json +1170 -1123
  14. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package.json +4 -4
  15. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/components/AgentforceConversationClient.tsx +13 -1
  16. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/pages/AccountObjectDetailPage.tsx +4 -2
  17. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/types/conversation.ts +1 -0
  18. package/lib/templates/project/reactinternalapp/package.json +5 -1
  19. package/lib/templates/project/reactinternalapp/scripts/org-setup-config-schema.mjs +96 -0
  20. package/lib/templates/project/reactinternalapp/scripts/org-setup.mjs +408 -178
  21. package/lib/templates/project/reactinternalapp/scripts/validate-org-setup-config.mjs +38 -0
  22. package/lib/templates/uiBundles/angularbasic/.forceignore +15 -0
  23. package/lib/templates/uiBundles/angularbasic/.postcssrc.json +5 -0
  24. package/lib/templates/uiBundles/angularbasic/.prettierignore +8 -0
  25. package/lib/templates/uiBundles/angularbasic/.prettierrc +12 -0
  26. package/lib/templates/uiBundles/angularbasic/CHANGELOG.md +4 -0
  27. package/lib/templates/uiBundles/angularbasic/README.md +85 -0
  28. package/lib/templates/uiBundles/angularbasic/_uibundle.uibundle-meta.xml +7 -0
  29. package/lib/templates/uiBundles/angularbasic/angular.json +94 -0
  30. package/lib/templates/uiBundles/angularbasic/esbuild/api-version.mjs +17 -0
  31. package/lib/templates/uiBundles/angularbasic/eslint.config.js +56 -0
  32. package/lib/templates/uiBundles/angularbasic/middleware/html.mjs +3 -0
  33. package/lib/templates/uiBundles/angularbasic/middleware/proxy.mjs +12 -0
  34. package/lib/templates/uiBundles/angularbasic/package-lock.json +13568 -0
  35. package/lib/templates/uiBundles/angularbasic/package.json +52 -0
  36. package/lib/templates/uiBundles/angularbasic/playwright.config.ts +25 -0
  37. package/lib/templates/uiBundles/angularbasic/public/favicon.ico +0 -0
  38. package/lib/templates/uiBundles/angularbasic/scripts/rewrite-e2e-assets.mjs +30 -0
  39. package/lib/templates/uiBundles/angularbasic/src/app/api/graphql-client.service.spec.ts +154 -0
  40. package/lib/templates/uiBundles/angularbasic/src/app/api/graphql-client.service.ts +48 -0
  41. package/lib/templates/uiBundles/angularbasic/src/app/app.config.ts +8 -0
  42. package/lib/templates/uiBundles/angularbasic/src/app/app.css +0 -0
  43. package/lib/templates/uiBundles/angularbasic/src/app/app.html +1 -0
  44. package/lib/templates/uiBundles/angularbasic/src/app/app.routes.ts +21 -0
  45. package/lib/templates/uiBundles/angularbasic/src/app/app.spec.ts +18 -0
  46. package/lib/templates/uiBundles/angularbasic/src/app/app.ts +10 -0
  47. package/lib/templates/uiBundles/angularbasic/src/app/layout/app-layout.component.html +50 -0
  48. package/lib/templates/uiBundles/angularbasic/src/app/layout/app-layout.component.spec.ts +63 -0
  49. package/lib/templates/uiBundles/angularbasic/src/app/layout/app-layout.component.ts +21 -0
  50. package/lib/templates/uiBundles/angularbasic/src/app/pages/home/home.component.html +6 -0
  51. package/lib/templates/uiBundles/angularbasic/src/app/pages/home/home.component.spec.ts +23 -0
  52. package/lib/templates/uiBundles/angularbasic/src/app/pages/home/home.component.ts +7 -0
  53. package/lib/templates/uiBundles/angularbasic/src/app/pages/not-found/not-found.component.html +12 -0
  54. package/lib/templates/uiBundles/angularbasic/src/app/pages/not-found/not-found.component.spec.ts +33 -0
  55. package/lib/templates/uiBundles/angularbasic/src/app/pages/not-found/not-found.component.ts +9 -0
  56. package/lib/templates/uiBundles/angularbasic/src/index.html +13 -0
  57. package/lib/templates/uiBundles/angularbasic/src/main.ts +5 -0
  58. package/lib/templates/uiBundles/angularbasic/src/styles.css +12 -0
  59. package/lib/templates/uiBundles/angularbasic/src/types/sf-globals.d.ts +9 -0
  60. package/lib/templates/uiBundles/angularbasic/tsconfig.app.json +11 -0
  61. package/lib/templates/uiBundles/angularbasic/tsconfig.json +33 -0
  62. package/lib/templates/uiBundles/angularbasic/tsconfig.spec.json +10 -0
  63. package/lib/templates/uiBundles/angularbasic/ui-bundle.json +7 -0
  64. package/lib/templates/uiBundles/reactbasic/package-lock.json +1170 -1123
  65. package/lib/templates/uiBundles/reactbasic/package.json +4 -4
  66. package/lib/utils/createUtil.d.ts +2 -0
  67. package/lib/utils/createUtil.js +7 -0
  68. package/lib/utils/createUtil.js.map +1 -1
  69. package/lib/utils/types.d.ts +11 -3
  70. package/package.json +5 -4
@@ -18,8 +18,8 @@
18
18
  "graphql:schema": "node scripts/get-graphql-schema.mjs"
19
19
  },
20
20
  "dependencies": {
21
- "@salesforce/platform-sdk": "^10.19.0",
22
- "@salesforce/ui-bundle": "^10.19.0",
21
+ "@salesforce/platform-sdk": "^10.24.0",
22
+ "@salesforce/ui-bundle": "^10.24.0",
23
23
  "@tailwindcss/vite": "^4.1.17",
24
24
  "class-variance-authority": "^0.7.1",
25
25
  "clsx": "^2.1.1",
@@ -45,8 +45,8 @@
45
45
  "@graphql-eslint/eslint-plugin": "^4.1.0",
46
46
  "@graphql-tools/utils": "^11.0.0",
47
47
  "@playwright/test": "^1.49.0",
48
- "@salesforce/graphiti": "^10.19.0",
49
- "@salesforce/vite-plugin-ui-bundle": "^10.19.0",
48
+ "@salesforce/graphiti": "^10.24.0",
49
+ "@salesforce/vite-plugin-ui-bundle": "^10.24.0",
50
50
  "@testing-library/jest-dom": "^6.6.3",
51
51
  "@testing-library/react": "^16.1.0",
52
52
  "@testing-library/user-event": "^14.5.2",
@@ -69,6 +69,7 @@ export function AgentforceConversationClient({
69
69
  width,
70
70
  height,
71
71
  styleTokens,
72
+ isFileBased,
72
73
  salesforceOrigin,
73
74
  frontdoorUrl,
74
75
  onReady,
@@ -89,10 +90,21 @@ export function AgentforceConversationClient({
89
90
  ...(agentId !== undefined && { agentId }),
90
91
  ...(agentLabel !== undefined && { agentLabel }),
91
92
  ...(styleTokens !== undefined && { styleTokens }),
93
+ ...(isFileBased !== undefined && { isFileBased }),
92
94
  renderingConfig,
93
95
  channel: "Vibes",
94
96
  };
95
- }, [agentId, agentLabel, inlineProp, headerEnabled, showHeaderIcon, width, height, styleTokens]);
97
+ }, [
98
+ agentId,
99
+ agentLabel,
100
+ inlineProp,
101
+ headerEnabled,
102
+ showHeaderIcon,
103
+ width,
104
+ height,
105
+ styleTokens,
106
+ isFileBased,
107
+ ]);
96
108
 
97
109
  const inline = normalizedAgentforceClientConfig?.renderingConfig?.mode === "inline";
98
110
 
@@ -156,7 +156,9 @@ function AccountDetailContent({ account }: { account: AccountNode }) {
156
156
  <FieldItem label="Industry">{fieldValue(account.Industry)}</FieldItem>
157
157
  <FieldItem label="Annual Revenue">{fieldValue(account.AnnualRevenue)}</FieldItem>
158
158
  </FieldRow>
159
- <FieldItem label="Description">{fieldValue(account.Description)}</FieldItem>
159
+ <dl>
160
+ <FieldItem label="Description">{fieldValue(account.Description)}</FieldItem>
161
+ </dl>
160
162
  </Section>
161
163
 
162
164
  <Separator />
@@ -216,7 +218,7 @@ function FieldItem({ label, children }: { label: string; children: React.ReactNo
216
218
  }
217
219
 
218
220
  function FieldRow({ children }: { children: React.ReactNode }) {
219
- return <div className="grid grid-cols-2 gap-x-8 gap-y-4">{children}</div>;
221
+ return <dl className="grid grid-cols-2 gap-x-8 gap-y-4">{children}</dl>;
220
222
  }
221
223
 
222
224
  function Section({ title, children }: { title: string; children: React.ReactNode }) {
@@ -33,6 +33,7 @@ export interface AgentforceConversationClientProps {
33
33
  height?: string | number;
34
34
  /** Theme overrides for the chat UI. */
35
35
  styleTokens?: StyleTokens;
36
+ isFileBased?: boolean;
36
37
  /** Optional. If not provided, resolved internally (e.g. from /__lo/frontdoor in dev, window.location.origin in prod). */
37
38
  salesforceOrigin?: string;
38
39
  /** Optional. If not provided, resolved internally in dev via /__lo/frontdoor. */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/ui-bundle-template-base-sfdx-project",
3
- "version": "10.19.0",
3
+ "version": "10.24.0",
4
4
  "description": "Base SFDX project template",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "publishConfig": {
@@ -11,6 +11,7 @@
11
11
  "build": "echo 'No build required for base-sfdx-project'",
12
12
  "clean": "echo 'No clean required for base-sfdx-project'",
13
13
  "lint": "eslint --no-error-on-unmatched-pattern **/{aura,lwc}/**/*.js",
14
+ "validate:org-setup-config": "node scripts/validate-org-setup-config.mjs",
14
15
  "test": "npm run test:unit",
15
16
  "test:coverage": "npm run test",
16
17
  "test:unit": "sfdx-lwc-jest -- --passWithNoTests",
@@ -22,6 +23,9 @@
22
23
  "precommit": "lint-staged",
23
24
  "setup": "node scripts/org-setup.mjs"
24
25
  },
26
+ "dependencies": {
27
+ "zod": "^3.24.1"
28
+ },
25
29
  "devDependencies": {
26
30
  "@lwc/eslint-plugin-lwc": "^3.3.0",
27
31
  "@prettier/plugin-xml": "^3.2.2",
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Shared schema + validator for org-setup.config.json (W-23043729).
3
+ *
4
+ * Authored ONCE, used at TWO moments:
5
+ * (a) build / CI time — `scripts/validate-org-setup-config.mjs` validates every
6
+ * org-setup.config.json this repo ships, failing the build on any violation.
7
+ * (b) setup runtime — `org-setup.mjs` calls `validateConfig` once in main(),
8
+ * before any step runs, to catch the developer's local post-scaffold edits.
9
+ *
10
+ * `validateConfig` is pure: it parses + validates and RETURNS a result. Each call
11
+ * site owns its own print/exit, so the build gate can report every bad file and
12
+ * the runtime can exit immediately — and the validator stays unit-testable.
13
+ *
14
+ * The zod schema uses `.strict()` at every level so unknown keys (e.g. the
15
+ * `permsetAssignment` singular typo) are rejected rather than silently ignored.
16
+ */
17
+
18
+ import { z } from 'zod';
19
+
20
+ /** Closed set of assignee values — no arbitrary usernames. */
21
+ const Assignee = z.enum(['currentUser', 'guestUser', 'skip']);
22
+
23
+ // No siteName: for guestUser the site is derived from the single
24
+ // networks/<siteName>.network-meta.xml the app ships (see spec §5.2).
25
+ const Assignment = z
26
+ .object({
27
+ assignee: Assignee,
28
+ })
29
+ .strict();
30
+
31
+ export const ConfigSchema = z
32
+ .object({
33
+ permsetAssignments: z
34
+ .object({
35
+ // guestUser is valid here — siteName is derived, not per-assignment.
36
+ defaultAssignee: Assignee.default('skip'),
37
+ assignments: z.record(z.string(), Assignment).default({}),
38
+ })
39
+ .strict()
40
+ .optional(),
41
+ role: z
42
+ .object({
43
+ assignee: z.literal('currentUser'), // only value the role code honors
44
+ roleName: z.string().min(1),
45
+ })
46
+ .strict()
47
+ .optional(),
48
+ selfRegistration: z
49
+ .object({
50
+ // No siteName: the site is derived from the single
51
+ // networks/<siteName>.network-meta.xml the app ships (see spec §5.2),
52
+ // exactly like the guestUser permset path.
53
+ selfRegProfile: z.string().min(1),
54
+ accountName: z.string().min(1),
55
+ })
56
+ .strict()
57
+ .optional(),
58
+ })
59
+ .strict();
60
+
61
+ /**
62
+ * Render a single zod issue as a "path: message" line. Empty path (a root-level
63
+ * problem) renders as "<root>: message".
64
+ */
65
+ function formatIssue(issue) {
66
+ const path = issue.path.length > 0 ? issue.path.join('.') : '<root>';
67
+ return `${path}: ${issue.message}`;
68
+ }
69
+
70
+ /**
71
+ * Parse + validate a raw org-setup.config.json string.
72
+ *
73
+ * @param {string} rawText raw file contents (not yet JSON-parsed)
74
+ * @param {string} [configPath] path used only for error messages
75
+ * @returns {{ ok: true, data: object } | { ok: false, errors: string[] }}
76
+ * On success, `data` is the parsed + defaulted config. On failure, `errors`
77
+ * is a non-empty list of human-readable messages (JSON parse error or zod
78
+ * issues). The caller decides whether to print/exit.
79
+ */
80
+ export function validateConfig(rawText, configPath) {
81
+ const where = configPath ? ` (${configPath})` : '';
82
+
83
+ let parsed;
84
+ try {
85
+ parsed = JSON.parse(rawText);
86
+ } catch (err) {
87
+ return { ok: false, errors: [`malformed JSON${where}: ${err.message}`] };
88
+ }
89
+
90
+ const result = ConfigSchema.safeParse(parsed);
91
+ if (!result.success) {
92
+ return { ok: false, errors: result.error.issues.map(formatIssue) };
93
+ }
94
+
95
+ return { ok: true, data: result.data };
96
+ }