@_davideast/jules-env 0.2.2 → 0.2.3
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.
- package/dist/cli.mjs +94 -5
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -6486,8 +6486,96 @@ var PhpSqliteRecipe = {
|
|
|
6486
6486
|
}
|
|
6487
6487
|
};
|
|
6488
6488
|
|
|
6489
|
+
// src/recipes/mysql.ts
|
|
6490
|
+
async function resolveDarwin6(ctx) {
|
|
6491
|
+
const installSteps = [
|
|
6492
|
+
{
|
|
6493
|
+
id: "install-mariadb",
|
|
6494
|
+
label: "Install MariaDB",
|
|
6495
|
+
cmd: "brew install mariadb",
|
|
6496
|
+
checkCmd: "brew list --versions mariadb"
|
|
6497
|
+
},
|
|
6498
|
+
{
|
|
6499
|
+
id: "start-mariadb",
|
|
6500
|
+
label: "Start MariaDB service",
|
|
6501
|
+
cmd: "brew services start mariadb",
|
|
6502
|
+
checkCmd: "mysqladmin ping -u root 2>/dev/null"
|
|
6503
|
+
},
|
|
6504
|
+
{
|
|
6505
|
+
id: "wait-for-mariadb",
|
|
6506
|
+
label: "Wait for MariaDB to be ready",
|
|
6507
|
+
cmd: 'for i in 1 2 3 4 5 6 7 8 9 10; do mysqladmin ping -u root 2>/dev/null && exit 0; sleep 1; done; echo "MariaDB did not start"; exit 1'
|
|
6508
|
+
}
|
|
6509
|
+
];
|
|
6510
|
+
if (ctx.preset) {
|
|
6511
|
+
installSteps.push({
|
|
6512
|
+
id: "create-database",
|
|
6513
|
+
label: `Create database '${ctx.preset}'`,
|
|
6514
|
+
cmd: `mariadb -u root -e "CREATE DATABASE IF NOT EXISTS \`${ctx.preset}\`"`,
|
|
6515
|
+
checkCmd: `mariadb -u root -e "SHOW DATABASES" | grep -q "^${ctx.preset}$"`
|
|
6516
|
+
});
|
|
6517
|
+
}
|
|
6518
|
+
const env = {
|
|
6519
|
+
MYSQL_HOST: "127.0.0.1"
|
|
6520
|
+
};
|
|
6521
|
+
return ExecutionPlanSchema.parse({ installSteps, env, paths: [] });
|
|
6522
|
+
}
|
|
6523
|
+
async function resolveLinux6(ctx) {
|
|
6524
|
+
const installSteps = [
|
|
6525
|
+
{
|
|
6526
|
+
id: "install-mariadb",
|
|
6527
|
+
label: "Install MariaDB",
|
|
6528
|
+
cmd: "(sudo apt-get update || true) && sudo apt-get install -y mariadb-server mariadb-client",
|
|
6529
|
+
checkCmd: "dpkg -s mariadb-server"
|
|
6530
|
+
},
|
|
6531
|
+
{
|
|
6532
|
+
id: "start-mariadb",
|
|
6533
|
+
label: "Start MariaDB service",
|
|
6534
|
+
cmd: `sudo mkdir -p /run/mysqld && sudo chown mysql:mysql /run/mysqld && if command -v systemctl >/dev/null 2>&1 && systemctl is-system-running 2>/dev/null | grep -qE "running|degraded"; then sudo systemctl enable --now mariadb; else sudo mysqld_safe --skip-syslog & fi`,
|
|
6535
|
+
checkCmd: "mysqladmin ping 2>/dev/null"
|
|
6536
|
+
},
|
|
6537
|
+
{
|
|
6538
|
+
id: "wait-for-mariadb",
|
|
6539
|
+
label: "Wait for MariaDB to be ready",
|
|
6540
|
+
cmd: 'for i in 1 2 3 4 5 6 7 8 9 10; do mysqladmin ping 2>/dev/null && exit 0; sleep 1; done; echo "MariaDB did not start"; exit 1'
|
|
6541
|
+
},
|
|
6542
|
+
{
|
|
6543
|
+
id: "setup-user",
|
|
6544
|
+
label: "Create MariaDB user for current user",
|
|
6545
|
+
cmd: `sudo mariadb -e "CREATE USER IF NOT EXISTS '$(whoami)'@'localhost' IDENTIFIED VIA unix_socket; GRANT ALL PRIVILEGES ON *.* TO '$(whoami)'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES;"`,
|
|
6546
|
+
checkCmd: 'mariadb -e "SELECT 1" 2>/dev/null'
|
|
6547
|
+
}
|
|
6548
|
+
];
|
|
6549
|
+
if (ctx.preset) {
|
|
6550
|
+
installSteps.push({
|
|
6551
|
+
id: "create-database",
|
|
6552
|
+
label: `Create database '${ctx.preset}'`,
|
|
6553
|
+
cmd: `mariadb -e "CREATE DATABASE IF NOT EXISTS \`${ctx.preset}\`"`,
|
|
6554
|
+
checkCmd: `mariadb -e "SHOW DATABASES" | grep -q "^${ctx.preset}$"`
|
|
6555
|
+
});
|
|
6556
|
+
}
|
|
6557
|
+
const env = {
|
|
6558
|
+
MYSQL_HOST: "localhost"
|
|
6559
|
+
};
|
|
6560
|
+
return ExecutionPlanSchema.parse({ installSteps, env, paths: [] });
|
|
6561
|
+
}
|
|
6562
|
+
var MysqlRecipe = {
|
|
6563
|
+
name: "mysql",
|
|
6564
|
+
description: "MySQL compatible relational database (MariaDB)",
|
|
6565
|
+
resolve: async (ctx) => {
|
|
6566
|
+
switch (process.platform) {
|
|
6567
|
+
case "darwin":
|
|
6568
|
+
return resolveDarwin6(ctx);
|
|
6569
|
+
case "linux":
|
|
6570
|
+
return resolveLinux6(ctx);
|
|
6571
|
+
default:
|
|
6572
|
+
throw new Error(`Unsupported platform: ${process.platform}`);
|
|
6573
|
+
}
|
|
6574
|
+
}
|
|
6575
|
+
};
|
|
6576
|
+
|
|
6489
6577
|
// src/recipes/laravel.ts
|
|
6490
|
-
async function
|
|
6578
|
+
async function resolveDarwin7() {
|
|
6491
6579
|
const installSteps = [
|
|
6492
6580
|
{
|
|
6493
6581
|
id: "install-laravel-installer",
|
|
@@ -6498,7 +6586,7 @@ async function resolveDarwin6() {
|
|
|
6498
6586
|
];
|
|
6499
6587
|
return ExecutionPlanSchema.parse({ installSteps, env: {}, paths: [] });
|
|
6500
6588
|
}
|
|
6501
|
-
async function
|
|
6589
|
+
async function resolveLinux7() {
|
|
6502
6590
|
const installSteps = [
|
|
6503
6591
|
{
|
|
6504
6592
|
id: "install-laravel-installer",
|
|
@@ -6516,9 +6604,9 @@ var LaravelRecipe = {
|
|
|
6516
6604
|
resolve: async (ctx) => {
|
|
6517
6605
|
switch (process.platform) {
|
|
6518
6606
|
case "darwin":
|
|
6519
|
-
return
|
|
6607
|
+
return resolveDarwin7();
|
|
6520
6608
|
case "linux":
|
|
6521
|
-
return
|
|
6609
|
+
return resolveLinux7();
|
|
6522
6610
|
default:
|
|
6523
6611
|
throw new Error(`Unsupported platform: ${process.platform}`);
|
|
6524
6612
|
}
|
|
@@ -6604,7 +6692,7 @@ var ollama_default = {
|
|
|
6604
6692
|
// package.json
|
|
6605
6693
|
var package_default = {
|
|
6606
6694
|
name: "@_davideast/jules-env",
|
|
6607
|
-
version: "0.2.
|
|
6695
|
+
version: "0.2.3",
|
|
6608
6696
|
description: "Configure ephemeral development environments",
|
|
6609
6697
|
license: "Apache-2.0",
|
|
6610
6698
|
type: "module",
|
|
@@ -6654,6 +6742,7 @@ var recipes = {
|
|
|
6654
6742
|
ruby: RubyRecipe,
|
|
6655
6743
|
php: PhpRecipe,
|
|
6656
6744
|
"php-sqlite": PhpSqliteRecipe,
|
|
6745
|
+
mysql: MysqlRecipe,
|
|
6657
6746
|
laravel: LaravelRecipe,
|
|
6658
6747
|
ollama: loadDataRecipe(ollama_default)
|
|
6659
6748
|
};
|