@shivaedev/quality 0.34.0 → 0.35.0
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/CHANGELOG.md +11 -0
- package/README.md +26 -0
- package/dist/appTestConfig.d.ts +2 -0
- package/dist/appTestConfig.d.ts.map +1 -0
- package/dist/appTestConfig.js +10 -0
- package/dist/appTestConfig.js.map +1 -0
- package/dist/appViteConfig.d.ts +19 -0
- package/dist/appViteConfig.d.ts.map +1 -0
- package/dist/appViteConfig.js +13 -0
- package/dist/appViteConfig.js.map +1 -0
- package/dist/cli/args.d.ts +6 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +6 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/ci.d.ts +5 -0
- package/dist/cli/ci.d.ts.map +1 -0
- package/dist/cli/ci.js +15 -0
- package/dist/cli/ci.js.map +1 -0
- package/dist/cli/messages.d.ts +1 -1
- package/dist/cli/messages.d.ts.map +1 -1
- package/dist/cli/messages.js +4 -0
- package/dist/cli/messages.js.map +1 -1
- package/dist/cli/program.d.ts +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +6 -0
- package/dist/cli/program.js.map +1 -1
- package/dist/hooks/setup.d.ts +4 -0
- package/dist/hooks/setup.d.ts.map +1 -0
- package/dist/hooks/setup.js +10 -0
- package/dist/hooks/setup.js.map +1 -0
- package/package.json +3 -2
- package/src/appTestConfig.ts +10 -0
- package/src/appViteConfig.ts +12 -0
- package/src/cli/args.ts +8 -0
- package/src/cli/ci.ts +15 -0
- package/src/cli/messages.ts +4 -0
- package/src/cli/program.ts +6 -0
- package/src/hooks/setup.ts +10 -0
- package/tsconfig/app.json +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.35.0 - 2026-10-25
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Quality provides a React application TypeScript preset, shared Vite and Vitest configuration helpers, application hook setup, and the shared application CI command.
|
|
8
|
+
- Platform provides configured local database preparation and a development runner for the server, worker and Vite processes.
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Generated apps reference their packages’ foundation configuration and helpers so dependency updates carry shared fixes into existing apps.
|
|
13
|
+
|
|
3
14
|
## 0.34.0 - 2026-10-24
|
|
4
15
|
|
|
5
16
|
### Added
|
package/README.md
CHANGED
|
@@ -55,6 +55,8 @@ Add the daily commands to `package.json`:
|
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
For pnpm applications, `quality ci` checks peer dependencies, then runs the app’s `lint`, `typecheck`, `build` and `test` scripts in that order. It stops at the first failure. Keep those scripts as the app’s native tool commands; set `ci` to `quality ci` and let `ready` call the same script.
|
|
59
|
+
|
|
58
60
|
The optional pre-commit hook runs Quality's lint, then the `typecheck` script when it exists, then an optional `quality:commit` script for repository checks. It uses the manifest's `packageManager` (`npm`, `pnpm`, `yarn` or `bun`), defaulting to `npm` when omitted. Add `quality:commit` only when the repository has extra commit checks.
|
|
59
61
|
|
|
60
62
|
Inspect the report and install the optional commit check explicitly:
|
|
@@ -64,6 +66,8 @@ quality lint
|
|
|
64
66
|
quality hooks install
|
|
65
67
|
```
|
|
66
68
|
|
|
69
|
+
For an application setup script, use `quality setup`. It installs the same hook when the current folder has its own `.git` entry, including a linked worktree. An unversioned app or an app inside another repository leaves hooks alone.
|
|
70
|
+
|
|
67
71
|
Installing the package does not install a hook. `hooks install` writes the repository's pre-commit hook. A hook Quality did not write is kept unless `--force` replaces it. For an existing repository, `quality baseline write` records error-level findings when there is no baseline; it refuses to regenerate an existing baseline without `--rule <id>`.
|
|
68
72
|
|
|
69
73
|
Add a config only when the repository needs to supply facts such as source locations or import boundaries:
|
|
@@ -301,6 +305,28 @@ The TypeScript base leaves `types`, `jsx`, `paths`, `include` and output directo
|
|
|
301
305
|
}
|
|
302
306
|
```
|
|
303
307
|
|
|
308
|
+
For a React browser app, extend `@shivaedev/quality/tsconfig/app.json` instead. It adds React JSX, browser libraries and the Node, React and React DOM types to the base. Keep the application's paths and input files in its own config.
|
|
309
|
+
|
|
310
|
+
Platform apps can share the Vite and Vitest setup too:
|
|
311
|
+
|
|
312
|
+
```ts
|
|
313
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
314
|
+
import react from "@vitejs/plugin-react";
|
|
315
|
+
import { appViteConfig } from "@shivaedev/quality/appViteConfig.ts";
|
|
316
|
+
|
|
317
|
+
export default appViteConfig([tailwindcss(), react()]);
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Use this in `vite.config.ts`. Plugins belong to the app. The shared server proxies `/api/auth`, `/rpc` and `/admin/jobs` to the local host on port 3000, preserving the request Host. It enables TypeScript path resolution.
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
import { appTestConfig } from "@shivaedev/quality/appTestConfig.ts";
|
|
324
|
+
|
|
325
|
+
export default appTestConfig();
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Use this in `vitest.config.ts`. It composes `testProjects` with browser and server resolution and inlines Platform and Better Auth for the test server. Both helpers accept extra export conditions for workspace development: `appViteConfig(plugins, ["source"])` and `appTestConfig(["source"])`. Published apps use the defaults.
|
|
329
|
+
|
|
304
330
|
For Vitest, install `vitest`, and add `@shivaedev/test-story` and `happy-dom` when the repository has DOM tests, then use:
|
|
305
331
|
|
|
306
332
|
```ts
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appTestConfig.d.ts","sourceRoot":"","sources":["../src/appTestConfig.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,CAAC,UAAU,GAAE,MAAM,EAAO,6BAMtD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
import { testProjects } from "#testProjects.ts";
|
|
3
|
+
export function appTestConfig(conditions = []) {
|
|
4
|
+
return defineConfig({
|
|
5
|
+
resolve: { conditions: [...conditions, "module", "browser", "development|production"] },
|
|
6
|
+
ssr: { resolve: { conditions: [...conditions, "node", "development|production"] } },
|
|
7
|
+
test: { ...testProjects(), server: { deps: { inline: ["@shivaedev/platform", "better-auth"] } } },
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=appTestConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appTestConfig.js","sourceRoot":"","sources":["../src/appTestConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,UAAU,aAAa,CAAC,UAAU,GAAa,EAAE;IACtD,OAAO,YAAY,CAAC;QACnB,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,wBAAwB,CAAC,EAAE;QACvF,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,UAAU,EAAE,MAAM,EAAE,wBAAwB,CAAC,EAAE,EAAE;QACnF,IAAI,EAAE,EAAE,GAAG,YAAY,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,qBAAqB,EAAE,aAAa,CAAC,EAAE,EAAE,EAAE;KACjG,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function appViteConfig<TPlugin>(plugins: TPlugin[], conditions?: string[]): {
|
|
2
|
+
plugins: TPlugin[];
|
|
3
|
+
resolve: {
|
|
4
|
+
conditions: string[];
|
|
5
|
+
tsconfigPaths: boolean;
|
|
6
|
+
};
|
|
7
|
+
server: {
|
|
8
|
+
host: string;
|
|
9
|
+
port: number;
|
|
10
|
+
proxy: {
|
|
11
|
+
[k: string]: {
|
|
12
|
+
changeOrigin: boolean;
|
|
13
|
+
target: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
strictPort: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=appViteConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appViteConfig.d.ts","sourceRoot":"","sources":["../src/appViteConfig.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,UAAU,GAAE,MAAM,EAAO;;;;;;;QAKjF,IAAI;QACJ,IAAI;QACJ,KAAK;;;;;;QACL,UAAU;;EAGZ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function appViteConfig(plugins, conditions = []) {
|
|
2
|
+
return {
|
|
3
|
+
plugins,
|
|
4
|
+
resolve: { conditions, tsconfigPaths: true },
|
|
5
|
+
server: {
|
|
6
|
+
host: "127.0.0.1",
|
|
7
|
+
port: 5173,
|
|
8
|
+
proxy: Object.fromEntries(["/admin/jobs", "/api/auth", "/rpc"].map((path) => [path, { changeOrigin: false, target: "http://127.0.0.1:3000" }])),
|
|
9
|
+
strictPort: true,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=appViteConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appViteConfig.js","sourceRoot":"","sources":["../src/appViteConfig.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa,CAAU,OAAkB,EAAE,UAAU,GAAa,EAAE;IACnF,OAAO;QACN,OAAO;QACP,OAAO,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE;QAC5C,MAAM,EAAE;YACP,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,aAAa,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC;YAC/I,UAAU,EAAE,IAAI;SAChB;KACD,CAAC;AACH,CAAC"}
|
package/dist/cli/args.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export type Command = {
|
|
2
|
+
readonly _tag: "Ci";
|
|
3
|
+
} | {
|
|
4
|
+
readonly _tag: "Setup";
|
|
5
|
+
readonly config: string | undefined;
|
|
6
|
+
} | {
|
|
2
7
|
readonly _tag: "Lint";
|
|
3
8
|
readonly config: string | undefined;
|
|
4
9
|
} | {
|
|
@@ -52,6 +57,6 @@ export type Parsed = {
|
|
|
52
57
|
readonly _tag: "Usage";
|
|
53
58
|
readonly problem: string;
|
|
54
59
|
};
|
|
55
|
-
export declare const USAGE = "Usage:\n quality lint [--config <file>]\n quality fix [--config <file>]\n quality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline merge <ancestor> <current> <other>\n quality baseline install-driver\n quality baseline write [--config <file>] [--rule <id>]...\n quality baseline prune [--config <file>] [--against <ref>]\n quality baseline tighten [--config <file>] [--staged]\n quality baseline migrate [--config <file>] [--from <file>]\n quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks status\n quality hooks pre-commit [--config <file>]\n\nlint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry\n or a baseline entry for an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.\nbaseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.\nbaseline write Record current error-level violations. Creates the baseline, or records the named rules again, replacing their entries.\nbaseline prune Drop fixed debt, lower entries to what is left and carry entries to files git saw move. Never adds or raises an entry.\nbaseline tighten Prune only the entries of files changed since HEAD, or with --staged, in the index.\nbaseline migrate Move a JSON or JSON Lines baseline (--from, quality/baseline.json by default) into root and package shards.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks status Check that git's effective hooks path runs Quality's pre-commit hook and report global chaining.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\n--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
|
|
60
|
+
export declare const USAGE = "Usage:\n quality lint [--config <file>]\n quality ci\n quality setup [--config <file>]\n quality fix [--config <file>]\n quality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline merge <ancestor> <current> <other>\n quality baseline install-driver\n quality baseline write [--config <file>] [--rule <id>]...\n quality baseline prune [--config <file>] [--against <ref>]\n quality baseline tighten [--config <file>] [--staged]\n quality baseline migrate [--config <file>] [--from <file>]\n quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks status\n quality hooks pre-commit [--config <file>]\n\nci Check pnpm peers, then run the application scripts lint, typecheck, build and test, stopping on failure.\nsetup Install the Quality hook when the current folder owns a .git entry; skip unversioned and enclosed apps.\nlint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry\n or a baseline entry for an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.\nbaseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.\nbaseline write Record current error-level violations. Creates the baseline, or records the named rules again, replacing their entries.\nbaseline prune Drop fixed debt, lower entries to what is left and carry entries to files git saw move. Never adds or raises an entry.\nbaseline tighten Prune only the entries of files changed since HEAD, or with --staged, in the index.\nbaseline migrate Move a JSON or JSON Lines baseline (--from, quality/baseline.json by default) into root and package shards.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks status Check that git's effective hooks path runs Quality's pre-commit hook and report global chaining.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\n--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
|
|
56
61
|
export declare function parseCommand(args: readonly string[]): Parsed;
|
|
57
62
|
//# sourceMappingURL=args.d.ts.map
|
package/dist/cli/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,OAAO,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC9D;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC9G;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAC7D;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAA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,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnI,eAAO,MAAM,KAAK,s6FAAgB,CAAC;AAuFnC,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CA0B5D"}
|
package/dist/cli/args.js
CHANGED
|
@@ -24,6 +24,7 @@ const ACCEPTS = {
|
|
|
24
24
|
"baseline prune": ["against"],
|
|
25
25
|
"baseline tighten": ["staged"],
|
|
26
26
|
"baseline write": ["rule"],
|
|
27
|
+
ci: [],
|
|
27
28
|
"exceptions migrate": ["from"],
|
|
28
29
|
fix: [],
|
|
29
30
|
"hooks install": ["force"],
|
|
@@ -31,6 +32,7 @@ const ACCEPTS = {
|
|
|
31
32
|
"hooks status": [],
|
|
32
33
|
"hooks uninstall": [],
|
|
33
34
|
lint: [],
|
|
35
|
+
setup: [],
|
|
34
36
|
};
|
|
35
37
|
function misplaced(name, values) {
|
|
36
38
|
const option = COMMAND_OPTIONS.find((key) => values[key] !== undefined && !(ACCEPTS[name] ?? []).includes(key));
|
|
@@ -43,6 +45,10 @@ function ref(against, command) {
|
|
|
43
45
|
function commandFor(name, values) {
|
|
44
46
|
const config = values.config;
|
|
45
47
|
switch (name) {
|
|
48
|
+
case "ci":
|
|
49
|
+
return parsed({ _tag: "Ci" });
|
|
50
|
+
case "setup":
|
|
51
|
+
return parsed({ _tag: "Setup", config });
|
|
46
52
|
case "lint":
|
|
47
53
|
return parsed({ _tag: "Lint", config });
|
|
48
54
|
case "exceptions migrate":
|
package/dist/cli/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../../src/cli/args.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,IAAI,aAAa,EAAE,WAAW,EAAE,MAAM,eAAe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
|
|
4
|
+
export declare const ci: (cwd: string) => Effect.Effect<undefined, GateFailed | import("effect/PlatformError").PlatformError, ChildProcessSpawner.ChildProcessSpawner>;
|
|
5
|
+
//# sourceMappingURL=ci.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci.d.ts","sourceRoot":"","sources":["../../src/cli/ci.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAgB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,EAAE,+IAUb,CAAC"}
|
package/dist/cli/ci.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Console, Effect } from "effect";
|
|
2
|
+
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
3
|
+
import { GateFailed } from "#failure.ts";
|
|
4
|
+
export const ci = Effect.fn("Cli.ci")(function* (cwd) {
|
|
5
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
6
|
+
for (const args of [["peers", "check"], ...["lint", "typecheck", "build", "test"].map((script) => ["run", script])]) {
|
|
7
|
+
yield* Console.log(`quality: running \`pnpm ${args.join(" ")}\``);
|
|
8
|
+
const code = yield* spawner.exitCode(ChildProcess.make("pnpm", args, { cwd, stderr: "inherit", stdout: "inherit" }));
|
|
9
|
+
if (code !== 0) {
|
|
10
|
+
yield* Console.error(`quality: pnpm ${args.join(" ")} failed (exit ${code}).`);
|
|
11
|
+
return yield* new GateFailed();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=ci.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci.js","sourceRoot":"","sources":["../../src/cli/ci.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ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ality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline merge <ancestor> <current> <other>\n quality baseline install-driver\n quality baseline write [--config <file>] [--rule <id>]...\n quality baseline prune [--config <file>] [--against <ref>]\n quality baseline tighten [--config <file>] [--staged]\n quality baseline migrate [--config <file>] [--from <file>]\n quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks status\n quality hooks pre-commit [--config <file>]\n\nlint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry\n or a baseline entry for an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.\nbaseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.\nbaseline write Record current error-level violations. Creates the baseline, or records the named rules again, replacing their entries.\nbaseline prune Drop fixed debt, lower entries to what is left and carry entries to files git saw move. Never adds or raises an entry.\nbaseline tighten Prune only the entries of files changed since HEAD, or with --staged, in the index.\nbaseline migrate Move a JSON or JSON Lines baseline (--from, quality/baseline.json by default) into root and package shards.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks status Check that git's effective hooks path runs Quality's pre-commit hook and report global chaining.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\n--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
|
|
1
|
+
export declare const USAGE = "Usage:\n quality lint [--config <file>]\n quality ci\n quality setup [--config <file>]\n quality fix [--config <file>]\n quality exceptions migrate [--config <file>] [--from <registry>]\n quality baseline merge <ancestor> <current> <other>\n quality baseline install-driver\n quality baseline write [--config <file>] [--rule <id>]...\n quality baseline prune [--config <file>] [--against <ref>]\n quality baseline tighten [--config <file>] [--staged]\n quality baseline migrate [--config <file>] [--from <file>]\n quality hooks install [--config <file>] [--force]\n quality hooks uninstall\n quality hooks status\n quality hooks pre-commit [--config <file>]\n\nci Check pnpm peers, then run the application scripts lint, typecheck, build and test, stopping on failure.\nsetup Install the Quality hook when the current folder owns a .git entry; skip unversioned and enclosed apps.\nlint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry\n or a baseline entry for an unknown rule.\nfix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.\nexceptions migrate Move legacy registry entries and Biome declarations into quality.config.ts exceptions and remove matching root overrides.\nbaseline merge Merge Git baseline versions into <current>: deletions win and counts take the minimum.\nbaseline install-driver Configure only the repository-local merge.quality-baseline.driver setting.\nbaseline write Record current error-level violations. Creates the baseline, or records the named rules again, replacing their entries.\nbaseline prune Drop fixed debt, lower entries to what is left and carry entries to files git saw move. Never adds or raises an entry.\nbaseline tighten Prune only the entries of files changed since HEAD, or with --staged, in the index.\nbaseline migrate Move a JSON or JSON Lines baseline (--from, quality/baseline.json by default) into root and package shards.\nhooks install Install the git pre-commit hook, shared by every worktree, that runs hooks pre-commit. Keeps a hook that is not quality's\n unless --force replaces it.\nhooks uninstall Remove quality's pre-commit hook. Keeps a hook that is not quality's.\nhooks status Check that git's effective hooks path runs Quality's pre-commit hook and report global chaining.\nhooks pre-commit What the hook runs: lint, then package.json scripts typecheck and quality:commit when present.\n\n--config <file> Config file; its directory is the repository root. Without this option, uses ./quality.config.ts when present, otherwise defaults.\n--against <ref> The branch the work merges into, whose merge base prune follows moves from. Defaults to origin/HEAD, then origin/main, then origin/master.\nExit codes: 0 passed, 1 failed the gate, 2 could not run.";
|
|
2
2
|
export declare const SUBCOMMANDS: Readonly<Record<string, string>>;
|
|
3
3
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,s6FAqCwC,CAAC;AAE3D,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIxD,CAAC"}
|
package/dist/cli/messages.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export const USAGE = `Usage:
|
|
2
2
|
quality lint [--config <file>]
|
|
3
|
+
quality ci
|
|
4
|
+
quality setup [--config <file>]
|
|
3
5
|
quality fix [--config <file>]
|
|
4
6
|
quality exceptions migrate [--config <file>] [--from <registry>]
|
|
5
7
|
quality baseline merge <ancestor> <current> <other>
|
|
@@ -13,6 +15,8 @@ export const USAGE = `Usage:
|
|
|
13
15
|
quality hooks status
|
|
14
16
|
quality hooks pre-commit [--config <file>]
|
|
15
17
|
|
|
18
|
+
ci Check pnpm peers, then run the application scripts lint, typecheck, build and test, stopping on failure.
|
|
19
|
+
setup Install the Quality hook when the current folder owns a .git entry; skip unversioned and enclosed apps.
|
|
16
20
|
lint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry
|
|
17
21
|
or a baseline entry for an unknown rule.
|
|
18
22
|
fix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.
|
package/dist/cli/messages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/cli/messages.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAqCqC,CAAC;AAE3D,MAAM,CAAC,MAAM,WAAW,GAAqC;IAC5D,QAAQ,EAAE,yEAAyE;IACnF,UAAU,EAAE,2BAA2B;IACvC,KAAK,EAAE,uDAAuD;CAC9D,CAAC"}
|
package/dist/cli/program.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export interface Invocation {
|
|
|
5
5
|
readonly cwd: string;
|
|
6
6
|
readonly launch: Launch;
|
|
7
7
|
}
|
|
8
|
-
export declare const program: (args: readonly string[], args_1: Invocation) => Effect.Effect<void, import("#failure.ts").GateFailed | SetupFailure, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/FileSystem").FileSystem>;
|
|
8
|
+
export declare const program: (args: readonly string[], args_1: Invocation) => Effect.Effect<void, import("#failure.ts").GateFailed | import("effect/PlatformError").PlatformError | SetupFailure, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/FileSystem").FileSystem>;
|
|
9
9
|
//# sourceMappingURL=program.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,MAAM,EAAE,MAAM,QAAQ,CAAC;AAWzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAOhD,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,OAAO,iRAwClB,CAAC"}
|
package/dist/cli/program.js
CHANGED
|
@@ -3,6 +3,7 @@ import { installDriver } from "#baseline/installDriver.ts";
|
|
|
3
3
|
import { mergeBaseline } from "#baseline/merge.ts";
|
|
4
4
|
import { parseCommand, USAGE } from "#cli/args.ts";
|
|
5
5
|
import { writeBaseline } from "#cli/baseline.ts";
|
|
6
|
+
import { ci } from "#cli/ci.ts";
|
|
6
7
|
import { fix } from "#cli/fix.ts";
|
|
7
8
|
import { lint } from "#cli/lint.ts";
|
|
8
9
|
import { migrateBaseline } from "#cli/migrate.ts";
|
|
@@ -11,6 +12,7 @@ import { pruneBaseline, tightenBaseline } from "#cli/shrink.ts";
|
|
|
11
12
|
import { SetupFailure } from "#failure.ts";
|
|
12
13
|
import { installHook } from "#hooks/install.ts";
|
|
13
14
|
import { preCommitHook } from "#hooks/preCommit.ts";
|
|
15
|
+
import { setupHook } from "#hooks/setup.ts";
|
|
14
16
|
import { hookStatus } from "#hooks/status.ts";
|
|
15
17
|
import { uninstallHook } from "#hooks/uninstall.ts";
|
|
16
18
|
export const program = Effect.fn("Cli.program")(function* (args, { cwd, launch }) {
|
|
@@ -22,6 +24,10 @@ export const program = Effect.fn("Cli.program")(function* (args, { cwd, launch }
|
|
|
22
24
|
switch (command._tag) {
|
|
23
25
|
case "Help":
|
|
24
26
|
return yield* Console.log(USAGE);
|
|
27
|
+
case "Ci":
|
|
28
|
+
return yield* ci(cwd);
|
|
29
|
+
case "Setup":
|
|
30
|
+
return yield* setupHook({ config: command.config, cwd, launch });
|
|
25
31
|
case "Lint":
|
|
26
32
|
return yield* lint(cwd, command.config);
|
|
27
33
|
case "Fix":
|
package/dist/cli/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,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all } from "./install.ts";
|
|
3
|
+
export declare const setupHook: (options: Omit<HookInstall, "force">) => Effect.Effect<void, import("effect/PlatformError").PlatformError | import("../failure.ts").SetupFailure, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | FileSystem.FileSystem>;
|
|
4
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/hooks/setup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,cAAc,CAAC;AAE7D,eAAO,MAAM,SAAS,6OAKpB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { Effect, FileSystem } from "effect";
|
|
3
|
+
import { installHook } from "./install.js";
|
|
4
|
+
export const setupHook = Effect.fn("Hooks.setupHook")(function* (options) {
|
|
5
|
+
const fs = yield* FileSystem.FileSystem;
|
|
6
|
+
if (yield* fs.exists(join(options.cwd, ".git"))) {
|
|
7
|
+
yield* installHook({ ...options, force: false });
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/hooks/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAoB,WAAW,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EAAE,OAAmC;IACnG,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;QACjD,KAAK,CAAC,CAAC,WAAW,CAAC,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAClD,CAAC;AACF,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/quality",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Repository quality gate with typed rules, a baseline of existing debt and a registry of reasoned exceptions",
|
|
5
5
|
"homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/quality#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"./rules/imports/bundleInputs.ts": null,
|
|
38
38
|
"./inventory/shadcnFolders.ts": null,
|
|
39
39
|
"./inventory/shadcnAlias.ts": null,
|
|
40
|
-
"./naming/migrationFile.ts": null
|
|
40
|
+
"./naming/migrationFile.ts": null,
|
|
41
|
+
"./tsconfig/app.json": "./tsconfig/app.json"
|
|
41
42
|
},
|
|
42
43
|
"bin": {
|
|
43
44
|
"quality": "./dist/cli.js"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineConfig } from "vitest/config";
|
|
2
|
+
import { testProjects } from "#testProjects.ts";
|
|
3
|
+
|
|
4
|
+
export function appTestConfig(conditions: string[] = []) {
|
|
5
|
+
return defineConfig({
|
|
6
|
+
resolve: { conditions: [...conditions, "module", "browser", "development|production"] },
|
|
7
|
+
ssr: { resolve: { conditions: [...conditions, "node", "development|production"] } },
|
|
8
|
+
test: { ...testProjects(), server: { deps: { inline: ["@shivaedev/platform", "better-auth"] } } },
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function appViteConfig<TPlugin>(plugins: TPlugin[], conditions: string[] = []) {
|
|
2
|
+
return {
|
|
3
|
+
plugins,
|
|
4
|
+
resolve: { conditions, tsconfigPaths: true },
|
|
5
|
+
server: {
|
|
6
|
+
host: "127.0.0.1",
|
|
7
|
+
port: 5173,
|
|
8
|
+
proxy: Object.fromEntries(["/admin/jobs", "/api/auth", "/rpc"].map((path) => [path, { changeOrigin: false, target: "http://127.0.0.1:3000" }])),
|
|
9
|
+
strictPort: true,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
package/src/cli/args.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { Result } from "effect";
|
|
|
3
3
|
import { USAGE as COMMAND_USAGE, SUBCOMMANDS } from "./messages.ts";
|
|
4
4
|
|
|
5
5
|
export type Command =
|
|
6
|
+
| { readonly _tag: "Ci" }
|
|
7
|
+
| { readonly _tag: "Setup"; readonly config: string | undefined }
|
|
6
8
|
| { readonly _tag: "Lint"; readonly config: string | undefined }
|
|
7
9
|
| { readonly _tag: "ExceptionsMigrate"; readonly config: string | undefined; readonly from: string | undefined }
|
|
8
10
|
| { readonly _tag: "Fix"; readonly config: string | undefined }
|
|
@@ -52,6 +54,7 @@ const ACCEPTS: Readonly<Record<string, readonly Option[]>> = {
|
|
|
52
54
|
"baseline prune": ["against"],
|
|
53
55
|
"baseline tighten": ["staged"],
|
|
54
56
|
"baseline write": ["rule"],
|
|
57
|
+
ci: [],
|
|
55
58
|
"exceptions migrate": ["from"],
|
|
56
59
|
fix: [],
|
|
57
60
|
"hooks install": ["force"],
|
|
@@ -59,6 +62,7 @@ const ACCEPTS: Readonly<Record<string, readonly Option[]>> = {
|
|
|
59
62
|
"hooks status": [],
|
|
60
63
|
"hooks uninstall": [],
|
|
61
64
|
lint: [],
|
|
65
|
+
setup: [],
|
|
62
66
|
};
|
|
63
67
|
|
|
64
68
|
function misplaced(name: string, values: Values): string | undefined {
|
|
@@ -74,6 +78,10 @@ function ref(against: string | undefined, command: Command): Parsed {
|
|
|
74
78
|
function commandFor(name: string, values: Values): Parsed {
|
|
75
79
|
const config = values.config;
|
|
76
80
|
switch (name) {
|
|
81
|
+
case "ci":
|
|
82
|
+
return parsed({ _tag: "Ci" });
|
|
83
|
+
case "setup":
|
|
84
|
+
return parsed({ _tag: "Setup", config });
|
|
77
85
|
case "lint":
|
|
78
86
|
return parsed({ _tag: "Lint", config });
|
|
79
87
|
case "exceptions migrate":
|
package/src/cli/ci.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Console, Effect } from "effect";
|
|
2
|
+
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
3
|
+
import { GateFailed } from "#failure.ts";
|
|
4
|
+
|
|
5
|
+
export const ci = Effect.fn("Cli.ci")(function* (cwd: string) {
|
|
6
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
7
|
+
for (const args of [["peers", "check"], ...["lint", "typecheck", "build", "test"].map((script) => ["run", script])]) {
|
|
8
|
+
yield* Console.log(`quality: running \`pnpm ${args.join(" ")}\``);
|
|
9
|
+
const code = yield* spawner.exitCode(ChildProcess.make("pnpm", args, { cwd, stderr: "inherit", stdout: "inherit" }));
|
|
10
|
+
if (code !== 0) {
|
|
11
|
+
yield* Console.error(`quality: pnpm ${args.join(" ")} failed (exit ${code}).`);
|
|
12
|
+
return yield* new GateFailed();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
package/src/cli/messages.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export const USAGE = `Usage:
|
|
2
2
|
quality lint [--config <file>]
|
|
3
|
+
quality ci
|
|
4
|
+
quality setup [--config <file>]
|
|
3
5
|
quality fix [--config <file>]
|
|
4
6
|
quality exceptions migrate [--config <file>] [--from <registry>]
|
|
5
7
|
quality baseline merge <ancestor> <current> <other>
|
|
@@ -13,6 +15,8 @@ export const USAGE = `Usage:
|
|
|
13
15
|
quality hooks status
|
|
14
16
|
quality hooks pre-commit [--config <file>]
|
|
15
17
|
|
|
18
|
+
ci Check pnpm peers, then run the application scripts lint, typecheck, build and test, stopping on failure.
|
|
19
|
+
setup Install the Quality hook when the current folder owns a .git entry; skip unversioned and enclosed apps.
|
|
16
20
|
lint Run every rule. Exits 1 on an error-level violation, a file over its baseline, a stale registry entry
|
|
17
21
|
or a baseline entry for an unknown rule.
|
|
18
22
|
fix Sort every package.json, apply Biome's lint fixes, unsafe ones included, its assist actions and formatting, then format again.
|
package/src/cli/program.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { installDriver } from "#baseline/installDriver.ts";
|
|
|
3
3
|
import { mergeBaseline } from "#baseline/merge.ts";
|
|
4
4
|
import { parseCommand, USAGE } from "#cli/args.ts";
|
|
5
5
|
import { writeBaseline } from "#cli/baseline.ts";
|
|
6
|
+
import { ci } from "#cli/ci.ts";
|
|
6
7
|
import { fix } from "#cli/fix.ts";
|
|
7
8
|
import { lint } from "#cli/lint.ts";
|
|
8
9
|
import { migrateBaseline } from "#cli/migrate.ts";
|
|
@@ -12,6 +13,7 @@ import { SetupFailure } from "#failure.ts";
|
|
|
12
13
|
import type { Launch } from "#hooks/command.ts";
|
|
13
14
|
import { installHook } from "#hooks/install.ts";
|
|
14
15
|
import { preCommitHook } from "#hooks/preCommit.ts";
|
|
16
|
+
import { setupHook } from "#hooks/setup.ts";
|
|
15
17
|
import { hookStatus } from "#hooks/status.ts";
|
|
16
18
|
import { uninstallHook } from "#hooks/uninstall.ts";
|
|
17
19
|
|
|
@@ -29,6 +31,10 @@ export const program = Effect.fn("Cli.program")(function* (args: readonly string
|
|
|
29
31
|
switch (command._tag) {
|
|
30
32
|
case "Help":
|
|
31
33
|
return yield* Console.log(USAGE);
|
|
34
|
+
case "Ci":
|
|
35
|
+
return yield* ci(cwd);
|
|
36
|
+
case "Setup":
|
|
37
|
+
return yield* setupHook({ config: command.config, cwd, launch });
|
|
32
38
|
case "Lint":
|
|
33
39
|
return yield* lint(cwd, command.config);
|
|
34
40
|
case "Fix":
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { Effect, FileSystem } from "effect";
|
|
3
|
+
import { type HookInstall, installHook } from "./install.ts";
|
|
4
|
+
|
|
5
|
+
export const setupHook = Effect.fn("Hooks.setupHook")(function* (options: Omit<HookInstall, "force">) {
|
|
6
|
+
const fs = yield* FileSystem.FileSystem;
|
|
7
|
+
if (yield* fs.exists(join(options.cwd, ".git"))) {
|
|
8
|
+
yield* installHook({ ...options, force: false });
|
|
9
|
+
}
|
|
10
|
+
});
|