pantheon-cli 0.2.69 → 0.2.72
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/pantheon.mjs +32 -18
- package/package.json +1 -1
package/dist/pantheon.mjs
CHANGED
|
@@ -43179,16 +43179,22 @@ function loadMachineConfig() {
|
|
|
43179
43179
|
const configPath = join4(dir, "config.json");
|
|
43180
43180
|
const credPath = join4(dir, "credentials.json");
|
|
43181
43181
|
if (!existsSync4(configPath) || !existsSync4(credPath)) return null;
|
|
43182
|
-
|
|
43183
|
-
|
|
43184
|
-
|
|
43185
|
-
|
|
43182
|
+
try {
|
|
43183
|
+
const parsed = JSON.parse(readFileSync4(configPath, "utf8"));
|
|
43184
|
+
const config2 = normalizeMachineConfig(parsed);
|
|
43185
|
+
if (JSON.stringify(parsed) !== JSON.stringify(config2)) {
|
|
43186
|
+
writeFileSync3(configPath, `${JSON.stringify(config2, null, 2)}
|
|
43186
43187
|
`);
|
|
43188
|
+
}
|
|
43189
|
+
return {
|
|
43190
|
+
config: migrateApiUrl(config2, configPath),
|
|
43191
|
+
credentials: JSON.parse(
|
|
43192
|
+
readFileSync4(credPath, "utf8")
|
|
43193
|
+
)
|
|
43194
|
+
};
|
|
43195
|
+
} catch {
|
|
43196
|
+
return null;
|
|
43187
43197
|
}
|
|
43188
|
-
return {
|
|
43189
|
-
config: migrateApiUrl(config2, configPath),
|
|
43190
|
-
credentials: JSON.parse(readFileSync4(credPath, "utf8"))
|
|
43191
|
-
};
|
|
43192
43198
|
}
|
|
43193
43199
|
function saveMachineConfig(config2, credentials) {
|
|
43194
43200
|
const dir = configDir();
|
|
@@ -43689,10 +43695,11 @@ import {
|
|
|
43689
43695
|
writeFileSync as writeFileSync6
|
|
43690
43696
|
} from "node:fs";
|
|
43691
43697
|
import { dirname as dirname3, join as join7, relative as relative2, resolve as resolve3, sep } from "node:path";
|
|
43698
|
+
import { gzipSync } from "node:zlib";
|
|
43692
43699
|
|
|
43693
43700
|
// ../core/src/drive-protocol.ts
|
|
43694
|
-
var DRIVE_MAX_FILE_BYTES =
|
|
43695
|
-
var DRIVE_MAX_CHANGE_BYTES =
|
|
43701
|
+
var DRIVE_MAX_FILE_BYTES = 200 * 1024 * 1024;
|
|
43702
|
+
var DRIVE_MAX_CHANGE_BYTES = 256 * 1024 * 1024;
|
|
43696
43703
|
var DRIVE_MAX_CHANGES = 100;
|
|
43697
43704
|
var CONTROL_NAMES = /* @__PURE__ */ new Set([
|
|
43698
43705
|
".git",
|
|
@@ -43813,7 +43820,6 @@ function walk(home, directory = home) {
|
|
|
43813
43820
|
}
|
|
43814
43821
|
function scanDriveWorkspace(home) {
|
|
43815
43822
|
const entries = {};
|
|
43816
|
-
let total = 0;
|
|
43817
43823
|
for (const path of walk(home).sort()) {
|
|
43818
43824
|
const bytes = readFileSync6(join7(home, ...path.split("/")));
|
|
43819
43825
|
if (bytes.length > DRIVE_MAX_FILE_BYTES) {
|
|
@@ -43821,12 +43827,6 @@ function scanDriveWorkspace(home) {
|
|
|
43821
43827
|
`Workspace file ${path} exceeds the ${DRIVE_MAX_FILE_BYTES / 1024 / 1024}MB file limit.`
|
|
43822
43828
|
);
|
|
43823
43829
|
}
|
|
43824
|
-
total += bytes.length;
|
|
43825
|
-
if (total > DRIVE_MAX_CHANGE_BYTES) {
|
|
43826
|
-
throw new Error(
|
|
43827
|
-
`Workspace changes exceed the ${DRIVE_MAX_CHANGE_BYTES / 1024 / 1024}MB sync limit.`
|
|
43828
|
-
);
|
|
43829
|
-
}
|
|
43830
43830
|
entries[path] = {
|
|
43831
43831
|
path,
|
|
43832
43832
|
sha256: sha256(bytes),
|
|
@@ -43838,12 +43838,26 @@ function scanDriveWorkspace(home) {
|
|
|
43838
43838
|
function diffDriveManifest(home, manifest) {
|
|
43839
43839
|
const local = scanDriveWorkspace(home);
|
|
43840
43840
|
const changes = [];
|
|
43841
|
+
let total = 0;
|
|
43841
43842
|
for (const [path, entry] of Object.entries(local)) {
|
|
43842
43843
|
if (manifest.entries[path]?.sha256 === entry.sha256 && manifest.entries[path]?.size === entry.size) {
|
|
43843
43844
|
continue;
|
|
43844
43845
|
}
|
|
43845
43846
|
const bytes = readFileSync6(join7(home, ...path.split("/")));
|
|
43846
|
-
|
|
43847
|
+
total += bytes.length;
|
|
43848
|
+
if (total > DRIVE_MAX_CHANGE_BYTES) {
|
|
43849
|
+
throw new Error(
|
|
43850
|
+
`Workspace changes exceed the ${DRIVE_MAX_CHANGE_BYTES / 1024 / 1024}MB sync limit.`
|
|
43851
|
+
);
|
|
43852
|
+
}
|
|
43853
|
+
const compressed = gzipSync(bytes);
|
|
43854
|
+
changes.push(
|
|
43855
|
+
compressed.length < bytes.length ? {
|
|
43856
|
+
...entry,
|
|
43857
|
+
content: compressed.toString("base64"),
|
|
43858
|
+
encoding: "gzip-base64"
|
|
43859
|
+
} : { ...entry, content: bytes.toString("base64") }
|
|
43860
|
+
);
|
|
43847
43861
|
}
|
|
43848
43862
|
const deletes = Object.keys(manifest.entries).filter((path) => !(path in local)).sort();
|
|
43849
43863
|
if (changes.length + deletes.length > DRIVE_MAX_CHANGES) {
|
package/package.json
CHANGED