Skip to content

Commit 7049ab1

Browse files
committed
chore: wip
1 parent 799caec commit 7049ab1

File tree

7 files changed

+25
-51
lines changed

7 files changed

+25
-51
lines changed

docs/advanced/php-configuration.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ services: {
2323
version: '8.4.11',
2424
autoDetect: {
2525
enabled: true,
26-
preferredDatabase: 'auto',
2726
includeAllDatabases: false,
2827
includeEnterprise: false,
2928
},
@@ -137,7 +136,6 @@ services: {
137136
strategy: 'auto-detect',
138137
autoDetect: {
139138
enabled: true,
140-
preferredDatabase: 'auto',
141139
includeAllDatabases: false,
142140
includeEnterprise: false,
143141
},
@@ -231,7 +229,6 @@ services: {
231229
strategy: 'auto-detect',
232230
autoDetect: {
233231
enabled: true,
234-
preferredDatabase: 'auto',
235232
},
236233
},
237234
}

packages/launchpad/launchpad.config.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,43 +69,35 @@ export const defaultConfig: LaunchpadConfig = {
6969
version: '8.4.11',
7070
},
7171
frameworks: {
72-
enabled: true,
73-
preferredDatabase: 'postgres',
7472
laravel: {
75-
enabled: true,
76-
autoDetect: true,
7773
postSetupCommands: {
7874
enabled: true,
7975
commands: [
8076
{
8177
name: 'migrate',
8278
command: 'php artisan migrate',
8379
description: 'Run database migrations',
84-
condition: 'hasUnrunMigrations',
8580
runInBackground: false,
8681
required: false,
8782
},
8883
{
8984
name: 'seed',
9085
command: 'php artisan db:seed',
9186
description: 'Seed the database with sample data',
92-
condition: 'hasSeeders',
9387
runInBackground: false,
9488
required: false,
9589
},
9690
{
9791
name: 'storage-link',
9892
command: 'php artisan storage:link',
9993
description: 'Create symbolic link for storage',
100-
condition: 'needsStorageLink',
10194
runInBackground: false,
10295
required: false,
10396
},
10497
{
10598
name: 'optimize',
10699
command: 'php artisan optimize',
107100
description: 'Optimize Laravel for production',
108-
condition: 'isProduction',
109101
runInBackground: false,
110102
required: false,
111103
},

packages/launchpad/src/binary-downloader.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ export class PrecompiledBinaryDownloader {
163163
const phpConfig = config.services?.php
164164

165165
// Use manual configuration if specified
166-
if (phpConfig?.manual?.configuration) {
166+
if (phpConfig?.configuration) {
167167
if (config.verbose) {
168-
console.log(`🔧 Using manual configuration: ${phpConfig.manual.configuration}`)
168+
console.log(`🔧 Using manual configuration: ${phpConfig.configuration}`)
169169
}
170-
return phpConfig.manual.configuration
170+
return phpConfig.configuration
171171
}
172172

173173
// Use auto-detection if enabled

packages/launchpad/src/config.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export const defaultConfig: LaunchpadConfig = {
6565
},
6666
frameworks: {
6767
enabled: process.env.LAUNCHPAD_FRAMEWORKS_ENABLED !== 'false',
68-
preferredDatabase: (process.env.LAUNCHPAD_PREFERRED_DATABASE as 'postgres' | 'sqlite') || 'postgres',
6968
laravel: {
7069
enabled: process.env.LAUNCHPAD_LARAVEL_ENABLED !== 'false',
7170
autoDetect: process.env.LAUNCHPAD_LARAVEL_AUTO_DETECT !== 'false',
@@ -119,14 +118,11 @@ export const defaultConfig: LaunchpadConfig = {
119118
// Smart auto-detection based on project analysis
120119
autoDetect: {
121120
enabled: process.env.LAUNCHPAD_PHP_AUTO_DETECT !== 'false',
122-
preferredDatabase: (process.env.LAUNCHPAD_PREFERRED_DATABASE as 'mysql' | 'postgres' | 'sqlite') || 'auto',
123121
includeAllDatabases: process.env.LAUNCHPAD_PHP_ALL_DATABASES === 'true',
124122
includeEnterprise: process.env.LAUNCHPAD_PHP_ENTERPRISE === 'true',
125123
},
126-
// Manual configuration (when auto-detect is disabled)
127-
manual: {
128-
configuration: (process.env.LAUNCHPAD_PHP_CONFIGURATION as 'laravel-mysql' | 'laravel-postgres' | 'laravel-sqlite' | 'api-only' | 'enterprise' | 'wordpress' | 'full-stack') || 'full-stack',
129-
},
124+
// configuration (when auto-detect is disabled)
125+
configuration: (process.env.LAUNCHPAD_PHP_CONFIGURATION as 'laravel-mysql' | 'laravel-postgres' | 'laravel-sqlite' | 'api-only' | 'enterprise' | 'wordpress' | 'full-stack') || 'full-stack',
130126
},
131127
},
132128
}

packages/launchpad/src/install-helpers.ts

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -441,20 +441,15 @@ export async function validatePackageInstallation(packageDir: string, domain: st
441441
const sbinDir = path.join(packageDir, 'sbin')
442442
const libDir = path.join(packageDir, 'lib')
443443
const lib64Dir = path.join(packageDir, 'lib64')
444+
const includeDir = path.join(packageDir, 'include')
445+
const shareDir = path.join(packageDir, 'share')
444446

445447
const hasBin = fs.existsSync(binDir)
446448
const hasSbin = fs.existsSync(sbinDir)
447449
const hasLib = fs.existsSync(libDir)
448450
const hasLib64 = fs.existsSync(lib64Dir)
449-
450-
// If no bin or sbin directory exists, check if it's purely a library package
451-
if (!hasBin && !hasSbin) {
452-
// For pure library packages, having lib/ is enough
453-
if (hasLib || hasLib64) {
454-
return true
455-
}
456-
return false
457-
}
451+
const hasInclude = fs.existsSync(includeDir)
452+
const hasShare = fs.existsSync(shareDir)
458453

459454
// Special handling for packages that are known to work differently
460455
const specialCases: Record<string, () => boolean> = {
@@ -496,17 +491,14 @@ export async function validatePackageInstallation(packageDir: string, domain: st
496491
},
497492
'x.org/util-macros': () => {
498493
// X11 util-macros provides build macros in share/aclocal or share/pkgconfig
499-
const shareDir = path.join(packageDir, 'share')
500494
const aclocalDir = path.join(shareDir, 'aclocal')
501495
const pkgconfigDir = path.join(shareDir, 'pkgconfig')
502-
return fs.existsSync(aclocalDir) || fs.existsSync(pkgconfigDir) || fs.existsSync(shareDir) || hasBin
496+
return fs.existsSync(aclocalDir) || fs.existsSync(pkgconfigDir) || hasShare || hasBin
503497
},
504498
'x.org/protocol': () => {
505499
// X11 protocol headers in include/ or share/
506-
const shareDir = path.join(packageDir, 'share')
507-
const includeDir = path.join(packageDir, 'include')
508500
const pkgconfigDir = path.join(shareDir, 'pkgconfig')
509-
return fs.existsSync(includeDir) || fs.existsSync(pkgconfigDir) || fs.existsSync(shareDir) || hasBin
501+
return hasInclude || fs.existsSync(pkgconfigDir) || hasShare || hasBin
510502
},
511503
'curl.se/ca-certs': () => {
512504
// CA certificate bundle - check for actual cert files in various locations
@@ -548,11 +540,20 @@ export async function validatePackageInstallation(packageDir: string, domain: st
548540
},
549541
}
550542

551-
// Check special cases first
543+
// Check special cases first so they don't get flagged by generic rules
552544
if (specialCases[domain]) {
553545
return specialCases[domain]()
554546
}
555547

548+
// If no bin or sbin directory exists, check if it's library or headers-only package
549+
if (!hasBin && !hasSbin) {
550+
// For library or headers-only packages, having lib/, include/, or share/ is enough
551+
if (hasLib || hasLib64 || hasInclude || hasShare) {
552+
return true
553+
}
554+
return false
555+
}
556+
556557
// For library packages that are expected to have both bin/ and lib/
557558
const strictLibraryPackages = [
558559
'gnu.org/gmp',

packages/launchpad/src/php/auto-detector.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,9 @@ export class PHPAutoDetector {
164164
}
165165
}
166166

167-
// If no databases detected, check user preference
168-
if (databases.length === 0) {
169-
const userPref = config.services?.php?.autoDetect?.preferredDatabase
170-
if (userPref && userPref !== 'auto') {
171-
databases.push(userPref)
172-
}
173-
else {
174-
// Default to SQLite for development
175-
databases.push('sqlite')
176-
}
177-
}
167+
// If no databases detected, default to SQLite
168+
if (databases.length === 0)
169+
databases.push('sqlite')
178170

179171
return databases
180172
}

packages/launchpad/src/types.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export interface LaunchpadConfig {
8080
}
8181
frameworks?: {
8282
enabled?: boolean
83-
preferredDatabase?: 'postgres' | 'sqlite'
8483
laravel?: {
8584
enabled?: boolean
8685
autoDetect?: boolean
@@ -100,13 +99,10 @@ export interface LaunchpadConfig {
10099
version?: string
101100
autoDetect?: {
102101
enabled?: boolean
103-
preferredDatabase?: 'mysql' | 'postgres' | 'sqlite' | 'auto'
104102
includeAllDatabases?: boolean
105103
includeEnterprise?: boolean
106104
}
107-
manual?: {
108-
configuration?: 'laravel-mysql' | 'laravel-postgres' | 'laravel-sqlite' | 'api-only' | 'enterprise' | 'wordpress' | 'full-stack'
109-
}
105+
configuration?: 'laravel-mysql' | 'laravel-postgres' | 'laravel-sqlite' | 'api-only' | 'enterprise' | 'wordpress' | 'full-stack'
110106
}
111107
}
112108
verbose?: boolean

0 commit comments

Comments
 (0)