@wordpress-flow/cli 1.2.4 → 1.2.6

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.
@@ -1966,6 +1966,15 @@ async function generateBlockJson(block, outputDir, tempDir) {
1966
1966
  const blockJson2 = blockInstance.toBlockJson();
1967
1967
  const blockJsonPath2 = path.join(outputDir, "block.json");
1968
1968
  fs.writeFileSync(blockJsonPath2, JSON.stringify(blockJson2, null, 2), "utf8");
1969
+ if (typeof blockInstance.getResponsiveClasses === "function") {
1970
+ const responsiveClasses = blockInstance.getResponsiveClasses();
1971
+ if (responsiveClasses.length > 0) {
1972
+ const classesPath = path.join(outputDir, "responsive-classes.html");
1973
+ const htmlContent = `<!-- Auto-generated by wordpress-flow CLI - DO NOT EDIT -->
1974
+ <div class="${responsiveClasses.join(" ")}"></div>`;
1975
+ fs.writeFileSync(classesPath, htmlContent, "utf8");
1976
+ }
1977
+ }
1969
1978
  return;
1970
1979
  }
1971
1980
  } catch (error) {}
package/dist/index.js CHANGED
@@ -116132,7 +116132,7 @@ class DockerEnvManager {
116132
116132
  // package.json
116133
116133
  var package_default = {
116134
116134
  name: "@wordpress-flow/cli",
116135
- version: "1.2.4",
116135
+ version: "1.2.6",
116136
116136
  type: "module",
116137
116137
  description: "TypeScript-based WordPress block creation system",
116138
116138
  main: "dist/index.js",
@@ -116260,6 +116260,19 @@ class DevModeOrchestrator {
116260
116260
  if (!this.options.skipEnv) {
116261
116261
  console.log("\uD83D\uDC33 Setting up Docker environment...");
116262
116262
  await this.startDockerEnvironment();
116263
+ } else {
116264
+ const port = config.dev.port || 8888;
116265
+ const dbPort = config.dev.databasePort || 3306;
116266
+ console.log(`
116267
+ \uD83D\uDCCC Connection Info:`);
116268
+ console.log(` WP Admin: http://localhost:${port}/wp-admin`);
116269
+ console.log(` User: admin`);
116270
+ console.log(` Pass: password`);
116271
+ console.log(` MySQL: 127.0.0.1:${dbPort}`);
116272
+ console.log(` Database: wordpress`);
116273
+ console.log(` User: wordpress`);
116274
+ console.log(` Pass: wordpress
116275
+ `);
116263
116276
  }
116264
116277
  console.log("⚙️ Initializing build system...");
116265
116278
  this.initializeManagers();
@@ -116314,10 +116327,15 @@ class DevModeOrchestrator {
116314
116327
  }
116315
116328
  const dbConfig = this.dockerEnvManager.getDatabaseConfig();
116316
116329
  this.configManager.setDatabaseConnection(dbConfig);
116317
- logger.success(`WordPress running at ${wordpressUrl}`);
116318
- logger.info(` Admin: ${wordpressUrl}/wp-admin (admin / password)`);
116330
+ console.log(`✅ WordPress running at ${wordpressUrl}`);
116331
+ console.log(` WP Admin: ${wordpressUrl}/wp-admin`);
116332
+ console.log(` User: admin`);
116333
+ console.log(` Pass: password`);
116319
116334
  if (config.dev.databasePort) {
116320
- logger.info(` Database: 127.0.0.1:${config.dev.databasePort} (wordpress / wordpress)`);
116335
+ console.log(` MySQL: 127.0.0.1:${config.dev.databasePort}`);
116336
+ console.log(` Database: wordpress`);
116337
+ console.log(` User: wordpress`);
116338
+ console.log(` Pass: wordpress`);
116321
116339
  }
116322
116340
  } catch (error) {
116323
116341
  const errorMessage = error.message;
@@ -116688,6 +116706,8 @@ class DevModeOrchestrator {
116688
116706
  this.watchers.push(watcher);
116689
116707
  watcher.on("add", (filePath2) => this.handlePageFileEvent("add", filePath2)).on("change", (filePath2) => this.handlePageFileEvent("change", filePath2)).on("unlink", (filePath2) => this.handlePageFileEvent("unlink", filePath2)).on("error", (error) => logger.error("Page watcher error:", error));
116690
116708
  }
116709
+ rescanTimeout = null;
116710
+ rescanDebounceMs = 500;
116691
116711
  handleBlockFileEvent(eventType, filePath2) {
116692
116712
  const fullPath = path17.resolve(this.blocksDir, filePath2);
116693
116713
  const fileName = path17.basename(filePath2, path17.extname(filePath2));
@@ -116697,10 +116717,19 @@ class DevModeOrchestrator {
116697
116717
  this.changeQueue.queueBlockChange(fileName, fullPath, eventType);
116698
116718
  } else if (parentBlock) {
116699
116719
  this.changeQueue.queueBlockImportChange(parentBlock, fullPath, eventType);
116700
- } else if (eventType === "add") {
116701
- this.rescanBlocks();
116720
+ } else if (eventType === "add" || eventType === "change") {
116721
+ this.scheduleRescan();
116702
116722
  }
116703
116723
  }
116724
+ scheduleRescan() {
116725
+ if (this.rescanTimeout) {
116726
+ clearTimeout(this.rescanTimeout);
116727
+ }
116728
+ this.rescanTimeout = setTimeout(() => {
116729
+ this.rescanTimeout = null;
116730
+ this.rescanBlocks();
116731
+ }, this.rescanDebounceMs);
116732
+ }
116704
116733
  handleTemplateFileEvent(eventType, filePath2) {
116705
116734
  const fullPath = path17.resolve(this.templatesDir, filePath2);
116706
116735
  this.changeQueue.queueTemplateChange(fullPath, eventType);
@@ -117292,6 +117321,21 @@ if (document.readyState === 'loading') {
117292
117321
  const blockJsonPath = path20.join(outputDir, "block.json");
117293
117322
  fs18.writeFileSync(blockJsonPath, JSON.stringify(blockJson, null, 2), "utf8");
117294
117323
  logger.debug(`Generated block.json for ${block.name}`);
117324
+ logger.info(`Checking for getResponsiveClasses on ${block.name}...`);
117325
+ logger.info(`blockInstance keys: ${Object.keys(blockInstance)}`);
117326
+ logger.info(`typeof getResponsiveClasses: ${typeof blockInstance.getResponsiveClasses}`);
117327
+ if (typeof blockInstance.getResponsiveClasses === "function") {
117328
+ const responsiveClasses = blockInstance.getResponsiveClasses();
117329
+ logger.info(`Found ${responsiveClasses.length} responsive classes for ${block.name}`);
117330
+ if (responsiveClasses.length > 0) {
117331
+ const classesPath = path20.join(outputDir, "responsive-classes.txt");
117332
+ fs18.writeFileSync(classesPath, responsiveClasses.join(`
117333
+ `), "utf8");
117334
+ logger.info(`Generated responsive-classes.txt for ${block.name}`);
117335
+ }
117336
+ } else {
117337
+ logger.info(`No getResponsiveClasses method found on ${block.name}`);
117338
+ }
117295
117339
  } catch (error) {
117296
117340
  logger.error(`Failed to generate block.json for ${block.name}:`, error);
117297
117341
  const fallbackBlockJson = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress-flow/cli",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "type": "module",
5
5
  "description": "TypeScript-based WordPress block creation system",
6
6
  "main": "dist/index.js",