@salesforce/templates 66.10.2 → 66.10.4

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 (64) hide show
  1. package/lib/generators/uiBundleGenerator.d.ts +1 -0
  2. package/lib/generators/uiBundleGenerator.js +13 -0
  3. package/lib/generators/uiBundleGenerator.js.map +1 -1
  4. package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/package-lock.json +646 -812
  5. package/lib/templates/project/reactinternalapp/CHANGELOG.md +186 -0
  6. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package-lock.json +784 -996
  7. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package.json +4 -3
  8. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/scripts/get-graphql-schema.mjs +8 -5
  9. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/api/graphqlClient.ts +24 -8
  10. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/components/AgentforceConversationClient.tsx +13 -1
  11. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/pages/AccountObjectDetailPage.tsx +4 -2
  12. package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/types/conversation.ts +1 -0
  13. package/lib/templates/project/reactinternalapp/_p_/_m_/permissionsets/reactinternalapp_Access.permissionset-meta.xml +4 -0
  14. package/lib/templates/project/reactinternalapp/package.json +5 -1
  15. package/lib/templates/project/reactinternalapp/scripts/org-setup-config-schema.mjs +96 -0
  16. package/lib/templates/project/reactinternalapp/scripts/org-setup.mjs +410 -177
  17. package/lib/templates/project/reactinternalapp/scripts/validate-org-setup-config.mjs +38 -0
  18. package/lib/templates/uiBundles/angularbasic/.forceignore +15 -0
  19. package/lib/templates/uiBundles/angularbasic/.postcssrc.json +5 -0
  20. package/lib/templates/uiBundles/angularbasic/.prettierignore +8 -0
  21. package/lib/templates/uiBundles/angularbasic/.prettierrc +12 -0
  22. package/lib/templates/uiBundles/angularbasic/CHANGELOG.md +4 -0
  23. package/lib/templates/uiBundles/angularbasic/README.md +85 -0
  24. package/lib/templates/uiBundles/angularbasic/_uibundle.uibundle-meta.xml +7 -0
  25. package/lib/templates/uiBundles/angularbasic/angular.json +94 -0
  26. package/lib/templates/uiBundles/angularbasic/esbuild/api-version.mjs +17 -0
  27. package/lib/templates/uiBundles/angularbasic/eslint.config.js +56 -0
  28. package/lib/templates/uiBundles/angularbasic/middleware/html.mjs +3 -0
  29. package/lib/templates/uiBundles/angularbasic/middleware/proxy.mjs +12 -0
  30. package/lib/templates/uiBundles/angularbasic/package-lock.json +14070 -0
  31. package/lib/templates/uiBundles/angularbasic/package.json +52 -0
  32. package/lib/templates/uiBundles/angularbasic/playwright.config.ts +25 -0
  33. package/lib/templates/uiBundles/angularbasic/public/favicon.ico +0 -0
  34. package/lib/templates/uiBundles/angularbasic/scripts/rewrite-e2e-assets.mjs +30 -0
  35. package/lib/templates/uiBundles/angularbasic/src/app/api/graphql-client.service.spec.ts +154 -0
  36. package/lib/templates/uiBundles/angularbasic/src/app/api/graphql-client.service.ts +51 -0
  37. package/lib/templates/uiBundles/angularbasic/src/app/app.config.ts +8 -0
  38. package/lib/templates/uiBundles/angularbasic/src/app/app.css +0 -0
  39. package/lib/templates/uiBundles/angularbasic/src/app/app.html +1 -0
  40. package/lib/templates/uiBundles/angularbasic/src/app/app.routes.ts +21 -0
  41. package/lib/templates/uiBundles/angularbasic/src/app/app.spec.ts +18 -0
  42. package/lib/templates/uiBundles/angularbasic/src/app/app.ts +10 -0
  43. package/lib/templates/uiBundles/angularbasic/src/app/layout/app-layout.component.html +50 -0
  44. package/lib/templates/uiBundles/angularbasic/src/app/layout/app-layout.component.spec.ts +63 -0
  45. package/lib/templates/uiBundles/angularbasic/src/app/layout/app-layout.component.ts +21 -0
  46. package/lib/templates/uiBundles/angularbasic/src/app/pages/home/home.component.html +6 -0
  47. package/lib/templates/uiBundles/angularbasic/src/app/pages/home/home.component.spec.ts +23 -0
  48. package/lib/templates/uiBundles/angularbasic/src/app/pages/home/home.component.ts +7 -0
  49. package/lib/templates/uiBundles/angularbasic/src/app/pages/not-found/not-found.component.html +12 -0
  50. package/lib/templates/uiBundles/angularbasic/src/app/pages/not-found/not-found.component.spec.ts +33 -0
  51. package/lib/templates/uiBundles/angularbasic/src/app/pages/not-found/not-found.component.ts +9 -0
  52. package/lib/templates/uiBundles/angularbasic/src/index.html +13 -0
  53. package/lib/templates/uiBundles/angularbasic/src/main.ts +5 -0
  54. package/lib/templates/uiBundles/angularbasic/src/styles.css +12 -0
  55. package/lib/templates/uiBundles/angularbasic/src/types/sf-globals.d.ts +9 -0
  56. package/lib/templates/uiBundles/angularbasic/tsconfig.app.json +11 -0
  57. package/lib/templates/uiBundles/angularbasic/tsconfig.json +33 -0
  58. package/lib/templates/uiBundles/angularbasic/tsconfig.spec.json +10 -0
  59. package/lib/templates/uiBundles/angularbasic/ui-bundle.json +7 -0
  60. package/lib/templates/uiBundles/reactbasic/package-lock.json +784 -996
  61. package/lib/templates/uiBundles/reactbasic/package.json +4 -3
  62. package/lib/templates/uiBundles/reactbasic/scripts/get-graphql-schema.mjs +8 -5
  63. package/lib/templates/uiBundles/reactbasic/src/api/graphqlClient.ts +24 -8
  64. package/package.json +6 -5
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Build / CI gate: validate this package's org-setup.config.json against the
3
+ * shared schema (W-23043729, spec §5.2).
4
+ *
5
+ * Ships inside the SFDX project template, so a generated app can self-check its
6
+ * org-setup.config.json in its own CI:
7
+ * npm run validate:org-setup-config
8
+ *
9
+ * Uses the SAME validateConfig + schema as org-setup.mjs runtime, so build-time
10
+ * and runtime checks can never drift. A missing config file is OK (not every
11
+ * project ships one); a present-but-invalid config fails the gate.
12
+ */
13
+
14
+ import { existsSync, readFileSync } from 'node:fs';
15
+ import { resolve, dirname } from 'node:path';
16
+ import { fileURLToPath } from 'node:url';
17
+
18
+ import { validateConfig } from './org-setup-config-schema.mjs';
19
+
20
+ const __dirname = dirname(fileURLToPath(import.meta.url));
21
+ const configPath = resolve(__dirname, 'org-setup.config.json');
22
+
23
+ if (!existsSync(configPath)) {
24
+ console.log('✓ org-setup.config.json: not present (nothing to validate)');
25
+ process.exit(0);
26
+ }
27
+
28
+ const result = validateConfig(readFileSync(configPath, 'utf8'), configPath);
29
+ if (result.ok) {
30
+ console.log('✓ org-setup.config.json');
31
+ process.exit(0);
32
+ }
33
+
34
+ console.error('❌ org-setup.config.json is invalid:');
35
+ for (const err of result.errors) {
36
+ console.error(` - ${err}`);
37
+ }
38
+ process.exit(1);
@@ -0,0 +1,15 @@
1
+ # List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status
2
+ # More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm
3
+ #
4
+
5
+ package.xml
6
+
7
+ # LWC configuration files
8
+ **/jsconfig.json
9
+ **/.eslintrc.json
10
+
11
+ # LWC Jest
12
+ **/__tests__/**
13
+
14
+ node_modules/
15
+ .DS_Store
@@ -0,0 +1,5 @@
1
+ {
2
+ "plugins": {
3
+ "@tailwindcss/postcss": {}
4
+ }
5
+ }
@@ -0,0 +1,8 @@
1
+ node_modules
2
+ dist
3
+ .angular
4
+ coverage
5
+ *.min.js
6
+ *.min.css
7
+ *.map
8
+ package-lock.json
@@ -0,0 +1,12 @@
1
+ {
2
+ "printWidth": 100,
3
+ "singleQuote": true,
4
+ "overrides": [
5
+ {
6
+ "files": "*.html",
7
+ "options": {
8
+ "parser": "angular"
9
+ }
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,4 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
@@ -0,0 +1,85 @@
1
+ # Base Angular App
2
+
3
+ Base Angular App is a template application that demonstrates how to build an Angular UI Bundle on the Salesforce platform with the Angular CLI, TypeScript, Tailwind, and the Salesforce UI Bundle SDK. It provides a minimal shell (home, 404), routing with standalone components and signals, so feature apps can extend it via the patches pipeline.
4
+
5
+ This UI Bundle lives inside an SFDX project. The project root is the directory that contains `force-app/` and `sfdx-project.json`. Run the commands in the sections below from the paths indicated.
6
+
7
+ ## Table of contents
8
+
9
+ - [Run (development)](#run-development)
10
+ - [Build](#build)
11
+ - [Deploy](#deploy)
12
+ - [Test](#test)
13
+ - [Lint](#lint)
14
+
15
+ ## Run (development)
16
+
17
+ From the UI Bundle directory (`force-app/main/default/uiBundles/base-angular-app`):
18
+
19
+ ```bash
20
+ npm install
21
+ npm run dev
22
+ ```
23
+
24
+ This starts the Salesforce Angular dev server (`sf-angular-serve`).
25
+
26
+ ## Build
27
+
28
+ From the UI Bundle directory:
29
+
30
+ ```bash
31
+ npm install
32
+ npm run build
33
+ ```
34
+
35
+ The production build is written to `dist/` inside the UI Bundle folder. Use `npm run watch` to rebuild on change in development mode. Deploy using the steps in [Deploy](#deploy).
36
+
37
+ ## Deploy
38
+
39
+ From the **SFDX project root** (the directory that contains `force-app/`):
40
+
41
+ 1. Build the UI Bundle:
42
+
43
+ ```bash
44
+ cd force-app/main/default/uiBundles/base-angular-app && npm install && npm run build && cd -
45
+ ```
46
+
47
+ 2. Deploy the UI Bundle only:
48
+
49
+ ```bash
50
+ sf project deploy start --source-dir force-app/main/default/ui-bundles --target-org <alias>
51
+ ```
52
+
53
+ Or deploy all metadata:
54
+
55
+ ```bash
56
+ sf project deploy start --source-dir force-app --target-org <alias>
57
+ ```
58
+
59
+ Replace `<alias>` with your target org alias.
60
+
61
+ ## Test
62
+
63
+ From the UI Bundle directory:
64
+
65
+ ```bash
66
+ npm install
67
+ npm run test
68
+ ```
69
+
70
+ This runs the unit test suite via `ng test`. For end-to-end tests:
71
+
72
+ ```bash
73
+ npm run build:e2e
74
+ npm run e2e
75
+ ```
76
+
77
+ This builds with E2E asset rewrites and runs Playwright against the static build. Ensure Chromium is installed (`npx playwright install chromium` if needed).
78
+
79
+ ## Lint
80
+
81
+ From the UI Bundle directory:
82
+
83
+ ```bash
84
+ npm run lint
85
+ ```
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <UIBundle xmlns="http://soap.sforce.com/2006/04/metadata">
3
+ <masterLabel><%= masterLabel %></masterLabel>
4
+ <description>A Salesforce UI Bundle.</description>
5
+ <isActive>true</isActive>
6
+ <version>1</version>
7
+ </UIBundle>
@@ -0,0 +1,94 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "cli": {
5
+ "packageManager": "npm",
6
+ "analytics": false
7
+ },
8
+ "newProjectRoot": "projects",
9
+ "projects": {
10
+ "<%= bundlename %>": {
11
+ "projectType": "application",
12
+ "schematics": {},
13
+ "root": "",
14
+ "sourceRoot": "src",
15
+ "prefix": "app",
16
+ "architect": {
17
+ "build": {
18
+ "builder": "@angular-builders/custom-esbuild:application",
19
+ "options": {
20
+ "outputPath": {
21
+ "base": "dist",
22
+ "browser": ""
23
+ },
24
+ "deployUrl": "./",
25
+ "browser": "src/main.ts",
26
+ "tsConfig": "tsconfig.app.json",
27
+ "assets": [
28
+ {
29
+ "glob": "**/*",
30
+ "input": "public"
31
+ }
32
+ ],
33
+ "styles": ["src/styles.css"],
34
+ "plugins": ["./esbuild/api-version.mjs"]
35
+ },
36
+ "configurations": {
37
+ "production": {
38
+ "budgets": [
39
+ {
40
+ "type": "initial",
41
+ "maximumWarning": "500kB",
42
+ "maximumError": "1MB"
43
+ },
44
+ {
45
+ "type": "anyComponentStyle",
46
+ "maximumWarning": "4kB",
47
+ "maximumError": "8kB"
48
+ }
49
+ ],
50
+ "outputHashing": "all",
51
+ "optimization": {
52
+ "scripts": true,
53
+ "styles": {
54
+ "minify": true,
55
+ "inlineCritical": false
56
+ }
57
+ }
58
+ },
59
+ "development": {
60
+ "optimization": false,
61
+ "extractLicenses": false,
62
+ "sourceMap": true
63
+ }
64
+ },
65
+ "defaultConfiguration": "production"
66
+ },
67
+ "serve": {
68
+ "builder": "@angular-builders/custom-esbuild:dev-server",
69
+ "options": {
70
+ "middlewares": ["./middleware/html.mjs", "./middleware/proxy.mjs"]
71
+ },
72
+ "configurations": {
73
+ "production": {
74
+ "buildTarget": "<%= bundlename %>:build:production"
75
+ },
76
+ "development": {
77
+ "buildTarget": "<%= bundlename %>:build:development"
78
+ }
79
+ },
80
+ "defaultConfiguration": "development"
81
+ },
82
+ "test": {
83
+ "builder": "@angular/build:unit-test"
84
+ },
85
+ "lint": {
86
+ "builder": "@angular-eslint/builder:lint",
87
+ "options": {
88
+ "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Build-time substitution of `__SF_API_VERSION__` (production + main app code in dev).
3
+ *
4
+ * Resolves the connected org's API version (from `sf` CLI session) once at
5
+ * builder startup and injects it via esbuild's `define`. Falls back to "65.0"
6
+ * if no session is available — matches @salesforce/platform-sdk's default.
7
+ *
8
+ * In `ng serve`, this plugin runs on the application esbuild pass but does NOT
9
+ * reach Vite's optimizeDeps prebundle of node_modules. `scripts/dev.mjs` covers
10
+ * that gap by passing the same value via `ng serve --define`.
11
+ *
12
+ * Referenced from angular.json: architect.build.options.plugins[].
13
+ */
14
+ import { createApiVersionPlugin } from '@salesforce/angular-plugin-ui-bundle';
15
+
16
+ const { plugin } = await createApiVersionPlugin();
17
+ export default plugin;
@@ -0,0 +1,56 @@
1
+ import js from '@eslint/js';
2
+ import angular from 'angular-eslint';
3
+ import tseslint from 'typescript-eslint';
4
+
5
+ export default tseslint.config(
6
+ // Global ignores
7
+ {
8
+ ignores: ['dist/**/*', '.angular/**/*', 'coverage/**/*', 'node_modules/**/*'],
9
+ },
10
+ // TypeScript files
11
+ {
12
+ files: ['**/*.ts'],
13
+ extends: [
14
+ js.configs.recommended,
15
+ ...tseslint.configs.recommended,
16
+ ...angular.configs.tsRecommended,
17
+ ],
18
+ processor: angular.processInlineTemplates,
19
+ rules: {
20
+ '@angular-eslint/directive-selector': [
21
+ 'error',
22
+ {
23
+ type: 'attribute',
24
+ prefix: 'app',
25
+ style: 'camelCase',
26
+ },
27
+ ],
28
+ '@angular-eslint/component-selector': [
29
+ 'error',
30
+ {
31
+ type: 'element',
32
+ prefix: 'app',
33
+ style: 'kebab-case',
34
+ },
35
+ ],
36
+ '@typescript-eslint/no-unused-vars': [
37
+ 'error',
38
+ {
39
+ argsIgnorePattern: '^_',
40
+ varsIgnorePattern: '^_',
41
+ caughtErrorsIgnorePattern: '^_',
42
+ ignoreRestSiblings: true,
43
+ },
44
+ ],
45
+ '@typescript-eslint/no-explicit-any': 'off',
46
+ '@typescript-eslint/explicit-function-return-type': 'off',
47
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
48
+ },
49
+ },
50
+ // Template files
51
+ {
52
+ files: ['**/*.html'],
53
+ extends: [...angular.configs.templateRecommended, ...angular.configs.templateAccessibility],
54
+ rules: {},
55
+ },
56
+ );
@@ -0,0 +1,3 @@
1
+ import { createHtmlMiddleware } from '@salesforce/angular-plugin-ui-bundle';
2
+
3
+ export default await createHtmlMiddleware();
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Proxy middleware for Angular CLI dev server.
3
+ *
4
+ * Forwards `/services/*` and other manifest-routed paths to the connected
5
+ * Salesforce org with authentication. Watches `ui-bundle.json` for changes
6
+ * and recreates the proxy handler automatically (manual browser refresh needed).
7
+ *
8
+ * Referenced from angular.json: architect.serve.options.middlewares[].
9
+ */
10
+ import { createProxyMiddleware } from '@salesforce/angular-plugin-ui-bundle';
11
+
12
+ export default await createProxyMiddleware();