spine-framework 0.3.67 → 0.3.69
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,10 @@ 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',
|
|
251
|
+
// min_role: first entry of required_roles array, or explicit min_role field
|
|
252
|
+
min_role: manifest.required_roles?.[0] ?? manifest.min_role ?? null,
|
|
249
253
|
},
|
|
250
254
|
{ onConflict: 'slug' }
|
|
251
255
|
)
|
|
@@ -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 {
|
|
@@ -297,10 +300,12 @@ export function RegisterPage() {
|
|
|
297
300
|
}
|
|
298
301
|
|
|
299
302
|
// Handle account creation vs existing account assignment
|
|
303
|
+
// IMPORTANT: use effectiveAccountStrategy (local var), NOT accountStrategy (React state)
|
|
304
|
+
// React state updates are async — accountStrategy may still hold the previous value here
|
|
300
305
|
let registrationResult
|
|
301
|
-
console.log('Registration decision:', {
|
|
306
|
+
console.log('Registration decision:', { effectiveAccountStrategy, targetAccount, effectiveRole })
|
|
302
307
|
|
|
303
|
-
if (
|
|
308
|
+
if (effectiveAccountStrategy === 'existing' && targetAccount) {
|
|
304
309
|
// Assign to existing account
|
|
305
310
|
console.log('Using existing_account path')
|
|
306
311
|
registrationResult = await callInvitesApi('complete-registration', {
|
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
|