Skip to content

Commit 1d88974

Browse files
chore: remove kebab case conversion in workflow script
1 parent 78d78bc commit 1d88974

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

.github/scripts/aggregate-passport-metadata.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,12 @@ const processFeatureGroups = (featureGroupDirs) => {
6767
const groupName = path.basename(groupDir);
6868
console.log(`Processing feature group: ${groupName}`);
6969

70-
// Check if this group exists in features.json
71-
if (!featureGroups[groupName]) {
70+
// Check if this group exists in features.json (case-insensitive)
71+
const matchingGroup = Object.keys(featureGroups).find(
72+
key => key.toLowerCase() === groupName.toLowerCase()
73+
);
74+
75+
if (!matchingGroup) {
7276
console.warn(`Feature group ${groupName} not found in features.json, skipping`);
7377
return;
7478
}
@@ -84,15 +88,11 @@ const processFeatureGroups = (featureGroupDirs) => {
8488
const tutorialPath = path.join(groupDir, 'tutorial.md');
8589
const tutorialExists = fs.existsSync(tutorialPath);
8690

87-
// Create the feature key (kebab-case)
88-
const featureKey = groupName
89-
.replace(/([a-z])([A-Z])/g, '$1-$2')
90-
.replace(/\s+/g, '-')
91-
.replace(/[^a-z0-9-]/gi, '')
92-
.toLowerCase();
91+
// Use the folder name directly as the feature key
92+
const featureKey = groupName;
9393

9494
if (!featureKey) {
95-
console.warn(`Generated empty feature key for ${groupName}, skipping`);
95+
console.warn(`Generated empty feature key for ${groupDir}, skipping`);
9696
return;
9797
}
9898

@@ -108,13 +108,13 @@ const processFeatureGroups = (featureGroupDirs) => {
108108
const metadata = JSON.parse(metadataContent);
109109

110110
// Add additional fields
111-
metadata.title = metadata.title || groupName;
111+
metadata.title = metadata.title || matchingGroup;
112112
metadata.sidebar_order = metadata.sidebar_order || 0;
113113
metadata.deprecated = metadata.deprecated || false;
114114

115115
// Add feature group information
116-
metadata.feature_group = groupName;
117-
metadata.features = Object.keys(featureGroups[groupName] || {});
116+
metadata.feature_group = matchingGroup;
117+
metadata.features = Object.keys(featureGroups[matchingGroup] || {});
118118

119119
// Create the feature entry
120120
featuresObject[featureKey] = {

.github/scripts/process-passport-tutorials.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ else
4040
if [ -f "${TUTORIAL_FILE}" ]; then
4141
echo "Found tutorial for ${GROUP_NAME}"
4242

43-
# Convert feature group name to kebab-case for the destination filename
44-
KEBAB_NAME=$(echo "${GROUP_NAME}" | sed -E 's/([a-z])([A-Z])/\1-\2/g' | tr '[:upper:]' '[:lower:]')
43+
# Use the folder name directly for the destination filename
44+
OUTPUT_FILENAME="${GROUP_NAME}.md"
4545

4646
# Copy the tutorial file
47-
cp "${TUTORIAL_FILE}" "${DOCS_TUTORIALS_DIR}/${KEBAB_NAME}.md"
48-
echo "Copied ${TUTORIAL_FILE} to ${DOCS_TUTORIALS_DIR}/${KEBAB_NAME}.md"
47+
cp "${TUTORIAL_FILE}" "${DOCS_TUTORIALS_DIR}/${OUTPUT_FILENAME}"
48+
echo "Copied ${TUTORIAL_FILE} to ${DOCS_TUTORIALS_DIR}/${OUTPUT_FILENAME}"
4949
else
5050
echo "Warning: No tutorial.md found for feature group ${GROUP_NAME}"
5151
fi

sample/Assets/Scripts/Passport/_tutorials/SetCallTimeout/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The Set Call Timeout feature allows developers to configure the timeout duration
1616

1717
### Feature: SetCallTimeout
1818

19-
The Set Call Timeout feature provides a simple way to adjust the timeout duration for network calls made through the Passport SDK. When making API calls to blockchain networks or authentication services, network latency can sometimes cause delays. This feature gives developers control over how long their application should wait before considering a request as failed due to timeout
19+
The Set Call Timeout feature provides a simple way to adjust the timeout duration for network calls made through the Passport SDK. When making API calls to blockchain networks or authentication services, network latency can sometimes cause delays. This feature gives developers control over how long their application should wait before considering a request as failed due to timeout.
2020

2121
```csharp title="SetCallTimeoutScript" manualLink="https://github.com/immutable/unity-immutable-sdk/blob/main/sample/Assets/Scripts/Passport/Other/SetCallTimeout/SetCallTimeoutScript.cs"
2222
using UnityEngine;

0 commit comments

Comments
 (0)