@r_masseater/vite-plus-adopt 0.28.5 → 0.29.1

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-Bl_a0iQm.mjs";
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-B0siLFbU.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-Bl_a0iQm.mjs";
1
+ import { d as findCiDrift, f as loadViteConfig, n as HOOKS, o as usage, p as VpToolsError, t as runAllChecks } from "./run-checks-B0siLFbU.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({
@@ -64,6 +64,22 @@ const loadViteConfig = (root) => findConfigFile(root).pipe(Effect.flatMap((file)
64
64
  const requireSection = (key) => (config) => Effect.fromOption(Option.fromNullishOr(config[key])).pipe(Effect.mapError(() => configMissing(`vite.config has no "${key}" section`)));
65
65
  /** @internal */
66
66
  const loadSection = Function.dual(2, (root, key) => loadViteConfig(root).pipe(Effect.flatMap(requireSection(key))));
67
+ // src/features/check-text/model/subject-script.ts
68
+ const ALWAYS = "always";
69
+ const scriptPattern = (script) => new RegExp(`\\p{Script=${script}}`, "u");
70
+ const usesAny = (scripts) => (subject) => pipe(scripts, Array.some((script) => scriptPattern(script).test(subject)));
71
+ const outcomeOf = (when, scripts, used) => {
72
+ const named = Array.join(scripts, ", ");
73
+ if (when === ALWAYS) return [used, `subject must contain a character of ${named}`];
74
+ return [!used, `subject must not contain a character of ${named}`];
75
+ };
76
+ /** @internal */
77
+ const subjectScript = (parsed, when = ALWAYS, value = []) => pipe(Option.fromNullishOr(parsed["subject"]), Option.filter(String$1.isNonEmpty), Option.match({
78
+ onNone: () => [true],
79
+ onSome: (subject) => outcomeOf(when, value, usesAny(value)(subject))
80
+ }));
81
+ /** @internal */
82
+ const SUBJECT_SCRIPT_PLUGIN = { rules: { "subject-script": subjectScript } };
67
83
  // src/features/check-text/model/commitlint.ts
68
84
  const DATA_FIRST_ARITY_3$1 = 3;
69
85
  const COMMENT_CHAR = "#";
@@ -75,7 +91,10 @@ const parserOptionsOf = (loaded) => {
75
91
  };
76
92
  const lintOptionsOf = (loaded) => ({
77
93
  parserOpts: parserOptionsOf(loaded),
78
- plugins: loaded.plugins,
94
+ plugins: {
95
+ ...loaded.plugins,
96
+ "vite-plus-adopt": SUBJECT_SCRIPT_PLUGIN
97
+ },
79
98
  ignores: loaded.ignores ?? [],
80
99
  defaultIgnores: loaded.defaultIgnores ?? true
81
100
  });
@@ -892,7 +911,7 @@ const syncCi = (root) => planned(root).pipe(Effect.flatMap(({ changes }) => Effe
892
911
  })));
893
912
  // package.json
894
913
  var name = "@r_masseater/vite-plus-adopt";
895
- var version = "0.28.5";
914
+ var version = "0.29.1";
896
915
  // src/features/sync-ci/model/installed-version.ts
897
916
  const RANGE_PREFIX = /^[\^~]/u;
898
917
  const pnpm$1 = attempt("pnpm");
@@ -2151,4 +2170,4 @@ const runAllChecks = (root) => Effect.gen(function* all() {
2151
2170
  });
2152
2171
  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 };
2153
2172
 
2154
- //# sourceMappingURL=run-checks-Bl_a0iQm.mjs.map
2173
+ //# sourceMappingURL=run-checks-B0siLFbU.mjs.map