spine-framework 0.3.67 → 0.3.68
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.
|
@@ -246,6 +246,8 @@ async function seedApp(appDir: string, appSlug: string) {
|
|
|
246
246
|
app_type: 'custom',
|
|
247
247
|
source: 'npm',
|
|
248
248
|
is_active: true,
|
|
249
|
+
route_prefix: manifest.route_prefix ?? ('/' + appSlug),
|
|
250
|
+
renderer: manifest.renderer ?? 'custom',
|
|
249
251
|
},
|
|
250
252
|
{ onConflict: 'slug' }
|
|
251
253
|
)
|
|
@@ -243,18 +243,21 @@ export function RegisterPage() {
|
|
|
243
243
|
// Determine role and account strategy from URL params or config
|
|
244
244
|
const urlRole = searchParams.get('role')
|
|
245
245
|
const urlApp = searchParams.get('app')
|
|
246
|
+
|
|
247
|
+
// Resolve which app config to use: URL param → default_app → none
|
|
248
|
+
const effectiveApp = urlApp || regConfig?.default_app
|
|
246
249
|
|
|
247
250
|
let effectiveRole = regConfig?.default_role || 'member'
|
|
248
251
|
let effectiveAccountStrategy: 'existing' | 'new' | 'choice' = 'new'
|
|
249
252
|
let targetAccount: string | undefined
|
|
250
253
|
|
|
251
|
-
// If app is
|
|
252
|
-
if (
|
|
253
|
-
const appConfig = regConfig.apps[
|
|
254
|
+
// If an app config is found (via URL param or default_app), apply it
|
|
255
|
+
if (effectiveApp && regConfig?.apps[effectiveApp]) {
|
|
256
|
+
const appConfig = regConfig.apps[effectiveApp]
|
|
254
257
|
|
|
255
|
-
console.log('App config found:', appConfig)
|
|
258
|
+
console.log('App config found:', { app: effectiveApp, appConfig })
|
|
256
259
|
|
|
257
|
-
// Determine role
|
|
260
|
+
// Determine role: URL param (if valid for this app) → app default → config default
|
|
258
261
|
if (urlRole && appConfig.roles.includes(urlRole)) {
|
|
259
262
|
effectiveRole = urlRole
|
|
260
263
|
} else {
|
package/package.json
CHANGED
|
@@ -42,13 +42,33 @@ fi
|
|
|
42
42
|
|
|
43
43
|
# 3. Overlay custom functions (overrides + additions), excluding test files
|
|
44
44
|
CUSTOM_COUNT=0
|
|
45
|
+
|
|
46
|
+
# 3a. Copy functions from custom/functions/
|
|
45
47
|
if [ -d "$CUSTOM_DIR/functions" ]; then
|
|
46
48
|
# Copy all files except test files (*-test.ts, *.test.ts)
|
|
47
49
|
find "$CUSTOM_DIR/functions" -maxdepth 1 -name '*.ts' ! -name '*-test.ts' ! -name '*.test.ts' -exec cp {} "$TMP_DIR"/ \; 2>/dev/null || true
|
|
48
50
|
# Copy subdirectories if any
|
|
49
51
|
find "$CUSTOM_DIR/functions" -mindepth 1 -type d -exec sh -c 'dir="$1"; base=$(basename "$dir"); mkdir -p "'"$TMP_DIR"'/$base" && cp -r "$dir"/* "'"$TMP_DIR"'/$base/"' _ {} \; 2>/dev/null || true
|
|
50
|
-
CUSTOM_COUNT=$(find "$CUSTOM_DIR/functions" -name '*.ts' ! -name '*-test.ts' ! -name '*.test.ts' 2>/dev/null | wc -l | tr -d ' ')
|
|
51
|
-
|
|
52
|
+
CUSTOM_COUNT=$((CUSTOM_COUNT + $(find "$CUSTOM_DIR/functions" -name '*.ts' ! -name '*-test.ts' ! -name '*.test.ts' 2>/dev/null | wc -l | tr -d ' ')))
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
# 3b. Copy functions from custom/apps/*/functions/
|
|
56
|
+
if [ -d "$CUSTOM_DIR/apps" ]; then
|
|
57
|
+
for app_dir in "$CUSTOM_DIR/apps"/*; do
|
|
58
|
+
if [ -d "$app_dir/functions" ]; then
|
|
59
|
+
# Copy all files except test files (*-test.ts, *.test.ts)
|
|
60
|
+
find "$app_dir/functions" -maxdepth 1 -name '*.ts' ! -name '*-test.ts' ! -name '*.test.ts' -exec cp {} "$TMP_DIR"/ \; 2>/dev/null || true
|
|
61
|
+
# Copy subdirectories if any
|
|
62
|
+
find "$app_dir/functions" -mindepth 1 -type d -exec sh -c 'dir="$1"; base=$(basename "$dir"); mkdir -p "'"$TMP_DIR"'/$base" && cp -r "$dir"/* "'"$TMP_DIR"'/$base/"' _ {} \; 2>/dev/null || true
|
|
63
|
+
APP_COUNT=$(find "$app_dir/functions" -name '*.ts' ! -name '*-test.ts' ! -name '*.test.ts' 2>/dev/null | wc -l | tr -d ' ')
|
|
64
|
+
CUSTOM_COUNT=$((CUSTOM_COUNT + APP_COUNT))
|
|
65
|
+
echo " ✓ $(basename "$app_dir"): $APP_COUNT files"
|
|
66
|
+
fi
|
|
67
|
+
done
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
if [ $CUSTOM_COUNT -gt 0 ]; then
|
|
71
|
+
echo " ✓ Custom: $CUSTOM_COUNT total files"
|
|
52
72
|
else
|
|
53
73
|
echo " ○ Custom: (empty)"
|
|
54
74
|
fi
|