@wordpress-flow/cli 1.2.9 → 1.2.10
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/index.js +34 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -80768,8 +80768,10 @@ var DEFAULTS = {
|
|
|
80768
80768
|
plugins: "./plugins"
|
|
80769
80769
|
},
|
|
80770
80770
|
sync: {
|
|
80771
|
+
postTypes: ["post", "page"],
|
|
80771
80772
|
excludePostTypes: [],
|
|
80772
|
-
includedPostStatuses: ["publish", "draft"]
|
|
80773
|
+
includedPostStatuses: ["publish", "draft"],
|
|
80774
|
+
conflictResolution: "manual"
|
|
80773
80775
|
},
|
|
80774
80776
|
dev: {
|
|
80775
80777
|
port: 8888,
|
|
@@ -80896,8 +80898,10 @@ class ConfigManager {
|
|
|
80896
80898
|
partsOutput: `${theme}/parts`
|
|
80897
80899
|
},
|
|
80898
80900
|
sync: {
|
|
80901
|
+
postTypes: raw.sync?.postTypes || DEFAULTS.sync.postTypes,
|
|
80899
80902
|
excludePostTypes: raw.sync?.excludePostTypes || DEFAULTS.sync.excludePostTypes,
|
|
80900
|
-
includedPostStatuses: raw.sync?.includedPostStatuses || DEFAULTS.sync.includedPostStatuses
|
|
80903
|
+
includedPostStatuses: raw.sync?.includedPostStatuses || DEFAULTS.sync.includedPostStatuses,
|
|
80904
|
+
conflictResolution: raw.sync?.conflictResolution || DEFAULTS.sync.conflictResolution
|
|
80901
80905
|
},
|
|
80902
80906
|
dev: {
|
|
80903
80907
|
port: raw.dev?.port || DEFAULTS.dev.port,
|
|
@@ -113176,13 +113180,16 @@ class PushCommand {
|
|
|
113176
113180
|
if (!baseDir) {
|
|
113177
113181
|
throw new Error("No base directory specified and no files provided");
|
|
113178
113182
|
}
|
|
113179
|
-
const
|
|
113180
|
-
const
|
|
113183
|
+
const config = this.configManager.getConfig();
|
|
113184
|
+
const postTypes = config.sync?.postTypes || ["post", "page"];
|
|
113181
113185
|
try {
|
|
113182
|
-
const
|
|
113183
|
-
const
|
|
113184
|
-
|
|
113185
|
-
|
|
113186
|
+
const allFiles = [];
|
|
113187
|
+
for (const postType of postTypes) {
|
|
113188
|
+
const pattern = path6.join(baseDir, `${postType}/**/*.mdx`);
|
|
113189
|
+
const files = await glob(pattern);
|
|
113190
|
+
allFiles.push(...files);
|
|
113191
|
+
logger.debug(`Found ${files.length} ${postType}(s)`);
|
|
113192
|
+
}
|
|
113186
113193
|
return allFiles;
|
|
113187
113194
|
} catch (error) {
|
|
113188
113195
|
throw error;
|
|
@@ -116177,7 +116184,7 @@ class DockerEnvManager {
|
|
|
116177
116184
|
// package.json
|
|
116178
116185
|
var package_default = {
|
|
116179
116186
|
name: "@wordpress-flow/cli",
|
|
116180
|
-
version: "1.2.
|
|
116187
|
+
version: "1.2.10",
|
|
116181
116188
|
type: "module",
|
|
116182
116189
|
description: "TypeScript-based WordPress block creation system",
|
|
116183
116190
|
main: "dist/index.js",
|
|
@@ -116537,14 +116544,18 @@ class DevModeOrchestrator {
|
|
|
116537
116544
|
async performInitialContentPush() {
|
|
116538
116545
|
if (!fs15.existsSync(this.contentDir))
|
|
116539
116546
|
return;
|
|
116540
|
-
const
|
|
116541
|
-
const
|
|
116547
|
+
const config = this.configManager.getConfig();
|
|
116548
|
+
const postTypes = config.sync.postTypes || ["post", "page"];
|
|
116549
|
+
console.log(`[DEBUG] Initial push - Post types: ${JSON.stringify(postTypes)}`);
|
|
116542
116550
|
const contentFiles = [];
|
|
116543
|
-
|
|
116544
|
-
|
|
116545
|
-
|
|
116546
|
-
|
|
116547
|
-
|
|
116551
|
+
for (const postType of postTypes) {
|
|
116552
|
+
const typeDir = path17.join(this.contentDir, postType);
|
|
116553
|
+
console.log(`[DEBUG] Checking directory: ${typeDir}, exists: ${fs15.existsSync(typeDir)}`);
|
|
116554
|
+
if (fs15.existsSync(typeDir)) {
|
|
116555
|
+
const files = this.findMDXFiles(typeDir);
|
|
116556
|
+
console.log(`[DEBUG] Found ${files.length} files in ${postType}`);
|
|
116557
|
+
contentFiles.push(...files);
|
|
116558
|
+
}
|
|
116548
116559
|
}
|
|
116549
116560
|
if (contentFiles.length === 0) {
|
|
116550
116561
|
return;
|
|
@@ -116743,8 +116754,13 @@ class DevModeOrchestrator {
|
|
|
116743
116754
|
startPageWatcher() {
|
|
116744
116755
|
if (!fs15.existsSync(this.contentDir))
|
|
116745
116756
|
return;
|
|
116746
|
-
|
|
116747
|
-
const
|
|
116757
|
+
const config = this.configManager.getConfig();
|
|
116758
|
+
const postTypes = config.sync.postTypes || ["post", "page"];
|
|
116759
|
+
const watchPatterns = postTypes.map((type) => `${type}/**/*.mdx`);
|
|
116760
|
+
console.log(`[DEBUG] Post types from config: ${JSON.stringify(postTypes)}`);
|
|
116761
|
+
console.log(`[DEBUG] Watch patterns: ${JSON.stringify(watchPatterns)}`);
|
|
116762
|
+
logger.debug(`Watching content: ${this.contentDir} (${postTypes.join(", ")})`);
|
|
116763
|
+
const watcher = $watch(watchPatterns, {
|
|
116748
116764
|
cwd: this.contentDir,
|
|
116749
116765
|
...this.getWatcherOptions()
|
|
116750
116766
|
});
|