@anvil-works/anvil-cli 0.7.0-canary.2 → 0.7.0-canary.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/cli.js +18 -2
- package/dist/index.js +18 -2
- package/dist/services/git-auth.d.ts +1 -0
- package/dist/services/git-auth.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -51758,6 +51758,8 @@ var __webpack_exports__ = {};
|
|
|
51758
51758
|
await pkceFlow.close();
|
|
51759
51759
|
}
|
|
51760
51760
|
}
|
|
51761
|
+
const external_module_namespaceObject = require("module");
|
|
51762
|
+
const requireFromHere = (0, external_module_namespaceObject.createRequire)(__filename);
|
|
51761
51763
|
function getUrlConfigKey(appId) {
|
|
51762
51764
|
return `anvil.auth.${appId}.url`;
|
|
51763
51765
|
}
|
|
@@ -51773,12 +51775,26 @@ var __webpack_exports__ = {};
|
|
|
51773
51775
|
function getDefaultCliPath(options) {
|
|
51774
51776
|
const servicesDir = options?.servicesDir ?? __dirname;
|
|
51775
51777
|
const pathExists = options?.pathExists ?? external_fs_default().existsSync;
|
|
51778
|
+
const packageCliPath = getInstalledPackageCliPath(options?.resolvePackageJson);
|
|
51776
51779
|
const candidates = [
|
|
51780
|
+
external_path_default().resolve(servicesDir, "cli.js"),
|
|
51781
|
+
external_path_default().resolve(servicesDir, "cli.ts"),
|
|
51777
51782
|
external_path_default().resolve(servicesDir, "..", "cli.js"),
|
|
51778
|
-
external_path_default().resolve(servicesDir, "..", "cli.ts")
|
|
51779
|
-
|
|
51783
|
+
external_path_default().resolve(servicesDir, "..", "cli.ts"),
|
|
51784
|
+
packageCliPath
|
|
51785
|
+
].filter((candidate)=>void 0 !== candidate);
|
|
51780
51786
|
return candidates.find((candidate)=>pathExists(candidate));
|
|
51781
51787
|
}
|
|
51788
|
+
function getInstalledPackageCliPath(resolvePackageJson = resolveAnvilCliPackageJson) {
|
|
51789
|
+
try {
|
|
51790
|
+
return external_path_default().join(external_path_default().dirname(resolvePackageJson()), "dist", "cli.js");
|
|
51791
|
+
} catch {
|
|
51792
|
+
return;
|
|
51793
|
+
}
|
|
51794
|
+
}
|
|
51795
|
+
function resolveAnvilCliPackageJson() {
|
|
51796
|
+
return requireFromHere.resolve("@anvil-works/anvil-cli/package.json");
|
|
51797
|
+
}
|
|
51782
51798
|
function getGitCredentialHelperCommand(options) {
|
|
51783
51799
|
const platform = options?.platform ?? process.platform;
|
|
51784
51800
|
const execPath = options?.execPath ?? process.execPath;
|
package/dist/index.js
CHANGED
|
@@ -46230,6 +46230,8 @@ var __webpack_exports__ = {};
|
|
|
46230
46230
|
}
|
|
46231
46231
|
throw new Error("Device login expired before it was approved.");
|
|
46232
46232
|
}
|
|
46233
|
+
const external_module_namespaceObject = require("module");
|
|
46234
|
+
const requireFromHere = (0, external_module_namespaceObject.createRequire)(__filename);
|
|
46233
46235
|
function getUrlConfigKey(appId) {
|
|
46234
46236
|
return `anvil.auth.${appId}.url`;
|
|
46235
46237
|
}
|
|
@@ -46245,12 +46247,26 @@ var __webpack_exports__ = {};
|
|
|
46245
46247
|
function getDefaultCliPath(options) {
|
|
46246
46248
|
const servicesDir = options?.servicesDir ?? __dirname;
|
|
46247
46249
|
const pathExists = options?.pathExists ?? external_fs_default().existsSync;
|
|
46250
|
+
const packageCliPath = getInstalledPackageCliPath(options?.resolvePackageJson);
|
|
46248
46251
|
const candidates = [
|
|
46252
|
+
external_path_default().resolve(servicesDir, "cli.js"),
|
|
46253
|
+
external_path_default().resolve(servicesDir, "cli.ts"),
|
|
46249
46254
|
external_path_default().resolve(servicesDir, "..", "cli.js"),
|
|
46250
|
-
external_path_default().resolve(servicesDir, "..", "cli.ts")
|
|
46251
|
-
|
|
46255
|
+
external_path_default().resolve(servicesDir, "..", "cli.ts"),
|
|
46256
|
+
packageCliPath
|
|
46257
|
+
].filter((candidate)=>void 0 !== candidate);
|
|
46252
46258
|
return candidates.find((candidate)=>pathExists(candidate));
|
|
46253
46259
|
}
|
|
46260
|
+
function getInstalledPackageCliPath(resolvePackageJson = resolveAnvilCliPackageJson) {
|
|
46261
|
+
try {
|
|
46262
|
+
return external_path_default().join(external_path_default().dirname(resolvePackageJson()), "dist", "cli.js");
|
|
46263
|
+
} catch {
|
|
46264
|
+
return;
|
|
46265
|
+
}
|
|
46266
|
+
}
|
|
46267
|
+
function resolveAnvilCliPackageJson() {
|
|
46268
|
+
return requireFromHere.resolve("@anvil-works/anvil-cli/package.json");
|
|
46269
|
+
}
|
|
46254
46270
|
function getGitCredentialHelperCommand(options) {
|
|
46255
46271
|
const platform = options?.platform ?? process.platform;
|
|
46256
46272
|
const execPath = options?.execPath ?? process.execPath;
|
|
@@ -5,6 +5,7 @@ export interface AppAuthBinding {
|
|
|
5
5
|
export declare function getDefaultCliPath(options?: {
|
|
6
6
|
servicesDir?: string;
|
|
7
7
|
pathExists?: (pathToCheck: string) => boolean;
|
|
8
|
+
resolvePackageJson?: () => string;
|
|
8
9
|
}): string | undefined;
|
|
9
10
|
export declare function getGitCredentialHelperCommand(options?: {
|
|
10
11
|
execPath?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-auth.d.ts","sourceRoot":"","sources":["../../src/services/git-auth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"git-auth.d.ts","sourceRoot":"","sources":["../../src/services/git-auth.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,cAAc;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAkBD,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9C,kBAAkB,CAAC,EAAE,MAAM,MAAM,CAAC;CACrC,GAAG,MAAM,GAAG,SAAS,CAarB;AAcD,wBAAgB,6BAA6B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