wp-studio 1.7.10 → 1.7.11-beta1

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.
Files changed (45) hide show
  1. package/dist/cli/{_events-BcapW3eh.mjs → _events-D_POEBYs.mjs} +4 -5
  2. package/dist/cli/appdata-D-luHxJU.mjs +19 -0
  3. package/dist/cli/{certificate-manager-SVYcCL_i.mjs → certificate-manager-v-yNLDFJ.mjs} +134 -15
  4. package/dist/cli/{delete-D1924O3o.mjs → delete-C4R7DV_E.mjs} +3 -3
  5. package/dist/cli/{helpers-oQuItT8n.mjs → helpers-CBl4GQzX.mjs} +2 -2
  6. package/dist/cli/{index-4lan3TI_.mjs → index-Bej4fL6n.mjs} +31 -4
  7. package/dist/cli/{index-DRQnCQvM.mjs → index-DYlrlauo.mjs} +1308 -1109
  8. package/dist/cli/{index-BjzOJKPi.mjs → index-jpyzVGrl.mjs} +90 -52
  9. package/dist/cli/{list-DOFyyV1f.mjs → list-BRllR-8H.mjs} +3 -3
  10. package/dist/cli/{login-BtPZeZ4G.mjs → login-CDVrFvfk.mjs} +3 -3
  11. package/dist/cli/{logout-Cr631QzG.mjs → logout-DLAXkbrZ.mjs} +2 -3
  12. package/dist/cli/main.mjs +2 -2
  13. package/dist/cli/{paths-CqXGLB7R.mjs → paths-D7DniT1Q.mjs} +7 -6
  14. package/dist/cli/plugin/skills/rank-me-up/SKILL.md +166 -0
  15. package/dist/cli/plugin/skills/site-spec/SKILL.md +4 -0
  16. package/dist/cli/process-manager-daemon.mjs +29 -5
  17. package/dist/cli/{process-manager-ipc-BisO0qtU.mjs → process-manager-ipc-GCdebuBH.mjs} +4 -1
  18. package/dist/cli/proxy-daemon.mjs +1 -1
  19. package/dist/cli/{prune-pm-logs-COryxqeo.mjs → prune-pm-logs-Dm_Bwi7l.mjs} +1 -1
  20. package/dist/cli/{resume-BwDwdJtq.mjs → resume-B8M2e-Ii.mjs} +4 -15
  21. package/dist/cli/{rewrite-wp-cli-post-content-2zlfFnKT.mjs → rewrite-wp-cli-post-content-Beo5_Ojo.mjs} +32 -531
  22. package/dist/cli/{set-D5eeqHbp.mjs → set-CizYT2gE.mjs} +2 -3
  23. package/dist/cli/{set-DYnzUz_G.mjs → set-_5ABvjxt.mjs} +4 -5
  24. package/dist/cli/{status-DNvMZBqD.mjs → status-D6Huwi6x.mjs} +2 -2
  25. package/dist/cli/well-known-paths-QcSJNi_l.mjs +95 -0
  26. package/dist/cli/wordpress-server-child.mjs +5 -3
  27. package/dist/cli/{wp-DD2-QiiP.mjs → wp-BevvZcM1.mjs} +2 -2
  28. package/dist/cli/wp-files/latest/available-site-translations.json +1 -1
  29. package/dist/cli/wp-files/sqlite-database-integration/admin-page.php +1 -2
  30. package/dist/cli/wp-files/sqlite-database-integration/constants.php +0 -5
  31. package/dist/cli/wp-files/sqlite-database-integration/load.php +1 -1
  32. package/dist/cli/wp-files/sqlite-database-integration/readme.txt +6 -3
  33. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/database/sqlite/class-wp-pdo-mysql-on-sqlite.php +22 -3
  34. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/database/version.php +1 -1
  35. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php +41 -89
  36. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/db.php +2 -24
  37. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/install-functions.php +7 -16
  38. package/package.json +2 -1
  39. package/dist/cli/well-known-paths-BYA1Bw5o.mjs +0 -214
  40. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-lexer.php +0 -2575
  41. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php +0 -899
  42. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-query-rewriter.php +0 -343
  43. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-token.php +0 -327
  44. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php +0 -4543
  45. package/dist/cli/wp-files/sqlite-database-integration/wp-includes/sqlite/php-polyfills.php +0 -68
@@ -1,11 +1,10 @@
1
1
  import fs__default from "fs";
2
- import { o as socketEventSchema, j as SITE_EVENTS, S as SNAPSHOT_EVENTS, A as AUTH_EVENTS, r as readCliConfig, p as siteDetailsSchema } from "./certificate-manager-SVYcCL_i.mjs";
3
- import { v as isEmptyDir } from "./rewrite-wp-cli-post-content-2zlfFnKT.mjs";
2
+ import { L as LoggerError, c as Logger, x as socketEventSchema, S as SITE_EVENTS, f as SNAPSHOT_EVENTS, A as AUTH_EVENTS, r as readCliConfig, y as siteDetailsSchema } from "./certificate-manager-v-yNLDFJ.mjs";
3
+ import { o as isEmptyDir } from "./rewrite-wp-cli-post-content-Beo5_Ojo.mjs";
4
4
  import { s as sequential } from "./sequential-BQFuixXz.mjs";
5
- import { M as SITE_EVENTS_SOCKET_PATH, w as SiteCommandLoggerAction, B as connectToDaemon, N as getDaemonBus, O as SITE_PROCESS_PREFIX, J as disconnectFromDaemon, Q as removeSiteFromConfig, m as getSiteUrl, l as isSiteRunning } from "./index-DRQnCQvM.mjs";
5
+ import { M as SITE_EVENTS_SOCKET_PATH, w as SiteCommandLoggerAction, B as connectToDaemon, N as getDaemonBus, O as SITE_PROCESS_PREFIX, J as disconnectFromDaemon, Q as removeSiteFromConfig, m as getSiteUrl, l as isSiteRunning } from "./index-DYlrlauo.mjs";
6
6
  import { __ } from "@wordpress/i18n";
7
- import { g as SocketServer } from "./process-manager-ipc-BisO0qtU.mjs";
8
- import { L as LoggerError, d as Logger } from "./well-known-paths-BYA1Bw5o.mjs";
7
+ import { g as SocketServer } from "./process-manager-ipc-GCdebuBH.mjs";
9
8
  const logger = new Logger();
10
9
  function toSiteDetails(site) {
11
10
  return siteDetailsSchema.parse({
@@ -0,0 +1,19 @@
1
+ import os from "os";
2
+ import path__default from "path";
3
+ import { __ } from "@wordpress/i18n";
4
+ import { L as LoggerError } from "./certificate-manager-v-yNLDFJ.mjs";
5
+ function getAppdataDirectory() {
6
+ if (process.env.E2E && process.env.E2E_APP_DATA_PATH) {
7
+ return path__default.join(process.env.E2E_APP_DATA_PATH, "Studio");
8
+ }
9
+ if (process.platform === "win32") {
10
+ if (!process.env.APPDATA) {
11
+ throw new LoggerError(__("Studio config file path not found."));
12
+ }
13
+ return path__default.join(process.env.APPDATA, "Studio");
14
+ }
15
+ return path__default.join(os.homedir(), "Library", "Application Support", "Studio");
16
+ }
17
+ export {
18
+ getAppdataDirectory as g
19
+ };
@@ -1,6 +1,6 @@
1
1
  import fs__default from "fs";
2
2
  import path__default from "path";
3
- import { i as commonjsGlobal, g as getDefaultExportFromCjs, k as getConfigDirectory, C as CLI_CONFIG_LOCKFILE_NAME, u as getCliConfigPath, L as LoggerError, a as LOCKFILE_STALE_TIME, b as LOCKFILE_WAIT_TIME, v as getCertificatesPath, w as CERT_UNTRUSTED_ROOT, x as SERVER_AUTH_OID } from "./well-known-paths-BYA1Bw5o.mjs";
3
+ import { f as getConfigDirectory, C as CLI_CONFIG_LOCKFILE_NAME, n as getCliConfigPath, L as LOCKFILE_STALE_TIME, a as LOCKFILE_WAIT_TIME, o as getCertificatesPath, p as CERT_UNTRUSTED_ROOT, q as SERVER_AUTH_OID } from "./well-known-paths-QcSJNi_l.mjs";
4
4
  import { z } from "zod";
5
5
  import { execFile } from "child_process";
6
6
  import require$$1 from "constants";
@@ -10,6 +10,7 @@ import require$$0 from "assert";
10
10
  import require$$2 from "events";
11
11
  import { __ } from "@wordpress/i18n";
12
12
  import { readFile, writeFile } from "atomically";
13
+ import { Spinner } from "picospinner";
13
14
  import { execFile as execFile$1 } from "node:child_process";
14
15
  import crypto from "node:crypto";
15
16
  import fs from "node:fs";
@@ -18,6 +19,113 @@ import { domainToASCII } from "node:url";
18
19
  import { promisify } from "node:util";
19
20
  import sudo from "@vscode/sudo-prompt";
20
21
  import forge from "node-forge";
22
+ const isIpcMode = Boolean(process.send);
23
+ let progressCallback = null;
24
+ function setProgressCallback(callback) {
25
+ progressCallback = callback;
26
+ }
27
+ function getProgressCallback() {
28
+ return progressCallback;
29
+ }
30
+ function emitProgress(message) {
31
+ progressCallback?.(message);
32
+ }
33
+ function canSend() {
34
+ return isIpcMode && !!process.send && process.connected;
35
+ }
36
+ class LoggerError extends Error {
37
+ constructor(message, previousError) {
38
+ super();
39
+ this.name = "LoggerError";
40
+ this.errorMessage = message;
41
+ if (previousError instanceof Error) {
42
+ this.previousError = previousError;
43
+ }
44
+ }
45
+ get message() {
46
+ if (this.previousError) {
47
+ return `${this.errorMessage}: ${this.previousError.message}`;
48
+ }
49
+ return this.errorMessage;
50
+ }
51
+ }
52
+ class Logger {
53
+ constructor() {
54
+ this.currentAction = null;
55
+ this.spinner = new Spinner();
56
+ }
57
+ reportStart(action, message) {
58
+ this.currentAction = action;
59
+ if (canSend()) {
60
+ process.send({ action, status: "inprogress", message });
61
+ } else if (progressCallback) {
62
+ progressCallback(message);
63
+ } else {
64
+ this.spinner.setText(message);
65
+ if (!this.spinner.running) {
66
+ this.spinner.start();
67
+ }
68
+ }
69
+ }
70
+ reportProgress(message) {
71
+ if (canSend()) {
72
+ process.send({ action: this.currentAction, status: "inprogress", message });
73
+ } else if (progressCallback) {
74
+ progressCallback(message, true);
75
+ } else {
76
+ if (!this.spinner.running) {
77
+ this.spinner.start();
78
+ }
79
+ this.spinner.setText(message);
80
+ }
81
+ }
82
+ reportSuccess(message) {
83
+ if (canSend()) {
84
+ process.send({ action: this.currentAction, status: "success", message });
85
+ } else if (progressCallback) {
86
+ progressCallback(message);
87
+ } else {
88
+ if (!this.spinner.running) {
89
+ this.spinner.start();
90
+ }
91
+ this.spinner.succeed(message);
92
+ }
93
+ this.currentAction = null;
94
+ }
95
+ reportWarning(message) {
96
+ if (canSend()) {
97
+ process.send({ action: this.currentAction, status: "warning", message });
98
+ } else if (progressCallback) {
99
+ progressCallback(message);
100
+ } else {
101
+ if (!this.spinner.running) {
102
+ this.spinner.start();
103
+ }
104
+ this.spinner.warn(message);
105
+ }
106
+ }
107
+ reportError(error, isFatal = true) {
108
+ if (isFatal) {
109
+ process.exitCode = 1;
110
+ }
111
+ if (canSend()) {
112
+ process.send({ action: this.currentAction, status: "fail", message: error.message });
113
+ } else if (progressCallback) {
114
+ progressCallback(error.message);
115
+ } else {
116
+ if (!this.spinner.running) {
117
+ this.spinner.start();
118
+ }
119
+ this.spinner.fail(error.message);
120
+ }
121
+ this.currentAction = null;
122
+ }
123
+ reportKeyValuePair(key, value) {
124
+ if (canSend()) {
125
+ process.send({ action: "keyValuePair", key, value });
126
+ }
127
+ }
128
+ }
21
129
  const authTokenSchema = z.object({
22
130
  accessToken: z.string(),
23
131
  expiresIn: z.number(),
@@ -171,6 +279,10 @@ async function isDirectoryHiddenOnWindows(dirPath) {
171
279
  });
172
280
  });
173
281
  }
282
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
283
+ function getDefaultExportFromCjs(x) {
284
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
285
+ }
174
286
  var lockfile$1 = {};
175
287
  var signalExit = { exports: {} };
176
288
  var signals = { exports: {} };
@@ -1005,24 +1117,31 @@ function deleteSiteCertificate(domain) {
1005
1117
  }
1006
1118
  export {
1007
1119
  AUTH_EVENTS as A,
1008
- SNAPSHOT_EVENTS as S,
1120
+ LoggerError as L,
1121
+ SITE_EVENTS as S,
1009
1122
  lockFileAsync as a,
1010
1123
  unlockFileAsync as b,
1011
- authTokenSchema as c,
1012
- requireSignalExit as d,
1013
- StatsMetric as e,
1014
- StatsGroup as f,
1015
- updateCliConfigWithPartial as g,
1124
+ Logger as c,
1125
+ commonjsGlobal as d,
1126
+ authTokenSchema as e,
1127
+ SNAPSHOT_EVENTS as f,
1128
+ getDefaultExportFromCjs as g,
1016
1129
  hideDirectoryOnWindows as h,
1017
- generateSiteCertificate as i,
1018
- SITE_EVENTS as j,
1019
- deleteSiteCertificate as k,
1130
+ requireSignalExit as i,
1131
+ StatsMetric as j,
1132
+ StatsGroup as k,
1020
1133
  lockCliConfig as l,
1021
- updateCheckSchema as m,
1022
- isDirectoryHiddenOnWindows as n,
1023
- socketEventSchema as o,
1024
- siteDetailsSchema as p,
1134
+ updateCliConfigWithPartial as m,
1135
+ generateSiteCertificate as n,
1136
+ deleteSiteCertificate as o,
1137
+ emitProgress as p,
1138
+ setProgressCallback as q,
1025
1139
  readCliConfig as r,
1026
1140
  saveCliConfig as s,
1027
- unlockCliConfig as u
1141
+ getProgressCallback as t,
1142
+ unlockCliConfig as u,
1143
+ updateCheckSchema as v,
1144
+ isDirectoryHiddenOnWindows as w,
1145
+ socketEventSchema as x,
1146
+ siteDetailsSchema as y
1028
1147
  };
@@ -1,7 +1,7 @@
1
- import { l as listAiSessions, g as getAiSessionsRootDirectory, d as deleteAiSession } from "./paths-CqXGLB7R.mjs";
1
+ import { l as listAiSessions, g as getAiSessionsRootDirectory, d as deleteAiSession } from "./paths-D7DniT1Q.mjs";
2
2
  import { __ } from "@wordpress/i18n";
3
- import { c as chooseSessionForAction } from "./helpers-oQuItT8n.mjs";
4
- import { L as LoggerError, d as Logger } from "./well-known-paths-BYA1Bw5o.mjs";
3
+ import { c as chooseSessionForAction } from "./helpers-CBl4GQzX.mjs";
4
+ import { L as LoggerError, c as Logger } from "./certificate-manager-v-yNLDFJ.mjs";
5
5
  const logger = new Logger();
6
6
  async function runCommand(sessionIdOrPrefix) {
7
7
  let resolvedSessionIdOrPrefix = sessionIdOrPrefix?.trim();
@@ -1,7 +1,7 @@
1
1
  import { select } from "@inquirer/prompts";
2
2
  import { visibleWidth, truncateToWidth } from "@mariozechner/pi-tui";
3
- import { l as listAiSessions, g as getAiSessionsRootDirectory } from "./paths-CqXGLB7R.mjs";
4
- import { h as chalk } from "./index-DRQnCQvM.mjs";
3
+ import { l as listAiSessions, g as getAiSessionsRootDirectory } from "./paths-D7DniT1Q.mjs";
4
+ import { h as chalk } from "./index-DYlrlauo.mjs";
5
5
  import { __ } from "@wordpress/i18n";
6
6
  function formatSessionTimestamp(timestamp) {
7
7
  const parsed = Date.parse(timestamp);
@@ -2,11 +2,11 @@ import { execFile } from "child_process";
2
2
  import fs__default from "fs";
3
3
  import path__default from "path";
4
4
  import { confirm } from "@inquirer/prompts";
5
- import { y as getAppConfigPath, k as getConfigDirectory } from "./well-known-paths-BYA1Bw5o.mjs";
5
+ import { r as getAppConfigPath, f as getConfigDirectory, g as getServerFilesPath } from "./well-known-paths-QcSJNi_l.mjs";
6
6
  import { __ } from "@wordpress/i18n";
7
- import { G as getAppdataDirectory } from "./rewrite-wp-cli-post-content-2zlfFnKT.mjs";
7
+ import { g as getAppdataDirectory } from "./appdata-D-luHxJU.mjs";
8
8
  import fs from "node:fs";
9
- import { h as hideDirectoryOnWindows, n as isDirectoryHiddenOnWindows } from "./certificate-manager-SVYcCL_i.mjs";
9
+ import { h as hideDirectoryOnWindows, w as isDirectoryHiddenOnWindows } from "./certificate-manager-v-yNLDFJ.mjs";
10
10
  import os from "node:os";
11
11
  import path from "node:path";
12
12
  function isInstalledOnMacOs() {
@@ -134,10 +134,37 @@ const renameProcessManagerHome = {
134
134
  fs.renameSync(getLegacyPmHome(), getNewPmHome());
135
135
  }
136
136
  };
137
+ function getObsoletePaths() {
138
+ const serverFilesPath = getServerFilesPath();
139
+ return [
140
+ path.join(serverFilesPath, "skills"),
141
+ path.join(serverFilesPath, "sqlite-database-integration"),
142
+ path.join(serverFilesPath, "sqlite-command"),
143
+ path.join(serverFilesPath, "phpmyadmin"),
144
+ path.join(serverFilesPath, "wp-cli.phar"),
145
+ path.join(
146
+ serverFilesPath,
147
+ "wordpress-versions",
148
+ "latest",
149
+ "available-site-translations.json"
150
+ )
151
+ ];
152
+ }
153
+ const cleanupObsoleteServerFiles = {
154
+ needsToRun: async () => {
155
+ return getObsoletePaths().some((p) => fs.existsSync(p));
156
+ },
157
+ run: async () => {
158
+ for (const p of getObsoletePaths()) {
159
+ await fs.promises.rm(p, { recursive: true, force: true });
160
+ }
161
+ }
162
+ };
137
163
  const migrations = [
138
164
  checkStudioCompatibilityForInitialMigration,
139
165
  hideStudioDirWindows,
140
- renameProcessManagerHome
166
+ renameProcessManagerHome,
167
+ cleanupObsoleteServerFiles
141
168
  ];
142
169
  export {
143
170
  migrations