Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SObject support (Markdown subcommand) #198

Merged
merged 33 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8b405e9
Cleaning up dist after every build (#193)
cesarParra Oct 10, 2024
74abc09
Initial commit
cesarParra Oct 14, 2024
cd4de36
WIP
cesarParra Oct 15, 2024
d0ff5f8
Introducing object parsing
cesarParra Oct 16, 2024
0fca2eb
Merge branch 'develop' into markdown-sobjects
cesarParra Oct 17, 2024
abc3f6c
Removing duplicate function declaration
cesarParra Oct 17, 2024
f68946c
Refactoring into generics to avoid using "as"
cesarParra Oct 17, 2024
1c5906f
Refactoring to "bundle"
cesarParra Oct 17, 2024
445a8ae
Moving reflection code
cesarParra Oct 17, 2024
cde8329
Moving reflection code
cesarParra Oct 17, 2024
a151cd9
Refactorings
cesarParra Oct 17, 2024
ccd9c4e
When parsing SObject metadata -> the resulting type is sobject
cesarParra Oct 17, 2024
f118f5a
When parsing SObject metadata tests
cesarParra Oct 17, 2024
f336f37
Validating SObject metadata
cesarParra Oct 18, 2024
1d30788
Refactoring validation into FP
cesarParra Oct 18, 2024
6a7f2ae
Introducing @salesforce/source-deploy-retrieve as a dependency
cesarParra Oct 18, 2024
a4a6f94
Test refactoring
cesarParra Oct 18, 2024
dbde850
SObject renderable implementation
cesarParra Oct 19, 2024
b89f5c0
SObject template implementation
cesarParra Oct 19, 2024
f86ced6
SObject template implementation
cesarParra Oct 19, 2024
642df80
SObject template implementation
cesarParra Oct 19, 2024
29561b4
SObject template implementation
cesarParra Oct 19, 2024
677d183
SObject template implementation
cesarParra Oct 19, 2024
7d48749
Retrieving custom fields.
cesarParra Oct 19, 2024
d9b5323
Retrieving custom fields.
cesarParra Oct 19, 2024
12503cd
Rendering field data
cesarParra Oct 19, 2024
6c87063
Refactoring from "sobject" to "customobject"
cesarParra Oct 19, 2024
2791c8a
Vitepress sidebar improvements
cesarParra Oct 19, 2024
964e2c6
Improvements to how fields are rendered
cesarParra Oct 19, 2024
d602b31
Validating CustomField metadata
cesarParra Oct 20, 2024
83fc58c
Displaying type in the end result
cesarParra Oct 20, 2024
ee61c03
Sorting custom object fields
cesarParra Oct 20, 2024
4736c8e
Generating custom objects UTs
cesarParra Oct 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 12 additions & 26 deletions examples/vitepress/apexdocs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default {
}),
markdown: defineMarkdownConfig({
sourceDir: 'force-app',
includeMetadata: false,
scope: ['global', 'public', 'protected', 'private', 'namespaceaccessible'],
sortAlphabetically: true,
namespace: 'apexdocs',
Expand All @@ -50,36 +51,21 @@ export default {
},
excludeTags: ['internal'],
transformDocs: async (docs) => {
const apexOnlyDocs = docs.filter((doc) => doc.type !== 'customobject');
const objectOnlyDocs = docs.filter((doc) => doc.type === 'customobject');

// Update sidebar
const sidebar = [
{
text: 'API Reference',
items: [
{
text: 'Grouped By Type',
items: [
{
text: 'Classes',
items: docs.filter((doc) => doc.source.type === 'class').map(toSidebarLink),
},
{
text: 'Interfaces',
items: docs.filter((doc) => doc.source.type === 'interface').map(toSidebarLink),
},
{
text: 'Enums',
items: docs.filter((doc) => doc.source.type === 'enum').map(toSidebarLink),
},
],
},
{
text: 'Grouped by Group',
items: Array.from(extractGroups(docs)).map(([groupName, groupDocs]) => ({
text: groupName,
items: groupDocs.map(toSidebarLink),
})),
},
],
items: Array.from(extractGroups(apexOnlyDocs)).map(([groupName, groupDocs]) => ({
text: groupName,
items: groupDocs.map(toSidebarLink),
})),
},
{
text: 'Object Reference',
items: objectOnlyDocs.map(toSidebarLink),
},
];
await writeFileAsync('./docs/.vitepress/sidebar.json', JSON.stringify(sidebar, null, 2));
Expand Down
162 changes: 67 additions & 95 deletions examples/vitepress/docs/.vitepress/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,117 +3,89 @@
"text": "API Reference",
"items": [
{
"text": "Grouped By Type",
"text": "Miscellaneous",
"items": [
{
"text": "Classes",
"items": [
{
"text": "BaseClass",
"link": "miscellaneous/BaseClass.md"
},
{
"text": "MultiInheritanceClass",
"link": "miscellaneous/MultiInheritanceClass.md"
},
{
"text": "SampleClass",
"link": "samplegroup/SampleClass.md"
},
{
"text": "SampleException",
"link": "miscellaneous/SampleException.md"
},
{
"text": "Url",
"link": "miscellaneous/Url.md"
}
]
"text": "BaseClass",
"link": "miscellaneous/BaseClass.md"
},
{
"text": "Interfaces",
"items": [
{
"text": "ParentInterface",
"link": "miscellaneous/ParentInterface.md"
},
{
"text": "SampleInterface",
"link": "miscellaneous/SampleInterface.md"
}
]
"text": "MultiInheritanceClass",
"link": "miscellaneous/MultiInheritanceClass.md"
},
{
"text": "Enums",
"items": [
{
"text": "ReferencedEnum",
"link": "miscellaneous/ReferencedEnum.md"
},
{
"text": "SampleEnum",
"link": "sample-enums/SampleEnum.md"
}
]
"text": "ParentInterface",
"link": "miscellaneous/ParentInterface.md"
},
{
"text": "ReferencedEnum",
"link": "miscellaneous/ReferencedEnum.md"
},
{
"text": "SampleException",
"link": "miscellaneous/SampleException.md"
},
{
"text": "SampleInterface",
"link": "miscellaneous/SampleInterface.md"
},
{
"text": "Url",
"link": "miscellaneous/Url.md"
}
]
},
{
"text": "Grouped by Group",
"text": "SampleGroup",
"items": [
{
"text": "Miscellaneous",
"items": [
{
"text": "BaseClass",
"link": "miscellaneous/BaseClass.md"
},
{
"text": "MultiInheritanceClass",
"link": "miscellaneous/MultiInheritanceClass.md"
},
{
"text": "ParentInterface",
"link": "miscellaneous/ParentInterface.md"
},
{
"text": "ReferencedEnum",
"link": "miscellaneous/ReferencedEnum.md"
},
{
"text": "SampleException",
"link": "miscellaneous/SampleException.md"
},
{
"text": "SampleInterface",
"link": "miscellaneous/SampleInterface.md"
},
{
"text": "Url",
"link": "miscellaneous/Url.md"
}
]
},
{
"text": "SampleGroup",
"items": [
{
"text": "SampleClass",
"link": "samplegroup/SampleClass.md"
}
]
},
"text": "SampleClass",
"link": "samplegroup/SampleClass.md"
}
]
},
{
"text": "Sample Enums",
"items": [
{
"text": "Sample Enums",
"items": [
{
"text": "SampleEnum",
"link": "sample-enums/SampleEnum.md"
}
]
"text": "SampleEnum",
"link": "sample-enums/SampleEnum.md"
}
]
}
]
},
{
"text": "Object Reference",
"items": [
{
"text": "Event__c",
"link": "custom-objects/Event__c.md"
},
{
"text": "Price_Component__c",
"link": "custom-objects/Price_Component__c.md"
},
{
"text": "Product__c",
"link": "custom-objects/Product__c.md"
},
{
"text": "Product_Price_Component__c",
"link": "custom-objects/Product_Price_Component__c.md"
},
{
"text": "Sales_Order__c",
"link": "custom-objects/Sales_Order__c.md"
},
{
"text": "Sales_Order_Line__c",
"link": "custom-objects/Sales_Order_Line__c.md"
},
{
"text": "Speaker__c",
"link": "custom-objects/Speaker__c.md"
}
]
}
]
65 changes: 65 additions & 0 deletions examples/vitepress/docs/custom-objects/Event__c.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: Event__c
---

# Event

Represents an event that people can register for.

## API Name
`apexdocs__Event__c`

## Fields
### Description

**API Name**

`apexdocs__Description__c`

**Type**

*LongTextArea*

---
### End Date

**API Name**

`apexdocs__End_Date__c`

**Type**

*Date*

---
### Location

**API Name**

`apexdocs__Location__c`

**Type**

*Location*

---
### Start Date

**API Name**

`apexdocs__Start_Date__c`

**Type**

*Date*

---
### Tag Line

**API Name**

`apexdocs__Tag_Line__c`

**Type**

*Text*
69 changes: 69 additions & 0 deletions examples/vitepress/docs/custom-objects/Price_Component__c.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: Price_Component__c
---

# Price Component

## API Name
`apexdocs__Price_Component__c`

## Fields
### Description

**API Name**

`apexdocs__Description__c`

**Type**

*Text*

---
### Expression

The Expression that determines if this price should take effect or not.

**API Name**

`apexdocs__Expression__c`

**Type**

*LongTextArea*

---
### Percent

Use this field to calculate the price based on the list price's percentage instead of providing a flat price.

**API Name**

`apexdocs__Percent__c`

**Type**

*Percent*

---
### Price

Use this when the Price Component represents a Flat Price. To represent a Percentage use the Percent field.

**API Name**

`apexdocs__Price__c`

**Type**

*Currency*

---
### Type

**API Name**

`apexdocs__Type__c`

**Type**

*Picklist*
Loading
Loading