playcademy 0.14.31 → 0.14.32
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.js +1 -1
- package/dist/index.js +49 -2
- package/dist/utils.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -3539,7 +3539,7 @@ import { join as join12 } from "path";
|
|
|
3539
3539
|
// package.json with { type: 'json' }
|
|
3540
3540
|
var package_default2 = {
|
|
3541
3541
|
name: "playcademy",
|
|
3542
|
-
version: "0.14.
|
|
3542
|
+
version: "0.14.31",
|
|
3543
3543
|
type: "module",
|
|
3544
3544
|
exports: {
|
|
3545
3545
|
".": {
|
|
@@ -9726,7 +9726,7 @@ var getStatusCommand = new Command12("status").description("Check your developer
|
|
|
9726
9726
|
});
|
|
9727
9727
|
|
|
9728
9728
|
// package.json
|
|
9729
|
-
var version2 = "0.14.
|
|
9729
|
+
var version2 = "0.14.31";
|
|
9730
9730
|
|
|
9731
9731
|
// src/commands/dev/server.ts
|
|
9732
9732
|
function setupCleanupHandlers(workspace, getServer) {
|
|
@@ -10374,6 +10374,52 @@ async function runDbReset(options = {}) {
|
|
|
10374
10374
|
}
|
|
10375
10375
|
}
|
|
10376
10376
|
|
|
10377
|
+
// src/commands/db/schema.ts
|
|
10378
|
+
async function runDbSchema(options = {}) {
|
|
10379
|
+
try {
|
|
10380
|
+
if (!hasDatabaseSetup()) {
|
|
10381
|
+
logger.newLine();
|
|
10382
|
+
logger.admonition("warning", "No Database Setup", [
|
|
10383
|
+
"No database configuration found in this project.",
|
|
10384
|
+
"Run `playcademy db init` to add database support."
|
|
10385
|
+
]);
|
|
10386
|
+
logger.newLine();
|
|
10387
|
+
return;
|
|
10388
|
+
}
|
|
10389
|
+
const schemaInfo = await getSchemaInfo();
|
|
10390
|
+
if (!schemaInfo) {
|
|
10391
|
+
logger.newLine();
|
|
10392
|
+
logger.warn("No schema found or schema is empty");
|
|
10393
|
+
logger.newLine();
|
|
10394
|
+
logger.remark("Nothing to show");
|
|
10395
|
+
logger.newLine();
|
|
10396
|
+
return;
|
|
10397
|
+
}
|
|
10398
|
+
if (options.raw) {
|
|
10399
|
+
logger.raw(schemaInfo.sql);
|
|
10400
|
+
} else {
|
|
10401
|
+
logger.newLine();
|
|
10402
|
+
logger.highlight("Database Schema");
|
|
10403
|
+
logger.newLine();
|
|
10404
|
+
const lines = schemaInfo.sql.split("\n").filter((line) => line.trim());
|
|
10405
|
+
lines.forEach((line) => {
|
|
10406
|
+
logger.bold(line, 1);
|
|
10407
|
+
});
|
|
10408
|
+
logger.newLine();
|
|
10409
|
+
const statementCount = await getSchemaStatementCount();
|
|
10410
|
+
logger.data("SQL Statements", String(statementCount), 1);
|
|
10411
|
+
if (options.full) {
|
|
10412
|
+
logger.highlight("Schema Hash");
|
|
10413
|
+
logger.newLine();
|
|
10414
|
+
logger.json(JSON.parse(schemaInfo.hash), 1);
|
|
10415
|
+
}
|
|
10416
|
+
logger.newLine();
|
|
10417
|
+
}
|
|
10418
|
+
} catch (error) {
|
|
10419
|
+
logAndExit(error, { prefix: "Failed to get schema" });
|
|
10420
|
+
}
|
|
10421
|
+
}
|
|
10422
|
+
|
|
10377
10423
|
// src/commands/db/seed.ts
|
|
10378
10424
|
import { existsSync as existsSync26 } from "fs";
|
|
10379
10425
|
import { join as join37 } from "path";
|
|
@@ -10591,6 +10637,7 @@ dbCommand.command("seed [file]").description("Seed database with initial data").
|
|
|
10591
10637
|
})
|
|
10592
10638
|
);
|
|
10593
10639
|
dbCommand.command("diff").description("Show schema changes since last deployment").action(runDbDiff);
|
|
10640
|
+
dbCommand.command("schema").description("Print full schema SQL that would be pushed after reset").option("--raw", "Output raw SQL only (for piping to files)").option("--full", "Show full schema hash").action((options) => runDbSchema({ raw: options.raw, full: options.full }));
|
|
10594
10641
|
|
|
10595
10642
|
// src/commands/kv/index.ts
|
|
10596
10643
|
import { Command as Command19 } from "commander";
|
package/dist/utils.js
CHANGED
package/dist/version.js
CHANGED