@wordpress-flow/cli 1.2.2 → 1.2.3
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 +191 -308
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35037,7 +35037,7 @@ var require_pool_connection = __commonJS((exports, module) => {
|
|
|
35037
35037
|
|
|
35038
35038
|
// ../../node_modules/mysql2/lib/promise/make_done_cb.js
|
|
35039
35039
|
var require_make_done_cb = __commonJS((exports, module) => {
|
|
35040
|
-
function makeDoneCb(
|
|
35040
|
+
function makeDoneCb(resolve2, reject, localErr) {
|
|
35041
35041
|
return function(err, rows, fields) {
|
|
35042
35042
|
if (err) {
|
|
35043
35043
|
localErr.message = err.message;
|
|
@@ -35048,7 +35048,7 @@ var require_make_done_cb = __commonJS((exports, module) => {
|
|
|
35048
35048
|
localErr.sqlMessage = err.sqlMessage;
|
|
35049
35049
|
reject(localErr);
|
|
35050
35050
|
} else {
|
|
35051
|
-
|
|
35051
|
+
resolve2([rows, fields]);
|
|
35052
35052
|
}
|
|
35053
35053
|
};
|
|
35054
35054
|
}
|
|
@@ -35067,8 +35067,8 @@ var require_prepared_statement_info = __commonJS((exports, module) => {
|
|
|
35067
35067
|
execute(parameters) {
|
|
35068
35068
|
const s = this.statement;
|
|
35069
35069
|
const localErr = new Error;
|
|
35070
|
-
return new this.Promise((
|
|
35071
|
-
const done = makeDoneCb(
|
|
35070
|
+
return new this.Promise((resolve2, reject) => {
|
|
35071
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
35072
35072
|
if (parameters) {
|
|
35073
35073
|
s.execute(parameters, done);
|
|
35074
35074
|
} else {
|
|
@@ -35077,9 +35077,9 @@ var require_prepared_statement_info = __commonJS((exports, module) => {
|
|
|
35077
35077
|
});
|
|
35078
35078
|
}
|
|
35079
35079
|
close() {
|
|
35080
|
-
return new this.Promise((
|
|
35080
|
+
return new this.Promise((resolve2) => {
|
|
35081
35081
|
this.statement.close();
|
|
35082
|
-
|
|
35082
|
+
resolve2();
|
|
35083
35083
|
});
|
|
35084
35084
|
}
|
|
35085
35085
|
}
|
|
@@ -35138,8 +35138,8 @@ var require_connection2 = __commonJS((exports, module) => {
|
|
|
35138
35138
|
if (typeof params === "function") {
|
|
35139
35139
|
throw new Error("Callback function is not available with promise clients.");
|
|
35140
35140
|
}
|
|
35141
|
-
return new this.Promise((
|
|
35142
|
-
const done = makeDoneCb(
|
|
35141
|
+
return new this.Promise((resolve2, reject) => {
|
|
35142
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
35143
35143
|
if (params !== undefined) {
|
|
35144
35144
|
c.query(query, params, done);
|
|
35145
35145
|
} else {
|
|
@@ -35153,8 +35153,8 @@ var require_connection2 = __commonJS((exports, module) => {
|
|
|
35153
35153
|
if (typeof params === "function") {
|
|
35154
35154
|
throw new Error("Callback function is not available with promise clients.");
|
|
35155
35155
|
}
|
|
35156
|
-
return new this.Promise((
|
|
35157
|
-
const done = makeDoneCb(
|
|
35156
|
+
return new this.Promise((resolve2, reject) => {
|
|
35157
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
35158
35158
|
if (params !== undefined) {
|
|
35159
35159
|
c.execute(query, params, done);
|
|
35160
35160
|
} else {
|
|
@@ -35163,38 +35163,38 @@ var require_connection2 = __commonJS((exports, module) => {
|
|
|
35163
35163
|
});
|
|
35164
35164
|
}
|
|
35165
35165
|
end() {
|
|
35166
|
-
return new this.Promise((
|
|
35167
|
-
this.connection.end(
|
|
35166
|
+
return new this.Promise((resolve2) => {
|
|
35167
|
+
this.connection.end(resolve2);
|
|
35168
35168
|
});
|
|
35169
35169
|
}
|
|
35170
35170
|
beginTransaction() {
|
|
35171
35171
|
const c = this.connection;
|
|
35172
35172
|
const localErr = new Error;
|
|
35173
|
-
return new this.Promise((
|
|
35174
|
-
const done = makeDoneCb(
|
|
35173
|
+
return new this.Promise((resolve2, reject) => {
|
|
35174
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
35175
35175
|
c.beginTransaction(done);
|
|
35176
35176
|
});
|
|
35177
35177
|
}
|
|
35178
35178
|
commit() {
|
|
35179
35179
|
const c = this.connection;
|
|
35180
35180
|
const localErr = new Error;
|
|
35181
|
-
return new this.Promise((
|
|
35182
|
-
const done = makeDoneCb(
|
|
35181
|
+
return new this.Promise((resolve2, reject) => {
|
|
35182
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
35183
35183
|
c.commit(done);
|
|
35184
35184
|
});
|
|
35185
35185
|
}
|
|
35186
35186
|
rollback() {
|
|
35187
35187
|
const c = this.connection;
|
|
35188
35188
|
const localErr = new Error;
|
|
35189
|
-
return new this.Promise((
|
|
35190
|
-
const done = makeDoneCb(
|
|
35189
|
+
return new this.Promise((resolve2, reject) => {
|
|
35190
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
35191
35191
|
c.rollback(done);
|
|
35192
35192
|
});
|
|
35193
35193
|
}
|
|
35194
35194
|
ping() {
|
|
35195
35195
|
const c = this.connection;
|
|
35196
35196
|
const localErr = new Error;
|
|
35197
|
-
return new this.Promise((
|
|
35197
|
+
return new this.Promise((resolve2, reject) => {
|
|
35198
35198
|
c.ping((err) => {
|
|
35199
35199
|
if (err) {
|
|
35200
35200
|
localErr.message = err.message;
|
|
@@ -35204,7 +35204,7 @@ var require_connection2 = __commonJS((exports, module) => {
|
|
|
35204
35204
|
localErr.sqlMessage = err.sqlMessage;
|
|
35205
35205
|
reject(localErr);
|
|
35206
35206
|
} else {
|
|
35207
|
-
|
|
35207
|
+
resolve2(true);
|
|
35208
35208
|
}
|
|
35209
35209
|
});
|
|
35210
35210
|
});
|
|
@@ -35212,7 +35212,7 @@ var require_connection2 = __commonJS((exports, module) => {
|
|
|
35212
35212
|
connect() {
|
|
35213
35213
|
const c = this.connection;
|
|
35214
35214
|
const localErr = new Error;
|
|
35215
|
-
return new this.Promise((
|
|
35215
|
+
return new this.Promise((resolve2, reject) => {
|
|
35216
35216
|
c.connect((err, param) => {
|
|
35217
35217
|
if (err) {
|
|
35218
35218
|
localErr.message = err.message;
|
|
@@ -35222,7 +35222,7 @@ var require_connection2 = __commonJS((exports, module) => {
|
|
|
35222
35222
|
localErr.sqlMessage = err.sqlMessage;
|
|
35223
35223
|
reject(localErr);
|
|
35224
35224
|
} else {
|
|
35225
|
-
|
|
35225
|
+
resolve2(param);
|
|
35226
35226
|
}
|
|
35227
35227
|
});
|
|
35228
35228
|
});
|
|
@@ -35231,7 +35231,7 @@ var require_connection2 = __commonJS((exports, module) => {
|
|
|
35231
35231
|
const c = this.connection;
|
|
35232
35232
|
const promiseImpl = this.Promise;
|
|
35233
35233
|
const localErr = new Error;
|
|
35234
|
-
return new this.Promise((
|
|
35234
|
+
return new this.Promise((resolve2, reject) => {
|
|
35235
35235
|
c.prepare(options, (err, statement) => {
|
|
35236
35236
|
if (err) {
|
|
35237
35237
|
localErr.message = err.message;
|
|
@@ -35242,7 +35242,7 @@ var require_connection2 = __commonJS((exports, module) => {
|
|
|
35242
35242
|
reject(localErr);
|
|
35243
35243
|
} else {
|
|
35244
35244
|
const wrappedStatement = new PromisePreparedStatementInfo(statement, promiseImpl);
|
|
35245
|
-
|
|
35245
|
+
resolve2(wrappedStatement);
|
|
35246
35246
|
}
|
|
35247
35247
|
});
|
|
35248
35248
|
});
|
|
@@ -35250,7 +35250,7 @@ var require_connection2 = __commonJS((exports, module) => {
|
|
|
35250
35250
|
changeUser(options) {
|
|
35251
35251
|
const c = this.connection;
|
|
35252
35252
|
const localErr = new Error;
|
|
35253
|
-
return new this.Promise((
|
|
35253
|
+
return new this.Promise((resolve2, reject) => {
|
|
35254
35254
|
c.changeUser(options, (err) => {
|
|
35255
35255
|
if (err) {
|
|
35256
35256
|
localErr.message = err.message;
|
|
@@ -35260,7 +35260,7 @@ var require_connection2 = __commonJS((exports, module) => {
|
|
|
35260
35260
|
localErr.sqlMessage = err.sqlMessage;
|
|
35261
35261
|
reject(localErr);
|
|
35262
35262
|
} else {
|
|
35263
|
-
|
|
35263
|
+
resolve2();
|
|
35264
35264
|
}
|
|
35265
35265
|
});
|
|
35266
35266
|
});
|
|
@@ -35538,12 +35538,12 @@ var require_pool2 = __commonJS((exports, module) => {
|
|
|
35538
35538
|
}
|
|
35539
35539
|
getConnection() {
|
|
35540
35540
|
const corePool = this.pool;
|
|
35541
|
-
return new this.Promise((
|
|
35541
|
+
return new this.Promise((resolve2, reject) => {
|
|
35542
35542
|
corePool.getConnection((err, coreConnection) => {
|
|
35543
35543
|
if (err) {
|
|
35544
35544
|
reject(err);
|
|
35545
35545
|
} else {
|
|
35546
|
-
|
|
35546
|
+
resolve2(new PromisePoolConnection(coreConnection, this.Promise));
|
|
35547
35547
|
}
|
|
35548
35548
|
});
|
|
35549
35549
|
});
|
|
@@ -35558,8 +35558,8 @@ var require_pool2 = __commonJS((exports, module) => {
|
|
|
35558
35558
|
if (typeof args === "function") {
|
|
35559
35559
|
throw new Error("Callback function is not available with promise clients.");
|
|
35560
35560
|
}
|
|
35561
|
-
return new this.Promise((
|
|
35562
|
-
const done = makeDoneCb(
|
|
35561
|
+
return new this.Promise((resolve2, reject) => {
|
|
35562
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
35563
35563
|
if (args !== undefined) {
|
|
35564
35564
|
corePool.query(sql, args, done);
|
|
35565
35565
|
} else {
|
|
@@ -35573,8 +35573,8 @@ var require_pool2 = __commonJS((exports, module) => {
|
|
|
35573
35573
|
if (typeof args === "function") {
|
|
35574
35574
|
throw new Error("Callback function is not available with promise clients.");
|
|
35575
35575
|
}
|
|
35576
|
-
return new this.Promise((
|
|
35577
|
-
const done = makeDoneCb(
|
|
35576
|
+
return new this.Promise((resolve2, reject) => {
|
|
35577
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
35578
35578
|
if (args) {
|
|
35579
35579
|
corePool.execute(sql, args, done);
|
|
35580
35580
|
} else {
|
|
@@ -35585,7 +35585,7 @@ var require_pool2 = __commonJS((exports, module) => {
|
|
|
35585
35585
|
end() {
|
|
35586
35586
|
const corePool = this.pool;
|
|
35587
35587
|
const localErr = new Error;
|
|
35588
|
-
return new this.Promise((
|
|
35588
|
+
return new this.Promise((resolve2, reject) => {
|
|
35589
35589
|
corePool.end((err) => {
|
|
35590
35590
|
if (err) {
|
|
35591
35591
|
localErr.message = err.message;
|
|
@@ -35595,7 +35595,7 @@ var require_pool2 = __commonJS((exports, module) => {
|
|
|
35595
35595
|
localErr.sqlMessage = err.sqlMessage;
|
|
35596
35596
|
reject(localErr);
|
|
35597
35597
|
} else {
|
|
35598
|
-
|
|
35598
|
+
resolve2();
|
|
35599
35599
|
}
|
|
35600
35600
|
});
|
|
35601
35601
|
});
|
|
@@ -35996,12 +35996,12 @@ var require_pool_cluster2 = __commonJS((exports, module) => {
|
|
|
35996
35996
|
}
|
|
35997
35997
|
getConnection() {
|
|
35998
35998
|
const corePoolNamespace = this.poolNamespace;
|
|
35999
|
-
return new this.Promise((
|
|
35999
|
+
return new this.Promise((resolve2, reject) => {
|
|
36000
36000
|
corePoolNamespace.getConnection((err, coreConnection) => {
|
|
36001
36001
|
if (err) {
|
|
36002
36002
|
reject(err);
|
|
36003
36003
|
} else {
|
|
36004
|
-
|
|
36004
|
+
resolve2(new PromisePoolConnection(coreConnection, this.Promise));
|
|
36005
36005
|
}
|
|
36006
36006
|
});
|
|
36007
36007
|
});
|
|
@@ -36012,8 +36012,8 @@ var require_pool_cluster2 = __commonJS((exports, module) => {
|
|
|
36012
36012
|
if (typeof values === "function") {
|
|
36013
36013
|
throw new Error("Callback function is not available with promise clients.");
|
|
36014
36014
|
}
|
|
36015
|
-
return new this.Promise((
|
|
36016
|
-
const done = makeDoneCb(
|
|
36015
|
+
return new this.Promise((resolve2, reject) => {
|
|
36016
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
36017
36017
|
corePoolNamespace.query(sql, values, done);
|
|
36018
36018
|
});
|
|
36019
36019
|
}
|
|
@@ -36023,8 +36023,8 @@ var require_pool_cluster2 = __commonJS((exports, module) => {
|
|
|
36023
36023
|
if (typeof values === "function") {
|
|
36024
36024
|
throw new Error("Callback function is not available with promise clients.");
|
|
36025
36025
|
}
|
|
36026
|
-
return new this.Promise((
|
|
36027
|
-
const done = makeDoneCb(
|
|
36026
|
+
return new this.Promise((resolve2, reject) => {
|
|
36027
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
36028
36028
|
corePoolNamespace.execute(sql, values, done);
|
|
36029
36029
|
});
|
|
36030
36030
|
}
|
|
@@ -36054,9 +36054,9 @@ var require_promise = __commonJS((exports) => {
|
|
|
36054
36054
|
if (!thePromise) {
|
|
36055
36055
|
throw new Error("no Promise implementation available." + "Use promise-enabled node version or pass userland Promise" + " implementation as parameter, for example: { Promise: require('bluebird') }");
|
|
36056
36056
|
}
|
|
36057
|
-
return new thePromise((
|
|
36057
|
+
return new thePromise((resolve2, reject) => {
|
|
36058
36058
|
coreConnection.once("connect", () => {
|
|
36059
|
-
|
|
36059
|
+
resolve2(new PromiseConnection(coreConnection, thePromise));
|
|
36060
36060
|
});
|
|
36061
36061
|
coreConnection.once("error", (err) => {
|
|
36062
36062
|
createConnectionErr.message = err.message;
|
|
@@ -36085,12 +36085,12 @@ var require_promise = __commonJS((exports) => {
|
|
|
36085
36085
|
}
|
|
36086
36086
|
getConnection(pattern, selector) {
|
|
36087
36087
|
const corePoolCluster = this.poolCluster;
|
|
36088
|
-
return new this.Promise((
|
|
36088
|
+
return new this.Promise((resolve2, reject) => {
|
|
36089
36089
|
corePoolCluster.getConnection(pattern, selector, (err, coreConnection) => {
|
|
36090
36090
|
if (err) {
|
|
36091
36091
|
reject(err);
|
|
36092
36092
|
} else {
|
|
36093
|
-
|
|
36093
|
+
resolve2(new PromisePoolConnection(coreConnection, this.Promise));
|
|
36094
36094
|
}
|
|
36095
36095
|
});
|
|
36096
36096
|
});
|
|
@@ -36101,8 +36101,8 @@ var require_promise = __commonJS((exports) => {
|
|
|
36101
36101
|
if (typeof args === "function") {
|
|
36102
36102
|
throw new Error("Callback function is not available with promise clients.");
|
|
36103
36103
|
}
|
|
36104
|
-
return new this.Promise((
|
|
36105
|
-
const done = makeDoneCb(
|
|
36104
|
+
return new this.Promise((resolve2, reject) => {
|
|
36105
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
36106
36106
|
corePoolCluster.query(sql, args, done);
|
|
36107
36107
|
});
|
|
36108
36108
|
}
|
|
@@ -36112,8 +36112,8 @@ var require_promise = __commonJS((exports) => {
|
|
|
36112
36112
|
if (typeof args === "function") {
|
|
36113
36113
|
throw new Error("Callback function is not available with promise clients.");
|
|
36114
36114
|
}
|
|
36115
|
-
return new this.Promise((
|
|
36116
|
-
const done = makeDoneCb(
|
|
36115
|
+
return new this.Promise((resolve2, reject) => {
|
|
36116
|
+
const done = makeDoneCb(resolve2, reject, localErr);
|
|
36117
36117
|
corePoolCluster.execute(sql, args, done);
|
|
36118
36118
|
});
|
|
36119
36119
|
}
|
|
@@ -36123,7 +36123,7 @@ var require_promise = __commonJS((exports) => {
|
|
|
36123
36123
|
end() {
|
|
36124
36124
|
const corePoolCluster = this.poolCluster;
|
|
36125
36125
|
const localErr = new Error;
|
|
36126
|
-
return new this.Promise((
|
|
36126
|
+
return new this.Promise((resolve2, reject) => {
|
|
36127
36127
|
corePoolCluster.end((err) => {
|
|
36128
36128
|
if (err) {
|
|
36129
36129
|
localErr.message = err.message;
|
|
@@ -36133,7 +36133,7 @@ var require_promise = __commonJS((exports) => {
|
|
|
36133
36133
|
localErr.sqlMessage = err.sqlMessage;
|
|
36134
36134
|
reject(localErr);
|
|
36135
36135
|
} else {
|
|
36136
|
-
|
|
36136
|
+
resolve2();
|
|
36137
36137
|
}
|
|
36138
36138
|
});
|
|
36139
36139
|
});
|
|
@@ -37820,14 +37820,14 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
37820
37820
|
var thenableResult = result2;
|
|
37821
37821
|
var wasAwaited = false;
|
|
37822
37822
|
var thenable = {
|
|
37823
|
-
then: function(
|
|
37823
|
+
then: function(resolve2, reject) {
|
|
37824
37824
|
wasAwaited = true;
|
|
37825
37825
|
thenableResult.then(function(returnValue2) {
|
|
37826
37826
|
popActScope(prevActScopeDepth);
|
|
37827
37827
|
if (actScopeDepth === 0) {
|
|
37828
|
-
recursivelyFlushAsyncActWork(returnValue2,
|
|
37828
|
+
recursivelyFlushAsyncActWork(returnValue2, resolve2, reject);
|
|
37829
37829
|
} else {
|
|
37830
|
-
|
|
37830
|
+
resolve2(returnValue2);
|
|
37831
37831
|
}
|
|
37832
37832
|
}, function(error2) {
|
|
37833
37833
|
popActScope(prevActScopeDepth);
|
|
@@ -37856,20 +37856,20 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
37856
37856
|
ReactCurrentActQueue.current = null;
|
|
37857
37857
|
}
|
|
37858
37858
|
var _thenable = {
|
|
37859
|
-
then: function(
|
|
37859
|
+
then: function(resolve2, reject) {
|
|
37860
37860
|
if (ReactCurrentActQueue.current === null) {
|
|
37861
37861
|
ReactCurrentActQueue.current = [];
|
|
37862
|
-
recursivelyFlushAsyncActWork(returnValue,
|
|
37862
|
+
recursivelyFlushAsyncActWork(returnValue, resolve2, reject);
|
|
37863
37863
|
} else {
|
|
37864
|
-
|
|
37864
|
+
resolve2(returnValue);
|
|
37865
37865
|
}
|
|
37866
37866
|
}
|
|
37867
37867
|
};
|
|
37868
37868
|
return _thenable;
|
|
37869
37869
|
} else {
|
|
37870
37870
|
var _thenable2 = {
|
|
37871
|
-
then: function(
|
|
37872
|
-
|
|
37871
|
+
then: function(resolve2, reject) {
|
|
37872
|
+
resolve2(returnValue);
|
|
37873
37873
|
}
|
|
37874
37874
|
};
|
|
37875
37875
|
return _thenable2;
|
|
@@ -37885,7 +37885,7 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
37885
37885
|
actScopeDepth = prevActScopeDepth;
|
|
37886
37886
|
}
|
|
37887
37887
|
}
|
|
37888
|
-
function recursivelyFlushAsyncActWork(returnValue,
|
|
37888
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve2, reject) {
|
|
37889
37889
|
{
|
|
37890
37890
|
var queue = ReactCurrentActQueue.current;
|
|
37891
37891
|
if (queue !== null) {
|
|
@@ -37894,16 +37894,16 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
37894
37894
|
enqueueTask(function() {
|
|
37895
37895
|
if (queue.length === 0) {
|
|
37896
37896
|
ReactCurrentActQueue.current = null;
|
|
37897
|
-
|
|
37897
|
+
resolve2(returnValue);
|
|
37898
37898
|
} else {
|
|
37899
|
-
recursivelyFlushAsyncActWork(returnValue,
|
|
37899
|
+
recursivelyFlushAsyncActWork(returnValue, resolve2, reject);
|
|
37900
37900
|
}
|
|
37901
37901
|
});
|
|
37902
37902
|
} catch (error2) {
|
|
37903
37903
|
reject(error2);
|
|
37904
37904
|
}
|
|
37905
37905
|
} else {
|
|
37906
|
-
|
|
37906
|
+
resolve2(returnValue);
|
|
37907
37907
|
}
|
|
37908
37908
|
}
|
|
37909
37909
|
}
|
|
@@ -78090,9 +78090,9 @@ var require_readdirp = __commonJS((exports, module) => {
|
|
|
78090
78090
|
return new ReaddirpStream(options);
|
|
78091
78091
|
};
|
|
78092
78092
|
var readdirpPromise = (root3, options = {}) => {
|
|
78093
|
-
return new Promise((
|
|
78093
|
+
return new Promise((resolve3, reject) => {
|
|
78094
78094
|
const files = [];
|
|
78095
|
-
readdirp(root3, options).on("data", (entry) => files.push(entry)).on("end", () =>
|
|
78095
|
+
readdirp(root3, options).on("data", (entry) => files.push(entry)).on("end", () => resolve3(files)).on("error", (error) => reject(error));
|
|
78096
78096
|
});
|
|
78097
78097
|
};
|
|
78098
78098
|
readdirp.promise = readdirpPromise;
|
|
@@ -80086,13 +80086,13 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
80086
80086
|
this._addToNodeFs(path8, initialAdd, wh, depth + 1);
|
|
80087
80087
|
}
|
|
80088
80088
|
}).on(EV_ERROR, this._boundHandleError);
|
|
80089
|
-
return new Promise((
|
|
80089
|
+
return new Promise((resolve3) => stream6.once(STR_END, () => {
|
|
80090
80090
|
if (this.fsw.closed) {
|
|
80091
80091
|
stream6 = undefined;
|
|
80092
80092
|
return;
|
|
80093
80093
|
}
|
|
80094
80094
|
const wasThrottled = throttler ? throttler.clear() : false;
|
|
80095
|
-
|
|
80095
|
+
resolve3();
|
|
80096
80096
|
previous2.getChildren().filter((item) => {
|
|
80097
80097
|
return item !== directory && !current2.has(item) && (!wh.hasGlob || wh.filterPath({
|
|
80098
80098
|
fullPath: sysPath.resolve(directory, item)
|
|
@@ -80691,206 +80691,70 @@ class SetupWizard {
|
|
|
80691
80691
|
}
|
|
80692
80692
|
async run() {
|
|
80693
80693
|
console.log(import_chalk.default.blue.bold(`
|
|
80694
|
-
\uD83D\uDE80 WordPress
|
|
80694
|
+
\uD83D\uDE80 WordPress Flow Setup
|
|
80695
80695
|
`));
|
|
80696
|
-
console.log(import_chalk.default.gray(`
|
|
80696
|
+
console.log(import_chalk.default.gray(`Configure your project. Press Enter to use defaults.
|
|
80697
80697
|
`));
|
|
80698
80698
|
try {
|
|
80699
|
-
const
|
|
80700
|
-
const config = this.buildConfig(responses);
|
|
80699
|
+
const config = await this.collectConfig();
|
|
80701
80700
|
await this.saveConfig(config);
|
|
80702
80701
|
console.log(import_chalk.default.green.bold(`
|
|
80703
|
-
✅ Configuration saved
|
|
80704
|
-
console.log(import_chalk.default.gray(`
|
|
80702
|
+
✅ Configuration saved!`));
|
|
80703
|
+
console.log(import_chalk.default.gray(`Run 'wordpress-flow dev' to start developing.
|
|
80705
80704
|
`));
|
|
80706
80705
|
return config;
|
|
80707
80706
|
} finally {
|
|
80708
80707
|
this.rl.close();
|
|
80709
80708
|
}
|
|
80710
80709
|
}
|
|
80711
|
-
async
|
|
80712
|
-
const
|
|
80713
|
-
|
|
80714
|
-
const
|
|
80715
|
-
const
|
|
80716
|
-
const
|
|
80717
|
-
|
|
80718
|
-
|
|
80719
|
-
|
|
80720
|
-
|
|
80721
|
-
|
|
80722
|
-
|
|
80723
|
-
|
|
80724
|
-
|
|
80725
|
-
};
|
|
80726
|
-
}
|
|
80727
|
-
async askConnectionType() {
|
|
80728
|
-
console.log(import_chalk.default.yellow("Connection Method:"));
|
|
80729
|
-
console.log("1. REST API (recommended - works with any WordPress installation)");
|
|
80730
|
-
console.log(`2. Direct Database (faster - requires database access)
|
|
80731
|
-
`);
|
|
80732
|
-
const choice = await this.ask("Choose connection method (1 or 2): ");
|
|
80733
|
-
if (choice === "1") {
|
|
80734
|
-
return "rest-api";
|
|
80735
|
-
} else if (choice === "2") {
|
|
80736
|
-
return "database";
|
|
80737
|
-
} else {
|
|
80738
|
-
console.log(import_chalk.default.red("Invalid choice. Please enter 1 or 2."));
|
|
80739
|
-
return this.askConnectionType();
|
|
80740
|
-
}
|
|
80741
|
-
}
|
|
80742
|
-
async askWordPressUrl() {
|
|
80743
|
-
const url = await this.ask("WordPress site URL (e.g., https://example.com): ");
|
|
80744
|
-
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
|
80745
|
-
console.log(import_chalk.default.red("Please enter a valid URL starting with http:// or https://"));
|
|
80746
|
-
return this.askWordPressUrl();
|
|
80710
|
+
async collectConfig() {
|
|
80711
|
+
const config = {};
|
|
80712
|
+
console.log(import_chalk.default.yellow("Paths:"));
|
|
80713
|
+
const theme = await this.ask("Theme directory (./theme): ");
|
|
80714
|
+
const content2 = await this.ask("Content directory (./content): ");
|
|
80715
|
+
const plugins = await this.ask("Plugins directory (./plugins): ");
|
|
80716
|
+
if (theme || content2 || plugins) {
|
|
80717
|
+
config.paths = {};
|
|
80718
|
+
if (theme)
|
|
80719
|
+
config.paths.theme = theme;
|
|
80720
|
+
if (content2)
|
|
80721
|
+
config.paths.content = content2;
|
|
80722
|
+
if (plugins)
|
|
80723
|
+
config.paths.plugins = plugins;
|
|
80747
80724
|
}
|
|
80748
|
-
return url.replace(/\/$/, "");
|
|
80749
|
-
}
|
|
80750
|
-
async askCredentials(type) {
|
|
80751
|
-
if (type === "rest-api") {
|
|
80752
|
-
return this.askRestApiCredentials();
|
|
80753
|
-
} else {
|
|
80754
|
-
return this.askDatabaseCredentials();
|
|
80755
|
-
}
|
|
80756
|
-
}
|
|
80757
|
-
async askRestApiCredentials() {
|
|
80758
|
-
console.log(import_chalk.default.yellow(`
|
|
80759
|
-
REST API Credentials:`));
|
|
80760
|
-
console.log(import_chalk.default.gray(`You can generate an application password in your WordPress admin under Users > Profile.
|
|
80761
|
-
`));
|
|
80762
|
-
const username = await this.ask("WordPress username: ");
|
|
80763
|
-
const applicationPassword = await this.ask("Application password: ", true);
|
|
80764
|
-
return { username, applicationPassword };
|
|
80765
|
-
}
|
|
80766
|
-
async askDatabaseCredentials() {
|
|
80767
80725
|
console.log(import_chalk.default.yellow(`
|
|
80768
|
-
|
|
80769
|
-
const
|
|
80770
|
-
const
|
|
80771
|
-
const
|
|
80772
|
-
|
|
80773
|
-
|
|
80774
|
-
|
|
80775
|
-
|
|
80776
|
-
|
|
80777
|
-
|
|
80778
|
-
|
|
80779
|
-
|
|
80780
|
-
|
|
80781
|
-
|
|
80782
|
-
|
|
80783
|
-
|
|
80784
|
-
|
|
80785
|
-
|
|
80786
|
-
|
|
80787
|
-
|
|
80788
|
-
Post Types:`));
|
|
80789
|
-
console.log(import_chalk.default.gray(`Specify which post types to sync (comma-separated).
|
|
80790
|
-
`));
|
|
80791
|
-
const postTypesStr = await this.ask("Post types to sync (default: post,page): ") || "post,page";
|
|
80792
|
-
return postTypesStr.split(",").map((type) => type.trim()).filter(Boolean);
|
|
80793
|
-
}
|
|
80794
|
-
async askConflictResolution() {
|
|
80795
|
-
console.log(import_chalk.default.yellow(`
|
|
80796
|
-
Conflict Resolution:`));
|
|
80797
|
-
console.log("1. Manual - Ask for each conflict");
|
|
80798
|
-
console.log("2. WordPress wins - Always use WordPress version");
|
|
80799
|
-
console.log(`3. Local wins - Always use local version
|
|
80800
|
-
`);
|
|
80801
|
-
const choice = await this.ask("Choose conflict resolution (1, 2, or 3): ");
|
|
80802
|
-
switch (choice) {
|
|
80803
|
-
case "1":
|
|
80804
|
-
return "manual";
|
|
80805
|
-
case "2":
|
|
80806
|
-
return "wordpress-wins";
|
|
80807
|
-
case "3":
|
|
80808
|
-
return "local-wins";
|
|
80809
|
-
default:
|
|
80810
|
-
console.log(import_chalk.default.red("Invalid choice. Please enter 1, 2, or 3."));
|
|
80811
|
-
return this.askConflictResolution();
|
|
80812
|
-
}
|
|
80813
|
-
}
|
|
80814
|
-
buildConfig(responses) {
|
|
80815
|
-
const baseConfig = {
|
|
80816
|
-
wordpressUrl: responses.wordpressUrl,
|
|
80817
|
-
syncPath: responses.syncPath,
|
|
80818
|
-
postTypes: responses.postTypes
|
|
80819
|
-
};
|
|
80820
|
-
let wordpress;
|
|
80821
|
-
if (responses.connectionType === "rest-api") {
|
|
80822
|
-
const creds = responses.credentials;
|
|
80823
|
-
wordpress = {
|
|
80824
|
-
type: "rest-api",
|
|
80825
|
-
...baseConfig,
|
|
80826
|
-
username: creds.username,
|
|
80827
|
-
applicationPassword: creds.applicationPassword
|
|
80828
|
-
};
|
|
80829
|
-
} else {
|
|
80830
|
-
const creds = responses.credentials;
|
|
80831
|
-
wordpress = {
|
|
80832
|
-
type: "database",
|
|
80833
|
-
...baseConfig,
|
|
80834
|
-
database: creds
|
|
80835
|
-
};
|
|
80836
|
-
}
|
|
80837
|
-
return {
|
|
80838
|
-
wordpress,
|
|
80839
|
-
paths: {
|
|
80840
|
-
mdxOutputDir: responses.syncPath,
|
|
80841
|
-
postTypeMappings: responses.postTypes.reduce((acc, type) => {
|
|
80842
|
-
acc[type] = path.join(responses.syncPath, type);
|
|
80843
|
-
return acc;
|
|
80844
|
-
}, {})
|
|
80845
|
-
},
|
|
80846
|
-
sync: {
|
|
80847
|
-
watchForChanges: true,
|
|
80848
|
-
conflictResolution: responses.conflictResolution,
|
|
80849
|
-
excludePostTypes: [],
|
|
80850
|
-
includedPostStatuses: ["publish", "draft"]
|
|
80851
|
-
}
|
|
80852
|
-
};
|
|
80726
|
+
Dev Environment:`));
|
|
80727
|
+
const port = await this.ask("WordPress port (8888): ");
|
|
80728
|
+
const dbPort = await this.ask("Database port (3306): ");
|
|
80729
|
+
const phpVersion = await this.ask("PHP version (8.2): ");
|
|
80730
|
+
const wpVersion = await this.ask("WordPress version (latest): ");
|
|
80731
|
+
const sqlDump = await this.ask("SQL dump file to import (none): ");
|
|
80732
|
+
if (port || dbPort || phpVersion || wpVersion || sqlDump) {
|
|
80733
|
+
config.dev = {};
|
|
80734
|
+
if (port)
|
|
80735
|
+
config.dev.port = parseInt(port, 10);
|
|
80736
|
+
if (dbPort)
|
|
80737
|
+
config.dev.databasePort = parseInt(dbPort, 10);
|
|
80738
|
+
if (phpVersion)
|
|
80739
|
+
config.dev.phpVersion = phpVersion;
|
|
80740
|
+
if (wpVersion)
|
|
80741
|
+
config.dev.wordpressVersion = wpVersion;
|
|
80742
|
+
if (sqlDump)
|
|
80743
|
+
config.dev.sqlDump = sqlDump;
|
|
80744
|
+
}
|
|
80745
|
+
return config;
|
|
80853
80746
|
}
|
|
80854
80747
|
async saveConfig(config) {
|
|
80855
80748
|
const configPath = path.join(process.cwd(), "wordpress-flow.config.json");
|
|
80856
|
-
|
|
80857
|
-
|
|
80858
|
-
|
|
80859
|
-
|
|
80860
|
-
|
|
80861
|
-
|
|
80862
|
-
|
|
80863
|
-
|
|
80864
|
-
|
|
80865
|
-
const envVars = [];
|
|
80866
|
-
if (config.wordpress.type === "rest-api") {
|
|
80867
|
-
envVars.push(`WP_APPLICATION_PASSWORD=${config.wordpress.applicationPassword}`);
|
|
80868
|
-
} else {
|
|
80869
|
-
envVars.push(`DB_PASSWORD=${config.wordpress.database.password}`);
|
|
80870
|
-
}
|
|
80871
|
-
let existingEnv = "";
|
|
80872
|
-
if (fs.existsSync(envPath)) {
|
|
80873
|
-
existingEnv = fs.readFileSync(envPath, "utf8");
|
|
80874
|
-
}
|
|
80875
|
-
const newEnvContent = existingEnv + `
|
|
80876
|
-
` + envVars.join(`
|
|
80877
|
-
`) + `
|
|
80878
|
-
`;
|
|
80879
|
-
fs.writeFileSync(envPath, newEnvContent);
|
|
80880
|
-
console.log(import_chalk.default.gray(`Credentials saved to: ${envPath}`));
|
|
80881
|
-
}
|
|
80882
|
-
ask(question, isPassword = false) {
|
|
80883
|
-
return new Promise((resolve2) => {
|
|
80884
|
-
if (isPassword) {
|
|
80885
|
-
this.rl.question(question, (answer) => {
|
|
80886
|
-
resolve2(answer);
|
|
80887
|
-
});
|
|
80888
|
-
this.rl._writeToOutput = () => {};
|
|
80889
|
-
} else {
|
|
80890
|
-
this.rl.question(question, (answer) => {
|
|
80891
|
-
resolve2(answer);
|
|
80892
|
-
});
|
|
80893
|
-
}
|
|
80749
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
80750
|
+
console.log(import_chalk.default.gray(`
|
|
80751
|
+
Saved to: ${configPath}`));
|
|
80752
|
+
}
|
|
80753
|
+
ask(question) {
|
|
80754
|
+
return new Promise((resolve) => {
|
|
80755
|
+
this.rl.question(question, (answer) => {
|
|
80756
|
+
resolve(answer.trim());
|
|
80757
|
+
});
|
|
80894
80758
|
});
|
|
80895
80759
|
}
|
|
80896
80760
|
}
|
|
@@ -82480,10 +82344,10 @@ utils_default.inherits(CanceledError, AxiosError_default, {
|
|
|
82480
82344
|
var CanceledError_default = CanceledError;
|
|
82481
82345
|
|
|
82482
82346
|
// ../../node_modules/axios/lib/core/settle.js
|
|
82483
|
-
function settle(
|
|
82347
|
+
function settle(resolve2, reject, response) {
|
|
82484
82348
|
const validateStatus2 = response.config.validateStatus;
|
|
82485
82349
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
82486
|
-
|
|
82350
|
+
resolve2(response);
|
|
82487
82351
|
} else {
|
|
82488
82352
|
reject(new AxiosError_default("Request failed with status code " + response.status, [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response));
|
|
82489
82353
|
}
|
|
@@ -83106,7 +82970,7 @@ function setProxy(options, configProxy, location) {
|
|
|
83106
82970
|
}
|
|
83107
82971
|
var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
83108
82972
|
var wrapAsync = (asyncExecutor) => {
|
|
83109
|
-
return new Promise((
|
|
82973
|
+
return new Promise((resolve2, reject) => {
|
|
83110
82974
|
let onDone;
|
|
83111
82975
|
let isDone;
|
|
83112
82976
|
const done = (value, isRejected) => {
|
|
@@ -83117,7 +82981,7 @@ var wrapAsync = (asyncExecutor) => {
|
|
|
83117
82981
|
};
|
|
83118
82982
|
const _resolve = (value) => {
|
|
83119
82983
|
done(value);
|
|
83120
|
-
|
|
82984
|
+
resolve2(value);
|
|
83121
82985
|
};
|
|
83122
82986
|
const _reject = (reason) => {
|
|
83123
82987
|
done(reason, true);
|
|
@@ -83169,7 +83033,7 @@ var http2Transport = {
|
|
|
83169
83033
|
}
|
|
83170
83034
|
};
|
|
83171
83035
|
var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
83172
|
-
return wrapAsync(async function dispatchHttpRequest(
|
|
83036
|
+
return wrapAsync(async function dispatchHttpRequest(resolve2, reject, onDone) {
|
|
83173
83037
|
let { data, lookup, family, httpVersion = 1, http2Options } = config;
|
|
83174
83038
|
const { responseType, responseEncoding } = config;
|
|
83175
83039
|
const method = config.method.toUpperCase();
|
|
@@ -83250,7 +83114,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
83250
83114
|
}
|
|
83251
83115
|
let convertedData;
|
|
83252
83116
|
if (method !== "GET") {
|
|
83253
|
-
return settle(
|
|
83117
|
+
return settle(resolve2, reject, {
|
|
83254
83118
|
status: 405,
|
|
83255
83119
|
statusText: "method not allowed",
|
|
83256
83120
|
headers: {},
|
|
@@ -83272,7 +83136,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
83272
83136
|
} else if (responseType === "stream") {
|
|
83273
83137
|
convertedData = stream3.Readable.from(convertedData);
|
|
83274
83138
|
}
|
|
83275
|
-
return settle(
|
|
83139
|
+
return settle(resolve2, reject, {
|
|
83276
83140
|
data: convertedData,
|
|
83277
83141
|
status: 200,
|
|
83278
83142
|
statusText: "OK",
|
|
@@ -83457,7 +83321,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
83457
83321
|
};
|
|
83458
83322
|
if (responseType === "stream") {
|
|
83459
83323
|
response.data = responseStream;
|
|
83460
|
-
settle(
|
|
83324
|
+
settle(resolve2, reject, response);
|
|
83461
83325
|
} else {
|
|
83462
83326
|
const responseBuffer = [];
|
|
83463
83327
|
let totalResponseBytes = 0;
|
|
@@ -83496,7 +83360,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
83496
83360
|
} catch (err) {
|
|
83497
83361
|
return reject(AxiosError_default.from(err, null, config, response.request, response));
|
|
83498
83362
|
}
|
|
83499
|
-
settle(
|
|
83363
|
+
settle(resolve2, reject, response);
|
|
83500
83364
|
});
|
|
83501
83365
|
}
|
|
83502
83366
|
abortEmitter.once("abort", (err) => {
|
|
@@ -83724,7 +83588,7 @@ var resolveConfig_default = (config) => {
|
|
|
83724
83588
|
// ../../node_modules/axios/lib/adapters/xhr.js
|
|
83725
83589
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
83726
83590
|
var xhr_default = isXHRAdapterSupported && function(config) {
|
|
83727
|
-
return new Promise(function dispatchXhrRequest(
|
|
83591
|
+
return new Promise(function dispatchXhrRequest(resolve2, reject) {
|
|
83728
83592
|
const _config = resolveConfig_default(config);
|
|
83729
83593
|
let requestData = _config.data;
|
|
83730
83594
|
const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
|
|
@@ -83756,7 +83620,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
|
|
|
83756
83620
|
request
|
|
83757
83621
|
};
|
|
83758
83622
|
settle(function _resolve(value) {
|
|
83759
|
-
|
|
83623
|
+
resolve2(value);
|
|
83760
83624
|
done();
|
|
83761
83625
|
}, function _reject(err) {
|
|
83762
83626
|
reject(err);
|
|
@@ -84113,8 +83977,8 @@ var factory = (env) => {
|
|
|
84113
83977
|
responseType = responseType || "text";
|
|
84114
83978
|
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config);
|
|
84115
83979
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
84116
|
-
return await new Promise((
|
|
84117
|
-
settle(
|
|
83980
|
+
return await new Promise((resolve2, reject) => {
|
|
83981
|
+
settle(resolve2, reject, {
|
|
84118
83982
|
data: responseData,
|
|
84119
83983
|
headers: AxiosHeaders_default.from(response.headers),
|
|
84120
83984
|
status: response.status,
|
|
@@ -84462,8 +84326,8 @@ class CancelToken {
|
|
|
84462
84326
|
throw new TypeError("executor must be a function.");
|
|
84463
84327
|
}
|
|
84464
84328
|
let resolvePromise;
|
|
84465
|
-
this.promise = new Promise(function promiseExecutor(
|
|
84466
|
-
resolvePromise =
|
|
84329
|
+
this.promise = new Promise(function promiseExecutor(resolve2) {
|
|
84330
|
+
resolvePromise = resolve2;
|
|
84467
84331
|
});
|
|
84468
84332
|
const token = this;
|
|
84469
84333
|
this.promise.then((cancel) => {
|
|
@@ -84477,9 +84341,9 @@ class CancelToken {
|
|
|
84477
84341
|
});
|
|
84478
84342
|
this.promise.then = (onfulfilled) => {
|
|
84479
84343
|
let _resolve;
|
|
84480
|
-
const promise = new Promise((
|
|
84481
|
-
token.subscribe(
|
|
84482
|
-
_resolve =
|
|
84344
|
+
const promise = new Promise((resolve2) => {
|
|
84345
|
+
token.subscribe(resolve2);
|
|
84346
|
+
_resolve = resolve2;
|
|
84483
84347
|
}).then(onfulfilled);
|
|
84484
84348
|
promise.cancel = function reject() {
|
|
84485
84349
|
token.unsubscribe(_resolve);
|
|
@@ -89032,10 +88896,10 @@ class Minipass extends EventEmitter2 {
|
|
|
89032
88896
|
return this[ENCODING] ? buf.join("") : Buffer.concat(buf, buf.dataLength);
|
|
89033
88897
|
}
|
|
89034
88898
|
async promise() {
|
|
89035
|
-
return new Promise((
|
|
88899
|
+
return new Promise((resolve2, reject) => {
|
|
89036
88900
|
this.on(DESTROYED, () => reject(new Error("stream destroyed")));
|
|
89037
88901
|
this.on("error", (er) => reject(er));
|
|
89038
|
-
this.on("end", () =>
|
|
88902
|
+
this.on("end", () => resolve2());
|
|
89039
88903
|
});
|
|
89040
88904
|
}
|
|
89041
88905
|
[Symbol.asyncIterator]() {
|
|
@@ -89054,7 +88918,7 @@ class Minipass extends EventEmitter2 {
|
|
|
89054
88918
|
return Promise.resolve({ done: false, value: res });
|
|
89055
88919
|
if (this[EOF])
|
|
89056
88920
|
return stop();
|
|
89057
|
-
let
|
|
88921
|
+
let resolve2;
|
|
89058
88922
|
let reject;
|
|
89059
88923
|
const onerr = (er) => {
|
|
89060
88924
|
this.off("data", ondata);
|
|
@@ -89068,19 +88932,19 @@ class Minipass extends EventEmitter2 {
|
|
|
89068
88932
|
this.off("end", onend);
|
|
89069
88933
|
this.off(DESTROYED, ondestroy);
|
|
89070
88934
|
this.pause();
|
|
89071
|
-
|
|
88935
|
+
resolve2({ value, done: !!this[EOF] });
|
|
89072
88936
|
};
|
|
89073
88937
|
const onend = () => {
|
|
89074
88938
|
this.off("error", onerr);
|
|
89075
88939
|
this.off("data", ondata);
|
|
89076
88940
|
this.off(DESTROYED, ondestroy);
|
|
89077
88941
|
stop();
|
|
89078
|
-
|
|
88942
|
+
resolve2({ done: true, value: undefined });
|
|
89079
88943
|
};
|
|
89080
88944
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
89081
88945
|
return new Promise((res2, rej) => {
|
|
89082
88946
|
reject = rej;
|
|
89083
|
-
|
|
88947
|
+
resolve2 = res2;
|
|
89084
88948
|
this.once(DESTROYED, ondestroy);
|
|
89085
88949
|
this.once("error", onerr);
|
|
89086
88950
|
this.once("end", onend);
|
|
@@ -89780,8 +89644,8 @@ class PathBase {
|
|
|
89780
89644
|
if (this.#asyncReaddirInFlight) {
|
|
89781
89645
|
await this.#asyncReaddirInFlight;
|
|
89782
89646
|
} else {
|
|
89783
|
-
let
|
|
89784
|
-
this.#asyncReaddirInFlight = new Promise((res) =>
|
|
89647
|
+
let resolve2 = () => {};
|
|
89648
|
+
this.#asyncReaddirInFlight = new Promise((res) => resolve2 = res);
|
|
89785
89649
|
try {
|
|
89786
89650
|
for (const e of await this.#fs.promises.readdir(fullpath, {
|
|
89787
89651
|
withFileTypes: true
|
|
@@ -89794,7 +89658,7 @@ class PathBase {
|
|
|
89794
89658
|
children.provisional = 0;
|
|
89795
89659
|
}
|
|
89796
89660
|
this.#asyncReaddirInFlight = undefined;
|
|
89797
|
-
|
|
89661
|
+
resolve2();
|
|
89798
89662
|
}
|
|
89799
89663
|
return children.slice(0, children.provisional);
|
|
89800
89664
|
}
|
|
@@ -105057,10 +104921,10 @@ function resolveAll(constructs, events, context) {
|
|
|
105057
104921
|
const called = [];
|
|
105058
104922
|
let index2 = -1;
|
|
105059
104923
|
while (++index2 < constructs.length) {
|
|
105060
|
-
const
|
|
105061
|
-
if (
|
|
105062
|
-
events =
|
|
105063
|
-
called.push(
|
|
104924
|
+
const resolve2 = constructs[index2].resolveAll;
|
|
104925
|
+
if (resolve2 && !called.includes(resolve2)) {
|
|
104926
|
+
events = resolve2(events, context);
|
|
104927
|
+
called.push(resolve2);
|
|
105064
104928
|
}
|
|
105065
104929
|
}
|
|
105066
104930
|
return events;
|
|
@@ -111108,7 +110972,7 @@ class Processor2 extends CallableInstance {
|
|
|
111108
110972
|
assertParser("process", this.parser || this.Parser);
|
|
111109
110973
|
assertCompiler("process", this.compiler || this.Compiler);
|
|
111110
110974
|
return done ? executor(undefined, done) : new Promise(executor);
|
|
111111
|
-
function executor(
|
|
110975
|
+
function executor(resolve2, reject) {
|
|
111112
110976
|
const realFile = vfile(file);
|
|
111113
110977
|
const parseTree = self2.parse(realFile);
|
|
111114
110978
|
self2.run(parseTree, realFile, function(error, tree, file2) {
|
|
@@ -111127,8 +110991,8 @@ class Processor2 extends CallableInstance {
|
|
|
111127
110991
|
function realDone(error, file2) {
|
|
111128
110992
|
if (error || !file2) {
|
|
111129
110993
|
reject(error);
|
|
111130
|
-
} else if (
|
|
111131
|
-
|
|
110994
|
+
} else if (resolve2) {
|
|
110995
|
+
resolve2(file2);
|
|
111132
110996
|
} else {
|
|
111133
110997
|
ok(done, "`done` is defined if `resolve` is not");
|
|
111134
110998
|
done(undefined, file2);
|
|
@@ -111161,7 +111025,7 @@ class Processor2 extends CallableInstance {
|
|
|
111161
111025
|
file = undefined;
|
|
111162
111026
|
}
|
|
111163
111027
|
return done ? executor(undefined, done) : new Promise(executor);
|
|
111164
|
-
function executor(
|
|
111028
|
+
function executor(resolve2, reject) {
|
|
111165
111029
|
ok(typeof file !== "function", "`file` can’t be a `done` anymore, we checked");
|
|
111166
111030
|
const realFile = vfile(file);
|
|
111167
111031
|
transformers.run(tree, realFile, realDone);
|
|
@@ -111169,8 +111033,8 @@ class Processor2 extends CallableInstance {
|
|
|
111169
111033
|
const resultingTree = outputTree || tree;
|
|
111170
111034
|
if (error) {
|
|
111171
111035
|
reject(error);
|
|
111172
|
-
} else if (
|
|
111173
|
-
|
|
111036
|
+
} else if (resolve2) {
|
|
111037
|
+
resolve2(resultingTree);
|
|
111174
111038
|
} else {
|
|
111175
111039
|
ok(done, "`done` is defined if `resolve` is not");
|
|
111176
111040
|
done(undefined, resultingTree, file2);
|
|
@@ -114804,7 +114668,7 @@ class AbortableWorkerPool {
|
|
|
114804
114668
|
const total = blocks.length;
|
|
114805
114669
|
let activeCount = 0;
|
|
114806
114670
|
logger.debug(`Building ${total} block(s) with ${this.concurrency} worker(s)`);
|
|
114807
|
-
return new Promise((
|
|
114671
|
+
return new Promise((resolve3) => {
|
|
114808
114672
|
const processNext = () => {
|
|
114809
114673
|
while (activeCount < this.concurrency && queue.length > 0) {
|
|
114810
114674
|
const block = queue.shift();
|
|
@@ -114817,7 +114681,7 @@ class AbortableWorkerPool {
|
|
|
114817
114681
|
if (queue.length > 0) {
|
|
114818
114682
|
processNext();
|
|
114819
114683
|
} else if (activeCount === 0) {
|
|
114820
|
-
|
|
114684
|
+
resolve3(results);
|
|
114821
114685
|
}
|
|
114822
114686
|
}).catch((error) => {
|
|
114823
114687
|
const errorMsg = error.message || String(error);
|
|
@@ -114833,7 +114697,7 @@ class AbortableWorkerPool {
|
|
|
114833
114697
|
if (queue.length > 0) {
|
|
114834
114698
|
processNext();
|
|
114835
114699
|
} else if (activeCount === 0) {
|
|
114836
|
-
|
|
114700
|
+
resolve3(results);
|
|
114837
114701
|
}
|
|
114838
114702
|
});
|
|
114839
114703
|
}
|
|
@@ -114842,7 +114706,7 @@ class AbortableWorkerPool {
|
|
|
114842
114706
|
});
|
|
114843
114707
|
}
|
|
114844
114708
|
buildBlockInWorker(block) {
|
|
114845
|
-
return new Promise((
|
|
114709
|
+
return new Promise((resolve3, reject) => {
|
|
114846
114710
|
const tempDir = path9.join(process.cwd(), ".wordpress-flow-temp", `worker-${block.name}-${Date.now()}`);
|
|
114847
114711
|
const workerData = {
|
|
114848
114712
|
block: {
|
|
@@ -114869,7 +114733,7 @@ class AbortableWorkerPool {
|
|
|
114869
114733
|
if (this.activeWorkers.has(block.name)) {
|
|
114870
114734
|
this.activeWorkers.delete(block.name);
|
|
114871
114735
|
worker.terminate();
|
|
114872
|
-
|
|
114736
|
+
resolve3({
|
|
114873
114737
|
success: false,
|
|
114874
114738
|
blockName: block.name,
|
|
114875
114739
|
error: `Build timeout after 5 minutes`,
|
|
@@ -114881,7 +114745,7 @@ class AbortableWorkerPool {
|
|
|
114881
114745
|
clearTimeout(timeout);
|
|
114882
114746
|
this.activeWorkers.delete(block.name);
|
|
114883
114747
|
if (activeWorker.aborted) {
|
|
114884
|
-
|
|
114748
|
+
resolve3({
|
|
114885
114749
|
success: false,
|
|
114886
114750
|
blockName: block.name,
|
|
114887
114751
|
aborted: true,
|
|
@@ -114890,7 +114754,7 @@ class AbortableWorkerPool {
|
|
|
114890
114754
|
return;
|
|
114891
114755
|
}
|
|
114892
114756
|
worker.terminate();
|
|
114893
|
-
|
|
114757
|
+
resolve3({
|
|
114894
114758
|
...result2,
|
|
114895
114759
|
buildTimeMs: Date.now() - startTime
|
|
114896
114760
|
});
|
|
@@ -114900,7 +114764,7 @@ class AbortableWorkerPool {
|
|
|
114900
114764
|
this.activeWorkers.delete(block.name);
|
|
114901
114765
|
worker.terminate();
|
|
114902
114766
|
if (activeWorker.aborted) {
|
|
114903
|
-
|
|
114767
|
+
resolve3({
|
|
114904
114768
|
success: false,
|
|
114905
114769
|
blockName: block.name,
|
|
114906
114770
|
aborted: true,
|
|
@@ -114908,7 +114772,7 @@ class AbortableWorkerPool {
|
|
|
114908
114772
|
});
|
|
114909
114773
|
return;
|
|
114910
114774
|
}
|
|
114911
|
-
|
|
114775
|
+
resolve3({
|
|
114912
114776
|
success: false,
|
|
114913
114777
|
blockName: block.name,
|
|
114914
114778
|
error: error.message,
|
|
@@ -114920,14 +114784,14 @@ class AbortableWorkerPool {
|
|
|
114920
114784
|
if (this.activeWorkers.has(block.name)) {
|
|
114921
114785
|
this.activeWorkers.delete(block.name);
|
|
114922
114786
|
if (activeWorker.aborted) {
|
|
114923
|
-
|
|
114787
|
+
resolve3({
|
|
114924
114788
|
success: false,
|
|
114925
114789
|
blockName: block.name,
|
|
114926
114790
|
aborted: true,
|
|
114927
114791
|
buildTimeMs: Date.now() - startTime
|
|
114928
114792
|
});
|
|
114929
114793
|
} else if (code2 !== 0) {
|
|
114930
|
-
|
|
114794
|
+
resolve3({
|
|
114931
114795
|
success: false,
|
|
114932
114796
|
blockName: block.name,
|
|
114933
114797
|
error: `Worker exited with code ${code2}`,
|
|
@@ -116235,7 +116099,7 @@ class DockerEnvManager {
|
|
|
116235
116099
|
return `http://localhost:${this.config.dev.port}`;
|
|
116236
116100
|
}
|
|
116237
116101
|
sleep(ms) {
|
|
116238
|
-
return new Promise((
|
|
116102
|
+
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
116239
116103
|
}
|
|
116240
116104
|
async cleanup() {
|
|
116241
116105
|
logger.info("\uD83E\uDDF9 Cleaning up Docker environment...");
|
|
@@ -116268,7 +116132,7 @@ class DockerEnvManager {
|
|
|
116268
116132
|
// package.json
|
|
116269
116133
|
var package_default = {
|
|
116270
116134
|
name: "@wordpress-flow/cli",
|
|
116271
|
-
version: "1.2.
|
|
116135
|
+
version: "1.2.3",
|
|
116272
116136
|
type: "module",
|
|
116273
116137
|
description: "TypeScript-based WordPress block creation system",
|
|
116274
116138
|
main: "dist/index.js",
|
|
@@ -117643,7 +117507,7 @@ class WorkerPool {
|
|
|
117643
117507
|
const total = blocks.length;
|
|
117644
117508
|
let activeWorkers = 0;
|
|
117645
117509
|
logger.info(`Building ${total} block(s) with ${this.concurrency} worker(s)`);
|
|
117646
|
-
return new Promise((
|
|
117510
|
+
return new Promise((resolve7, reject) => {
|
|
117647
117511
|
const processNext = () => {
|
|
117648
117512
|
while (activeWorkers < this.concurrency && queue.length > 0) {
|
|
117649
117513
|
const block = queue.shift();
|
|
@@ -117656,7 +117520,7 @@ class WorkerPool {
|
|
|
117656
117520
|
if (queue.length > 0) {
|
|
117657
117521
|
processNext();
|
|
117658
117522
|
} else if (activeWorkers === 0) {
|
|
117659
|
-
|
|
117523
|
+
resolve7(results);
|
|
117660
117524
|
}
|
|
117661
117525
|
}).catch((error) => {
|
|
117662
117526
|
const result2 = {
|
|
@@ -117671,7 +117535,7 @@ class WorkerPool {
|
|
|
117671
117535
|
if (queue.length > 0) {
|
|
117672
117536
|
processNext();
|
|
117673
117537
|
} else if (activeWorkers === 0) {
|
|
117674
|
-
|
|
117538
|
+
resolve7(results);
|
|
117675
117539
|
}
|
|
117676
117540
|
});
|
|
117677
117541
|
}
|
|
@@ -117680,7 +117544,7 @@ class WorkerPool {
|
|
|
117680
117544
|
});
|
|
117681
117545
|
}
|
|
117682
117546
|
buildBlockInWorker(block) {
|
|
117683
|
-
return new Promise((
|
|
117547
|
+
return new Promise((resolve7, reject) => {
|
|
117684
117548
|
const tempDir = path21.join(process.cwd(), ".wordpress-flow-temp", `worker-${block.name}-${Date.now()}`);
|
|
117685
117549
|
const workerData = {
|
|
117686
117550
|
block: {
|
|
@@ -117702,7 +117566,7 @@ class WorkerPool {
|
|
|
117702
117566
|
worker.on("message", (result2) => {
|
|
117703
117567
|
clearTimeout(timeout);
|
|
117704
117568
|
worker.terminate();
|
|
117705
|
-
|
|
117569
|
+
resolve7(result2);
|
|
117706
117570
|
});
|
|
117707
117571
|
worker.on("error", (error) => {
|
|
117708
117572
|
clearTimeout(timeout);
|
|
@@ -118131,12 +117995,31 @@ program2.command("database export").description("Export Docker database to SQL f
|
|
|
118131
117995
|
async function ensureConfiguration() {
|
|
118132
117996
|
const configManager = ConfigManager.getInstance();
|
|
118133
117997
|
if (!configManager.hasConfig()) {
|
|
118134
|
-
|
|
118135
|
-
|
|
118136
|
-
|
|
117998
|
+
const shouldCreate = await askYesNo(import_chalk4.default.yellow("⚠️ No configuration found. Create wordpress-flow.config.json with defaults?"));
|
|
117999
|
+
if (shouldCreate) {
|
|
118000
|
+
await configManager.saveConfig({});
|
|
118001
|
+
console.log(import_chalk4.default.green("✅ Created wordpress-flow.config.json"));
|
|
118002
|
+
} else {
|
|
118003
|
+
console.log(import_chalk4.default.gray("Aborted. Run 'wordpress-flow setup' to configure manually."));
|
|
118004
|
+
process.exit(0);
|
|
118005
|
+
}
|
|
118137
118006
|
}
|
|
118138
118007
|
await configManager.loadConfig();
|
|
118139
118008
|
}
|
|
118009
|
+
function askYesNo(question) {
|
|
118010
|
+
return new Promise((resolve7) => {
|
|
118011
|
+
const readline2 = __require("readline");
|
|
118012
|
+
const rl = readline2.createInterface({
|
|
118013
|
+
input: process.stdin,
|
|
118014
|
+
output: process.stdout
|
|
118015
|
+
});
|
|
118016
|
+
rl.question(`${question} (Y/n): `, (answer) => {
|
|
118017
|
+
rl.close();
|
|
118018
|
+
const normalized = answer.trim().toLowerCase();
|
|
118019
|
+
resolve7(normalized === "" || normalized === "y" || normalized === "yes");
|
|
118020
|
+
});
|
|
118021
|
+
});
|
|
118022
|
+
}
|
|
118140
118023
|
async function main() {
|
|
118141
118024
|
try {
|
|
118142
118025
|
await program2.parseAsync();
|