@westbayberry/dg 1.0.8 → 1.0.9
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.mjs +31 -29
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -48,7 +48,8 @@ __export(config_exports, {
|
|
|
48
48
|
});
|
|
49
49
|
import { parseArgs } from "node:util";
|
|
50
50
|
import { readFileSync, existsSync } from "node:fs";
|
|
51
|
-
import { join } from "node:path";
|
|
51
|
+
import { join, dirname } from "node:path";
|
|
52
|
+
import { fileURLToPath } from "node:url";
|
|
52
53
|
import { homedir } from "node:os";
|
|
53
54
|
function loadDgrc() {
|
|
54
55
|
const candidates = [
|
|
@@ -69,8 +70,9 @@ function loadDgrc() {
|
|
|
69
70
|
}
|
|
70
71
|
function getVersion() {
|
|
71
72
|
try {
|
|
73
|
+
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
72
74
|
const pkg = JSON.parse(
|
|
73
|
-
readFileSync(join(
|
|
75
|
+
readFileSync(join(thisDir, "..", "package.json"), "utf-8")
|
|
74
76
|
);
|
|
75
77
|
return pkg.version ?? "1.0.0";
|
|
76
78
|
} catch {
|
|
@@ -308,7 +310,7 @@ function parsePackageSpec(spec) {
|
|
|
308
310
|
};
|
|
309
311
|
}
|
|
310
312
|
async function resolveVersion(spec) {
|
|
311
|
-
return new Promise((
|
|
313
|
+
return new Promise((resolve) => {
|
|
312
314
|
const child = spawn("npm", ["view", spec, "version"], {
|
|
313
315
|
stdio: ["pipe", "pipe", "pipe"]
|
|
314
316
|
});
|
|
@@ -318,20 +320,20 @@ async function resolveVersion(spec) {
|
|
|
318
320
|
});
|
|
319
321
|
const timer = setTimeout(() => {
|
|
320
322
|
child.kill();
|
|
321
|
-
|
|
323
|
+
resolve(null);
|
|
322
324
|
}, 15e3);
|
|
323
325
|
child.on("close", (code) => {
|
|
324
326
|
clearTimeout(timer);
|
|
325
327
|
if (code !== 0) {
|
|
326
|
-
|
|
328
|
+
resolve(null);
|
|
327
329
|
return;
|
|
328
330
|
}
|
|
329
331
|
const version = stdout.trim();
|
|
330
|
-
|
|
332
|
+
resolve(version || null);
|
|
331
333
|
});
|
|
332
334
|
child.on("error", () => {
|
|
333
335
|
clearTimeout(timer);
|
|
334
|
-
|
|
336
|
+
resolve(null);
|
|
335
337
|
});
|
|
336
338
|
});
|
|
337
339
|
}
|
|
@@ -366,13 +368,13 @@ async function resolvePackages(specs) {
|
|
|
366
368
|
return { resolved, failed };
|
|
367
369
|
}
|
|
368
370
|
function runNpm(args) {
|
|
369
|
-
return new Promise((
|
|
371
|
+
return new Promise((resolve) => {
|
|
370
372
|
const child = spawn("npm", args, {
|
|
371
373
|
stdio: "inherit",
|
|
372
374
|
shell: false
|
|
373
375
|
});
|
|
374
|
-
child.on("close", (code) =>
|
|
375
|
-
child.on("error", () =>
|
|
376
|
+
child.on("close", (code) => resolve(code ?? 1));
|
|
377
|
+
child.on("error", () => resolve(1));
|
|
376
378
|
});
|
|
377
379
|
}
|
|
378
380
|
function readBareInstallPackages(cwd2) {
|
|
@@ -3944,14 +3946,14 @@ var require_react_development = __commonJS({
|
|
|
3944
3946
|
var thenableResult = result;
|
|
3945
3947
|
var wasAwaited = false;
|
|
3946
3948
|
var thenable = {
|
|
3947
|
-
then: function(
|
|
3949
|
+
then: function(resolve, reject) {
|
|
3948
3950
|
wasAwaited = true;
|
|
3949
3951
|
thenableResult.then(function(returnValue2) {
|
|
3950
3952
|
popActScope(prevActScopeDepth);
|
|
3951
3953
|
if (actScopeDepth === 0) {
|
|
3952
|
-
recursivelyFlushAsyncActWork(returnValue2,
|
|
3954
|
+
recursivelyFlushAsyncActWork(returnValue2, resolve, reject);
|
|
3953
3955
|
} else {
|
|
3954
|
-
|
|
3956
|
+
resolve(returnValue2);
|
|
3955
3957
|
}
|
|
3956
3958
|
}, function(error2) {
|
|
3957
3959
|
popActScope(prevActScopeDepth);
|
|
@@ -3981,20 +3983,20 @@ var require_react_development = __commonJS({
|
|
|
3981
3983
|
ReactCurrentActQueue.current = null;
|
|
3982
3984
|
}
|
|
3983
3985
|
var _thenable = {
|
|
3984
|
-
then: function(
|
|
3986
|
+
then: function(resolve, reject) {
|
|
3985
3987
|
if (ReactCurrentActQueue.current === null) {
|
|
3986
3988
|
ReactCurrentActQueue.current = [];
|
|
3987
|
-
recursivelyFlushAsyncActWork(returnValue,
|
|
3989
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
3988
3990
|
} else {
|
|
3989
|
-
|
|
3991
|
+
resolve(returnValue);
|
|
3990
3992
|
}
|
|
3991
3993
|
}
|
|
3992
3994
|
};
|
|
3993
3995
|
return _thenable;
|
|
3994
3996
|
} else {
|
|
3995
3997
|
var _thenable2 = {
|
|
3996
|
-
then: function(
|
|
3997
|
-
|
|
3998
|
+
then: function(resolve, reject) {
|
|
3999
|
+
resolve(returnValue);
|
|
3998
4000
|
}
|
|
3999
4001
|
};
|
|
4000
4002
|
return _thenable2;
|
|
@@ -4010,7 +4012,7 @@ var require_react_development = __commonJS({
|
|
|
4010
4012
|
actScopeDepth = prevActScopeDepth;
|
|
4011
4013
|
}
|
|
4012
4014
|
}
|
|
4013
|
-
function recursivelyFlushAsyncActWork(returnValue,
|
|
4015
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
4014
4016
|
{
|
|
4015
4017
|
var queue = ReactCurrentActQueue.current;
|
|
4016
4018
|
if (queue !== null) {
|
|
@@ -4019,16 +4021,16 @@ var require_react_development = __commonJS({
|
|
|
4019
4021
|
enqueueTask(function() {
|
|
4020
4022
|
if (queue.length === 0) {
|
|
4021
4023
|
ReactCurrentActQueue.current = null;
|
|
4022
|
-
|
|
4024
|
+
resolve(returnValue);
|
|
4023
4025
|
} else {
|
|
4024
|
-
recursivelyFlushAsyncActWork(returnValue,
|
|
4026
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
4025
4027
|
}
|
|
4026
4028
|
});
|
|
4027
4029
|
} catch (error2) {
|
|
4028
4030
|
reject(error2);
|
|
4029
4031
|
}
|
|
4030
4032
|
} else {
|
|
4031
|
-
|
|
4033
|
+
resolve(returnValue);
|
|
4032
4034
|
}
|
|
4033
4035
|
}
|
|
4034
4036
|
}
|
|
@@ -35380,8 +35382,8 @@ var init_ink = __esm({
|
|
|
35380
35382
|
}
|
|
35381
35383
|
}
|
|
35382
35384
|
async waitUntilExit() {
|
|
35383
|
-
this.exitPromise ||= new Promise((
|
|
35384
|
-
this.resolveExitPromise =
|
|
35385
|
+
this.exitPromise ||= new Promise((resolve, reject) => {
|
|
35386
|
+
this.resolveExitPromise = resolve;
|
|
35385
35387
|
this.rejectExitPromise = reject;
|
|
35386
35388
|
});
|
|
35387
35389
|
return this.exitPromise;
|
|
@@ -39966,11 +39968,11 @@ async function runStaticLogin() {
|
|
|
39966
39968
|
|
|
39967
39969
|
`);
|
|
39968
39970
|
process.stderr.write(import_chalk4.default.dim(" Press ENTER to open in the browser...\n"));
|
|
39969
|
-
await new Promise((
|
|
39971
|
+
await new Promise((resolve) => {
|
|
39970
39972
|
const onData = () => {
|
|
39971
39973
|
process.stdin.removeListener("data", onData);
|
|
39972
39974
|
if (process.stdin.unref) process.stdin.unref();
|
|
39973
|
-
|
|
39975
|
+
resolve();
|
|
39974
39976
|
};
|
|
39975
39977
|
process.stdin.setEncoding("utf-8");
|
|
39976
39978
|
process.stdin.resume();
|
|
@@ -40313,9 +40315,9 @@ function useNpmWrapper(npmArgs, config) {
|
|
|
40313
40315
|
return;
|
|
40314
40316
|
}
|
|
40315
40317
|
dispatch({ type: "BLOCKED", result, dgForce: false });
|
|
40316
|
-
const shouldProceed = await new Promise((
|
|
40317
|
-
pendingInstall.current = () =>
|
|
40318
|
-
rejectRef.current = () =>
|
|
40318
|
+
const shouldProceed = await new Promise((resolve) => {
|
|
40319
|
+
pendingInstall.current = () => resolve(true);
|
|
40320
|
+
rejectRef.current = () => resolve(false);
|
|
40319
40321
|
});
|
|
40320
40322
|
if (shouldProceed) {
|
|
40321
40323
|
dispatch({ type: "INSTALLING" });
|