@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.
- package/lib/generators/apexClassGenerator.js +9 -2
- package/lib/generators/apexClassGenerator.js.map +1 -1
- package/lib/generators/uiBundleGenerator.d.ts +1 -0
- package/lib/generators/uiBundleGenerator.js +13 -0
- package/lib/generators/uiBundleGenerator.js.map +1 -1
- package/lib/i18n/i18n.d.ts +1 -0
- package/lib/i18n/i18n.js +1 -0
- package/lib/i18n/i18n.js.map +1 -1
- package/lib/templates/apexclass/Batchable.cls +15 -0
- package/lib/templates/apexclass/Queueable.cls +13 -0
- package/lib/templates/project/reactexternalapp/_p_/_m_/_w_/_a_/package-lock.json +1173 -1126
- package/lib/templates/project/reactinternalapp/CHANGELOG.md +65 -0
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package-lock.json +1170 -1123
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/package.json +4 -4
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/components/AgentforceConversationClient.tsx +13 -1
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/pages/AccountObjectDetailPage.tsx +4 -2
- package/lib/templates/project/reactinternalapp/_p_/_m_/_w_/_a_/src/types/conversation.ts +1 -0
- package/lib/templates/project/reactinternalapp/package.json +5 -1
- package/lib/templates/project/reactinternalapp/scripts/org-setup-config-schema.mjs +96 -0
- package/lib/templates/project/reactinternalapp/scripts/org-setup.mjs +408 -178
- package/lib/templates/project/reactinternalapp/scripts/validate-org-setup-config.mjs +38 -0
- package/lib/templates/uiBundles/angularbasic/.forceignore +15 -0
- package/lib/templates/uiBundles/angularbasic/.postcssrc.json +5 -0
- package/lib/templates/uiBundles/angularbasic/.prettierignore +8 -0
- package/lib/templates/uiBundles/angularbasic/.prettierrc +12 -0
- package/lib/templates/uiBundles/angularbasic/CHANGELOG.md +4 -0
- package/lib/templates/uiBundles/angularbasic/README.md +85 -0
- package/lib/templates/uiBundles/angularbasic/_uibundle.uibundle-meta.xml +7 -0
- package/lib/templates/uiBundles/angularbasic/angular.json +94 -0
- package/lib/templates/uiBundles/angularbasic/esbuild/api-version.mjs +17 -0
- package/lib/templates/uiBundles/angularbasic/eslint.config.js +56 -0
- package/lib/templates/uiBundles/angularbasic/middleware/html.mjs +3 -0
- package/lib/templates/uiBundles/angularbasic/middleware/proxy.mjs +12 -0
- package/lib/templates/uiBundles/angularbasic/package-lock.json +13568 -0
- package/lib/templates/uiBundles/angularbasic/package.json +52 -0
- package/lib/templates/uiBundles/angularbasic/playwright.config.ts +25 -0
- package/lib/templates/uiBundles/angularbasic/public/favicon.ico +0 -0
- package/lib/templates/uiBundles/angularbasic/scripts/rewrite-e2e-assets.mjs +30 -0
- package/lib/templates/uiBundles/angularbasic/src/app/api/graphql-client.service.spec.ts +154 -0
- package/lib/templates/uiBundles/angularbasic/src/app/api/graphql-client.service.ts +48 -0
- package/lib/templates/uiBundles/angularbasic/src/app/app.config.ts +8 -0
- package/lib/templates/uiBundles/angularbasic/src/app/app.css +0 -0
- package/lib/templates/uiBundles/angularbasic/src/app/app.html +1 -0
- package/lib/templates/uiBundles/angularbasic/src/app/app.routes.ts +21 -0
- package/lib/templates/uiBundles/angularbasic/src/app/app.spec.ts +18 -0
- package/lib/templates/uiBundles/angularbasic/src/app/app.ts +10 -0
- package/lib/templates/uiBundles/angularbasic/src/app/layout/app-layout.component.html +50 -0
- package/lib/templates/uiBundles/angularbasic/src/app/layout/app-layout.component.spec.ts +63 -0
- package/lib/templates/uiBundles/angularbasic/src/app/layout/app-layout.component.ts +21 -0
- package/lib/templates/uiBundles/angularbasic/src/app/pages/home/home.component.html +6 -0
- package/lib/templates/uiBundles/angularbasic/src/app/pages/home/home.component.spec.ts +23 -0
- package/lib/templates/uiBundles/angularbasic/src/app/pages/home/home.component.ts +7 -0
- package/lib/templates/uiBundles/angularbasic/src/app/pages/not-found/not-found.component.html +12 -0
- package/lib/templates/uiBundles/angularbasic/src/app/pages/not-found/not-found.component.spec.ts +33 -0
- package/lib/templates/uiBundles/angularbasic/src/app/pages/not-found/not-found.component.ts +9 -0
- package/lib/templates/uiBundles/angularbasic/src/index.html +13 -0
- package/lib/templates/uiBundles/angularbasic/src/main.ts +5 -0
- package/lib/templates/uiBundles/angularbasic/src/styles.css +12 -0
- package/lib/templates/uiBundles/angularbasic/src/types/sf-globals.d.ts +9 -0
- package/lib/templates/uiBundles/angularbasic/tsconfig.app.json +11 -0
- package/lib/templates/uiBundles/angularbasic/tsconfig.json +33 -0
- package/lib/templates/uiBundles/angularbasic/tsconfig.spec.json +10 -0
- package/lib/templates/uiBundles/angularbasic/ui-bundle.json +7 -0
- package/lib/templates/uiBundles/reactbasic/package-lock.json +1170 -1123
- package/lib/templates/uiBundles/reactbasic/package.json +4 -4
- package/lib/utils/createUtil.d.ts +2 -0
- package/lib/utils/createUtil.js +7 -0
- package/lib/utils/createUtil.js.map +1 -1
- package/lib/utils/types.d.ts +11 -3
- package/package.json +5 -4
|
@@ -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,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,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,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();
|