-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds a new metadata bundle type for AppFrameworkTemplates (#1442)
* feat(appFrameworkTemplateBundle): add support for appFrameworkTemplateBundle to sdr * feat(appFrameworkTemplateBundle): add empty obj layout.json files * feat(appFrameworkTemplateBundle): add straight empty layout.json files * feat(appFrameworkTemplateBundle): trying to fix the layout.json test failures * feat(appFrameworkTemplateBundle): {} layout.json * feat(appFrameworkTemplateBundle): {} with another line layout.json * feat(appFrameworkTemplateBundle): update type to string, string[] instead of | string[]
- Loading branch information
Showing
13 changed files
with
845 additions
and
647 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ppTemplates/__snapshots__/verify-md-files.expected/appTemplates/test_template/layout.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
11 changes: 11 additions & 0 deletions
11
...ates/__snapshots__/verify-md-files.expected/appTemplates/test_template/template-info.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"templateType": "App", | ||
"label": "my test template", | ||
"name": "test_template", | ||
"namespace": null, | ||
"assetVersion": 63.0, | ||
"maxAppCount": null, | ||
"layoutDefinition": "layout.json", | ||
"tags": {}, | ||
"chainDefinitions": [] | ||
} |
8 changes: 8 additions & 0 deletions
8
test/snapshot/sampleProjects/appTemplates/__snapshots__/verify-md-files.expected/package.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<types> | ||
<members>force-app</members> | ||
<name>AppFrameworkTemplateBundle</name> | ||
</types> | ||
<version>62.0</version> | ||
</Package> |
1 change: 1 addition & 0 deletions
1
...erify-source-files.expected/force-app/main/default/appTemplates/test_template/layout.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
11 changes: 11 additions & 0 deletions
11
...ource-files.expected/force-app/main/default/appTemplates/test_template/template-info.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"templateType": "App", | ||
"label": "my test template", | ||
"name": "test_template", | ||
"namespace": null, | ||
"assetVersion": 63.0, | ||
"maxAppCount": null, | ||
"layoutDefinition": "layout.json", | ||
"tags": {}, | ||
"chainDefinitions": [] | ||
} |
1 change: 1 addition & 0 deletions
1
...snapshot/sampleProjects/appTemplates/originalMdapi/appTemplates/test_template/layout.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
11 changes: 11 additions & 0 deletions
11
...t/sampleProjects/appTemplates/originalMdapi/appTemplates/test_template/template-info.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"templateType": "App", | ||
"label": "my test template", | ||
"name": "test_template", | ||
"namespace": null, | ||
"assetVersion": 63.0, | ||
"maxAppCount": null, | ||
"layoutDefinition": "layout.json", | ||
"tags": {}, | ||
"chainDefinitions": [] | ||
} |
11 changes: 11 additions & 0 deletions
11
test/snapshot/sampleProjects/appTemplates/sfdx-project.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"packageDirectories": [ | ||
{ | ||
"default": true, | ||
"path": "force-app" | ||
} | ||
], | ||
"name": "appTemplatesTestProject", | ||
"namespace": "", | ||
"sourceApiVersion": "62.0" | ||
} |
53 changes: 53 additions & 0 deletions
53
test/snapshot/sampleProjects/appTemplates/snapshots.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
import * as fs from 'node:fs'; | ||
import * as path from 'node:path'; | ||
import { | ||
FORCE_APP, | ||
MDAPI_OUT, | ||
dirsAreIdentical, | ||
fileSnap, | ||
mdapiToSource, | ||
sourceToMdapi, | ||
} from '../../helper/conversions'; | ||
|
||
// we don't want failing tests outputting over each other | ||
/* eslint-disable no-await-in-loop */ | ||
|
||
describe('appTemplates', () => { | ||
const testDir = path.join('test', 'snapshot', 'sampleProjects', 'appTemplates'); | ||
let sourceFiles: string[]; | ||
let mdFiles: string[]; | ||
|
||
before(async () => { | ||
sourceFiles = await mdapiToSource(testDir); | ||
mdFiles = await sourceToMdapi(testDir); | ||
}); | ||
|
||
it('verify source files', async () => { | ||
for (const file of sourceFiles) { | ||
await fileSnap(file, testDir); | ||
} | ||
dirsAreIdentical( | ||
path.join(testDir, FORCE_APP), | ||
path.join(testDir, '__snapshots__', 'verify-source-files.expected', FORCE_APP) | ||
); | ||
}); | ||
|
||
it('verify md files', async () => { | ||
for (const file of mdFiles) { | ||
await fileSnap(file, testDir); | ||
} | ||
}); | ||
|
||
after(async () => { | ||
await Promise.all([ | ||
fs.promises.rm(path.join(testDir, FORCE_APP), { recursive: true, force: true }), | ||
fs.promises.rm(path.join(testDir, MDAPI_OUT), { recursive: true, force: true }), | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters