Skip to content

Commit beff1ea

Browse files
feat: introducing 31 new react sdk samples (#58)
* feat: introducing 31 react sdk samples * fix: removed old references of mock-data * chore: bump version 1.1.2 to ul-context-inspector, workflow unbuntu * chore: stable version acul sdk integration * chore: package upgrade and ubuntu fix
1 parent 0e250b6 commit beff1ea

File tree

601 files changed

+35622
-4753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

601 files changed

+35622
-4753
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Validate Auth0 ACUL Manifest'
2+
description: 'Validates manifest.json structure and file integrity for Auth0 ACUL samples'
3+
author: 'Auth0 ACUL Team'
4+
5+
inputs:
6+
manifest-path:
7+
description: 'Path to manifest.json file'
8+
required: false
9+
default: './manifest.json'
10+
strict-mode:
11+
description: 'Enable strict validation mode'
12+
required: false
13+
default: 'true'
14+
15+
outputs:
16+
result:
17+
description: 'Validation result (success/failure)'
18+
errors:
19+
description: 'Number of validation errors'
20+
warnings:
21+
description: 'Number of validation warnings'
22+
23+
runs:
24+
using: 'composite'
25+
steps:
26+
- name: Run manifest validation
27+
shell: bash
28+
run: ${{ github.action_path }}/validate.sh
29+
env:
30+
MANIFEST_PATH: ${{ inputs.manifest-path }}
31+
STRICT_MODE: ${{ inputs.strict-mode }}
32+
33+
branding:
34+
icon: 'check-circle'
35+
color: 'green'
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
#!/bin/bash
2+
3+
#############################################
4+
# Auth0 ACUL Manifest Validator
5+
# Clean, readable validation script
6+
#############################################
7+
8+
set -e
9+
10+
# Default values
11+
MANIFEST_PATH="${MANIFEST_PATH:-./manifest.json}"
12+
13+
# Colors for output
14+
RED='\033[0;31m'
15+
GREEN='\033[0;32m'
16+
YELLOW='\033[1;33m'
17+
BLUE='\033[0;34m'
18+
NC='\033[0m' # No Color
19+
20+
# Counters
21+
ERRORS=0
22+
23+
echo -e "${BLUE}🔍 Auth0 ACUL Manifest Validation${NC}"
24+
echo "=================================="
25+
echo "Manifest: $MANIFEST_PATH"
26+
echo ""
27+
28+
#############################################
29+
# BASIC CHECKS
30+
#############################################
31+
32+
echo -e "${BLUE}📋 Running basic checks...${NC}"
33+
34+
# Check if manifest exists
35+
if [ ! -f "$MANIFEST_PATH" ]; then
36+
echo -e "${RED}❌ Manifest file not found: $MANIFEST_PATH${NC}"
37+
exit 1
38+
fi
39+
40+
# Validate JSON syntax
41+
if ! node -e "JSON.parse(require('fs').readFileSync('$MANIFEST_PATH', 'utf8'))" 2>/dev/null; then
42+
echo -e "${RED}❌ Invalid JSON in manifest file${NC}"
43+
exit 1
44+
fi
45+
46+
echo -e "${GREEN}✅ Basic checks passed${NC}"
47+
48+
#############################################
49+
# MANIFEST VALIDATION
50+
#############################################
51+
52+
echo ""
53+
echo -e "${BLUE}📋 Validating manifest structure...${NC}"
54+
55+
# Validate required top-level properties
56+
if ! node -e "
57+
const manifest = JSON.parse(require('fs').readFileSync('$MANIFEST_PATH', 'utf8'));
58+
if (!manifest.templates) throw new Error('Missing templates property');
59+
if (!manifest.metadata) throw new Error('Missing metadata property');
60+
console.log('✅ Required properties found');
61+
" 2>/dev/null; then
62+
echo -e "${RED}❌ Missing required properties (templates, metadata)${NC}"
63+
ERRORS=$((ERRORS + 1))
64+
RESULT="failure"
65+
else
66+
echo -e "${GREEN}✅ Required properties validated${NC}"
67+
fi
68+
69+
# Check for unregistered template directories
70+
echo -e "${BLUE}📁 Checking for unregistered templates...${NC}"
71+
72+
node -e "
73+
const fs = require('fs');
74+
const manifest = JSON.parse(fs.readFileSync('$MANIFEST_PATH', 'utf8'));
75+
76+
// Discover template directories
77+
const templateDirs = [];
78+
const entries = fs.readdirSync('.', { withFileTypes: true });
79+
80+
for (const entry of entries) {
81+
if (entry.isDirectory() &&
82+
!entry.name.startsWith('.') &&
83+
!['node_modules', 'scripts', 'dist'].includes(entry.name)) {
84+
85+
// Check if it looks like a template
86+
if (fs.existsSync(entry.name + '/package.json') ||
87+
fs.existsSync(entry.name + '/src')) {
88+
templateDirs.push(entry.name);
89+
}
90+
}
91+
}
92+
93+
const manifestTemplates = Object.keys(manifest.templates);
94+
const unregisteredTemplates = templateDirs.filter(dir => !manifestTemplates.includes(dir));
95+
96+
if (unregisteredTemplates.length > 0) {
97+
console.log(\`❌ Unregistered template directories found: \${unregisteredTemplates.join(', ')}\`);
98+
console.log(\` Please add these templates to manifest.json or remove them\`);
99+
process.exit(1);
100+
} else {
101+
console.log('✅ All template directories are registered');
102+
}
103+
" 2>/dev/null
104+
105+
TEMPLATE_CHECK_EXIT_CODE=$?
106+
if [ $TEMPLATE_CHECK_EXIT_CODE -ne 0 ]; then
107+
echo -e "${RED}❌ Template directory validation failed${NC}"
108+
RESULT="failure"
109+
ERRORS=$((ERRORS + 1))
110+
else
111+
echo -e "${GREEN}✅ Template directory validation passed${NC}"
112+
fi
113+
114+
# Validate templates structure
115+
echo -e "${BLUE}🔧 Validating templates...${NC}"
116+
117+
node -e "
118+
const fs = require('fs');
119+
const path = require('path');
120+
const manifest = JSON.parse(fs.readFileSync('$MANIFEST_PATH', 'utf8'));
121+
122+
let errors = 0;
123+
124+
for (const [templateId, template] of Object.entries(manifest.templates)) {
125+
console.log(\` Checking template: \${templateId}\`);
126+
127+
// Check required fields
128+
const required = ['name', 'description', 'framework', 'sdk'];
129+
for (const field of required) {
130+
if (!template[field]) {
131+
console.log(\`❌ Template \${templateId} missing \${field}\`);
132+
errors++;
133+
}
134+
}
135+
136+
// Skip file validation for coming-soon templates
137+
if (template.status === 'coming-soon') {
138+
console.log(\` ⏳ Skipping file validation for coming-soon template\`);
139+
continue;
140+
}
141+
142+
// Validate base files exist (prepend template directory)
143+
if (template.base_files) {
144+
for (const filePath of template.base_files) {
145+
const fullPath = path.join(templateId, filePath);
146+
if (!fs.existsSync(fullPath)) {
147+
console.log(\`❌ Base file not found: \${fullPath}\`);
148+
errors++;
149+
}
150+
}
151+
}
152+
153+
// Validate base directories (prepend template directory)
154+
if (template.base_directories) {
155+
for (const dirPath of template.base_directories) {
156+
const fullPath = path.join(templateId, dirPath);
157+
if (!fs.existsSync(fullPath)) {
158+
console.log(\`❌ Base directory not found: \${fullPath}\`);
159+
errors++;
160+
} else if (!fs.statSync(fullPath).isDirectory()) {
161+
console.log(\`❌ Base directory is not a directory: \${fullPath}\`);
162+
errors++;
163+
}
164+
}
165+
}
166+
167+
// Validate screens
168+
if (template.screens) {
169+
// Check for duplicate screen IDs
170+
const screenIds = template.screens.map(s => s.id).filter(Boolean);
171+
const duplicateIds = screenIds.filter((id, index) => screenIds.indexOf(id) !== index);
172+
if (duplicateIds.length > 0) {
173+
console.log(\`❌ Duplicate screen IDs found in \${templateId}: \${[...new Set(duplicateIds)].join(', ')}\`);
174+
errors++;
175+
}
176+
177+
for (const screen of template.screens) {
178+
if (!screen.id || !screen.name || !screen.path) {
179+
console.log(\`❌ Screen missing required fields (id, name, path)\`);
180+
errors++;
181+
continue;
182+
}
183+
184+
// Prepend template directory to screen path
185+
const fullScreenPath = path.join(templateId, screen.path);
186+
if (!fs.existsSync(fullScreenPath)) {
187+
console.log(\`❌ Screen path not found: \${fullScreenPath}\`);
188+
errors++;
189+
continue;
190+
}
191+
}
192+
}
193+
194+
// Check for unregistered screens in file system
195+
const screensPath = path.join(templateId, 'src', 'screens');
196+
if (fs.existsSync(screensPath)) {
197+
const actualScreens = fs.readdirSync(screensPath, { withFileTypes: true })
198+
.filter(dirent => dirent.isDirectory())
199+
.map(dirent => dirent.name);
200+
201+
const manifestScreens = (template.screens || []).map(s => s.id);
202+
const unregisteredScreens = actualScreens.filter(screen => !manifestScreens.includes(screen));
203+
204+
if (unregisteredScreens.length > 0) {
205+
console.log(\`❌ Unregistered screens found in \${templateId}: \${unregisteredScreens.join(', ')}\`);
206+
console.log(\` Please add these screens to manifest.json or remove them\`);
207+
errors++;
208+
}
209+
}
210+
}
211+
212+
console.log(\`Validation complete: \${errors} errors\`);
213+
process.exit(errors > 0 ? 1 : 0);
214+
" 2>/dev/null
215+
216+
VALIDATION_EXIT_CODE=$?
217+
if [ $VALIDATION_EXIT_CODE -eq 0 ]; then
218+
echo -e "${GREEN}✅ Template validation passed${NC}"
219+
RESULT="success"
220+
else
221+
echo -e "${RED}❌ Template validation failed${NC}"
222+
RESULT="failure"
223+
ERRORS=$((ERRORS + 1))
224+
fi
225+
226+
#############################################
227+
# SUMMARY
228+
#############################################
229+
230+
echo ""
231+
echo -e "${BLUE}📊 Validation Summary${NC}"
232+
echo "===================="
233+
echo "Result: $RESULT"
234+
echo "Errors: $ERRORS"
235+
236+
# Set GitHub Actions outputs
237+
if [ -n "$GITHUB_OUTPUT" ]; then
238+
echo "result=$RESULT" >> "$GITHUB_OUTPUT"
239+
echo "errors=$ERRORS" >> "$GITHUB_OUTPUT"
240+
fi
241+
242+
# Exit with appropriate code
243+
if [ "$RESULT" = "failure" ]; then
244+
exit 1
245+
else
246+
exit 0
247+
fi

.github/config/deploy_config.yml

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)