fleetfizz 0.14.0 → 0.14.2
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/fleetfizz.mjs +19 -36
- package/package.json +1 -1
package/dist/fleetfizz.mjs
CHANGED
|
@@ -35654,7 +35654,7 @@ const runWith = (command, config) => {
|
|
|
35654
35654
|
};
|
|
35655
35655
|
//#endregion
|
|
35656
35656
|
//#region package.json
|
|
35657
|
-
var version = "0.14.
|
|
35657
|
+
var version = "0.14.2";
|
|
35658
35658
|
//#endregion
|
|
35659
35659
|
//#region ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
35660
35660
|
/**
|
|
@@ -39479,7 +39479,7 @@ const applyScript = (plan, configRecord, init) => {
|
|
|
39479
39479
|
`IFS= read -r ff_schema || ff_schema=""`,
|
|
39480
39480
|
...inputsOf(plan).map((_, i) => `IFS= read -r ff_in_${i} || exit 1`),
|
|
39481
39481
|
`ff_git() { if [ -n "$ff_token" ]; then FF_TOKEN="$ff_token" git -c credential.helper= -c 'credential.helper=!f() { echo username=x-access-token; echo "password=$FF_TOKEN"; }; f' "$@"; else git "$@"; fi; }`,
|
|
39482
|
-
`ff_skills() { if [ -n "$ff_token" ]; then GH_TOKEN="$ff_token" GIT_CONFIG_COUNT=
|
|
39482
|
+
`ff_skills() { if [ -n "$ff_token" ]; then GH_TOKEN="$ff_token" GIT_CONFIG_COUNT=3 GIT_CONFIG_KEY_0=core.autocrlf GIT_CONFIG_VALUE_0=false GIT_CONFIG_KEY_1=credential.helper GIT_CONFIG_VALUE_1= GIT_CONFIG_KEY_2=credential.helper GIT_CONFIG_VALUE_2='!f() { echo username=x-access-token; echo "password=$GH_TOKEN"; }; f' DISABLE_TELEMETRY=1 skills "$@"; else GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=core.autocrlf GIT_CONFIG_VALUE_0=false DISABLE_TELEMETRY=1 skills "$@"; fi; }`,
|
|
39483
39483
|
...configStep(configRecord),
|
|
39484
39484
|
...plan.providers.flatMap((p) => providerSteps(p, offsets)),
|
|
39485
39485
|
doneLine("end", true)
|
|
@@ -40557,11 +40557,20 @@ const pnpm = globals("pnpm");
|
|
|
40557
40557
|
//#region ../../packages/providers/src/fleetfizz/index.ts
|
|
40558
40558
|
const installerOf = (paths) => {
|
|
40559
40559
|
const has = (...parts) => paths.some((path) => parts.some((part) => path.includes(part)));
|
|
40560
|
-
if (has("
|
|
40560
|
+
if (has("vite-plus/packages/", "vite-plus/bin/")) return "vp";
|
|
40561
40561
|
if (has("/pnpm/")) return "pnpm";
|
|
40562
40562
|
if (has("/.bun/")) return "bun";
|
|
40563
40563
|
if (has("/lib/node_modules/")) return "npm";
|
|
40564
40564
|
};
|
|
40565
|
+
const ownInstaller = fn("ownInstaller")(function* () {
|
|
40566
|
+
const fs = yield* FileSystem;
|
|
40567
|
+
const main = process.argv[1] ?? "";
|
|
40568
|
+
const real = yield* fs.realPath(main).pipe(orElseSucceed(() => main));
|
|
40569
|
+
return {
|
|
40570
|
+
at: main,
|
|
40571
|
+
installer: installerOf([main, real])
|
|
40572
|
+
};
|
|
40573
|
+
});
|
|
40565
40574
|
const decodeFact$2 = decodeUnknownOption(Union([Struct({
|
|
40566
40575
|
fact: Literal("fizz"),
|
|
40567
40576
|
path: String$6,
|
|
@@ -40604,29 +40613,9 @@ const fleetfizz = {
|
|
|
40604
40613
|
items: () => [{ name: ITEM }],
|
|
40605
40614
|
observe: () => OBSERVE$1,
|
|
40606
40615
|
parse,
|
|
40607
|
-
resolve: (
|
|
40608
|
-
const facts = [];
|
|
40609
|
-
yield* runScript({
|
|
40610
|
-
name: starting.machine.name,
|
|
40611
|
-
local: true
|
|
40612
|
-
}, checkScript({
|
|
40613
|
-
scope: starting,
|
|
40614
|
-
providers: [{
|
|
40615
|
-
provider: fleetfizz,
|
|
40616
|
-
items
|
|
40617
|
-
}]
|
|
40618
|
-
}), [], (line) => sync(() => {
|
|
40619
|
-
const parsed = parseLine(line);
|
|
40620
|
-
if (parsed.kind === "state") facts.push(parsed.fact);
|
|
40621
|
-
})).pipe(timeout("2 minutes"));
|
|
40622
|
-
const { fizz } = parse(assembleState(facts).facts.fleetfizz ?? []);
|
|
40623
|
-
return {
|
|
40624
|
-
from: starting.machine.name,
|
|
40625
|
-
installer: fizz === void 0 ? void 0 : installerOf([fizz.path, fizz.real])
|
|
40626
|
-
};
|
|
40627
|
-
}).pipe(orElseSucceed(() => ({
|
|
40616
|
+
resolve: (_, { starting }) => ownInstaller().pipe(map$5(({ installer }) => ({
|
|
40628
40617
|
from: starting.machine.name,
|
|
40629
|
-
installer
|
|
40618
|
+
installer
|
|
40630
40619
|
}))),
|
|
40631
40620
|
decide({ observed, resolved, ctx }) {
|
|
40632
40621
|
const version = ctx.config.version;
|
|
@@ -42112,7 +42101,8 @@ const treeHash = (dir) => {
|
|
|
42112
42101
|
try {
|
|
42113
42102
|
execFileSync("git", ["init", "-q", "--bare", git]);
|
|
42114
42103
|
const env = { ...process.env, GIT_DIR: git, GIT_INDEX_FILE: join(git, "index") };
|
|
42115
|
-
|
|
42104
|
+
// As ff_skills clones: no line-ending conversion, so the hash is GitHub's.
|
|
42105
|
+
execFileSync("git", ["-c", "core.autocrlf=false", "--work-tree", dir, "add", "-A", "-f", "."], { cwd: dir, env, stdio: "ignore" });
|
|
42116
42106
|
return execFileSync("git", ["write-tree"], { env, encoding: "utf8" }).trim();
|
|
42117
42107
|
} catch {
|
|
42118
42108
|
return undefined;
|
|
@@ -42211,7 +42201,8 @@ const TreeResponse = Struct({
|
|
|
42211
42201
|
path: String$6,
|
|
42212
42202
|
type: String$6,
|
|
42213
42203
|
sha: String$6
|
|
42214
|
-
}))
|
|
42204
|
+
})),
|
|
42205
|
+
truncated: Boolean$4
|
|
42215
42206
|
});
|
|
42216
42207
|
const fetchFolders = fn("fetchFolders")(function* (repo, ref, token) {
|
|
42217
42208
|
const response = yield* execute(get(`https://api.github.com/repos/${repo}/git/trees/${encodeURIComponent(ref ?? "HEAD")}?recursive=1`).pipe(setHeaders({
|
|
@@ -42221,6 +42212,7 @@ const fetchFolders = fn("fetchFolders")(function* (repo, ref, token) {
|
|
|
42221
42212
|
if (response.status === 404) return { error: `no ${ref ?? "default branch"} in ${repo}, or no access to it` };
|
|
42222
42213
|
if (response.status !== 200) return { error: `GitHub answered ${response.status}` };
|
|
42223
42214
|
const body = yield* schemaBodyJson(TreeResponse)(response);
|
|
42215
|
+
if (body.truncated) return { error: "the repo is too large for GitHub to list its folders" };
|
|
42224
42216
|
return { folders: new Map([["", body.sha], ...body.tree.flatMap((e) => e.type === "tree" ? [[e.path, e.sha]] : [])]) };
|
|
42225
42217
|
}, timeout("15 seconds"), orElseSucceed(() => ({ error: "could not reach GitHub" })), provide(layer$2));
|
|
42226
42218
|
const skillQuestion = (subject, found, problem) => ({
|
|
@@ -75336,15 +75328,6 @@ var VersionError = class extends TaggedError()("VersionError", { reason: String$
|
|
|
75336
75328
|
}
|
|
75337
75329
|
};
|
|
75338
75330
|
const SWITCHED = "FLEETFIZZ_SWITCHED";
|
|
75339
|
-
const ownInstaller = fn("ownInstaller")(function* () {
|
|
75340
|
-
const fs = yield* FileSystem;
|
|
75341
|
-
const main = process.argv[1] ?? "";
|
|
75342
|
-
const real = yield* fs.realPath(main).pipe(orElseSucceed(() => main));
|
|
75343
|
-
return {
|
|
75344
|
-
at: main,
|
|
75345
|
-
installer: installerOf([main, real])
|
|
75346
|
-
};
|
|
75347
|
-
});
|
|
75348
75331
|
const runHere = fn("runHere")(function* (command, args, env = {}) {
|
|
75349
75332
|
const spawner = yield* ChildProcessSpawner;
|
|
75350
75333
|
return yield* scoped(gen(function* () {
|