@salesforce/templates 65.5.1 → 65.5.2
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/webApplicationGenerator.js +6 -14
- package/lib/generators/webApplicationGenerator.js.map +1 -1
- package/lib/i18n/i18n.js +1 -1
- package/lib/templates/webapplication/reactbasic/.prettierrc +10 -10
- package/lib/templates/webapplication/{webappbasic/_webapplication.webApplication-meta.xml → reactbasic/_webapplication.webapplication-meta.xml} +2 -2
- package/lib/templates/webapplication/reactbasic/eslint.config.js +4 -4
- package/lib/templates/webapplication/reactbasic/index.html +1 -1
- package/lib/templates/webapplication/reactbasic/package.json +3 -3
- package/lib/templates/webapplication/reactbasic/src/api/graphql-operations-types.ts +127 -0
- package/lib/templates/webapplication/reactbasic/src/api/utils/query/highRevenueAccountsQuery.graphql +29 -0
- package/lib/templates/webapplication/reactbasic/src/app.tsx +5 -5
- package/lib/templates/webapplication/reactbasic/src/appLayout.tsx +7 -7
- package/lib/templates/webapplication/reactbasic/src/pages/About.tsx +9 -9
- package/lib/templates/webapplication/reactbasic/src/pages/Home.tsx +11 -11
- package/lib/templates/webapplication/reactbasic/src/pages/NotFound.tsx +1 -1
- package/lib/templates/webapplication/reactbasic/src/routes.tsx +15 -10
- package/lib/templates/webapplication/reactbasic/src/styles/global.css +5 -3
- package/lib/templates/webapplication/reactbasic/tsconfig.json +1 -3
- package/lib/templates/webapplication/reactbasic/webapplication.json +7 -0
- package/lib/templates/webapplication/{reactbasic/_webapplication.webApplication-meta.xml → webappbasic/_webapplication.webapplication-meta.xml} +2 -2
- package/lib/templates/webapplication/webappbasic/src/index.html +11 -0
- package/lib/templates/webapplication/webappbasic/webapplication.json +7 -0
- package/package.json +3 -3
- package/lib/templates/webapplication/reactbasic/README.md +0 -73
- package/lib/templates/webapplication/reactbasic/package-lock.json +0 -5248
- package/lib/templates/webapplication/reactbasic/webapp.json +0 -12
- package/lib/templates/webapplication/webappbasic/index.html +0 -11
- package/lib/templates/webapplication/webappbasic/webapp.json +0 -11
|
@@ -22,7 +22,7 @@ class WebApplicationGenerator extends baseGenerator_1.BaseGenerator {
|
|
|
22
22
|
utils_1.CreateUtil.checkInputs(this.options.webappname);
|
|
23
23
|
utils_1.CreateUtil.checkInputs(this.options.template);
|
|
24
24
|
const fileparts = path.resolve(this.outputdir).split(path.sep);
|
|
25
|
-
if (!this.options.internal && !fileparts.includes('
|
|
25
|
+
if (!this.options.internal && !fileparts.includes('webapplications')) {
|
|
26
26
|
throw new Error(i18n_1.nls.localize('MissingWebApplicationsDir'));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -44,22 +44,18 @@ class WebApplicationGenerator extends baseGenerator_1.BaseGenerator {
|
|
|
44
44
|
generateDefault(webappDir, webappname, masterLabel) {
|
|
45
45
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
this.sourceRootWithPartialPath(path.join('webapplication', 'webappbasic'));
|
|
47
|
-
yield this.render(this.templatePath('_webapplication.
|
|
48
|
-
yield this.render(this.templatePath('index.html'), this.destinationPath(path.join(webappDir, 'index.html')), { masterLabel });
|
|
49
|
-
// Copy the rest of the files over
|
|
47
|
+
yield this.render(this.templatePath('_webapplication.webapplication-meta.xml'), this.destinationPath(path.join(webappDir, `${webappname}.webapplication-meta.xml`)), { apiVersion: this.apiversion, masterLabel });
|
|
50
48
|
const templatePath = this.sourceRoot();
|
|
51
|
-
yield this.copyDirectoryRecursive(templatePath, webappDir, new Set(['_webapplication.
|
|
49
|
+
yield this.copyDirectoryRecursive(templatePath, webappDir, new Set(['_webapplication.webapplication-meta.xml']));
|
|
52
50
|
});
|
|
53
51
|
}
|
|
54
52
|
generateReactBasic(webappDir, webappname, masterLabel) {
|
|
55
53
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
56
54
|
this.sourceRootWithPartialPath(path.join('webapplication', 'reactbasic'));
|
|
57
|
-
yield this.render(this.templatePath('_webapplication.
|
|
58
|
-
yield this.render(this.templatePath('index.html'), this.destinationPath(path.join(webappDir, 'index.html')), { masterLabel });
|
|
55
|
+
yield this.render(this.templatePath('_webapplication.webapplication-meta.xml'), this.destinationPath(path.join(webappDir, `${webappname}.webapplication-meta.xml`)), { apiVersion: this.apiversion, masterLabel });
|
|
59
56
|
yield this.render(this.templatePath('package.json'), this.destinationPath(path.join(webappDir, 'package.json')), { webappname });
|
|
60
|
-
// Copy the rest of the files over
|
|
61
57
|
const templatePath = this.sourceRoot();
|
|
62
|
-
yield this.copyDirectoryRecursive(templatePath, webappDir, new Set(['_webapplication.
|
|
58
|
+
yield this.copyDirectoryRecursive(templatePath, webappDir, new Set(['_webapplication.webapplication-meta.xml', 'package.json']));
|
|
63
59
|
});
|
|
64
60
|
}
|
|
65
61
|
copyDirectoryRecursive(sourceDir_1, destDir_1) {
|
|
@@ -76,14 +72,10 @@ class WebApplicationGenerator extends baseGenerator_1.BaseGenerator {
|
|
|
76
72
|
if (excludeFiles.has(entry.name)) {
|
|
77
73
|
continue;
|
|
78
74
|
}
|
|
79
|
-
// Skip files that already exist
|
|
80
|
-
if (fs.existsSync(destPath)) {
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
75
|
if (entry.isDirectory()) {
|
|
84
76
|
yield this.copyDirectoryRecursive(sourcePath, destPath, excludeFiles);
|
|
85
77
|
}
|
|
86
|
-
else {
|
|
78
|
+
else if (!fs.existsSync(destPath)) {
|
|
87
79
|
// Copy file and track it
|
|
88
80
|
const content = yield (0, promises_1.readFile)(sourcePath);
|
|
89
81
|
yield (0, promises_1.mkdir)(path.dirname(destPath), { recursive: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webApplicationGenerator.js","sourceRoot":"","sources":["../../src/generators/webApplicationGenerator.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,yCAAuD;AACvD,yBAAyB;AACzB,6BAA6B;AAC7B,+CAA8D;AAC9D,kCAA8B;AAC9B,oCAAsC;AAEtC,mDA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AC;gBACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;gBAEhD,yCAAyC;gBACzC,IAAI,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;oBACjC,SAAS;gBACX,CAAC;gBAED,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;oBACxB,MAAM,IAAI,CAAC,sBAAsB,CAAC,UAAU,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;gBACxE,CAAC;qBAAM,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACpC,yBAAyB;oBACzB,MAAM,OAAO,GAAG,MAAM,IAAA,mBAAQ,EAAC,UAAU,CAAC,CAAC;oBAC3C,MAAM,IAAA,gBAAK,EAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;oBACzD,MAAM,IAAA,oBAAS,EAAC,QAAQ,EAAE,OAAqB,CAAC,CAAC;oBAEjD,4BAA4B;oBAC5B,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC;oBAC5D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC1C,CAAC;YACH,CAAC;QACH,CAAC;KAAA;CACF;AAvHD,0CAuHC"}
|
package/lib/i18n/i18n.js
CHANGED
|
@@ -26,7 +26,7 @@ exports.messages = {
|
|
|
26
26
|
MissingWaveTemplatesDir: "Analytics templates must have a parent folder named 'waveTemplates'.",
|
|
27
27
|
MissingAuraDir: "Lightning bundles must have a parent folder named 'aura'.",
|
|
28
28
|
MissingLWCDir: "Lightning bundles must have a parent folder named 'lwc'.",
|
|
29
|
-
MissingWebApplicationsDir: "Web applications must have a parent folder named '
|
|
29
|
+
MissingWebApplicationsDir: "Web applications must have a parent folder named 'webapplications'.",
|
|
30
30
|
MissingFlexipagesDir: "FlexiPages must have a parent folder named 'flexipages'.",
|
|
31
31
|
MissingLightningComponentTemplate: 'Template %s not available for component type %s.',
|
|
32
32
|
localCustomTemplateDoNotExist: 'Local custom templates folder %s does not exist',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
2
|
+
"semi": true,
|
|
3
|
+
"trailingComma": "es5",
|
|
4
|
+
"singleQuote": true,
|
|
5
|
+
"printWidth": 80,
|
|
6
|
+
"tabWidth": 2,
|
|
7
|
+
"useTabs": false,
|
|
8
|
+
"bracketSpacing": true,
|
|
9
|
+
"arrowParens": "avoid",
|
|
10
|
+
"endOfLine": "lf"
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<WebApplication xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
3
|
-
<apiVersion><%= apiVersion %></apiVersion>
|
|
4
3
|
<masterLabel><%= masterLabel %></masterLabel>
|
|
5
4
|
<description>A Salesforce web application.</description>
|
|
6
|
-
<
|
|
5
|
+
<isActive>true</isActive>
|
|
6
|
+
<version>1</version>
|
|
7
7
|
</WebApplication>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import js from '@eslint/js';
|
|
2
|
-
import globals from 'globals';
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
-
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
5
2
|
import tseslint from '@typescript-eslint/eslint-plugin';
|
|
6
3
|
import tsparser from '@typescript-eslint/parser';
|
|
7
4
|
import react from 'eslint-plugin-react';
|
|
5
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
6
|
+
import reactRefresh from 'eslint-plugin-react-refresh';
|
|
7
|
+
import globals from 'globals';
|
|
8
8
|
|
|
9
9
|
export default [
|
|
10
10
|
// Global ignores
|
|
@@ -110,4 +110,4 @@ export default [
|
|
|
110
110
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
111
111
|
},
|
|
112
112
|
},
|
|
113
|
-
];
|
|
113
|
+
];
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title
|
|
7
|
+
<title>Welcome to React App</title>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<div id="root"></div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "base-react-app",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"test": "vitest"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@salesforce/webapp-experimental": "
|
|
14
|
+
"@salesforce/webapp-experimental": "*",
|
|
15
15
|
"@tailwindcss/vite": "^4.1.17",
|
|
16
16
|
"react": "^19.2.0",
|
|
17
17
|
"react-dom": "^19.2.0",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@eslint/js": "^9.39.1",
|
|
23
|
-
"@salesforce/vite-plugin-webapp-experimental": "
|
|
23
|
+
"@salesforce/vite-plugin-webapp-experimental": "*",
|
|
24
24
|
"@testing-library/jest-dom": "^6.6.3",
|
|
25
25
|
"@testing-library/react": "^16.1.0",
|
|
26
26
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export type Maybe<T> = T | null;
|
|
2
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
3
|
+
export type Exact<T extends { [key: string]: unknown }> = {
|
|
4
|
+
[K in keyof T]: T[K];
|
|
5
|
+
};
|
|
6
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
7
|
+
[SubKey in K]?: Maybe<T[SubKey]>;
|
|
8
|
+
};
|
|
9
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
|
10
|
+
[SubKey in K]: Maybe<T[SubKey]>;
|
|
11
|
+
};
|
|
12
|
+
export type MakeEmpty<
|
|
13
|
+
T extends { [key: string]: unknown },
|
|
14
|
+
K extends keyof T,
|
|
15
|
+
> = { [_ in K]?: never };
|
|
16
|
+
export type Incremental<T> =
|
|
17
|
+
| T
|
|
18
|
+
| {
|
|
19
|
+
[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
|
|
20
|
+
};
|
|
21
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
22
|
+
export type Scalars = {
|
|
23
|
+
ID: { input: string; output: string };
|
|
24
|
+
String: { input: string; output: string };
|
|
25
|
+
Boolean: { input: boolean; output: boolean };
|
|
26
|
+
Int: { input: number; output: number };
|
|
27
|
+
Float: { input: number; output: number };
|
|
28
|
+
Base64: { input: any; output: any };
|
|
29
|
+
/** An arbitrary precision signed decimal */
|
|
30
|
+
BigDecimal: { input: any; output: any };
|
|
31
|
+
/** An arbitrary precision signed integer */
|
|
32
|
+
BigInteger: { input: any; output: any };
|
|
33
|
+
/** An 8-bit signed integer */
|
|
34
|
+
Byte: { input: any; output: any };
|
|
35
|
+
/** A UTF-16 code unit; a character on Unicode's BMP */
|
|
36
|
+
Char: { input: any; output: any };
|
|
37
|
+
Currency: { input: any; output: any };
|
|
38
|
+
Date: { input: any; output: any };
|
|
39
|
+
DateTime: { input: any; output: any };
|
|
40
|
+
Double: { input: any; output: any };
|
|
41
|
+
Email: { input: any; output: any };
|
|
42
|
+
EncryptedString: { input: any; output: any };
|
|
43
|
+
/** Can be set to an ID or a Reference to the result of another mutation operation. */
|
|
44
|
+
IdOrRef: { input: any; output: any };
|
|
45
|
+
JSON: { input: any; output: any };
|
|
46
|
+
Latitude: { input: any; output: any };
|
|
47
|
+
/** A 64-bit signed integer */
|
|
48
|
+
Long: { input: any; output: any };
|
|
49
|
+
LongTextArea: { input: any; output: any };
|
|
50
|
+
Longitude: { input: any; output: any };
|
|
51
|
+
MultiPicklist: { input: any; output: any };
|
|
52
|
+
Percent: { input: any; output: any };
|
|
53
|
+
PhoneNumber: { input: any; output: any };
|
|
54
|
+
Picklist: { input: any; output: any };
|
|
55
|
+
RichTextArea: { input: any; output: any };
|
|
56
|
+
/** A 16-bit signed integer */
|
|
57
|
+
Short: { input: any; output: any };
|
|
58
|
+
TextArea: { input: any; output: any };
|
|
59
|
+
Time: { input: any; output: any };
|
|
60
|
+
Url: { input: any; output: any };
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export enum DataType {
|
|
64
|
+
Address = 'ADDRESS',
|
|
65
|
+
Anytype = 'ANYTYPE',
|
|
66
|
+
Base64 = 'BASE64',
|
|
67
|
+
Boolean = 'BOOLEAN',
|
|
68
|
+
Combobox = 'COMBOBOX',
|
|
69
|
+
Complexvalue = 'COMPLEXVALUE',
|
|
70
|
+
Currency = 'CURRENCY',
|
|
71
|
+
Date = 'DATE',
|
|
72
|
+
Datetime = 'DATETIME',
|
|
73
|
+
Double = 'DOUBLE',
|
|
74
|
+
Email = 'EMAIL',
|
|
75
|
+
Encryptedstring = 'ENCRYPTEDSTRING',
|
|
76
|
+
Int = 'INT',
|
|
77
|
+
Json = 'JSON',
|
|
78
|
+
Junctionidlist = 'JUNCTIONIDLIST',
|
|
79
|
+
Location = 'LOCATION',
|
|
80
|
+
Long = 'LONG',
|
|
81
|
+
Multipicklist = 'MULTIPICKLIST',
|
|
82
|
+
Percent = 'PERCENT',
|
|
83
|
+
Phone = 'PHONE',
|
|
84
|
+
Picklist = 'PICKLIST',
|
|
85
|
+
Reference = 'REFERENCE',
|
|
86
|
+
String = 'STRING',
|
|
87
|
+
Textarea = 'TEXTAREA',
|
|
88
|
+
Time = 'TIME',
|
|
89
|
+
Url = 'URL',
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export enum FieldExtraTypeInfo {
|
|
93
|
+
ExternalLookup = 'EXTERNAL_LOOKUP',
|
|
94
|
+
ImageUrl = 'IMAGE_URL',
|
|
95
|
+
IndirectLookup = 'INDIRECT_LOOKUP',
|
|
96
|
+
Personname = 'PERSONNAME',
|
|
97
|
+
Plaintextarea = 'PLAINTEXTAREA',
|
|
98
|
+
Richtextarea = 'RICHTEXTAREA',
|
|
99
|
+
SwitchablePersonname = 'SWITCHABLE_PERSONNAME',
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export enum ResultOrder {
|
|
103
|
+
Asc = 'ASC',
|
|
104
|
+
Desc = 'DESC',
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type GetHighRevenueAccountsQueryVariables = Exact<{
|
|
108
|
+
minRevenue?: InputMaybe<Scalars['Currency']['input']>;
|
|
109
|
+
}>;
|
|
110
|
+
|
|
111
|
+
export type GetHighRevenueAccountsQuery = {
|
|
112
|
+
uiapi: {
|
|
113
|
+
query: {
|
|
114
|
+
Account?: {
|
|
115
|
+
edges?: Array<{
|
|
116
|
+
node?: {
|
|
117
|
+
Id: string;
|
|
118
|
+
Name?: { value?: string | null } | null;
|
|
119
|
+
AnnualRevenue?: { value?: any | null } | null;
|
|
120
|
+
Industry?: { value?: any | null } | null;
|
|
121
|
+
Website?: { value?: any | null } | null;
|
|
122
|
+
} | null;
|
|
123
|
+
} | null> | null;
|
|
124
|
+
} | null;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
package/lib/templates/webapplication/reactbasic/src/api/utils/query/highRevenueAccountsQuery.graphql
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
query GetHighRevenueAccounts($minRevenue: Currency) {
|
|
2
|
+
uiapi {
|
|
3
|
+
query {
|
|
4
|
+
Account(
|
|
5
|
+
where: { AnnualRevenue: { gt: $minRevenue } }
|
|
6
|
+
orderBy: { AnnualRevenue: { order: DESC } }
|
|
7
|
+
first: 50
|
|
8
|
+
) {
|
|
9
|
+
edges {
|
|
10
|
+
node {
|
|
11
|
+
Id
|
|
12
|
+
Name {
|
|
13
|
+
value
|
|
14
|
+
}
|
|
15
|
+
AnnualRevenue {
|
|
16
|
+
value
|
|
17
|
+
}
|
|
18
|
+
Industry {
|
|
19
|
+
value
|
|
20
|
+
}
|
|
21
|
+
Website {
|
|
22
|
+
value
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createBrowserRouter, RouterProvider } from 'react-router';
|
|
2
2
|
import { routes } from '@/routes';
|
|
3
|
-
import { StrictMode } from 'react'
|
|
4
|
-
import { createRoot } from 'react-dom/client'
|
|
5
|
-
import './styles/global.css'
|
|
3
|
+
import { StrictMode } from 'react';
|
|
4
|
+
import { createRoot } from 'react-dom/client';
|
|
5
|
+
import './styles/global.css';
|
|
6
6
|
|
|
7
7
|
const router = createBrowserRouter(routes);
|
|
8
8
|
|
|
9
9
|
createRoot(document.getElementById('root')!).render(
|
|
10
10
|
<StrictMode>
|
|
11
11
|
<RouterProvider router={router} />
|
|
12
|
-
</StrictMode
|
|
13
|
-
)
|
|
12
|
+
</StrictMode>
|
|
13
|
+
);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
function About() {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
return (
|
|
3
|
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
|
|
4
|
+
<div className="text-center">
|
|
5
|
+
<h1 className="text-4xl font-bold text-gray-900 mb-4">About</h1>
|
|
6
|
+
<p className="text-lg text-gray-600">This is the about page.</p>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export default About;
|
|
12
|
+
export default About;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default function Home() {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
2
|
+
return (
|
|
3
|
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
|
|
4
|
+
<div className="text-center">
|
|
5
|
+
<h1 className="text-4xl font-bold text-gray-900 mb-4">Home</h1>
|
|
6
|
+
<p className="text-lg text-gray-600 mb-8">
|
|
7
|
+
Welcome to your React application.
|
|
8
|
+
</p>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { RouteObject } from
|
|
2
|
-
import AppLayout from
|
|
3
|
-
import Home from
|
|
4
|
-
import About from
|
|
1
|
+
import type { RouteObject } from 'react-router';
|
|
2
|
+
import AppLayout from '@/appLayout';
|
|
3
|
+
import Home from '@/pages/Home';
|
|
4
|
+
import About from './pages/About';
|
|
5
|
+
import NotFound from './pages/NotFound';
|
|
5
6
|
|
|
6
7
|
export const routes: RouteObject[] = [
|
|
7
8
|
{
|
|
@@ -11,13 +12,17 @@ export const routes: RouteObject[] = [
|
|
|
11
12
|
{
|
|
12
13
|
index: true,
|
|
13
14
|
element: <Home />,
|
|
14
|
-
handle: { showInNavigation: true, label: 'Home' }
|
|
15
|
+
handle: { showInNavigation: true, label: 'Home' },
|
|
15
16
|
},
|
|
16
17
|
{
|
|
17
18
|
path: 'about',
|
|
18
19
|
element: <About />,
|
|
19
|
-
handle: { showInNavigation: true, label: 'About' }
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
handle: { showInNavigation: true, label: 'About' },
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
path: '*',
|
|
24
|
+
element: <NotFound />,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<WebApplication xmlns="http://soap.sforce.com/2006/04/metadata">
|
|
3
|
-
<apiVersion><%= apiVersion %></apiVersion>
|
|
4
3
|
<masterLabel><%= masterLabel %></masterLabel>
|
|
5
4
|
<description>A Salesforce web application.</description>
|
|
6
|
-
<
|
|
5
|
+
<isActive>true</isActive>
|
|
6
|
+
<version>1</version>
|
|
7
7
|
</WebApplication>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/templates",
|
|
3
|
-
"version": "65.5.
|
|
3
|
+
"version": "65.5.2",
|
|
4
4
|
"description": "Salesforce JS library for templates",
|
|
5
5
|
"bugs": "https://github.com/forcedotcom/salesforcedx-templates/issues",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@salesforce/kit": "^3.2.4",
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
16
|
+
"@salesforce/webapp-template-base-react-app-experimental": "^1.3.5",
|
|
17
|
+
"@salesforce/webapp-template-base-web-app-experimental": "^1.3.5",
|
|
18
18
|
"ejs": "^3.1.10",
|
|
19
19
|
"got": "^11.8.6",
|
|
20
20
|
"hpagent": "^1.2.0",
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# React + TypeScript + Vite
|
|
2
|
-
|
|
3
|
-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
-
|
|
5
|
-
Currently, two official plugins are available:
|
|
6
|
-
|
|
7
|
-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
-
|
|
10
|
-
## React Compiler
|
|
11
|
-
|
|
12
|
-
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
-
|
|
14
|
-
## Expanding the ESLint configuration
|
|
15
|
-
|
|
16
|
-
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
-
|
|
18
|
-
```js
|
|
19
|
-
export default defineConfig([
|
|
20
|
-
globalIgnores(['dist']),
|
|
21
|
-
{
|
|
22
|
-
files: ['**/*.{ts,tsx}'],
|
|
23
|
-
extends: [
|
|
24
|
-
// Other configs...
|
|
25
|
-
|
|
26
|
-
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
-
tseslint.configs.recommendedTypeChecked,
|
|
28
|
-
// Alternatively, use this for stricter rules
|
|
29
|
-
tseslint.configs.strictTypeChecked,
|
|
30
|
-
// Optionally, add this for stylistic rules
|
|
31
|
-
tseslint.configs.stylisticTypeChecked,
|
|
32
|
-
|
|
33
|
-
// Other configs...
|
|
34
|
-
],
|
|
35
|
-
languageOptions: {
|
|
36
|
-
parserOptions: {
|
|
37
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
-
tsconfigRootDir: import.meta.dirname,
|
|
39
|
-
},
|
|
40
|
-
// other options...
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
])
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
-
|
|
48
|
-
```js
|
|
49
|
-
// eslint.config.js
|
|
50
|
-
import reactX from 'eslint-plugin-react-x'
|
|
51
|
-
import reactDom from 'eslint-plugin-react-dom'
|
|
52
|
-
|
|
53
|
-
export default defineConfig([
|
|
54
|
-
globalIgnores(['dist']),
|
|
55
|
-
{
|
|
56
|
-
files: ['**/*.{ts,tsx}'],
|
|
57
|
-
extends: [
|
|
58
|
-
// Other configs...
|
|
59
|
-
// Enable lint rules for React
|
|
60
|
-
reactX.configs['recommended-typescript'],
|
|
61
|
-
// Enable lint rules for React DOM
|
|
62
|
-
reactDom.configs.recommended,
|
|
63
|
-
],
|
|
64
|
-
languageOptions: {
|
|
65
|
-
parserOptions: {
|
|
66
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
-
tsconfigRootDir: import.meta.dirname,
|
|
68
|
-
},
|
|
69
|
-
// other options...
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
])
|
|
73
|
-
```
|