@r_masseater/vite-plus-adopt 0.28.1 → 0.28.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/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { hookFlags } from "@r_masseater/masseater-utils/hook-flags";
|
|
3
3
|
import { runMain } from "@r_masseater/masseater-utils/node-main";
|
|
4
|
-
import { a as stagedSecrets, c as prePush, i as lintMessageText, l as runCi, r as lintMessageFile, s as prepare, t as runAllChecks, u as version } from "./run-checks-
|
|
4
|
+
import { a as stagedSecrets, c as prePush, i as lintMessageText, l as runCi, r as lintMessageFile, s as prepare, t as runAllChecks, u as version } from "./run-checks-du6H0Xbu.mjs";
|
|
5
5
|
import { Effect, Option, Path } from "effect";
|
|
6
6
|
import { Command } from "effect/cli";
|
|
7
7
|
// src/app/cli.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as findCiDrift, f as loadViteConfig, n as HOOKS, o as usage, p as VpToolsError, t as runAllChecks } from "./run-checks-
|
|
1
|
+
import { d as findCiDrift, f as loadViteConfig, n as HOOKS, o as usage, p as VpToolsError, t as runAllChecks } from "./run-checks-du6H0Xbu.mjs";
|
|
2
2
|
import { Array, Function, Option, Record, pipe } from "effect";
|
|
3
3
|
/** @internal */
|
|
4
4
|
const runVpa = Function.dual(2, (root, args) => pipe(args, Array.match({
|
|
@@ -280,7 +280,7 @@ const unusedOf = (config, descriptor, recorder) => {
|
|
|
280
280
|
})));
|
|
281
281
|
};
|
|
282
282
|
const wrapperOf = (config, recorder) => pipe(Option.liftPredicate(recorder.wrap, () => config.reportUnusedDirectives === true), Option.getOrElse(() => Function.identity));
|
|
283
|
-
const reportOf = (formatted, results, unused) => ({
|
|
283
|
+
const reportOf$1 = (formatted, results, unused) => ({
|
|
284
284
|
valid: Array.isReadonlyArrayEmpty(unused) && pipe(results, Array.every((result) => Array.isArrayEmpty(result.messages))),
|
|
285
285
|
output: pipe([formatted, formatUnused(unused)], Array.filter(String$1.isNonEmpty), Array.join("\n"))
|
|
286
286
|
});
|
|
@@ -301,7 +301,7 @@ const lintTexts = Function.dual(DATA_FIRST_ARITY_3, (config, root, files) => Eff
|
|
|
301
301
|
formatterName: "stylish",
|
|
302
302
|
color: false
|
|
303
303
|
}));
|
|
304
|
-
return reportOf(formatter.format(results), results, unused);
|
|
304
|
+
return reportOf$1(formatter.format(results), results, unused);
|
|
305
305
|
}));
|
|
306
306
|
// src/features/check-text/model/text-checks.ts
|
|
307
307
|
const MARKDOWN = "*.md";
|
|
@@ -892,7 +892,7 @@ const syncCi = (root) => planned(root).pipe(Effect.flatMap(({ changes }) => Effe
|
|
|
892
892
|
})));
|
|
893
893
|
// package.json
|
|
894
894
|
var name = "@r_masseater/vite-plus-adopt";
|
|
895
|
-
var version = "0.28.
|
|
895
|
+
var version = "0.28.2";
|
|
896
896
|
// src/features/sync-ci/model/installed-version.ts
|
|
897
897
|
const RANGE_PREFIX = /^[\^~]/u;
|
|
898
898
|
const pnpm$1 = attempt("pnpm");
|
|
@@ -1608,13 +1608,13 @@ const installOne = Function.dual(DATA_FIRST_ARITY$2, (cache, lock, planned) => E
|
|
|
1608
1608
|
};
|
|
1609
1609
|
}));
|
|
1610
1610
|
// src/features/install-tools/model/link-bin.ts
|
|
1611
|
-
const BIN_DIRECTORY = ["node_modules", ".bin"];
|
|
1611
|
+
const BIN_DIRECTORY$1 = ["node_modules", ".bin"];
|
|
1612
1612
|
const launcher = (target) => `@"${target}" %*\r\n`;
|
|
1613
1613
|
/** @internal */
|
|
1614
1614
|
const linkExecutable = (root) => ({ name, target }) => Effect.gen(function* linkOne() {
|
|
1615
1615
|
const fs = yield* FileSystem.FileSystem;
|
|
1616
1616
|
const path = yield* Path.Path;
|
|
1617
|
-
const directory = path.join(root, ...BIN_DIRECTORY);
|
|
1617
|
+
const directory = path.join(root, ...BIN_DIRECTORY$1);
|
|
1618
1618
|
yield* fs.makeDirectory(directory, { recursive: true });
|
|
1619
1619
|
if (process.platform === "win32") return yield* fs.writeFileString(path.join(directory, `${name}.cmd`), launcher(target));
|
|
1620
1620
|
const entry = path.join(directory, name);
|
|
@@ -1676,7 +1676,7 @@ const decodeSection = (raw) => Schema.decodeUnknownEffect(ToolsSectionSchema)(ra
|
|
|
1676
1676
|
/** @internal */
|
|
1677
1677
|
const toolsEnabled = Config.option(Config.String("VPA_TOOLS")).pipe(Effect.map(Option.exists((value) => Array.contains(DISABLED, String$1.toLowerCase(value)))), Effect.map((disabled) => !disabled), Effect.orElseSucceed(() => true));
|
|
1678
1678
|
// src/features/install-tools/model/install-tools.ts
|
|
1679
|
-
const CONCURRENCY = 4;
|
|
1679
|
+
const CONCURRENCY$1 = 4;
|
|
1680
1680
|
const executablesOf = ({ planned, directory }) => Effect.forEach(planned.bins, (name) => findExecutable(directory)(name).pipe(Effect.map((target) => ({
|
|
1681
1681
|
name,
|
|
1682
1682
|
target
|
|
@@ -1689,6 +1689,7 @@ const record = (root, lock) => (installed) => {
|
|
|
1689
1689
|
...Record.fromEntries(recorded)
|
|
1690
1690
|
});
|
|
1691
1691
|
};
|
|
1692
|
+
/** @internal */
|
|
1692
1693
|
const plannedTools = (root) => Effect.gen(function* plan() {
|
|
1693
1694
|
const config = yield* loadViteConfig(root);
|
|
1694
1695
|
const enabled = yield* toolsEnabled;
|
|
@@ -1701,9 +1702,9 @@ const plannedTools = (root) => Effect.gen(function* plan() {
|
|
|
1701
1702
|
const installAll = (root, planned) => Effect.gen(function* installPlanned() {
|
|
1702
1703
|
const lock = yield* readLock(root);
|
|
1703
1704
|
const cache = yield* vpaCacheDirectory("tools");
|
|
1704
|
-
const installed = yield* Effect.forEach(planned, (tool) => installOne(cache, lock, tool), { concurrency: CONCURRENCY });
|
|
1705
|
+
const installed = yield* Effect.forEach(planned, (tool) => installOne(cache, lock, tool), { concurrency: CONCURRENCY$1 });
|
|
1705
1706
|
yield* record(root, lock)(installed);
|
|
1706
|
-
const found = yield* Effect.forEach(installed, executablesOf, { concurrency: CONCURRENCY });
|
|
1707
|
+
const found = yield* Effect.forEach(installed, executablesOf, { concurrency: CONCURRENCY$1 });
|
|
1707
1708
|
const executables = Array.flatten(found);
|
|
1708
1709
|
yield* Effect.forEach(executables, linkExecutable(root), {
|
|
1709
1710
|
concurrency: 1,
|
|
@@ -1716,6 +1717,38 @@ const installTools = (root) => plannedTools(root).pipe(Effect.flatMap(Option.mat
|
|
|
1716
1717
|
onNone: () => Effect.succeedNone,
|
|
1717
1718
|
onSome: (planned) => installAll(root, planned).pipe(Effect.asSome)
|
|
1718
1719
|
})));
|
|
1720
|
+
// src/features/install-tools/model/linked-check.ts
|
|
1721
|
+
const BIN_DIRECTORY = ["node_modules", ".bin"];
|
|
1722
|
+
const WINDOWS_LAUNCHER = ".cmd";
|
|
1723
|
+
const CONCURRENCY = 4;
|
|
1724
|
+
const entryOf = (name) => {
|
|
1725
|
+
if (process.platform === "win32") return `${name}${WINDOWS_LAUNCHER}`;
|
|
1726
|
+
return name;
|
|
1727
|
+
};
|
|
1728
|
+
const missingIn = (root) => (planned) => Effect.gen(function* missing() {
|
|
1729
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1730
|
+
const path = yield* Path.Path;
|
|
1731
|
+
const bins = pipe(planned, Array.flatMap(({ bins: names }) => names));
|
|
1732
|
+
const isLinked = (name) => fs.exists(path.join(root, ...BIN_DIRECTORY, entryOf(name))).pipe(Effect.orElseSucceed(() => false));
|
|
1733
|
+
const linked = yield* Effect.forEach(bins, (name) => isLinked(name), { concurrency: CONCURRENCY });
|
|
1734
|
+
return pipe(Array.zip(bins, linked), Array.filter(([, exists]) => !exists), Array.map(([name]) => name));
|
|
1735
|
+
});
|
|
1736
|
+
const messageOf = (missing) => `${Array.join(missing, ", ")} from "tools" in vite.config.ts is not linked into node_modules/.bin, so a task that runs it gets another copy from PATH or none. A package manager command that skips the prepare script, such as an update, removes these links. Run vp exec msch --prepare to link them again.`;
|
|
1737
|
+
const reportOf = (missing) => {
|
|
1738
|
+
if (Array.isReadonlyArrayEmpty(missing)) return {
|
|
1739
|
+
valid: true,
|
|
1740
|
+
output: ""
|
|
1741
|
+
};
|
|
1742
|
+
return {
|
|
1743
|
+
valid: false,
|
|
1744
|
+
output: messageOf(missing)
|
|
1745
|
+
};
|
|
1746
|
+
};
|
|
1747
|
+
/** @internal */
|
|
1748
|
+
const toolsLinkedCheck = ({ root }) => plannedTools(root).pipe(Effect.flatMap(Option.match({
|
|
1749
|
+
onNone: () => Effect.succeedNone,
|
|
1750
|
+
onSome: (planned) => missingIn(root)(planned).pipe(Effect.map((missing) => Option.some(reportOf(missing))))
|
|
1751
|
+
})));
|
|
1719
1752
|
// src/features/write-git-hooks/model/git-hooks.ts
|
|
1720
1753
|
const HOOKS_DIRECTORY = ".vite-hooks";
|
|
1721
1754
|
const ATTRIBUTES = ".gitattributes";
|
|
@@ -2062,6 +2095,10 @@ const CHECKS = [
|
|
|
2062
2095
|
{
|
|
2063
2096
|
name: "fallow",
|
|
2064
2097
|
run: fallowCheck
|
|
2098
|
+
},
|
|
2099
|
+
{
|
|
2100
|
+
name: "tools",
|
|
2101
|
+
run: toolsLinkedCheck
|
|
2065
2102
|
}
|
|
2066
2103
|
];
|
|
2067
2104
|
// src/app/run-checks.ts
|
|
@@ -2114,4 +2151,4 @@ const runAllChecks = (root) => Effect.gen(function* all() {
|
|
|
2114
2151
|
});
|
|
2115
2152
|
export { stagedSecrets as a, prePush as c, findCiDrift as d, loadViteConfig as f, lintMessageText as i, runCi as l, HOOKS as n, usage as o, VpToolsError as p, lintMessageFile as r, prepare as s, runAllChecks as t, version as u };
|
|
2116
2153
|
|
|
2117
|
-
//# sourceMappingURL=run-checks-
|
|
2154
|
+
//# sourceMappingURL=run-checks-du6H0Xbu.mjs.map
|