@wordpress-flow/cli 1.2.9 → 1.2.11
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 +49 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -78019,9 +78019,9 @@ var require_readdirp = __commonJS((exports, module) => {
|
|
|
78019
78019
|
async _formatEntry(dirent, path8) {
|
|
78020
78020
|
let entry;
|
|
78021
78021
|
try {
|
|
78022
|
-
const
|
|
78023
|
-
const fullPath = sysPath.resolve(sysPath.join(path8,
|
|
78024
|
-
entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename:
|
|
78022
|
+
const basename3 = this._isDirent ? dirent.name : dirent;
|
|
78023
|
+
const fullPath = sysPath.resolve(sysPath.join(path8, basename3));
|
|
78024
|
+
entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename: basename3 };
|
|
78025
78025
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
78026
78026
|
} catch (err) {
|
|
78027
78027
|
this._onError(err);
|
|
@@ -79944,16 +79944,16 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
79944
79944
|
_watchWithNodeFs(path8, listener) {
|
|
79945
79945
|
const opts = this.fsw.options;
|
|
79946
79946
|
const directory = sysPath.dirname(path8);
|
|
79947
|
-
const
|
|
79947
|
+
const basename3 = sysPath.basename(path8);
|
|
79948
79948
|
const parent = this.fsw._getWatchedDir(directory);
|
|
79949
|
-
parent.add(
|
|
79949
|
+
parent.add(basename3);
|
|
79950
79950
|
const absolutePath = sysPath.resolve(path8);
|
|
79951
79951
|
const options = { persistent: opts.persistent };
|
|
79952
79952
|
if (!listener)
|
|
79953
79953
|
listener = EMPTY_FN;
|
|
79954
79954
|
let closer;
|
|
79955
79955
|
if (opts.usePolling) {
|
|
79956
|
-
options.interval = opts.enableBinaryInterval && isBinaryPath(
|
|
79956
|
+
options.interval = opts.enableBinaryInterval && isBinaryPath(basename3) ? opts.binaryInterval : opts.interval;
|
|
79957
79957
|
closer = setFsWatchFileListener(path8, absolutePath, options, {
|
|
79958
79958
|
listener,
|
|
79959
79959
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -79972,10 +79972,10 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
79972
79972
|
return;
|
|
79973
79973
|
}
|
|
79974
79974
|
const dirname2 = sysPath.dirname(file);
|
|
79975
|
-
const
|
|
79975
|
+
const basename3 = sysPath.basename(file);
|
|
79976
79976
|
const parent = this.fsw._getWatchedDir(dirname2);
|
|
79977
79977
|
let prevStats = stats;
|
|
79978
|
-
if (parent.has(
|
|
79978
|
+
if (parent.has(basename3))
|
|
79979
79979
|
return;
|
|
79980
79980
|
const listener = async (path8, newStats) => {
|
|
79981
79981
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
|
|
@@ -79998,9 +79998,9 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
79998
79998
|
prevStats = newStats2;
|
|
79999
79999
|
}
|
|
80000
80000
|
} catch (error) {
|
|
80001
|
-
this.fsw._remove(dirname2,
|
|
80001
|
+
this.fsw._remove(dirname2, basename3);
|
|
80002
80002
|
}
|
|
80003
|
-
} else if (parent.has(
|
|
80003
|
+
} else if (parent.has(basename3)) {
|
|
80004
80004
|
const at2 = newStats.atimeMs;
|
|
80005
80005
|
const mt = newStats.mtimeMs;
|
|
80006
80006
|
if (!at2 || at2 <= mt || mt !== prevStats.mtimeMs) {
|
|
@@ -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,
|
|
@@ -85705,7 +85709,7 @@ class PullCommand {
|
|
|
85705
85709
|
errors: []
|
|
85706
85710
|
};
|
|
85707
85711
|
try {
|
|
85708
|
-
const postTypes = options.postTypes || ["post", "page"];
|
|
85712
|
+
const postTypes = options.postTypes || config.sync.postTypes || ["post", "page"];
|
|
85709
85713
|
const outputDir = options.outputDir || config.paths.content;
|
|
85710
85714
|
fs3.mkdirSync(outputDir, { recursive: true });
|
|
85711
85715
|
let totalProcessed = 0;
|
|
@@ -85779,7 +85783,6 @@ class PullCommand {
|
|
|
85779
85783
|
const blocks = this.blockParser.parse(post.content.raw);
|
|
85780
85784
|
const frontmatter = {
|
|
85781
85785
|
title: post.title.rendered,
|
|
85782
|
-
slug: post.slug,
|
|
85783
85786
|
postId: post.id,
|
|
85784
85787
|
status: post.status
|
|
85785
85788
|
};
|
|
@@ -113176,13 +113179,16 @@ class PushCommand {
|
|
|
113176
113179
|
if (!baseDir) {
|
|
113177
113180
|
throw new Error("No base directory specified and no files provided");
|
|
113178
113181
|
}
|
|
113179
|
-
const
|
|
113180
|
-
const
|
|
113182
|
+
const config = this.configManager.getConfig();
|
|
113183
|
+
const postTypes = config.sync?.postTypes || ["post", "page"];
|
|
113181
113184
|
try {
|
|
113182
|
-
const
|
|
113183
|
-
const
|
|
113184
|
-
|
|
113185
|
-
|
|
113185
|
+
const allFiles = [];
|
|
113186
|
+
for (const postType of postTypes) {
|
|
113187
|
+
const pattern = path6.join(baseDir, `${postType}/**/*.mdx`);
|
|
113188
|
+
const files = await glob(pattern);
|
|
113189
|
+
allFiles.push(...files);
|
|
113190
|
+
logger.debug(`Found ${files.length} ${postType}(s)`);
|
|
113191
|
+
}
|
|
113186
113192
|
return allFiles;
|
|
113187
113193
|
} catch (error) {
|
|
113188
113194
|
throw error;
|
|
@@ -113213,13 +113219,14 @@ ${"=".repeat(80)}`);
|
|
|
113213
113219
|
`);
|
|
113214
113220
|
const pathParts = filePath2.split(path6.sep);
|
|
113215
113221
|
const postType = pathParts[pathParts.length - 2];
|
|
113222
|
+
const slug = path6.basename(filePath2, ".mdx");
|
|
113216
113223
|
const postData = {
|
|
113217
113224
|
title: { raw: mdxFile.frontmatter.title },
|
|
113218
113225
|
content: { raw: htmlContent },
|
|
113219
113226
|
excerpt: mdxFile.frontmatter.excerpt ? { raw: mdxFile.frontmatter.excerpt } : undefined,
|
|
113220
113227
|
status: mdxFile.frontmatter.status,
|
|
113221
113228
|
type: postType,
|
|
113222
|
-
slug
|
|
113229
|
+
slug,
|
|
113223
113230
|
categories: mdxFile.frontmatter.categories,
|
|
113224
113231
|
tags: mdxFile.frontmatter.tags,
|
|
113225
113232
|
meta: mdxFile.frontmatter.meta,
|
|
@@ -113265,13 +113272,14 @@ ${"=".repeat(80)}`);
|
|
|
113265
113272
|
const htmlContent = await this.getBlockRenderer().renderMDXContentToHTML(mdxFile.content);
|
|
113266
113273
|
const pathParts = filePath2.split(path6.sep);
|
|
113267
113274
|
const postType = pathParts[pathParts.length - 2];
|
|
113275
|
+
const slug = path6.basename(filePath2, ".mdx");
|
|
113268
113276
|
const postData = {
|
|
113269
113277
|
title: { raw: mdxFile.frontmatter.title },
|
|
113270
113278
|
content: { raw: htmlContent },
|
|
113271
113279
|
excerpt: mdxFile.frontmatter.excerpt ? { raw: mdxFile.frontmatter.excerpt } : undefined,
|
|
113272
113280
|
status: mdxFile.frontmatter.status,
|
|
113273
113281
|
type: postType,
|
|
113274
|
-
slug
|
|
113282
|
+
slug,
|
|
113275
113283
|
categories: mdxFile.frontmatter.categories,
|
|
113276
113284
|
tags: mdxFile.frontmatter.tags,
|
|
113277
113285
|
meta: mdxFile.frontmatter.meta,
|
|
@@ -116177,7 +116185,7 @@ class DockerEnvManager {
|
|
|
116177
116185
|
// package.json
|
|
116178
116186
|
var package_default = {
|
|
116179
116187
|
name: "@wordpress-flow/cli",
|
|
116180
|
-
version: "1.2.
|
|
116188
|
+
version: "1.2.11",
|
|
116181
116189
|
type: "module",
|
|
116182
116190
|
description: "TypeScript-based WordPress block creation system",
|
|
116183
116191
|
main: "dist/index.js",
|
|
@@ -116537,14 +116545,18 @@ class DevModeOrchestrator {
|
|
|
116537
116545
|
async performInitialContentPush() {
|
|
116538
116546
|
if (!fs15.existsSync(this.contentDir))
|
|
116539
116547
|
return;
|
|
116540
|
-
const
|
|
116541
|
-
const
|
|
116548
|
+
const config = this.configManager.getConfig();
|
|
116549
|
+
const postTypes = config.sync.postTypes || ["post", "page"];
|
|
116550
|
+
console.log(`[DEBUG] Initial push - Post types: ${JSON.stringify(postTypes)}`);
|
|
116542
116551
|
const contentFiles = [];
|
|
116543
|
-
|
|
116544
|
-
|
|
116545
|
-
|
|
116546
|
-
|
|
116547
|
-
|
|
116552
|
+
for (const postType of postTypes) {
|
|
116553
|
+
const typeDir = path17.join(this.contentDir, postType);
|
|
116554
|
+
console.log(`[DEBUG] Checking directory: ${typeDir}, exists: ${fs15.existsSync(typeDir)}`);
|
|
116555
|
+
if (fs15.existsSync(typeDir)) {
|
|
116556
|
+
const files = this.findMDXFiles(typeDir);
|
|
116557
|
+
console.log(`[DEBUG] Found ${files.length} files in ${postType}`);
|
|
116558
|
+
contentFiles.push(...files);
|
|
116559
|
+
}
|
|
116548
116560
|
}
|
|
116549
116561
|
if (contentFiles.length === 0) {
|
|
116550
116562
|
return;
|
|
@@ -116743,8 +116755,13 @@ class DevModeOrchestrator {
|
|
|
116743
116755
|
startPageWatcher() {
|
|
116744
116756
|
if (!fs15.existsSync(this.contentDir))
|
|
116745
116757
|
return;
|
|
116746
|
-
|
|
116747
|
-
const
|
|
116758
|
+
const config = this.configManager.getConfig();
|
|
116759
|
+
const postTypes = config.sync.postTypes || ["post", "page"];
|
|
116760
|
+
const watchPatterns = postTypes.map((type) => `${type}/**/*.mdx`);
|
|
116761
|
+
console.log(`[DEBUG] Post types from config: ${JSON.stringify(postTypes)}`);
|
|
116762
|
+
console.log(`[DEBUG] Watch patterns: ${JSON.stringify(watchPatterns)}`);
|
|
116763
|
+
logger.debug(`Watching content: ${this.contentDir} (${postTypes.join(", ")})`);
|
|
116764
|
+
const watcher = $watch(watchPatterns, {
|
|
116748
116765
|
cwd: this.contentDir,
|
|
116749
116766
|
...this.getWatcherOptions()
|
|
116750
116767
|
});
|