@meetploy/cli 1.11.4 → 1.12.1

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.
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Ploy Dev Dashboard</title>
7
- <script type="module" crossorigin src="/assets/main-B1TTAu_I.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/main-BXQv-ae0.css">
7
+ <script type="module" crossorigin src="/assets/main-CYxpKFOS.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/main-BNiZvT9K.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
package/dist/dev.js CHANGED
@@ -375,8 +375,12 @@ function createDbHandler(getDatabase) {
375
375
  const startTime = Date.now();
376
376
  try {
377
377
  const body = await c.req.json();
378
- const { bindingName, method, query, params, statements } = body;
379
- const db = getDatabase(bindingName);
378
+ const { bindingName, databaseId, method, query, params, statements } = body;
379
+ const dbName = bindingName ?? databaseId;
380
+ if (!dbName) {
381
+ return c.json({ error: "Missing bindingName or databaseId" }, 400);
382
+ }
383
+ const db = getDatabase(dbName);
380
384
  if (method === "prepare" && query) {
381
385
  const stmt = db.prepare(query);
382
386
  const isSelect = query.trim().toUpperCase().startsWith("SELECT");
package/dist/index.js CHANGED
@@ -465,10 +465,12 @@ export function initializeDB(bindingName: string, serviceUrl: string): DBDatabas
465
465
  return {
466
466
  prepare(query) {
467
467
  let boundParams = [];
468
- return {
468
+ const stmt = {
469
+ __db_data: { query, params: boundParams },
469
470
  bind(...values) {
470
471
  boundParams = values;
471
- return this;
472
+ stmt.__db_data = { query, params: boundParams };
473
+ return stmt;
472
474
  },
473
475
  async run() {
474
476
  const response = await fetch(serviceUrl, {
@@ -516,6 +518,7 @@ export function initializeDB(bindingName: string, serviceUrl: string): DBDatabas
516
518
  return arrayRows;
517
519
  },
518
520
  };
521
+ return stmt;
519
522
  },
520
523
  async dump() {
521
524
  const response = await fetch(serviceUrl, {
@@ -594,6 +597,12 @@ var init_trace_event = __esm({
594
597
  }
595
598
  });
596
599
 
600
+ // ../shared/dist/unified-log.js
601
+ var init_unified_log = __esm({
602
+ "../shared/dist/unified-log.js"() {
603
+ }
604
+ });
605
+
597
606
  // ../shared/dist/url-validation.js
598
607
  var init_url_validation = __esm({
599
608
  "../shared/dist/url-validation.js"() {
@@ -607,6 +616,7 @@ var init_dist = __esm({
607
616
  init_error();
608
617
  init_health_check();
609
618
  init_trace_event();
619
+ init_unified_log();
610
620
  init_url_validation();
611
621
  }
612
622
  });
@@ -1113,6 +1123,42 @@ var init_bundler = __esm({
1113
1123
  ];
1114
1124
  }
1115
1125
  });
1126
+
1127
+ // ../emulator/dist/utils/logger.js
1128
+ function timestamp() {
1129
+ return (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false });
1130
+ }
1131
+ function log(message) {
1132
+ console.log(`${COLORS.dim}[${timestamp()}]${COLORS.reset} ${COLORS.cyan}[ploy]${COLORS.reset} ${message}`);
1133
+ }
1134
+ function success(message) {
1135
+ console.log(`${COLORS.dim}[${timestamp()}]${COLORS.reset} ${COLORS.green}[ploy]${COLORS.reset} ${message}`);
1136
+ }
1137
+ function warn(message) {
1138
+ console.log(`${COLORS.dim}[${timestamp()}]${COLORS.reset} ${COLORS.yellow}[ploy]${COLORS.reset} ${message}`);
1139
+ }
1140
+ function error(message) {
1141
+ console.error(`${COLORS.dim}[${timestamp()}]${COLORS.reset} ${COLORS.red}[ploy]${COLORS.reset} ${message}`);
1142
+ }
1143
+ function debug(message, verbose) {
1144
+ if (verbose) {
1145
+ console.log(`${COLORS.dim}[${timestamp()}]${COLORS.reset} ${COLORS.magenta}[ploy:debug]${COLORS.reset} ${message}`);
1146
+ }
1147
+ }
1148
+ var COLORS;
1149
+ var init_logger = __esm({
1150
+ "../emulator/dist/utils/logger.js"() {
1151
+ COLORS = {
1152
+ reset: "\x1B[0m",
1153
+ dim: "\x1B[2m",
1154
+ cyan: "\x1B[36m",
1155
+ green: "\x1B[32m",
1156
+ yellow: "\x1B[33m",
1157
+ red: "\x1B[31m",
1158
+ magenta: "\x1B[35m"
1159
+ };
1160
+ }
1161
+ });
1116
1162
  function createFileWatcher(srcDir, onRebuild) {
1117
1163
  let watcher = null;
1118
1164
  let debounceTimer = null;
@@ -1145,7 +1191,27 @@ function createFileWatcher(srcDir, onRebuild) {
1145
1191
  watcher = watch(srcDir, {
1146
1192
  persistent: true,
1147
1193
  ignoreInitial: true,
1148
- ignored: ["**/node_modules/**", "**/dist/**", "**/.ploy/**", "**/.*"]
1194
+ ignored: [
1195
+ "**/node_modules/**",
1196
+ "**/dist/**",
1197
+ "**/.*",
1198
+ "**/.*/**",
1199
+ "**/coverage/**",
1200
+ "**/build/**",
1201
+ "**/*.log",
1202
+ "**/pnpm-lock.yaml",
1203
+ "**/package-lock.json",
1204
+ "**/yarn.lock"
1205
+ ]
1206
+ });
1207
+ watcher.on("error", (err) => {
1208
+ const error2 = err;
1209
+ if (error2.code === "EMFILE") {
1210
+ warn("Warning: Too many open files. Some file changes may not be detected.");
1211
+ warn("Consider increasing your system's file descriptor limit (ulimit -n).");
1212
+ } else {
1213
+ error(`File watcher error: ${error2.message || String(err)}`);
1214
+ }
1149
1215
  });
1150
1216
  watcher.on("change", (filePath) => {
1151
1217
  if (shouldRebuild(filePath)) {
@@ -1177,6 +1243,7 @@ function createFileWatcher(srcDir, onRebuild) {
1177
1243
  }
1178
1244
  var init_watcher = __esm({
1179
1245
  "../emulator/dist/bundler/watcher.js"() {
1246
+ init_logger();
1180
1247
  }
1181
1248
  });
1182
1249
 
@@ -1593,8 +1660,12 @@ function createDbHandler(getDatabase) {
1593
1660
  const startTime = Date.now();
1594
1661
  try {
1595
1662
  const body = await c.req.json();
1596
- const { bindingName, method, query, params, statements } = body;
1597
- const db = getDatabase(bindingName);
1663
+ const { bindingName, databaseId, method, query, params, statements } = body;
1664
+ const dbName = bindingName ?? databaseId;
1665
+ if (!dbName) {
1666
+ return c.json({ error: "Missing bindingName or databaseId" }, 400);
1667
+ }
1668
+ const db = getDatabase(dbName);
1598
1669
  if (method === "prepare" && query) {
1599
1670
  const stmt = db.prepare(query);
1600
1671
  const isSelect = query.trim().toUpperCase().startsWith("SELECT");
@@ -2101,39 +2172,6 @@ var init_mock_server = __esm({
2101
2172
  DEFAULT_MOCK_SERVER_PORT = 4003;
2102
2173
  }
2103
2174
  });
2104
-
2105
- // ../emulator/dist/utils/logger.js
2106
- function timestamp() {
2107
- return (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false });
2108
- }
2109
- function log(message) {
2110
- console.log(`${COLORS.dim}[${timestamp()}]${COLORS.reset} ${COLORS.cyan}[ploy]${COLORS.reset} ${message}`);
2111
- }
2112
- function success(message) {
2113
- console.log(`${COLORS.dim}[${timestamp()}]${COLORS.reset} ${COLORS.green}[ploy]${COLORS.reset} ${message}`);
2114
- }
2115
- function error(message) {
2116
- console.error(`${COLORS.dim}[${timestamp()}]${COLORS.reset} ${COLORS.red}[ploy]${COLORS.reset} ${message}`);
2117
- }
2118
- function debug(message, verbose) {
2119
- if (verbose) {
2120
- console.log(`${COLORS.dim}[${timestamp()}]${COLORS.reset} ${COLORS.magenta}[ploy:debug]${COLORS.reset} ${message}`);
2121
- }
2122
- }
2123
- var COLORS;
2124
- var init_logger = __esm({
2125
- "../emulator/dist/utils/logger.js"() {
2126
- COLORS = {
2127
- reset: "\x1B[0m",
2128
- dim: "\x1B[2m",
2129
- cyan: "\x1B[36m",
2130
- green: "\x1B[32m",
2131
- yellow: "\x1B[33m",
2132
- red: "\x1B[31m",
2133
- magenta: "\x1B[35m"
2134
- };
2135
- }
2136
- });
2137
2175
  function getProjectHash(projectDir) {
2138
2176
  return createHash("sha256").update(projectDir).digest("hex").slice(0, 12);
2139
2177
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetploy/cli",
3
- "version": "1.11.4",
3
+ "version": "1.12.1",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",