@r_masseater/msch 0.71.0 → 0.73.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/dist/changed.mjs +5 -4
- package/dist/changed.mjs.map +1 -1
- package/dist/cli.mjs +163 -267
- package/dist/cli.mjs.map +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +1 -1
- package/dist/decision-rules.d.mts +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-TN74hRYq.mjs → define-lint-preset-Bawe3IU5.mjs} +6 -1
- package/dist/define-lint-preset-Bawe3IU5.mjs.map +1 -0
- package/dist/{dependencies-C3kCe35Q.mjs → dependencies-BAjtDvY4.mjs} +27 -55
- package/dist/dependencies-BAjtDvY4.mjs.map +1 -0
- package/dist/exits.mjs +3 -3
- package/dist/exits.mjs.map +1 -1
- package/dist/{index-CWZNFtdG.d.mts → index-CHxAqDok.d.mts} +3 -6
- package/dist/{index-BvxWopv8.d.mts → index-DEuWKkok.d.mts} +2 -1
- package/dist/lint-rules.mjs +18 -2
- package/dist/lint-rules.mjs.map +1 -1
- package/dist/lint.d.mts +1 -1
- package/dist/lint.mjs +1 -1
- package/dist/{lookup-report-D1VTEK5k.mjs → lookup-report-Dp36RBaW.mjs} +2 -2
- package/dist/{lookup-report-D1VTEK5k.mjs.map → lookup-report-Dp36RBaW.mjs.map} +1 -1
- package/dist/{manifest-texts-K650kDy8.mjs → manifest-texts-CfnH7ifu.mjs} +4 -6
- package/dist/manifest-texts-CfnH7ifu.mjs.map +1 -0
- package/dist/output-DrM4OsOJ.mjs +14 -0
- package/dist/output-DrM4OsOJ.mjs.map +1 -0
- package/dist/{pass-records-kbx5VgwI.mjs → pass-records-DylVXWk1.mjs} +5 -4
- package/dist/pass-records-DylVXWk1.mjs.map +1 -0
- package/dist/publish.mjs +81 -151
- package/dist/publish.mjs.map +1 -1
- package/dist/{published-CpfXkChq.mjs → published-Bj0gR5IF.mjs} +27 -91
- package/dist/published-Bj0gR5IF.mjs.map +1 -0
- package/dist/published.mjs +11 -11
- package/dist/published.mjs.map +1 -1
- package/dist/refs.mjs +3 -3
- package/dist/refs.mjs.map +1 -1
- package/dist/runtime-Q9CzisOt.mjs +40 -0
- package/dist/runtime-Q9CzisOt.mjs.map +1 -0
- package/dist/wake.mjs +2 -2
- package/dist/wake.mjs.map +1 -1
- package/dist/workspace-manifest-CAVYfp66.mjs +8 -0
- package/dist/workspace-manifest-CAVYfp66.mjs.map +1 -0
- package/dist/workspace-settings.d.mts +1 -1
- package/dist/workspace-settings.mjs +8 -6
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +9 -6
- package/dist/define-lint-preset-TN74hRYq.mjs.map +0 -1
- package/dist/dependencies-C3kCe35Q.mjs.map +0 -1
- package/dist/export-subpaths-D6ZLYZGy.mjs +0 -17
- package/dist/export-subpaths-D6ZLYZGy.mjs.map +0 -1
- package/dist/manifest-texts-K650kDy8.mjs.map +0 -1
- package/dist/pass-records-kbx5VgwI.mjs.map +0 -1
- package/dist/published-CpfXkChq.mjs.map +0 -1
- package/dist/runtime-1exMm81b.mjs +0 -45
- package/dist/runtime-1exMm81b.mjs.map +0 -1
- package/dist/workspace-manifest-BC-1cRIJ.mjs +0 -20
- package/dist/workspace-manifest-BC-1cRIJ.mjs.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { r as nodeRepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
|
2
|
+
import { Array, Cause, Console, Effect, Layer, Runtime, pipe } from "effect";
|
|
3
|
+
import { FetchHttpClient } from "effect/http";
|
|
4
|
+
import { runMain } from "@effect/platform-node/NodeRuntime";
|
|
5
|
+
import { layer } from "@effect/platform-node/NodeServices";
|
|
6
|
+
import { Otlp, OtlpSerialization } from "effect/observability";
|
|
7
|
+
// ../node-main/src/features/run-main/model/report.ts
|
|
8
|
+
const linesOf = (serviceName) => (reason) => pipe(Cause.prettyErrors(Cause.fromReasons([reason])), Array.map((error) => {
|
|
9
|
+
if (Cause.isDieReason(reason)) return `${serviceName}: ${error.name}: ${error.message}`;
|
|
10
|
+
return `${serviceName}: ${error.message}`;
|
|
11
|
+
}));
|
|
12
|
+
/** @internal */
|
|
13
|
+
const reportOf = (serviceName) => (cause) => {
|
|
14
|
+
if (Cause.hasInterruptsOnly(cause) || !cause.pipe(Cause.squash, Runtime.getErrorReported)) return [];
|
|
15
|
+
return pipe(cause.reasons, Array.filter((reason) => !Cause.isInterruptReason(reason)), Array.flatMap(linesOf(serviceName)));
|
|
16
|
+
};
|
|
17
|
+
// ../node-main/src/features/run-main/model/run-main.ts
|
|
18
|
+
const platform = Layer.mergeAll(layer, FetchHttpClient.layer);
|
|
19
|
+
const runWithTracingAnd = ({ serviceName, services }) => (program) => {
|
|
20
|
+
const tracing = Otlp.layerFromConfig({ resource: { serviceName } }).pipe(Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer));
|
|
21
|
+
const provided = Layer.provideMerge(services, platform);
|
|
22
|
+
const report = reportOf(serviceName);
|
|
23
|
+
runMain(Layer.mergeAll(tracing, provided).pipe(Layer.build, Effect.flatMap((context) => Effect.provideContext(program, context)), Effect.scoped, Effect.tapCause((cause) => Effect.forEach(report(cause), (line) => Console.error(line), {
|
|
24
|
+
concurrency: 1,
|
|
25
|
+
discard: true
|
|
26
|
+
}))), { disableErrorReporting: true });
|
|
27
|
+
};
|
|
28
|
+
/** @internal */
|
|
29
|
+
const runMainWith = runWithTracingAnd;
|
|
30
|
+
// src/app/runtime.ts
|
|
31
|
+
/** @internal */
|
|
32
|
+
const runCli = (name) => (program) => {
|
|
33
|
+
runMainWith({
|
|
34
|
+
serviceName: name,
|
|
35
|
+
services: nodeRepositoryFiles
|
|
36
|
+
})(program);
|
|
37
|
+
};
|
|
38
|
+
export { runCli as t };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=runtime-Q9CzisOt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-Q9CzisOt.mjs","names":["Arr","nodeServices"],"sources":["../../node-main/src/features/run-main/model/report.ts","../../node-main/src/features/run-main/model/run-main.ts","../src/app/runtime.ts"],"sourcesContent":["import { Array as Arr, Cause, Runtime, pipe } from \"effect\";\n\nconst linesOf =\n (serviceName: string) =>\n <Failure>(reason: Cause.Reason<Failure>): readonly string[] =>\n pipe(\n Cause.prettyErrors(Cause.fromReasons([reason])),\n Arr.map((error) => {\n if (Cause.isDieReason(reason)) {\n return `${serviceName}: ${error.name}: ${error.message}`;\n }\n return `${serviceName}: ${error.message}`;\n }),\n );\n\n/** @internal */\nexport const reportOf =\n (serviceName: string) =>\n <Failure>(cause: Cause.Cause<Failure>): readonly string[] => {\n if (Cause.hasInterruptsOnly(cause) || !cause.pipe(Cause.squash, Runtime.getErrorReported)) {\n return [];\n }\n return pipe(\n cause.reasons,\n Arr.filter((reason) => !Cause.isInterruptReason(reason)),\n Arr.flatMap(linesOf(serviceName)),\n );\n };\n","import { runMain as nodeRuntimeRunMain } from \"@effect/platform-node/NodeRuntime\";\nimport { layer as nodeServices } from \"@effect/platform-node/NodeServices\";\nimport type { NodeServices } from \"@effect/platform-node/NodeServices\";\nimport { Console, Effect, Layer } from \"effect\";\nimport { FetchHttpClient } from \"effect/http\";\nimport type { HttpClient } from \"effect/http\";\nimport { Otlp, OtlpSerialization } from \"effect/observability\";\n\nimport { reportOf } from \"./report.ts\";\n\n/** @internal */\nexport type Platform = NodeServices | HttpClient.HttpClient;\n\n/** @internal */\nexport type Run<Provided> = <Success, Failure>(\n program: Effect.Effect<Success, Failure, Platform | Provided>,\n) => void;\n\nconst platform = Layer.mergeAll(nodeServices, FetchHttpClient.layer);\n\nconst runWithTracingAnd =\n <Provided, LayerFailure>({\n serviceName,\n services,\n }: Readonly<{\n serviceName: string;\n services: Layer.Layer<Provided, LayerFailure, Platform>;\n }>): Run<Provided> =>\n (program) => {\n const tracing = Otlp.layerFromConfig({ resource: { serviceName } }).pipe(\n Layer.provide(OtlpSerialization.layerJson),\n Layer.provide(FetchHttpClient.layer),\n );\n const provided = Layer.provideMerge(services, platform);\n const report = reportOf(serviceName);\n nodeRuntimeRunMain(\n Layer.mergeAll(tracing, provided).pipe(\n Layer.build,\n Effect.flatMap((context) => Effect.provideContext(program, context)),\n Effect.scoped,\n Effect.tapCause((cause) =>\n Effect.forEach(report(cause), (line) => Console.error(line), {\n concurrency: 1,\n discard: true,\n }),\n ),\n ),\n { disableErrorReporting: true },\n );\n };\n\nconst runWithTracing = (serviceName: string): Run<never> =>\n runWithTracingAnd({ serviceName, services: Layer.empty });\n\n/** @internal */\nexport const runMainWith = runWithTracingAnd;\n\n/** @internal */\nexport const runMain = runWithTracing;\n","import { runMainWith } from \"@r_masseater/node-main\";\nimport type { Effect, FileSystem, Path, Stdio } from \"effect\";\nimport type { HttpClient } from \"effect/http\";\nimport type { ChildProcessSpawner } from \"effect/process\";\n\nimport { nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\nimport type { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\n/** @internal */\nexport const runCli =\n (name: string) =>\n <Value, Failure>(\n program: Effect.Effect<\n Value,\n Failure,\n | RepositoryFiles\n | Stdio.Stdio\n | FileSystem.FileSystem\n | Path.Path\n | ChildProcessSpawner.ChildProcessSpawner\n | HttpClient.HttpClient\n >,\n ): void => {\n runMainWith({ serviceName: name, services: nodeRepositoryFiles })(program);\n };\n"],"mappings":";;;;;;;AAEA,MAAM,WACH,iBACS,WACR,KACE,MAAM,aAAa,MAAM,YAAY,CAAC,MAAM,CAAC,CAAC,GAC9CA,MAAI,KAAK,UAAU;CACjB,IAAI,MAAM,YAAY,MAAM,GAC1B,OAAO,GAAG,YAAY,IAAI,MAAM,KAAK,IAAI,MAAM;CAEjD,OAAO,GAAG,YAAY,IAAI,MAAM;AAClC,CAAC,CACH;;AAGJ,MAAa,YACV,iBACS,UAAmD;CAC3D,IAAI,MAAM,kBAAkB,KAAK,KAAK,CAAC,MAAM,KAAK,MAAM,QAAQ,QAAQ,gBAAgB,GACtF,OAAO,CAAC;CAEV,OAAO,KACL,MAAM,SACNA,MAAI,QAAQ,WAAW,CAAC,MAAM,kBAAkB,MAAM,CAAC,GACvDA,MAAI,QAAQ,QAAQ,WAAW,CAAC,CAClC;AACF;;ACTF,MAAM,WAAW,MAAM,SAASC,OAAc,gBAAgB,KAAK;AAEnE,MAAM,qBACqB,EACvB,aACA,gBAKD,YAAY;CACX,MAAM,UAAU,KAAK,gBAAgB,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,KAClE,MAAM,QAAQ,kBAAkB,SAAS,GACzC,MAAM,QAAQ,gBAAgB,KAAK,CACrC;CACA,MAAM,WAAW,MAAM,aAAa,UAAU,QAAQ;CACtD,MAAM,SAAS,SAAS,WAAW;CACnC,QACE,MAAM,SAAS,SAAS,QAAQ,CAAC,CAAC,KAChC,MAAM,OACN,OAAO,SAAS,YAAY,OAAO,eAAe,SAAS,OAAO,CAAC,GACnE,OAAO,QACP,OAAO,UAAU,UACf,OAAO,QAAQ,OAAO,KAAK,IAAI,SAAS,QAAQ,MAAM,IAAI,GAAG;EAC3D,aAAa;EACb,SAAS;CACX,CAAC,CACH,CACF,GACA,EAAE,uBAAuB,KAAK,CAChC;AACF;;AAMF,MAAa,cAAc;;;AC9C3B,MAAa,UACV,UAEC,YAUS;CACT,YAAY;EAAE,aAAa;EAAM,UAAU;CAAoB,CAAC,CAAC,CAAC,OAAO;AAC3E"}
|
package/dist/wake.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as runCli } from "./runtime-
|
|
2
|
+
import { t as runCli } from "./runtime-Q9CzisOt.mjs";
|
|
3
3
|
import { n as actionsOidcToken, t as BROKER } from "./credential-broker-9FMyTp1H.mjs";
|
|
4
4
|
import { Boolean, Console, Effect, Option, Schema } from "effect";
|
|
5
5
|
import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
|
|
@@ -19,7 +19,7 @@ const wakeOnRedMain = Effect.fn("wake.redMain")(function* wakeOnRedMain() {
|
|
|
19
19
|
}));
|
|
20
20
|
});
|
|
21
21
|
// bin/msch-wake.ts
|
|
22
|
-
runCli(wakeOnRedMain());
|
|
22
|
+
runCli("msch-wake")(wakeOnRedMain());
|
|
23
23
|
export {};
|
|
24
24
|
|
|
25
25
|
//# sourceMappingURL=wake.mjs.map
|
package/dist/wake.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wake.mjs","names":["Bool"],"sources":["../src/features/wake-project/model/wake.ts","../bin/msch-wake.ts"],"sourcesContent":["import { Boolean as Bool, Console, Effect, Option, Schema } from \"effect\";\nimport { HttpClient, HttpClientRequest, HttpClientResponse } from \"effect/http\";\n\nimport { BROKER, actionsOidcToken } from \"#/shared/lib/credential-broker.ts\";\n\nconst Woken = Schema.Struct({ woken: Schema.Boolean });\n\n/** @internal */\nexport const wakeOnRedMain = Effect.fn(\"wake.redMain\")(function* wakeOnRedMain() {\n const oidc = yield* actionsOidcToken;\n if (Option.isNone(oidc)) {\n return yield* Console.log(\"Not running in GitHub Actions: nothing to tell the broker\");\n }\n const client = yield* HttpClient.HttpClient;\n const request = HttpClientRequest.post(`${BROKER}wake/main-red`).pipe(\n HttpClientRequest.bearerToken(oidc.value),\n );\n const response = yield* HttpClient.filterStatusOk(client).execute(request);\n const { woken } = yield* HttpClientResponse.schemaBodyJson(Woken)(response);\n return yield* Console.log(\n Bool.match(woken, {\n onTrue: () => \"Asked the project to fix main\",\n onFalse: () => \"Asked recently: skipped\",\n }),\n );\n});\n","#!/usr/bin/env node\nimport { runCli } from \"#/app/runtime.ts\";\nimport { wakeOnRedMain } from \"#/features/wake-project/index.ts\";\n\nrunCli(wakeOnRedMain());\n"],"mappings":";;;;;;AAKA,MAAM,QAAQ,OAAO,OAAO,EAAE,OAAO,OAAO,QAAQ,CAAC;;AAGrD,MAAa,gBAAgB,OAAO,GAAG,cAAc,CAAC,CAAC,UAAU,gBAAgB;CAC/E,MAAM,OAAO,OAAO;CACpB,IAAI,OAAO,OAAO,IAAI,GACpB,OAAO,OAAO,QAAQ,IAAI,2DAA2D;CAEvF,MAAM,SAAS,OAAO,WAAW;CACjC,MAAM,UAAU,kBAAkB,KAAK,GAAG,OAAO,cAAc,CAAC,CAAC,KAC/D,kBAAkB,YAAY,KAAK,KAAK,CAC1C;CACA,MAAM,WAAW,OAAO,WAAW,eAAe,MAAM,CAAC,CAAC,QAAQ,OAAO;CACzE,MAAM,EAAE,UAAU,OAAO,mBAAmB,eAAe,KAAK,CAAC,CAAC,QAAQ;CAC1E,OAAO,OAAO,QAAQ,IACpBA,QAAK,MAAM,OAAO;EAChB,cAAc;EACd,eAAe;CACjB,CAAC,CACH;AACF,CAAC;;ACrBD,OAAO,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"wake.mjs","names":["Bool"],"sources":["../src/features/wake-project/model/wake.ts","../bin/msch-wake.ts"],"sourcesContent":["import { Boolean as Bool, Console, Effect, Option, Schema } from \"effect\";\nimport { HttpClient, HttpClientRequest, HttpClientResponse } from \"effect/http\";\n\nimport { BROKER, actionsOidcToken } from \"#/shared/lib/credential-broker.ts\";\n\nconst Woken = Schema.Struct({ woken: Schema.Boolean });\n\n/** @internal */\nexport const wakeOnRedMain = Effect.fn(\"wake.redMain\")(function* wakeOnRedMain() {\n const oidc = yield* actionsOidcToken;\n if (Option.isNone(oidc)) {\n return yield* Console.log(\"Not running in GitHub Actions: nothing to tell the broker\");\n }\n const client = yield* HttpClient.HttpClient;\n const request = HttpClientRequest.post(`${BROKER}wake/main-red`).pipe(\n HttpClientRequest.bearerToken(oidc.value),\n );\n const response = yield* HttpClient.filterStatusOk(client).execute(request);\n const { woken } = yield* HttpClientResponse.schemaBodyJson(Woken)(response);\n return yield* Console.log(\n Bool.match(woken, {\n onTrue: () => \"Asked the project to fix main\",\n onFalse: () => \"Asked recently: skipped\",\n }),\n );\n});\n","#!/usr/bin/env node\nimport { runCli } from \"#/app/runtime.ts\";\nimport { wakeOnRedMain } from \"#/features/wake-project/index.ts\";\n\nrunCli(\"msch-wake\")(wakeOnRedMain());\n"],"mappings":";;;;;;AAKA,MAAM,QAAQ,OAAO,OAAO,EAAE,OAAO,OAAO,QAAQ,CAAC;;AAGrD,MAAa,gBAAgB,OAAO,GAAG,cAAc,CAAC,CAAC,UAAU,gBAAgB;CAC/E,MAAM,OAAO,OAAO;CACpB,IAAI,OAAO,OAAO,IAAI,GACpB,OAAO,OAAO,QAAQ,IAAI,2DAA2D;CAEvF,MAAM,SAAS,OAAO,WAAW;CACjC,MAAM,UAAU,kBAAkB,KAAK,GAAG,OAAO,cAAc,CAAC,CAAC,KAC/D,kBAAkB,YAAY,KAAK,KAAK,CAC1C;CACA,MAAM,WAAW,OAAO,WAAW,eAAe,MAAM,CAAC,CAAC,QAAQ,OAAO;CACzE,MAAM,EAAE,UAAU,OAAO,mBAAmB,eAAe,KAAK,CAAC,CAAC,QAAQ;CAC1E,OAAO,OAAO,QAAQ,IACpBA,QAAK,MAAM,OAAO;EAChB,cAAc;EACd,eAAe;CACjB,CAAC,CACH;AACF,CAAC;;ACrBD,OAAO,WAAW,CAAC,CAAC,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Effect, Option } from "effect";
|
|
2
|
+
import { readWorkspaceManifest } from "@r_masseater/kestrion/pnpm";
|
|
3
|
+
// src/entities/workspace/model/workspace-manifest.ts
|
|
4
|
+
/** @internal */
|
|
5
|
+
const workspaceManifest = (root) => readWorkspaceManifest(root).pipe(Effect.orElseSucceed(() => Option.none()));
|
|
6
|
+
export { workspaceManifest as t };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=workspace-manifest-CAVYfp66.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-manifest-CAVYfp66.mjs","names":[],"sources":["../src/entities/workspace/model/workspace-manifest.ts"],"sourcesContent":["import { readWorkspaceManifest } from \"@r_masseater/kestrion/pnpm\";\nimport type { WorkspaceManifest } from \"@r_masseater/kestrion/pnpm\";\nimport { Effect, Option } from \"effect\";\n\n/** @internal */\nexport const workspaceManifest = (root: string): Effect.Effect<Option.Option<WorkspaceManifest>> =>\n readWorkspaceManifest(root).pipe(Effect.orElseSucceed(() => Option.none()));\n"],"mappings":";;;;AAKA,MAAa,qBAAqB,SAChC,sBAAsB,IAAI,CAAC,CAAC,KAAK,OAAO,oBAAoB,OAAO,KAAK,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as WorkspaceSettings, c as DependencySets, d as WorkspaceTasks, i as WorkspaceLint, l as IgnoredDirectory, n as RuleSets, o as workspaceSettings, r as SettingsOptions, s as DependencyAllowance, t as RuleSet, u as ignoredDirectories } from "./index-
|
|
1
|
+
import { a as WorkspaceSettings, c as DependencySets, d as WorkspaceTasks, i as WorkspaceLint, l as IgnoredDirectory, n as RuleSets, o as workspaceSettings, r as SettingsOptions, s as DependencyAllowance, t as RuleSet, u as ignoredDirectories } from "./index-CHxAqDok.mjs";
|
|
2
2
|
export { type DependencyAllowance, type DependencySets, type IgnoredDirectory, type RuleSet, type RuleSets, type SettingsOptions, type WorkspaceLint, type WorkspaceSettings, type WorkspaceTasks, ignoredDirectories, workspaceSettings };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as readManifest, o as workspaceDirectories } from "./dependencies-BAjtDvY4.mjs";
|
|
2
|
+
import { C as merged, E as usedFrom, M as nestedValues, S as literalSettings, T as settingsInvalid, b as tasksOf, c as linkedPaths, d as deployEntries, f as shadcnUiIn, h as NO_TASKS, j as literalOf, m as prefixed, n as entriesOf, s as publicEntriesOf, t as PackEntry, w as programOf, x as testsItself } from "./published-Bj0gR5IF.mjs";
|
|
3
3
|
import { n as RepositoryFiles, r as nodeRepositoryFiles } from "./repository-files-C2gVviac.mjs";
|
|
4
4
|
import { n as FINGERPRINT_FILE, r as LOCK_FILE, t as CLOSURE_FILE } from "./locked-closure-paths-Dtqs8uBU.mjs";
|
|
5
5
|
import { i as reachable, r as ignoredDirectories, t as collectIgnoredDirectories } from "./ignored-directories-BW8gCBE1.mjs";
|
|
6
6
|
import { Array, Effect, Option, Record, Schema, String, pipe } from "effect";
|
|
7
|
+
import { depPathsOf, readWantedLockfile } from "@r_masseater/kestrion/pnpm";
|
|
8
|
+
import { PACKAGE_JSON_FILE } from "@r_masseater/kestrion";
|
|
9
|
+
import { decodePackageJson } from "@r_masseater/kestrion/npm";
|
|
7
10
|
// src/entities/workspace/model/site-entries.ts
|
|
8
11
|
const READ_CONCURRENCY$1 = 16;
|
|
9
12
|
const SCRIPT = /\.[cm]?tsx?$/u;
|
|
@@ -28,7 +31,7 @@ const closureOf = (edges) => ({ own }) => {
|
|
|
28
31
|
/** @internal */
|
|
29
32
|
const lockedClosures = Effect.fn("lockedClosures")(function* lockedClosures(root) {
|
|
30
33
|
const files = yield* RepositoryFiles;
|
|
31
|
-
const lockfile = yield*
|
|
34
|
+
const lockfile = yield* readWantedLockfile(root);
|
|
32
35
|
const nodesOf = (id, sections) => [...pipe(sections, Array.flatMap(depPathsOf)), ...pipe(linkedPaths(sections), Array.map((path) => files.relative(root, files.join(root, id, path))), Array.map((linked) => `${IMPORTER}${Option.getOrElse(Option.liftPredicate(linked, String.isNonEmpty), () => ROOT_IMPORTER)}`))];
|
|
33
36
|
return pipe(lockfile, Option.map(({ importers, packages }) => {
|
|
34
37
|
const found = pipe(Record.toEntries(importers), Array.map(([id, project]) => {
|
|
@@ -128,7 +131,6 @@ const testProjectOf = Effect.fn("testProjectOf")(function* testProjectOf(source,
|
|
|
128
131
|
});
|
|
129
132
|
// src/features/build-workspace-settings/model/workspace-public-entries.ts
|
|
130
133
|
const PACK_ENTRY = ["pack", "entry"];
|
|
131
|
-
const decodeEntryManifest = Schema.decodeUnknownOption(EntryManifestJson);
|
|
132
134
|
const decodePackEntry = Schema.decodeUnknownOption(PackEntry);
|
|
133
135
|
const packEntriesIn = (program) => pipe(nestedValues(PACK_ENTRY)(program), Array.flatMap((node) => pipe(literalOf(node), Option.flatMap(decodePackEntry), Option.toArray, Array.flatMap(entriesOf))));
|
|
134
136
|
const entryFilesOf = ({ join, packEntries }) => (manifest) => {
|
|
@@ -144,10 +146,10 @@ const entryFilesOf = ({ join, packEntries }) => (manifest) => {
|
|
|
144
146
|
};
|
|
145
147
|
const publicEntryFiles = Effect.fn("publicEntryFiles")(function* publicEntryFiles(root, directory, config) {
|
|
146
148
|
const files = yield* RepositoryFiles;
|
|
147
|
-
const text = yield* files.readFile(files.join(root, directory,
|
|
149
|
+
const text = yield* files.readFile(files.join(root, directory, PACKAGE_JSON_FILE));
|
|
148
150
|
const packEntries = pipe(config, Option.map(packEntriesIn), Option.getOrElse(() => []));
|
|
149
151
|
const join = (target) => files.join(directory, target);
|
|
150
|
-
return pipe(text, Option.flatMap(
|
|
152
|
+
return pipe(text, Option.flatMap(decodePackageJson), Option.map(entryFilesOf({
|
|
151
153
|
join,
|
|
152
154
|
packEntries
|
|
153
155
|
})), Option.getOrElse(() => []));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-settings.mjs","names":["READ_CONCURRENCY","Arr","Rec","Arr","Str","Str","Arr","Rec","Names","Arr","Rec","Arr","Rec","Arr"],"sources":["../src/entities/workspace/model/site-entries.ts","../src/entities/workspace/model/locked-closures.ts","../src/entities/workspace/model/locked-closure-files.ts","../src/features/build-workspace-settings/model/dependency-allowances.ts","../src/features/build-workspace-settings/model/test-project.ts","../src/features/build-workspace-settings/model/workspace-public-entries.ts","../src/features/build-workspace-settings/model/workspace-settings.ts"],"sourcesContent":["import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst READ_CONCURRENCY = 16;\nconst SCRIPT = /\\.[cm]?tsx?$/u;\nconst SKIPPED = /\\.test\\.|\\.d\\.[cm]?ts$/u;\nconst SERVER_ENTRY_IMPORT = /from\\s+[\"']@effect\\/ui\\/html\\/HtmlServerHttp[\"']/u;\n\nexport const siteEntries = Effect.fn(\"siteEntries\")(function* siteEntries(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const candidates = pipe(\n listed,\n Arr.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)),\n );\n const texts = yield* Effect.forEach(\n candidates,\n (file) => files.readFile(files.join(root, file)),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(\n Arr.zip(candidates, texts),\n Arr.filter(([, text]) => Option.exists(text, (value) => SERVER_ENTRY_IMPORT.test(value))),\n Arr.map(([file]) => file),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { reachable } from \"#/shared/lib/reachable.ts\";\nimport type { Edges } from \"#/shared/lib/reachable.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { depPathsOf } from \"./locked-graph.ts\";\nimport type { ResolvedDependencies } from \"./locked-graph.ts\";\nimport { linkedPaths } from \"./locked-links.ts\";\nimport { wantedLockfile } from \"./locked-packages.ts\";\n\ntype LockedClosures = Readonly<Record<string, readonly string[]>>;\n\nconst IMPORTER = \"importer:\";\nconst ROOT_IMPORTER = \".\";\n\ntype Sections = readonly (ResolvedDependencies | undefined)[];\ntype Edge = readonly [string, readonly string[]];\n\ninterface Used {\n readonly dependencies?: ResolvedDependencies | undefined;\n readonly optionalDependencies?: ResolvedDependencies | undefined;\n}\n\ninterface Importer {\n readonly id: string;\n readonly own: readonly string[];\n readonly used: readonly string[];\n}\n\nconst usedSections = ({ dependencies, optionalDependencies }: Used): Sections => [\n dependencies,\n optionalDependencies,\n];\n\nconst packageEdges = <Package extends string>(\n packages: Readonly<Record<Package, Used>>,\n): readonly Edge[] =>\n pipe(\n Rec.toEntries(packages),\n Arr.map(([id, snapshot]): Edge => [id, pipe(usedSections(snapshot), Arr.flatMap(depPathsOf))]),\n );\n\nconst closureOf =\n (edges: Edges) =>\n ({ own }: Importer): readonly string[] => {\n const packages = pipe(\n reachable(edges, own),\n Arr.filter((id) => !Str.startsWith(IMPORTER)(id)),\n );\n return Arr.sort(packages, Str.Order);\n };\n\n/** @internal */\nexport const lockedClosures = Effect.fn(\"lockedClosures\")(function* lockedClosures(root: string) {\n const files = yield* RepositoryFiles;\n const lockfile = yield* wantedLockfile(root);\n const nodesOf = (id: string, sections: Sections): readonly string[] => [\n ...pipe(sections, Arr.flatMap(depPathsOf)),\n ...pipe(\n linkedPaths(sections),\n Arr.map((path) => files.relative(root, files.join(root, id, path))),\n Arr.map(\n (linked) =>\n `${IMPORTER}${Option.getOrElse(Option.liftPredicate(linked, Str.isNonEmpty), () => ROOT_IMPORTER)}`,\n ),\n ),\n ];\n return pipe(\n lockfile,\n Option.map(({ importers, packages }): LockedClosures => {\n const found = pipe(\n Rec.toEntries(importers),\n Arr.map(([id, project]): Importer => {\n const used = usedSections(project);\n return {\n id,\n own: nodesOf(id, [...used, project.devDependencies]),\n used: nodesOf(id, used),\n };\n }),\n );\n const edges = Rec.fromEntries([\n ...pipe(\n found,\n Arr.map(({ id, used }): Edge => [`${IMPORTER}${id}`, used]),\n ),\n ...packageEdges(packages ?? {}),\n ]);\n return Rec.fromEntries(\n pipe(\n found,\n Arr.map((importer) => [importer.id, closureOf(edges)(importer)] as const),\n ),\n );\n }),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { CLOSURE_FILE, FINGERPRINT_FILE, LOCK_FILE } from \"#/shared/lib/locked-closure-paths.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { lockedClosures } from \"./locked-closures.ts\";\n\nconst LINE = \"\\n\";\nconst FILE_CONCURRENCY = 16;\n\nconst writeChanged = Effect.fn(\"writeChanged\")(function* writeChanged(file: string, text: string) {\n const files = yield* RepositoryFiles;\n const written = yield* files.readFile(file);\n if (!Option.exists(written, (found) => found === text)) {\n yield* files.writeFile(file, text);\n }\n});\n\nconst isWritten = Effect.fn(\"isWritten\")(function* isWritten(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const recorded = yield* files.readFile(files.join(root, FINGERPRINT_FILE));\n const [hash, ...importers] = Str.split(\n Option.getOrElse(recorded, () => \"\"),\n LINE,\n );\n if (hash !== fingerprint) {\n return false;\n }\n const present = yield* Effect.forEach(\n importers,\n (importer) => files.exists(files.join(root, importer, CLOSURE_FILE)),\n { concurrency: FILE_CONCURRENCY },\n );\n return pipe(present, Arr.every(Boolean));\n});\n\nconst writeAll = Effect.fn(\"writeAll\")(function* writeAll(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const closures = yield* lockedClosures(root);\n const entries = Rec.toEntries(Option.getOrElse(closures, () => ({})));\n yield* Effect.forEach(\n entries,\n ([importer, closure]) =>\n writeChanged(files.join(root, importer, CLOSURE_FILE), Arr.join(closure, LINE)),\n { concurrency: FILE_CONCURRENCY, discard: true },\n );\n const importers = pipe(\n entries,\n Arr.map(([importer]) => importer),\n );\n yield* files.writeFile(\n files.join(root, FINGERPRINT_FILE),\n Arr.join([fingerprint, ...importers], LINE),\n );\n});\n\n/** @internal */\nexport const writeLockedClosures = Effect.fn(\"writeLockedClosures\")(function* writeLockedClosures(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const fingerprint = yield* files.hashFile(files.join(root, LOCK_FILE));\n if (Option.isNone(fingerprint)) {\n return;\n }\n const written = yield* isWritten(root, fingerprint.value);\n if (!written) {\n yield* writeAll(root, fingerprint.value);\n }\n});\n","import { Array as Arr, Effect, Option, Record as Rec, Schema } from \"effect\";\n\nimport { literalSettings, usedFrom } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\n\nexport type DependencySets = Readonly<Record<string, readonly string[]>>;\n\nexport interface DependencyAllowance {\n readonly workspaces: readonly string[];\n readonly dependencies: readonly string[];\n}\n\nexport type DependencyAllowances = Readonly<Record<string, DependencyAllowance>>;\n\nexport const MSCH_DEV_DEPENDENCIES = [\"msch\", \"devDependencies\"] as const;\nexport const MSCH_DEPENDENCIES = [\"msch\", \"dependencies\"] as const;\n\nconst Names = Schema.String.pipe(Schema.Array, Schema.optional);\nconst DependencySettings = Schema.Struct({ use: Names, dependencies: Names });\nconst WorkspaceDependencyAllowances = Schema.Record(Schema.String, DependencySettings);\n\nconst allowanceOf = Effect.fn(\"allowanceOf\")(function* allowanceOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n [reason, allowance]: readonly [string, typeof DependencySettings.Type],\n) {\n const sets = yield* usedFrom(source.file, dependencySets, allowance.use ?? []);\n const dependencies = [...Arr.flatten(sets), ...(allowance.dependencies ?? [])];\n return [\n `${source.directory}: ${reason}`,\n { workspaces: [source.directory], dependencies },\n ] as const;\n});\n\nexport const allowancesOf = Effect.fn(\"allowancesOf\")(function* allowancesOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n path: typeof MSCH_DEV_DEPENDENCIES | typeof MSCH_DEPENDENCIES,\n) {\n const settings = yield* literalSettings({\n source,\n path,\n decode: Schema.decodeUnknownEffect(WorkspaceDependencyAllowances),\n });\n const allowed = Rec.toEntries(Option.getOrElse(settings, () => ({})));\n const entries = yield* Effect.forEach(\n allowed,\n (entry) => allowanceOf(source, dependencySets, entry),\n { concurrency: 1 },\n );\n return Rec.fromEntries(entries);\n});\n","import { Effect, Option, Schema, pipe } from \"effect\";\n\nimport type { Manifest } from \"#/entities/package/index.ts\";\nimport { literalSettings } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\n\nconst TEST_ISOLATION = [\"test\", \"isolate\"] as const;\n\nexport interface SharedTestProject {\n readonly extends: string | false;\n readonly root: string;\n readonly test: { readonly name: string; readonly isolate: false };\n}\n\nexport type TestProject = string | SharedTestProject;\n\nexport interface ProjectPlace {\n readonly directory: string;\n readonly config: string | false;\n}\n\nexport const sharedTestProject =\n (manifest: Option.Option<Manifest>) =>\n ({ directory, config }: ProjectPlace): TestProject => ({\n extends: config,\n root: directory,\n test: {\n name: pipe(\n manifest,\n Option.flatMap(({ name }) => Option.fromUndefinedOr(name)),\n Option.getOrElse(() => directory),\n ),\n isolate: false,\n },\n });\n\nexport const testProjectOf = Effect.fn(\"testProjectOf\")(function* testProjectOf(\n source: WorkspaceSource,\n config: string,\n manifest: Option.Option<Manifest>,\n) {\n const isolated = yield* literalSettings({\n source,\n path: TEST_ISOLATION,\n decode: Schema.decodeUnknownEffect(Schema.Boolean),\n });\n if (Option.getOrElse(isolated, () => false)) {\n return source.directory;\n }\n return sharedTestProject(manifest)({ directory: source.directory, config });\n});\n","import { Array as Arr, Effect, Option, Schema, pipe } from \"effect\";\n\nimport {\n MANIFEST_FILE,\n EntryManifestJson,\n entriesOf,\n PackEntry,\n publicEntriesOf,\n} from \"#/entities/package/index.ts\";\nimport type { EntryManifest, PackEntrySource } from \"#/entities/package/index.ts\";\nimport { literalOf, nestedValues } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst PACK_ENTRY = [\"pack\", \"entry\"] as const;\n\nconst decodeEntryManifest = Schema.decodeUnknownOption(EntryManifestJson);\nconst decodePackEntry = Schema.decodeUnknownOption(PackEntry);\n\nconst packEntriesIn = (program: unknown): readonly PackEntrySource[] =>\n pipe(\n nestedValues(PACK_ENTRY)(program),\n Arr.flatMap((node) =>\n pipe(\n literalOf(node),\n Option.flatMap(decodePackEntry),\n Option.toArray,\n Arr.flatMap(entriesOf),\n ),\n ),\n );\n\ninterface EntryFilesRequest {\n readonly join: (target: string) => string;\n readonly packEntries: readonly PackEntrySource[];\n}\n\nconst entryFilesOf =\n ({ join, packEntries }: EntryFilesRequest) =>\n (manifest: EntryManifest): readonly string[] => {\n const joined = pipe(\n packEntries,\n Arr.map((entry) => ({ name: entry.name, source: join(entry.source) })),\n );\n return pipe(\n publicEntriesOf({ manifest, join, packEntries: joined }),\n Arr.map(({ source }) => source),\n Arr.dedupe,\n );\n };\n\nexport const publicEntryFiles = Effect.fn(\"publicEntryFiles\")(function* publicEntryFiles(\n root: string,\n directory: string,\n config: Option.Option<unknown>,\n) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, directory, MANIFEST_FILE));\n const packEntries = pipe(\n config,\n Option.map(packEntriesIn),\n Option.getOrElse(() => []),\n );\n const join = (target: string): string => files.join(directory, target);\n return pipe(\n text,\n Option.flatMap(decodeEntryManifest),\n Option.map(entryFilesOf({ join, packEntries })),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, Schema, pipe } from \"effect\";\nimport type { AllowWarnDeny, OxlintOverride } from \"vite-plus/lint\";\n\nimport { readManifest } from \"#/entities/package/index.ts\";\nimport {\n deployEntries,\n literalSettings,\n merged,\n programOf,\n settingsInvalid,\n siteEntries,\n usedFrom,\n workspaceDirectories,\n writeLockedClosures,\n prefixed,\n shadcnUiIn,\n NO_TASKS,\n tasksOf,\n testsItself,\n} from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource, WorkspaceTasks } from \"#/entities/workspace/index.ts\";\nimport { collectIgnoredDirectories } from \"#/shared/lib/ignored-directories.ts\";\nimport type { IgnoredDirectory } from \"#/shared/lib/ignored-directories.ts\";\nimport { RepositoryFiles, nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { MSCH_DEPENDENCIES, MSCH_DEV_DEPENDENCIES, allowancesOf } from \"./dependency-allowances.ts\";\nimport type { DependencyAllowances, DependencySets } from \"./dependency-allowances.ts\";\nimport { sharedTestProject, testProjectOf } from \"./test-project.ts\";\nimport type { TestProject } from \"./test-project.ts\";\nimport { publicEntryFiles } from \"./workspace-public-entries.ts\";\n\nexport type RuleSet = Readonly<Record<string, unknown>>;\nexport type RuleSets = Readonly<Record<string, RuleSet>>;\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst READ_CONCURRENCY = 16;\nconst ROOT_WORKSPACE = \".\";\nconst MSCH_LINT = [\"msch\", \"lint\"] as const;\n\ntype SeverityName = Extract<AllowWarnDeny, string>;\n\nconst SEVERITY_NAMES: Readonly<Record<SeverityName, true>> = {\n off: true,\n allow: true,\n warn: true,\n error: true,\n deny: true,\n};\nconst Severity = Schema.Literals<readonly SeverityName[]>(Rec.keys(SEVERITY_NAMES));\nconst SeverityWithOptions = Schema.mutable(\n Schema.TupleWithRest(Schema.Tuple([Severity]), [Schema.Unknown]),\n);\nconst RuleSetting = Schema.Union([Severity, SeverityWithOptions]);\nconst Rules = Schema.Record(Schema.String, RuleSetting);\nconst decodeRules = Schema.decodeUnknownEffect(Rules);\nconst Names = Schema.String.pipe(Schema.Array, Schema.optional);\nconst WorkspaceOverride = Schema.Struct({\n files: Schema.Array(Schema.String),\n excludeFiles: Names,\n rules: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n use: Names,\n});\nconst WorkspaceLintSettings = Schema.Struct({\n ignorePatterns: Names,\n overrides: WorkspaceOverride.pipe(Schema.Array, Schema.optional),\n});\n\nexport interface WorkspaceLint {\n readonly ignorePatterns: readonly string[];\n readonly overrides: readonly OxlintOverride[];\n readonly shadcnUi: readonly string[];\n readonly publicEntries: readonly string[];\n readonly deployEntries: readonly string[];\n readonly siteEntries: readonly string[];\n}\n\nexport interface WorkspaceSettings {\n readonly lint: WorkspaceLint;\n readonly members: readonly string[];\n readonly ignoredDirectories: readonly IgnoredDirectory[];\n readonly testProjects: readonly TestProject[];\n readonly tasks: WorkspaceTasks;\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n}\n\nexport interface SettingsOptions {\n readonly root: string;\n readonly ruleSets: RuleSets;\n readonly dependencySets: DependencySets;\n}\n\ninterface Workspace {\n readonly directory: string;\n readonly ignorePatterns: readonly string[];\n readonly overrides: readonly OxlintOverride[];\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n readonly ownTests: boolean;\n readonly testProject: TestProject;\n readonly tasks: WorkspaceTasks;\n readonly publicEntries: readonly string[];\n}\n\nconst overrideOf = Effect.fn(\"overrideOf\")(function* overrideOf(\n source: WorkspaceSource,\n ruleSets: RuleSets,\n override: typeof WorkspaceOverride.Type,\n) {\n const { file, directory } = source;\n const fromSets = yield* usedFrom(file, ruleSets, override.use ?? []);\n const rules = yield* decodeRules(merged([...fromSets, override.rules ?? {}])).pipe(\n Effect.mapError((error) => settingsInvalid(file)(error.message)),\n );\n const files = pipe(override.files, Arr.map(prefixed(directory)));\n return pipe(\n Option.fromUndefinedOr(override.excludeFiles),\n Option.match({\n onNone: (): OxlintOverride => ({ files, rules }),\n onSome: (excluded): OxlintOverride => ({\n files,\n excludeFiles: pipe(excluded, Arr.map(prefixed(directory))),\n rules,\n }),\n }),\n );\n});\n\nconst lintOf = Effect.fn(\"lintOf\")(function* lintOf(source: WorkspaceSource, ruleSets: RuleSets) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_LINT,\n decode: Schema.decodeUnknownEffect(WorkspaceLintSettings),\n });\n const lint = Option.getOrElse(settings, (): typeof WorkspaceLintSettings.Type => ({}));\n const overrides = yield* Effect.forEach(\n lint.overrides ?? [],\n (override) => overrideOf(source, ruleSets, override),\n { concurrency: 1 },\n );\n const ignorePatterns = pipe(lint.ignorePatterns ?? [], Arr.map(prefixed(source.directory)));\n return { ignorePatterns, overrides };\n});\n\nconst settingsOf = Effect.fn(\"settingsOf\")(function* settingsOf(\n source: WorkspaceSource,\n options: SettingsOptions,\n) {\n const lint = yield* lintOf(source, options.ruleSets);\n const devDependencies = yield* allowancesOf(\n source,\n options.dependencySets,\n MSCH_DEV_DEPENDENCIES,\n );\n const dependencies = yield* allowancesOf(source, options.dependencySets, MSCH_DEPENDENCIES);\n const ownTests = testsItself(source.program);\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(files.dirname(source.file));\n const tasks = tasksOf(manifest)(source.program);\n const testProject = yield* testProjectOf(source, `${source.directory}/${CONFIG_FILE}`, manifest);\n return {\n directory: source.directory,\n ...lint,\n devDependencies,\n dependencies,\n ownTests,\n testProject,\n tasks,\n };\n});\n\nconst unconfiguredWorkspace = Effect.fn(\"unconfiguredWorkspace\")(function* unconfiguredWorkspace(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const publicEntries = yield* publicEntryFiles(root, directory, Option.none());\n const manifest = yield* readManifest(files.join(root, directory));\n return {\n directory,\n ignorePatterns: [],\n overrides: [],\n devDependencies: {},\n dependencies: {},\n ownTests: false,\n testProject: sharedTestProject(manifest)({ directory, config: false }),\n tasks: NO_TASKS,\n publicEntries,\n };\n});\n\nconst workspaceIn = Effect.fn(\"workspaceIn\")(function* workspaceIn(\n options: SettingsOptions,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const file = files.join(options.root, directory, CONFIG_FILE);\n const text = yield* files.readFile(file);\n if (Option.isNone(text)) {\n return yield* unconfiguredWorkspace(options.root, directory);\n }\n const program = yield* programOf(file, text.value);\n const settings = yield* settingsOf({ file, directory, program }, options);\n const publicEntries = yield* publicEntryFiles(options.root, directory, Option.some(program));\n return { ...settings, publicEntries };\n});\n\nconst mergedTasks = (found: readonly { readonly tasks: WorkspaceTasks }[]): WorkspaceTasks => ({\n verify: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.verify),\n ),\n native: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.native),\n ),\n});\n\nconst mergedAllowances = (\n found: readonly Workspace[],\n): Pick<Workspace, \"devDependencies\" | \"dependencies\"> => ({\n devDependencies: merged(\n pipe(\n found,\n Arr.map(({ devDependencies }) => devDependencies),\n ),\n ),\n dependencies: merged(\n pipe(\n found,\n Arr.map(({ dependencies }) => dependencies),\n ),\n ),\n});\n\nconst collectWorkspaceSettings = Effect.fn(\"collectWorkspaceSettings\")(\n function* collectWorkspaceSettings(options: SettingsOptions) {\n yield* Effect.ignore(writeLockedClosures(options.root));\n const directories = yield* workspaceDirectories(options.root);\n const found: readonly Workspace[] = yield* Effect.forEach(\n directories,\n (directory) => workspaceIn(options, directory),\n { concurrency: READ_CONCURRENCY },\n );\n const shadcnUi = yield* Effect.forEach(\n directories,\n (directory) => shadcnUiIn(options.root, directory),\n { concurrency: READ_CONCURRENCY },\n );\n return {\n members: pipe(\n directories,\n Arr.filter((directory) => directory !== ROOT_WORKSPACE),\n ),\n ignoredDirectories: yield* collectIgnoredDirectories(options.root),\n lint: {\n ignorePatterns: pipe(\n found,\n Arr.flatMap(({ ignorePatterns }) => ignorePatterns),\n ),\n overrides: pipe(\n found,\n Arr.flatMap(({ overrides }) => overrides),\n ),\n shadcnUi: Arr.getSomes(shadcnUi),\n publicEntries: pipe(\n found,\n Arr.flatMap(({ publicEntries }) => publicEntries),\n ),\n deployEntries: yield* deployEntries(options.root),\n siteEntries: yield* siteEntries(options.root),\n },\n testProjects: pipe(\n found,\n Arr.filter(({ ownTests }) => !ownTests),\n Arr.map(({ testProject }) => testProject),\n ),\n tasks: mergedTasks(found),\n ...mergedAllowances(found),\n };\n },\n);\n\nexport const workspaceSettings = (options: SettingsOptions): Promise<WorkspaceSettings> =>\n Effect.runPromise(collectWorkspaceSettings(options).pipe(Effect.provide(nodeRepositoryFiles)));\n\nexport type { WorkspaceTasks } from \"#/entities/workspace/index.ts\";\n"],"mappings":";;;;;;;AAIA,MAAMA,qBAAmB;AACzB,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,sBAAsB;AAE5B,MAAa,cAAc,OAAO,GAAG,aAAa,CAAC,CAAC,UAAU,YAAY,MAAc;CACtF,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,OAAO,MAAM,YAAY,IAAI;CAC5C,MAAM,aAAa,KACjB,QACAC,MAAI,QAAQ,SAAS,OAAO,KAAK,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,CAC/D;CACA,MAAM,QAAQ,OAAO,OAAO,QAC1B,aACC,SAAS,MAAM,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AAG,0BAA0B,CAAC,CACpE,UAAU,yBAAyB,SAA0B;CAC3D,OAAO,OAAO,OAAO,oBAAoB,QAAQ,IAAI,CAAC;CACtD,MAAM,cAAc,OAAO,qBAAqB,QAAQ,IAAI;CAC5D,MAAM,QAA8B,OAAO,OAAO,QAChD,cACC,cAAc,YAAY,SAAS,SAAS,GAC7C,EAAE,aAAa,iBAAiB,CAClC;CACA,MAAM,WAAW,OAAO,OAAO,QAC7B,cACC,cAAc,WAAW,QAAQ,MAAM,SAAS,GACjD,EAAE,aAAa,iBAAiB,CAClC;CACA,OAAO;EACL,SAAS,KACP,aACAA,MAAI,QAAQ,cAAc,cAAc,cAAc,CACxD;EACA,oBAAoB,OAAO,0BAA0B,QAAQ,IAAI;EACjE,MAAM;GACJ,gBAAgB,KACd,OACAA,MAAI,SAAS,EAAE,qBAAqB,cAAc,CACpD;GACA,WAAW,KACT,OACAA,MAAI,SAAS,EAAE,gBAAgB,SAAS,CAC1C;GACA,UAAUA,MAAI,SAAS,QAAQ;GAC/B,eAAe,KACb,OACAA,MAAI,SAAS,EAAE,oBAAoB,aAAa,CAClD;GACA,eAAe,OAAO,cAAc,QAAQ,IAAI;GAChD,aAAa,OAAO,YAAY,QAAQ,IAAI;EAC9C;EACA,cAAc,KACZ,OACAA,MAAI,QAAQ,EAAE,eAAe,CAAC,QAAQ,GACtCA,MAAI,KAAK,EAAE,kBAAkB,WAAW,CAC1C;EACA,OAAO,YAAY,KAAK;EACxB,GAAG,iBAAiB,KAAK;CAC3B;AACF,CACF;AAEA,MAAa,qBAAqB,YAChC,OAAO,WAAW,yBAAyB,OAAO,CAAC,CAAC,KAAK,OAAO,QAAQ,mBAAmB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"workspace-settings.mjs","names":["READ_CONCURRENCY","Arr","Rec","Arr","Str","Str","Arr","Rec","Names","Arr","Rec","Arr","Rec","Arr"],"sources":["../src/entities/workspace/model/site-entries.ts","../src/entities/workspace/model/locked-closures.ts","../src/entities/workspace/model/locked-closure-files.ts","../src/features/build-workspace-settings/model/dependency-allowances.ts","../src/features/build-workspace-settings/model/test-project.ts","../src/features/build-workspace-settings/model/workspace-public-entries.ts","../src/features/build-workspace-settings/model/workspace-settings.ts"],"sourcesContent":["import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst READ_CONCURRENCY = 16;\nconst SCRIPT = /\\.[cm]?tsx?$/u;\nconst SKIPPED = /\\.test\\.|\\.d\\.[cm]?ts$/u;\nconst SERVER_ENTRY_IMPORT = /from\\s+[\"']@effect\\/ui\\/html\\/HtmlServerHttp[\"']/u;\n\nexport const siteEntries = Effect.fn(\"siteEntries\")(function* siteEntries(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const candidates = pipe(\n listed,\n Arr.filter((file) => SCRIPT.test(file) && !SKIPPED.test(file)),\n );\n const texts = yield* Effect.forEach(\n candidates,\n (file) => files.readFile(files.join(root, file)),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(\n Arr.zip(candidates, texts),\n Arr.filter(([, text]) => Option.exists(text, (value) => SERVER_ENTRY_IMPORT.test(value))),\n Arr.map(([file]) => file),\n );\n});\n","import { depPathsOf, readWantedLockfile } from \"@r_masseater/kestrion/pnpm\";\nimport type { ResolvedDependencies } from \"@r_masseater/kestrion/pnpm\";\nimport { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { reachable } from \"#/shared/lib/reachable.ts\";\nimport type { Edges } from \"#/shared/lib/reachable.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { linkedPaths } from \"./locked-links.ts\";\n\ntype LockedClosures = Readonly<Record<string, readonly string[]>>;\n\nconst IMPORTER = \"importer:\";\nconst ROOT_IMPORTER = \".\";\n\ntype Sections = readonly (ResolvedDependencies | undefined)[];\ntype Edge = readonly [string, readonly string[]];\n\ninterface Used {\n readonly dependencies?: ResolvedDependencies | undefined;\n readonly optionalDependencies?: ResolvedDependencies | undefined;\n}\n\ninterface Importer {\n readonly id: string;\n readonly own: readonly string[];\n readonly used: readonly string[];\n}\n\nconst usedSections = ({ dependencies, optionalDependencies }: Used): Sections => [\n dependencies,\n optionalDependencies,\n];\n\nconst packageEdges = <Package extends string>(\n packages: Readonly<Record<Package, Used>>,\n): readonly Edge[] =>\n pipe(\n Rec.toEntries(packages),\n Arr.map(([id, snapshot]): Edge => [id, pipe(usedSections(snapshot), Arr.flatMap(depPathsOf))]),\n );\n\nconst closureOf =\n (edges: Edges) =>\n ({ own }: Importer): readonly string[] => {\n const packages = pipe(\n reachable(edges, own),\n Arr.filter((id) => !Str.startsWith(IMPORTER)(id)),\n );\n return Arr.sort(packages, Str.Order);\n };\n\n/** @internal */\nexport const lockedClosures = Effect.fn(\"lockedClosures\")(function* lockedClosures(root: string) {\n const files = yield* RepositoryFiles;\n const lockfile = yield* readWantedLockfile(root);\n const nodesOf = (id: string, sections: Sections): readonly string[] => [\n ...pipe(sections, Arr.flatMap(depPathsOf)),\n ...pipe(\n linkedPaths(sections),\n Arr.map((path) => files.relative(root, files.join(root, id, path))),\n Arr.map(\n (linked) =>\n `${IMPORTER}${Option.getOrElse(Option.liftPredicate(linked, Str.isNonEmpty), () => ROOT_IMPORTER)}`,\n ),\n ),\n ];\n return pipe(\n lockfile,\n Option.map(({ importers, packages }): LockedClosures => {\n const found = pipe(\n Rec.toEntries(importers),\n Arr.map(([id, project]): Importer => {\n const used = usedSections(project);\n return {\n id,\n own: nodesOf(id, [...used, project.devDependencies]),\n used: nodesOf(id, used),\n };\n }),\n );\n const edges = Rec.fromEntries([\n ...pipe(\n found,\n Arr.map(({ id, used }): Edge => [`${IMPORTER}${id}`, used]),\n ),\n ...packageEdges(packages ?? {}),\n ]);\n return Rec.fromEntries(\n pipe(\n found,\n Arr.map((importer) => [importer.id, closureOf(edges)(importer)] as const),\n ),\n );\n }),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { CLOSURE_FILE, FINGERPRINT_FILE, LOCK_FILE } from \"#/shared/lib/locked-closure-paths.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { lockedClosures } from \"./locked-closures.ts\";\n\nconst LINE = \"\\n\";\nconst FILE_CONCURRENCY = 16;\n\nconst writeChanged = Effect.fn(\"writeChanged\")(function* writeChanged(file: string, text: string) {\n const files = yield* RepositoryFiles;\n const written = yield* files.readFile(file);\n if (!Option.exists(written, (found) => found === text)) {\n yield* files.writeFile(file, text);\n }\n});\n\nconst isWritten = Effect.fn(\"isWritten\")(function* isWritten(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const recorded = yield* files.readFile(files.join(root, FINGERPRINT_FILE));\n const [hash, ...importers] = Str.split(\n Option.getOrElse(recorded, () => \"\"),\n LINE,\n );\n if (hash !== fingerprint) {\n return false;\n }\n const present = yield* Effect.forEach(\n importers,\n (importer) => files.exists(files.join(root, importer, CLOSURE_FILE)),\n { concurrency: FILE_CONCURRENCY },\n );\n return pipe(present, Arr.every(Boolean));\n});\n\nconst writeAll = Effect.fn(\"writeAll\")(function* writeAll(root: string, fingerprint: string) {\n const files = yield* RepositoryFiles;\n const closures = yield* lockedClosures(root);\n const entries = Rec.toEntries(Option.getOrElse(closures, () => ({})));\n yield* Effect.forEach(\n entries,\n ([importer, closure]) =>\n writeChanged(files.join(root, importer, CLOSURE_FILE), Arr.join(closure, LINE)),\n { concurrency: FILE_CONCURRENCY, discard: true },\n );\n const importers = pipe(\n entries,\n Arr.map(([importer]) => importer),\n );\n yield* files.writeFile(\n files.join(root, FINGERPRINT_FILE),\n Arr.join([fingerprint, ...importers], LINE),\n );\n});\n\n/** @internal */\nexport const writeLockedClosures = Effect.fn(\"writeLockedClosures\")(function* writeLockedClosures(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const fingerprint = yield* files.hashFile(files.join(root, LOCK_FILE));\n if (Option.isNone(fingerprint)) {\n return;\n }\n const written = yield* isWritten(root, fingerprint.value);\n if (!written) {\n yield* writeAll(root, fingerprint.value);\n }\n});\n","import { Array as Arr, Effect, Option, Record as Rec, Schema } from \"effect\";\n\nimport { literalSettings, usedFrom } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\n\nexport type DependencySets = Readonly<Record<string, readonly string[]>>;\n\nexport interface DependencyAllowance {\n readonly workspaces: readonly string[];\n readonly dependencies: readonly string[];\n}\n\nexport type DependencyAllowances = Readonly<Record<string, DependencyAllowance>>;\n\nexport const MSCH_DEV_DEPENDENCIES = [\"msch\", \"devDependencies\"] as const;\nexport const MSCH_DEPENDENCIES = [\"msch\", \"dependencies\"] as const;\n\nconst Names = Schema.String.pipe(Schema.Array, Schema.optional);\nconst DependencySettings = Schema.Struct({ use: Names, dependencies: Names });\nconst WorkspaceDependencyAllowances = Schema.Record(Schema.String, DependencySettings);\n\nconst allowanceOf = Effect.fn(\"allowanceOf\")(function* allowanceOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n [reason, allowance]: readonly [string, typeof DependencySettings.Type],\n) {\n const sets = yield* usedFrom(source.file, dependencySets, allowance.use ?? []);\n const dependencies = [...Arr.flatten(sets), ...(allowance.dependencies ?? [])];\n return [\n `${source.directory}: ${reason}`,\n { workspaces: [source.directory], dependencies },\n ] as const;\n});\n\nexport const allowancesOf = Effect.fn(\"allowancesOf\")(function* allowancesOf(\n source: WorkspaceSource,\n dependencySets: DependencySets,\n path: typeof MSCH_DEV_DEPENDENCIES | typeof MSCH_DEPENDENCIES,\n) {\n const settings = yield* literalSettings({\n source,\n path,\n decode: Schema.decodeUnknownEffect(WorkspaceDependencyAllowances),\n });\n const allowed = Rec.toEntries(Option.getOrElse(settings, () => ({})));\n const entries = yield* Effect.forEach(\n allowed,\n (entry) => allowanceOf(source, dependencySets, entry),\n { concurrency: 1 },\n );\n return Rec.fromEntries(entries);\n});\n","import type { PackageJson } from \"@r_masseater/kestrion\";\nimport { Effect, Option, Schema, pipe } from \"effect\";\n\nimport { literalSettings } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\n\nconst TEST_ISOLATION = [\"test\", \"isolate\"] as const;\n\nexport interface SharedTestProject {\n readonly extends: string | false;\n readonly root: string;\n readonly test: { readonly name: string; readonly isolate: false };\n}\n\nexport type TestProject = string | SharedTestProject;\n\nexport interface ProjectPlace {\n readonly directory: string;\n readonly config: string | false;\n}\n\nexport const sharedTestProject =\n (manifest: Option.Option<PackageJson>) =>\n ({ directory, config }: ProjectPlace): TestProject => ({\n extends: config,\n root: directory,\n test: {\n name: pipe(\n manifest,\n Option.flatMap(({ name }) => Option.fromUndefinedOr(name)),\n Option.getOrElse(() => directory),\n ),\n isolate: false,\n },\n });\n\nexport const testProjectOf = Effect.fn(\"testProjectOf\")(function* testProjectOf(\n source: WorkspaceSource,\n config: string,\n manifest: Option.Option<PackageJson>,\n) {\n const isolated = yield* literalSettings({\n source,\n path: TEST_ISOLATION,\n decode: Schema.decodeUnknownEffect(Schema.Boolean),\n });\n if (Option.getOrElse(isolated, () => false)) {\n return source.directory;\n }\n return sharedTestProject(manifest)({ directory: source.directory, config });\n});\n","import { PACKAGE_JSON_FILE } from \"@r_masseater/kestrion\";\nimport { decodePackageJson } from \"@r_masseater/kestrion/npm\";\nimport { Array as Arr, Effect, Option, Schema, pipe } from \"effect\";\n\nimport { entriesOf, PackEntry, publicEntriesOf } from \"#/entities/package/index.ts\";\nimport type { EntryManifest, PackEntrySource } from \"#/entities/package/index.ts\";\nimport { literalOf, nestedValues } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst PACK_ENTRY = [\"pack\", \"entry\"] as const;\n\nconst decodePackEntry = Schema.decodeUnknownOption(PackEntry);\n\nconst packEntriesIn = (program: unknown): readonly PackEntrySource[] =>\n pipe(\n nestedValues(PACK_ENTRY)(program),\n Arr.flatMap((node) =>\n pipe(\n literalOf(node),\n Option.flatMap(decodePackEntry),\n Option.toArray,\n Arr.flatMap(entriesOf),\n ),\n ),\n );\n\ninterface EntryFilesRequest {\n readonly join: (target: string) => string;\n readonly packEntries: readonly PackEntrySource[];\n}\n\nconst entryFilesOf =\n ({ join, packEntries }: EntryFilesRequest) =>\n (manifest: EntryManifest): readonly string[] => {\n const joined = pipe(\n packEntries,\n Arr.map((entry) => ({ name: entry.name, source: join(entry.source) })),\n );\n return pipe(\n publicEntriesOf({ manifest, join, packEntries: joined }),\n Arr.map(({ source }) => source),\n Arr.dedupe,\n );\n };\n\nexport const publicEntryFiles = Effect.fn(\"publicEntryFiles\")(function* publicEntryFiles(\n root: string,\n directory: string,\n config: Option.Option<unknown>,\n) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, directory, PACKAGE_JSON_FILE));\n const packEntries = pipe(\n config,\n Option.map(packEntriesIn),\n Option.getOrElse(() => []),\n );\n const join = (target: string): string => files.join(directory, target);\n return pipe(\n text,\n Option.flatMap(decodePackageJson),\n Option.map(entryFilesOf({ join, packEntries })),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n","import { Array as Arr, Effect, Option, Record as Rec, Schema, pipe } from \"effect\";\nimport type { AllowWarnDeny, OxlintOverride } from \"vite-plus/lint\";\n\nimport { readManifest } from \"#/entities/package/index.ts\";\nimport {\n deployEntries,\n literalSettings,\n merged,\n programOf,\n settingsInvalid,\n siteEntries,\n usedFrom,\n workspaceDirectories,\n writeLockedClosures,\n prefixed,\n shadcnUiIn,\n NO_TASKS,\n tasksOf,\n testsItself,\n} from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource, WorkspaceTasks } from \"#/entities/workspace/index.ts\";\nimport { collectIgnoredDirectories } from \"#/shared/lib/ignored-directories.ts\";\nimport type { IgnoredDirectory } from \"#/shared/lib/ignored-directories.ts\";\nimport { RepositoryFiles, nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { MSCH_DEPENDENCIES, MSCH_DEV_DEPENDENCIES, allowancesOf } from \"./dependency-allowances.ts\";\nimport type { DependencyAllowances, DependencySets } from \"./dependency-allowances.ts\";\nimport { sharedTestProject, testProjectOf } from \"./test-project.ts\";\nimport type { TestProject } from \"./test-project.ts\";\nimport { publicEntryFiles } from \"./workspace-public-entries.ts\";\n\nexport type RuleSet = Readonly<Record<string, unknown>>;\nexport type RuleSets = Readonly<Record<string, RuleSet>>;\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst READ_CONCURRENCY = 16;\nconst ROOT_WORKSPACE = \".\";\nconst MSCH_LINT = [\"msch\", \"lint\"] as const;\n\ntype SeverityName = Extract<AllowWarnDeny, string>;\n\nconst SEVERITY_NAMES: Readonly<Record<SeverityName, true>> = {\n off: true,\n allow: true,\n warn: true,\n error: true,\n deny: true,\n};\nconst Severity = Schema.Literals<readonly SeverityName[]>(Rec.keys(SEVERITY_NAMES));\nconst SeverityWithOptions = Schema.mutable(\n Schema.TupleWithRest(Schema.Tuple([Severity]), [Schema.Unknown]),\n);\nconst RuleSetting = Schema.Union([Severity, SeverityWithOptions]);\nconst Rules = Schema.Record(Schema.String, RuleSetting);\nconst decodeRules = Schema.decodeUnknownEffect(Rules);\nconst Names = Schema.String.pipe(Schema.Array, Schema.optional);\nconst WorkspaceOverride = Schema.Struct({\n files: Schema.Array(Schema.String),\n excludeFiles: Names,\n rules: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),\n use: Names,\n});\nconst WorkspaceLintSettings = Schema.Struct({\n ignorePatterns: Names,\n overrides: WorkspaceOverride.pipe(Schema.Array, Schema.optional),\n});\n\nexport interface WorkspaceLint {\n readonly ignorePatterns: readonly string[];\n readonly overrides: readonly OxlintOverride[];\n readonly shadcnUi: readonly string[];\n readonly publicEntries: readonly string[];\n readonly deployEntries: readonly string[];\n readonly siteEntries: readonly string[];\n}\n\nexport interface WorkspaceSettings {\n readonly lint: WorkspaceLint;\n readonly members: readonly string[];\n readonly ignoredDirectories: readonly IgnoredDirectory[];\n readonly testProjects: readonly TestProject[];\n readonly tasks: WorkspaceTasks;\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n}\n\nexport interface SettingsOptions {\n readonly root: string;\n readonly ruleSets: RuleSets;\n readonly dependencySets: DependencySets;\n}\n\ninterface Workspace {\n readonly directory: string;\n readonly ignorePatterns: readonly string[];\n readonly overrides: readonly OxlintOverride[];\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n readonly ownTests: boolean;\n readonly testProject: TestProject;\n readonly tasks: WorkspaceTasks;\n readonly publicEntries: readonly string[];\n}\n\nconst overrideOf = Effect.fn(\"overrideOf\")(function* overrideOf(\n source: WorkspaceSource,\n ruleSets: RuleSets,\n override: typeof WorkspaceOverride.Type,\n) {\n const { file, directory } = source;\n const fromSets = yield* usedFrom(file, ruleSets, override.use ?? []);\n const rules = yield* decodeRules(merged([...fromSets, override.rules ?? {}])).pipe(\n Effect.mapError((error) => settingsInvalid(file)(error.message)),\n );\n const files = pipe(override.files, Arr.map(prefixed(directory)));\n return pipe(\n Option.fromUndefinedOr(override.excludeFiles),\n Option.match({\n onNone: (): OxlintOverride => ({ files, rules }),\n onSome: (excluded): OxlintOverride => ({\n files,\n excludeFiles: pipe(excluded, Arr.map(prefixed(directory))),\n rules,\n }),\n }),\n );\n});\n\nconst lintOf = Effect.fn(\"lintOf\")(function* lintOf(source: WorkspaceSource, ruleSets: RuleSets) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_LINT,\n decode: Schema.decodeUnknownEffect(WorkspaceLintSettings),\n });\n const lint = Option.getOrElse(settings, (): typeof WorkspaceLintSettings.Type => ({}));\n const overrides = yield* Effect.forEach(\n lint.overrides ?? [],\n (override) => overrideOf(source, ruleSets, override),\n { concurrency: 1 },\n );\n const ignorePatterns = pipe(lint.ignorePatterns ?? [], Arr.map(prefixed(source.directory)));\n return { ignorePatterns, overrides };\n});\n\nconst settingsOf = Effect.fn(\"settingsOf\")(function* settingsOf(\n source: WorkspaceSource,\n options: SettingsOptions,\n) {\n const lint = yield* lintOf(source, options.ruleSets);\n const devDependencies = yield* allowancesOf(\n source,\n options.dependencySets,\n MSCH_DEV_DEPENDENCIES,\n );\n const dependencies = yield* allowancesOf(source, options.dependencySets, MSCH_DEPENDENCIES);\n const ownTests = testsItself(source.program);\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(files.dirname(source.file));\n const tasks = tasksOf(manifest)(source.program);\n const testProject = yield* testProjectOf(source, `${source.directory}/${CONFIG_FILE}`, manifest);\n return {\n directory: source.directory,\n ...lint,\n devDependencies,\n dependencies,\n ownTests,\n testProject,\n tasks,\n };\n});\n\nconst unconfiguredWorkspace = Effect.fn(\"unconfiguredWorkspace\")(function* unconfiguredWorkspace(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const publicEntries = yield* publicEntryFiles(root, directory, Option.none());\n const manifest = yield* readManifest(files.join(root, directory));\n return {\n directory,\n ignorePatterns: [],\n overrides: [],\n devDependencies: {},\n dependencies: {},\n ownTests: false,\n testProject: sharedTestProject(manifest)({ directory, config: false }),\n tasks: NO_TASKS,\n publicEntries,\n };\n});\n\nconst workspaceIn = Effect.fn(\"workspaceIn\")(function* workspaceIn(\n options: SettingsOptions,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const file = files.join(options.root, directory, CONFIG_FILE);\n const text = yield* files.readFile(file);\n if (Option.isNone(text)) {\n return yield* unconfiguredWorkspace(options.root, directory);\n }\n const program = yield* programOf(file, text.value);\n const settings = yield* settingsOf({ file, directory, program }, options);\n const publicEntries = yield* publicEntryFiles(options.root, directory, Option.some(program));\n return { ...settings, publicEntries };\n});\n\nconst mergedTasks = (found: readonly { readonly tasks: WorkspaceTasks }[]): WorkspaceTasks => ({\n verify: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.verify),\n ),\n native: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.native),\n ),\n});\n\nconst mergedAllowances = (\n found: readonly Workspace[],\n): Pick<Workspace, \"devDependencies\" | \"dependencies\"> => ({\n devDependencies: merged(\n pipe(\n found,\n Arr.map(({ devDependencies }) => devDependencies),\n ),\n ),\n dependencies: merged(\n pipe(\n found,\n Arr.map(({ dependencies }) => dependencies),\n ),\n ),\n});\n\nconst collectWorkspaceSettings = Effect.fn(\"collectWorkspaceSettings\")(\n function* collectWorkspaceSettings(options: SettingsOptions) {\n yield* Effect.ignore(writeLockedClosures(options.root));\n const directories = yield* workspaceDirectories(options.root);\n const found: readonly Workspace[] = yield* Effect.forEach(\n directories,\n (directory) => workspaceIn(options, directory),\n { concurrency: READ_CONCURRENCY },\n );\n const shadcnUi = yield* Effect.forEach(\n directories,\n (directory) => shadcnUiIn(options.root, directory),\n { concurrency: READ_CONCURRENCY },\n );\n return {\n members: pipe(\n directories,\n Arr.filter((directory) => directory !== ROOT_WORKSPACE),\n ),\n ignoredDirectories: yield* collectIgnoredDirectories(options.root),\n lint: {\n ignorePatterns: pipe(\n found,\n Arr.flatMap(({ ignorePatterns }) => ignorePatterns),\n ),\n overrides: pipe(\n found,\n Arr.flatMap(({ overrides }) => overrides),\n ),\n shadcnUi: Arr.getSomes(shadcnUi),\n publicEntries: pipe(\n found,\n Arr.flatMap(({ publicEntries }) => publicEntries),\n ),\n deployEntries: yield* deployEntries(options.root),\n siteEntries: yield* siteEntries(options.root),\n },\n testProjects: pipe(\n found,\n Arr.filter(({ ownTests }) => !ownTests),\n Arr.map(({ testProject }) => testProject),\n ),\n tasks: mergedTasks(found),\n ...mergedAllowances(found),\n };\n },\n);\n\nexport const workspaceSettings = (options: SettingsOptions): Promise<WorkspaceSettings> =>\n Effect.runPromise(collectWorkspaceSettings(options).pipe(Effect.provide(nodeRepositoryFiles)));\n\nexport type { WorkspaceTasks } from \"#/entities/workspace/index.ts\";\n"],"mappings":";;;;;;;;;;AAIA,MAAMA,qBAAmB;AACzB,MAAM,SAAS;AACf,MAAM,UAAU;AAChB,MAAM,sBA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qB,YAChC,OAAO,WAAW,yBAAyB,OAAO,CAAC,CAAC,KAAK,OAAO,QAAQ,mBAAmB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@r_masseater/msch",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"description": "masseater's check policy: points every finite value set and object shape at its one owner, and ships the oxlint preset of plugins and rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lint",
|
|
@@ -93,20 +93,22 @@
|
|
|
93
93
|
"@effect/platform-node": "^4.1.5",
|
|
94
94
|
"@effect/platform-node-shared": "^4.1.5",
|
|
95
95
|
"@html-eslint/eslint-plugin-react": "^0.68.0",
|
|
96
|
+
"@npmcli/package-json": "^8.0.1",
|
|
96
97
|
"@pnpm/deps.path": "^1101.0.11",
|
|
97
98
|
"@pnpm/lockfile.fs": "^1100.2.20",
|
|
98
99
|
"@pnpm/logger": "^1100.0.0",
|
|
99
100
|
"@pnpm/workspace.projects-reader": "^1101.1.9",
|
|
100
101
|
"@pnpm/workspace.workspace-manifest-reader": "^1100.3.4",
|
|
101
102
|
"@pnpm/workspace.workspace-manifest-writer": "^1100.2.13",
|
|
102
|
-
"@r_masseater/fu4": "^0.3.
|
|
103
|
-
"@r_masseater/h56m": "^0.3.
|
|
103
|
+
"@r_masseater/fu4": "^0.3.2",
|
|
104
|
+
"@r_masseater/h56m": "^0.3.2",
|
|
105
|
+
"@r_masseater/kestrion": "^0.1.0",
|
|
104
106
|
"@r_masseater/oxlint-plugin-decision": "^0.8.1",
|
|
105
107
|
"@r_masseater/oxlint-typed-rules": "^0.5.0",
|
|
106
108
|
"@r_masseater/textlint-rule-preset-ja": "^0.3.0",
|
|
107
109
|
"@r_masseater/vite-plus-adopt": "^0.16.0",
|
|
108
|
-
"@r_masseater/wism": "^0.4.
|
|
109
|
-
"@r_masseater/y8": "^0.6.
|
|
110
|
+
"@r_masseater/wism": "^0.4.3",
|
|
111
|
+
"@r_masseater/y8": "^0.6.3",
|
|
110
112
|
"@shadcn/lint": "^0.2.5",
|
|
111
113
|
"@tanstack/intent": "^0.5.6",
|
|
112
114
|
"@textlint-ja/textlint-rule-preset-ai-writing": "^1.7.2",
|
|
@@ -118,6 +120,7 @@
|
|
|
118
120
|
"htmlparser2": "^12.0.0",
|
|
119
121
|
"modern-web-guidance": "^1.0.2",
|
|
120
122
|
"oxlint-plugin-eslint": "^1.95.0",
|
|
123
|
+
"rolldown": "^1.3.4",
|
|
121
124
|
"semver": "^7.8.6",
|
|
122
125
|
"sql-parser-cst": "^0.45.0",
|
|
123
126
|
"textlint-filter-rule-comments": "^1.3.0",
|
|
@@ -131,7 +134,7 @@
|
|
|
131
134
|
"@masseater.dev/lint-host": "0.0.0",
|
|
132
135
|
"@masseater.dev/path-kit": "0.0.0",
|
|
133
136
|
"@r_masseater/github-workflow": "0.1.1",
|
|
134
|
-
"@r_masseater/node-main": "0.
|
|
137
|
+
"@r_masseater/node-main": "0.2.0",
|
|
135
138
|
"@r_masseater/vitest-otlp": "0.2.2",
|
|
136
139
|
"@types/node": "26.6.10",
|
|
137
140
|
"@types/semver": "7.8.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"define-lint-preset-TN74hRYq.mjs","names":["Rec","Arr","Str","effectPresets","decisionPlugin","shadcn","Str","Arr","Rec"],"sources":["../src/features/define-lint-preset/config/lint-overrides.config.ts","../src/features/define-lint-preset/config/decision-rules.ts","../src/features/define-lint-preset/config/web-guidance.config.ts","../src/features/define-lint-preset/config/lint.config.ts","../src/features/define-lint-preset/config/test-rules.config.ts","../src/features/define-lint-preset/config/preset.ts","../src/features/define-lint-preset/config/required-stack.config.ts","../src/features/define-lint-preset/config/traced-rules.config.ts","../src/features/define-lint-preset/config/remotion-rules.config.ts","../src/features/define-lint-preset/config/structure.config.ts","../src/features/define-lint-preset/config/kuromojin.config.ts","../src/features/define-lint-preset/config/textlint-presets.config.ts","../src/features/define-lint-preset/config/textlint-filters.config.ts","../src/features/define-lint-preset/config/markdown.config.ts"],"sourcesContent":["const LOGPUSH = 'Property[key.name=\"logpush\"]:not([value.value=false])';\nconst LOGPUSH_MESSAGE =\n \"Worker には logpush: true を付ける。付けないと、その Worker のログが Logpush に流れない\";\n\nconst CPU_LIMIT = 'Property[key.name=\"limits\"]:has(Property[key.name=\"cpuMs\"])';\nconst CPU_LIMIT_MESSAGE =\n \"コードを動かす Worker には limits.cpuMs を付け、本番の CPU 時間の最大値をわずかに上回る値にする。付けないと、1 回の暴走が上限の CPU 時間まで請求される\";\n\nconst UNATTRIBUTED_MODEL_CALL =\n \"モデルの呼び出しは AI Gateway を通し、呼び出し元を metadata に載せる。載せないと、費用やエラーを後から呼び出し元で引けない\";\n\nconst UNGATED_MODEL_CALL =\n \"モデルの呼び出しは AI Gateway を通す。通らない呼び出しには日ごとの費用の上限が掛からず、無料枠を超えた分がそのまま請求される\";\n\nconst MODEL_RUN =\n 'CallExpression[callee.property.name=\"run\"]:matches([callee.object.name=\"AI\"], [callee.object.property.name=\"AI\"])';\n\nconst AI_RUN_URL =\n \":matches(Literal[value=/ai.run/], TemplateLiteral:has(TemplateElement[value.raw=/ai.run/]))\";\n\nconst AI_RUN_REQUEST = `CallExpression:has(> ${AI_RUN_URL})`;\n\nexport const cloudflareResourceSyntax: readonly Readonly<{ selector: string; message: string }>[] =\n [\n {\n selector: `CallExpression[callee.object.name=\"Workers\"][callee.property.name=\"Worker\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n message: LOGPUSH_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=\"Website\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n message: LOGPUSH_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=/^(Workers|Website)$/] > ObjectExpression.arguments:has(Property[key.name=\"main\"]):not(:has(${CPU_LIMIT}))`,\n message: CPU_LIMIT_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=\"Website\"]:not([callee.property.name=\"StaticSite\"]) > ObjectExpression.arguments:not(:has(${CPU_LIMIT}))`,\n message: CPU_LIMIT_MESSAGE,\n },\n {\n selector: `${MODEL_RUN}[arguments.length<3]`,\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector: `${MODEL_RUN} > .arguments:nth-child(3):not(Identifier[name=\"options\"])`,\n message: `${UNGATED_MODEL_CALL}。AI.run の第 3 引数には、runWorkersAi の call が受け取る options をそのまま渡す`,\n },\n {\n selector: `${AI_RUN_REQUEST} > ObjectExpression.arguments:not(:has(Property[key.name=\"headers\"]))`,\n message: `${UNGATED_MODEL_CALL}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n },\n {\n selector: `${AI_RUN_REQUEST} > ObjectExpression.arguments > Property[key.name=\"headers\"] > ObjectExpression:not(:has(Property[key.value=\"cf-aig-gateway-id\"]))`,\n message: `${UNGATED_MODEL_CALL}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n },\n {\n selector:\n 'CallExpression[callee.name=\"runWorkersAi\"] > ObjectExpression > Property[key.name=\"call\"] > ArrowFunctionExpression[params.length=0]',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'CallExpression[callee.name=\"createAI\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"metadata\"]))',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'ObjectExpression:has(Property[key.value=\"cf-aig-gateway-id\"]):not(:has(Property[key.value=\"cf-aig-metadata\"]))',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"collectLogs\"][value.value=true]))',\n message:\n \"AI Gateway には collectLogs: true を付ける。付けないと、モデルの呼び出しが後から引けない\",\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"spendLimits\"] > ObjectExpression > Property[key.name=\"enabled\"][value.value=true]))',\n message:\n \"AI Gateway には spendLimits を enabled: true で付け、日ごとの費用の上限を掛ける。付けないと、従量課金のモデルの呼び出しが上限なく請求される\",\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"cacheTtl\"]))',\n message:\n \"AI Gateway には cacheTtl を付け、同じ問いの答えをキャッシュする。付けないと、同じ問いにも毎回課金される\",\n },\n {\n selector: 'MemberExpression[object.name=\"Rum\"][property.name=\"Site\"]',\n message:\n \"Rum.Site は使わない。CI のトークンに Account Settings Write が要る。Cloudflare API でホストごとに一度サイトを作り、トークンを CF_BEACON_TOKEN に置く\",\n },\n ];\nexport const removalPolicySyntax: Readonly<{ selector: string; message: string }> = {\n selector:\n 'CallExpression[callee.object.name=/^(D1|R2)$/][callee.property.name=/^(Database|Bucket)$/]:not(CallExpression[callee.property.name=\"pipe\"][arguments.0.callee.object.name=\"RemovalPolicy\"] > MemberExpression.callee > CallExpression.object)',\n message:\n \"D1 と R2 は作り直すと中身が消えるので、alchemy の RemovalPolicy.protect() を .pipe で付けて置き換えと削除を止める\",\n};\n\nexport const removalPolicyOverride: {\n files: string[];\n excludeFiles: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/*.ts\"],\n excludeFiles: [\"**/*.test.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\"error\", ...cloudflareResourceSyntax, removalPolicySyntax],\n },\n};\n\nexport const alchemyOverride: {\n files: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/alchemy.run.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n ...cloudflareResourceSyntax,\n removalPolicySyntax,\n {\n selector: 'CallExpression[callee.name=\"Stack\"]:not([arguments.0.name=\"APP_NAME\"])',\n message: \"スタック名には app-name.ts の APP_NAME を渡す\",\n },\n {\n selector:\n 'Program:not(:has(YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n {\n selector:\n 'CallExpression[callee.name=\"Stack\"] > .arguments:nth-child(3):not(:has(FunctionExpression > BlockStatement > ExpressionStatement:nth-last-child(2) > YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n ],\n },\n};\n\nexport const commandsOverride: {\n files: string[];\n rules: Readonly<Record<string, \"off\">>;\n} = {\n files: [\"bin/**\"],\n rules: {\n \"node/no-process-env\": \"off\",\n \"node/no-sync\": \"off\",\n \"effecttsgo/node-builtin-import\": \"off\",\n },\n};\n","import { createDecisionPlugin, defineDecisionRule } from \"@r_masseater/oxlint-plugin-decision\";\n\nexport default createDecisionPlugin({\n name: \"stack\",\n rules: [\n defineDecisionRule({\n id: \"exclusive-status\",\n target: \"file\",\n question:\n \"Does this code represent one piece of state with several boolean flags or optional fields whose combinations can contradict each other, instead of one exclusive status expressed as a discriminated union? Answer no when every state is a single exclusive status, or when the file holds no such state. A violation needs two or more booleans or optional fields that describe the same piece of state; a single boolean value, parameter, return value or field is not a violation, and a union of objects told apart by a status or kind field is already an exclusive status. A constant configuration object whose shape a library fixes, such as an OpenFeature flag definition, holds no state and is not a violation.\",\n message: \"状態は排他的なstatusを持つ判別共用体で表し、booleanフラグの組を使わない。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"server-state-tanstack-query\",\n target: \"file\",\n question:\n \"Does this code fetch, cache or synchronize server data on the client with something other than TanStack Query, such as fetch inside useEffect, SWR or a hand-written cache? Answer no when server data on the client goes only through TanStack Query, or when the file handles none. Creating an API client such as a better-auth or Eden client, which fetches nothing until a query calls it, is not a violation.\",\n message: \"サーバー状態はTanStack Queryだけで扱う。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"ui-state-effect-atom\",\n target: \"file\",\n question:\n \"Does this code hold client-side UI state with something other than effect-atom, such as useState, useReducer, React context used as a store, zustand, jotai or redux? Answer no when client-side UI state is held only by effect-atom, or when the file holds none. effect-atom is Atom from effect/reactivity, read and written through @effect/atom-react hooks such as useAtomValue and useAtomSet. Creating a TanStack Query QueryClient or configuring the router, which hold no UI state, is not a violation.\",\n message: \"UI状態はeffect-atomだけで扱う。\",\n cutoff: 0.8,\n }),\n ],\n});\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nexport const webGuidanceRules = {\n \"jsx-a11y/no-redundant-roles\": [\"error\", { ul: [\"list\"], ol: [\"list\"] }],\n \"jsx-a11y/no-noninteractive-tabindex\": [\"error\", { tags: [\"section\"], roles: [\"tabpanel\"] }],\n} satisfies LintRules;\n","import { presets as effectPresets } from \"@effect/tsgo/oxlint-presets\";\nimport htmlReact from \"@html-eslint/eslint-plugin-react\";\nimport eslintReact from \"@r_masseater/oxlint-typed-rules/react\";\nimport { Array as Arr, Record as Rec, String as Str, Struct, pipe } from \"effect\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\n\nimport decisionPlugin from \"./decision-rules.ts\";\n\nexport const generated = [\n \"**/routeTree.gen.ts\",\n \"**/generated/**\",\n \"**/drizzle/**/snapshot.json\",\n \".claude/skills/**\",\n \".intent/**\",\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \"**/CHANGELOG.md\",\n \".github/release-please/*manifest.json\",\n \"**/.release-please-manifest.json\",\n \"**/*.d.*.ts\",\n \"**/src-tauri/gen/**\",\n];\n\nconst asErrors = (names: readonly string[]): Readonly<Record<string, \"error\">> =>\n Rec.fromEntries(\n pipe(\n names,\n Arr.map((name) => [name, \"error\"] as const),\n ),\n );\n\nexport const allRulesOf = ({\n prefix,\n rules,\n}: Readonly<{ prefix: string; rules: Readonly<Record<string, unknown>> }>): Readonly<\n Record<string, \"error\">\n> =>\n asErrors(\n pipe(\n Rec.keys(rules),\n Arr.map((rule) => `${prefix}/${rule}`),\n ),\n );\n\nconst reactHooksRuleNames = pipe(\n Struct.keys(reactHooks.configs[\"recommended-latest\"].rules),\n Arr.map(Str.replace(\"react-hooks/\", \"react-hooks-js/\")),\n);\n\nconst reactHooksRules = asErrors(reactHooksRuleNames);\n\nconst eslintReactRuleNames = pipe(\n Rec.keys(eslintReact.configs[\"strict-typescript\"].rules ?? {}),\n Arr.filter(\n (name) => !(Str.replace(\"@eslint-react/\", \"react-hooks-js/\")(name) in reactHooksRules),\n ),\n);\n\nconst effectRuleNames = pipe(\n Rec.values(effectPresets),\n Arr.flatMap((preset) => Struct.keys(preset.rules ?? {})),\n);\n\nexport const pluginRules: Readonly<Record<string, \"error\">> = {\n ...asErrors(Rec.keys(htmlReact.configs.all.rules ?? {})),\n ...reactHooksRules,\n ...asErrors(eslintReactRuleNames),\n ...asErrors(effectRuleNames),\n};\n\nexport const decisionPluginName = decisionPlugin.meta.name;\n\nexport const decisionRules = allRulesOf({\n prefix: decisionPluginName,\n rules: decisionPlugin.rules,\n});\n\nexport const decisionTestRules = pipe(\n decisionRules,\n Rec.map(() => \"off\" as const),\n);\n\nexport const shadcnRestyleContracts = [\n { pattern: \"^Table(Head|Cell)$\", allow: [\"text-alignment\", \"fvn-spacing\"] },\n { pattern: \"^TableCaption$\", allow: [\"caption\", \"text-alignment\", \"mt-*\", \"mb-*\"] },\n];\n\nexport { webGuidanceRules } from \"./web-guidance.config.ts\";\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nconst NO_TEST_DOUBLES =\n \"依存の振る舞いを差し替えない。Effect の Layer を差し替えるか、本物の実装を使う\";\n\nexport const testRules = {\n \"vitest/expect-expect\": [\n \"error\",\n { assertFunctionNames: [\"expect\", \"expect*\", \"assert*\", \"waitFor*\", \"run\", \"*.run\"] },\n ],\n \"vitest/valid-expect\": [\"error\", { maxArgs: 2 }],\n \"vitest/valid-title\": [\"error\", { allowArguments: true }],\n \"vitest/prefer-called-times\": \"off\",\n \"vitest/prefer-import-in-mock\": \"off\",\n \"vitest/no-standalone-expect\": \"off\",\n \"vitest/no-conditional-in-test\": \"off\",\n \"vitest/require-test-timeout\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/require-top-level-describe\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/require-hook\": \"off\",\n \"vitest/no-hooks\": \"off\",\n \"vitest/consistent-test-it\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/padding-around-after-all-blocks\": \"off\",\n \"vitest/padding-around-test-blocks\": \"off\",\n \"vitest/max-expects\": \"off\",\n} satisfies LintRules;\n\nconst NO_FLAKE_MASKING =\n \"再試行や flakyTest で不安定なテストを隠さない。待つ対象のイベントを await して直す\";\n\nexport const testDoubleSyntax: readonly Readonly<{ selector: string; message: string }>[] = [\n {\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=/^(mock|doMock)$/]',\n message: NO_TEST_DOUBLES,\n },\n {\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=\"stubGlobal\"]',\n message: NO_TEST_DOUBLES,\n },\n];\n\nexport const flakeMaskingSyntax: readonly Readonly<{ selector: string; message: string }>[] = [\n { selector: 'Property[key.name=\"retry\"]', message: NO_FLAKE_MASKING },\n { selector: 'MemberExpression[property.name=\"retry\"]', message: NO_FLAKE_MASKING },\n { selector: 'MemberExpression[property.name=\"flakyTest\"]', message: NO_FLAKE_MASKING },\n];\n","import { fileURLToPath } from \"node:url\";\n\nimport tanstackQuery from \"@r_masseater/oxlint-typed-rules/tanstack-query\";\nimport tanstackRouter from \"@r_masseater/oxlint-typed-rules/tanstack-router\";\nimport { plugin as shadcn } from \"@shadcn/lint\";\nimport baselineJs from \"eslint-plugin-baseline-js\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport {\n alchemyOverride,\n cloudflareResourceSyntax,\n removalPolicyOverride,\n commandsOverride,\n} from \"./lint-overrides.config.ts\";\nimport {\n allRulesOf,\n decisionPluginName,\n generated,\n pluginRules,\n shadcnRestyleContracts,\n webGuidanceRules,\n} from \"./lint.config.ts\";\nimport { flakeMaskingSyntax, testDoubleSyntax, testRules } from \"./test-rules.config.ts\";\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\n\nconst resolved = (specifier: string): string => fileURLToPath(import.meta.resolve(specifier));\n\nconst DECISION_TIMEOUT_MS = 50_000;\n\nconst typedRules = \"@r_masseater/oxlint-typed-rules\";\n\nconst jsPlugins = [\n { name: \"vite-plus\", specifier: resolved(\"vite-plus/oxlint-plugin\") },\n { name: \"tanstack-query\", specifier: resolved(`${typedRules}/tanstack-query`) },\n { name: \"tanstack-router\", specifier: resolved(`${typedRules}/tanstack-router`) },\n { name: \"tanstack-start\", specifier: resolved(`${typedRules}/tanstack-start`) },\n { name: \"drizzle\", specifier: resolved(`${typedRules}/drizzle`) },\n { name: \"react-hooks-js\", specifier: resolved(\"eslint-plugin-react-hooks\") },\n { name: \"@eslint-react\", specifier: resolved(`${typedRules}/react`) },\n { name: \"@remotion\", specifier: resolved(`${typedRules}/remotion`) },\n { name: \"shadcn\", specifier: resolved(\"@shadcn/lint\") },\n { name: \"baseline-js\", specifier: resolved(\"eslint-plugin-baseline-js\") },\n { name: \"@html-eslint/react\", specifier: resolved(\"@html-eslint/eslint-plugin-react\") },\n { name: \"eslint-js\", specifier: resolved(\"oxlint-plugin-eslint\") },\n { name: decisionPluginName, specifier: resolved(\"@r_masseater/msch/decision-rules\") },\n { name: \"msch-lint\", specifier: resolved(\"@r_masseater/msch/lint-rules\") },\n];\n\nconst rules = {\n \"vite-plus/prefer-vite-plus-imports\": \"error\",\n \"tanstack-start/no-async-client-component\": \"error\",\n \"tanstack-start/no-client-code-in-server-component\": \"error\",\n ...allRulesOf({ prefix: \"tanstack-query\", rules: tanstackQuery.rules }),\n ...allRulesOf({ prefix: \"tanstack-router\", rules: tanstackRouter.rules }),\n \"drizzle/enforce-delete-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n \"drizzle/enforce-update-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n ...allRulesOf({ prefix: \"shadcn\", rules: shadcn.rules }),\n \"shadcn/no-restyle\": [\"error\", { contracts: shadcnRestyleContracts }],\n ...allRulesOf({ prefix: \"baseline-js\", rules: baselineJs.rules }),\n ...baselineJs.configs.recommended().rules,\n \"baseline-js/use-baseline\": [\n \"error\",\n {\n available: \"widely\",\n includeWebApis: { preset: \"auto\" },\n includeJsBuiltins: { preset: \"auto\" },\n },\n ],\n ...pluginRules,\n \"eslint/capitalized-comments\": \"off\",\n \"eslint/sort-imports\": \"off\",\n \"eslint/sort-keys\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/exports-last\": \"off\",\n ...testRules,\n ...webGuidanceRules,\n \"msch-lint/array-from-async\": \"error\",\n \"msch-lint/ecosystem-readers\": \"error\",\n \"msch-lint/explicit-import-path\": \"error\",\n \"msch-lint/get-or-insert\": \"error\",\n \"msch-lint/mcp-tool-layer\": \"error\",\n \"msch-lint/inline-exports\": \"error\",\n \"msch-lint/ui-state-in-atoms\": \"error\",\n \"msch-lint/no-hand-written-sql\": \"error\",\n \"msch-lint/platform-node-by-module\": \"error\",\n \"msch-lint/readonly-parameters\": \"error\",\n \"msch-lint/typed-calls-not-reflect\": \"error\",\n \"react/react-in-jsx-scope\": \"off\",\n \"eslint/no-undef\": \"off\",\n \"typescript/promise-function-async\": \"off\",\n \"react/forbid-component-props\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"node/no-top-level-await\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"eslint/new-cap\": [\"error\", { capIsNew: false }],\n \"eslint/one-var\": [\"error\", \"never\"],\n \"unicorn/relative-url-style\": [\"error\", \"always\"],\n \"eslint/id-length\": [\"error\", { exceptions: [\"x\", \"y\"] }],\n \"jsdoc/check-tag-names\": [\"error\", { definedTags: [\"msch\", \"stability\"] }],\n \"jsdoc/require-param\": [\"error\", { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] }],\n \"jsdoc/require-returns\": [\n \"error\",\n { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] },\n ],\n \"eslint-js/no-restricted-syntax\": [\"error\", ...cloudflareResourceSyntax],\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"eslint/no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"react/function-component-definition\": [\n \"error\",\n { namedComponents: \"arrow-function\", unnamedComponents: \"arrow-function\" },\n ],\n \"typescript/no-empty-interface\": [\"error\", { allowSingleExtends: true }],\n \"typescript/no-empty-object-type\": [\"error\", { allowInterfaces: \"with-single-extends\" }],\n \"react/jsx-filename-extension\": [\"error\", { extensions: [\".tsx\"] }],\n \"react/only-export-components\": [\"error\", { allowExportNames: [\"Route\"] }],\n} satisfies LintConfig[\"rules\"];\n\nconst overrides = [\n removalPolicyOverride,\n alchemyOverride,\n {\n files: [\"**/*.config.ts\", \"**/alchemy.*.ts\", \"**/decision-rules.ts\"],\n rules: { \"import/no-default-export\": \"off\" },\n },\n commandsOverride,\n {\n files: [\"**/bin/**\"],\n rules: { \"baseline-js/use-baseline\": \"off\" },\n },\n {\n files: [\"**/*.test.ts\", \"**/*.test.tsx\", \"**/*.test.support.ts\", \"**/vite.config.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n ...cloudflareResourceSyntax,\n ...flakeMaskingSyntax,\n ...testDoubleSyntax,\n ],\n },\n },\n {\n files: [\"**/vite.config.ts\"],\n rules: {\n \"eslint/max-lines\": \"off\",\n \"eslint/max-lines-per-function\": \"off\",\n \"baseline-js/use-baseline\": \"off\",\n },\n },\n] satisfies LintConfig[\"overrides\"];\n\nexport const lint = {\n ignorePatterns: generated,\n plugins: [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"react\",\n \"react-perf\",\n \"jsx-a11y\",\n \"jsdoc\",\n \"vitest\",\n \"promise\",\n \"node\",\n \"effecttsgo\",\n ],\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n restriction: \"error\",\n nursery: \"error\",\n },\n jsPlugins,\n rules,\n overrides,\n settings: {\n [decisionPluginName]: {\n model: \"cloudflare/@cf/cloudflare/clef-flash\",\n timeoutMs: DECISION_TIMEOUT_MS,\n ci: \"skip\",\n },\n },\n options: {\n typeAware: true,\n typeCheck: true,\n denyWarnings: true,\n reportUnusedDisableDirectives: \"error\",\n },\n} satisfies LintConfig;\n","const UI_STATE = \"UI 状態は effect-atom だけで扱う\";\n\nexport const INSTRUMENTATION = \"計装は Effect のトレーシングだけで扱う\";\nconst INFRASTRUCTURE = \"インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない\";\n\nexport const requiredStack: Readonly<Record<string, readonly string[]>> = {\n [UI_STATE]: [\n \"zustand\",\n \"jotai\",\n \"valtio\",\n \"recoil\",\n \"mobx\",\n \"mobx-*\",\n \"redux\",\n \"@reduxjs/*\",\n \"react-redux\",\n \"xstate\",\n \"@xstate/*\",\n \"nanostores\",\n \"@nanostores/*\",\n \"@preact/signals*\",\n ],\n \"サーバー状態は TanStack Query と Eden だけで扱う\": [\n \"swr\",\n \"react-query\",\n \"@apollo/*\",\n \"urql\",\n \"@urql/*\",\n \"axios\",\n \"ky\",\n \"ofetch\",\n \"got\",\n \"node-fetch\",\n \"graphql-request\",\n \"@trpc/*\",\n ],\n \"ルーティングとサーバーは TanStack Start と Elysia だけで扱う\": [\n \"react-router\",\n \"react-router-dom\",\n \"next\",\n \"@remix-run/*\",\n \"wouter\",\n \"express\",\n \"hono\",\n \"fastify\",\n \"koa\",\n \"@nestjs/*\",\n ],\n \"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する\": [\n \"prisma\",\n \"@prisma/*\",\n \"typeorm\",\n \"sequelize\",\n \"kysely\",\n \"knex\",\n \"@mikro-orm/*\",\n \"better-sqlite3\",\n \"pg\",\n \"mysql2\",\n ],\n \"認証は better-auth だけで扱う\": [\n \"next-auth\",\n \"@auth/*\",\n \"lucia\",\n \"passport\",\n \"passport-*\",\n \"@clerk/*\",\n \"firebase/auth\",\n \"@supabase/*\",\n ],\n \"UI は shadcn/ui と Tailwind CSS だけで組む\": [\n \"@mui/*\",\n \"antd\",\n \"@chakra-ui/*\",\n \"@mantine/*\",\n \"styled-components\",\n \"@emotion/*\",\n \"bootstrap\",\n \"react-bootstrap\",\n ],\n \"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う\": [\n \"zod\",\n \"yup\",\n \"joi\",\n \"valibot\",\n \"arktype\",\n \"io-ts\",\n \"superstruct\",\n \"moment\",\n \"dayjs\",\n \"date-fns\",\n \"luxon\",\n \"winston\",\n \"pino\",\n \"bunyan\",\n \"loglevel\",\n \"lodash\",\n \"lodash-es\",\n \"ramda\",\n \"rxjs\",\n \"fp-ts\",\n \"neverthrow\",\n \"ts-results\",\n \"purify-ts\",\n ],\n \"CSV は effect/encoding の Csv だけで読み書きする\": [\n \"papaparse\",\n \"csv-parse\",\n \"csv-parser\",\n \"csv-stringify\",\n \"fast-csv\",\n \"@fast-csv/*\",\n \"d3-dsv\",\n ],\n \"tar は effect/encoding の Tar だけで読み書きする\": [\n \"modern-tar\",\n \"nanotar\",\n \"tar\",\n \"tar-stream\",\n \"tar-fs\",\n \"tar-js\",\n \"tarts\",\n \"it-tar\",\n ],\n \"エージェントスキルは vite.config.ts の skills に書き、msch --prepare で入れる\": [\"skills\"],\n \"フィーチャーフラグは OpenFeature だけで扱う\": [\n \"launchdarkly-*\",\n \"@launchdarkly/*\",\n \"@growthbook/*\",\n \"unleash-client\",\n \"flagsmith\",\n \"@vercel/flags\",\n ],\n \"テストは Vitest と Playwright だけで扱う\": [\n \"jest\",\n \"jest-*\",\n \"@jest/*\",\n \"ts-jest\",\n \"mocha\",\n \"jasmine\",\n \"jasmine-core\",\n \"ava\",\n \"cypress\",\n \"tap\",\n \"uvu\",\n ],\n \"決済は Stripe だけで扱う\": [\n \"@paypal/*\",\n \"paypal-rest-sdk\",\n \"braintree\",\n \"@paddle/*\",\n \"@lemonsqueezy/*\",\n \"square\",\n ],\n \"整形は Vite+ の vp fmt だけで扱う\": [\n \"prettier\",\n \"prettier-plugin-*\",\n \"@prettier/*\",\n \"@biomejs/*\",\n \"dprint\",\n ],\n \"lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む\": [\n \"eslint\",\n \"@eslint/*\",\n \"eslint-config-*\",\n \"tslint\",\n \"standard\",\n \"xo\",\n ],\n [INSTRUMENTATION]: [\"@opentelemetry/*\", \"dd-trace\", \"newrelic\"],\n [INFRASTRUCTURE]: [\n \"wrangler\",\n \"miniflare\",\n \"@cloudflare/vite-plugin\",\n \"@vercel/*\",\n \"@netlify/*\",\n \"aws-cdk\",\n \"aws-cdk-lib\",\n \"@pulumi/*\",\n \"cdktf\",\n ],\n};\n","export const tracedRules = {\n \"msch-lint/traced-elysia\": \"error\",\n \"msch-lint/traced-effect-run\": \"error\",\n} as const;\n","import remotion from \"@r_masseater/oxlint-typed-rules/remotion\";\n\nimport { allRulesOf } from \"./lint.config.ts\";\n\nexport const remotionRules = allRulesOf({ prefix: \"@remotion\", rules: remotion.rules });\n","import type { WismConfig } from \"@r_masseater/wism\";\nimport { rustCrate, skill, structure, workspace } from \"@r_masseater/wism/presets\";\nimport { Array as Arr, Predicate, String as Str, pipe } from \"effect\";\n\nconst NEGATION = \"!\";\nconst isIgnore = Predicate.not(Str.startsWith(NEGATION));\n\nexport interface StructureOptions {\n readonly members: readonly string[];\n readonly ignorePatterns: readonly string[];\n}\n\nexport const structureOf = ({ members, ignorePatterns }: StructureOptions): WismConfig =>\n structure({\n kinds: [workspace({ paths: members }), rustCrate(), skill()],\n ignores: pipe(ignorePatterns, Arr.filter(isIgnore)),\n });\n","import { createRequire, registerHooks } from \"node:module\";\n\nexport const KUROMOJIN = \"kuromojin\";\nconst ON_Y8 = \"@r_masseater/y8/kuromojin\";\n\nexport const requireWithY8Kuromojin = (parentUrl: string): NodeJS.Require => {\n registerHooks({\n resolve: (specifier, context, nextResolve) => {\n if (specifier === KUROMOJIN) {\n return nextResolve(ON_Y8, { ...context, parentURL: import.meta.url });\n }\n return nextResolve(specifier, context);\n },\n });\n return createRequire(parentUrl);\n};\n","import presetJa from \"@r_masseater/textlint-rule-preset-ja\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, Record as Rec, pipe } from \"effect\";\n\nimport { JAPANESE } from \"#/shared/config/index.ts\";\n\nimport { requireWithY8Kuromojin } from \"./kuromojin.config.ts\";\n\ntype Preset = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]>[string];\ntype Rule = Preset[\"rules\"][string];\ntype Reporter = Extract<Rule, (...args: never) => unknown>;\ntype Fixable = Exclude<Rule, Reporter>;\n\nconst NO_HANDLERS = {};\n\nconst isPreset = (value: unknown): value is Preset =>\n Predicate.hasProperty(value, \"rules\") &&\n Predicate.isObject(value.rules) &&\n Predicate.hasProperty(value, \"rulesConfig\") &&\n Predicate.isObject(value.rulesConfig);\n\nconst presetIn = (value: unknown): Option.Option<Preset> => {\n if (isPreset(value)) {\n return Option.some(value);\n }\n if (Predicate.hasProperty(value, \"default\")) {\n return presetIn(value.default);\n }\n return Option.none();\n};\n\nconst required = requireWithY8Kuromojin(import.meta.url);\n\nconst presetOf = (specifier: string, loaded: unknown): Preset =>\n Option.getOrThrowWith(\n presetIn(loaded),\n () => new TypeError(`${specifier} does not export a textlint preset`),\n );\n\nconst japaneseOnly =\n (reporter: Reporter): Reporter =>\n (context, options) => {\n if (JAPANESE.test(context.getSource())) {\n return reporter(context, options);\n }\n return NO_HANDLERS;\n };\n\nconst forJapanese = (rule: Reporter | Readonly<Fixable>): Rule => {\n if (Predicate.isFunction(rule)) {\n return japaneseOnly(rule);\n }\n return { linter: japaneseOnly(rule.linter), fixer: japaneseOnly(rule.fixer) };\n};\n\nconst japanesePreset = (specifier: string, loaded: unknown): Preset => {\n const { rules, rulesConfig } = presetOf(specifier, loaded);\n return { rules: pipe(rules, Rec.map(forJapanese)), rulesConfig };\n};\n\nexport const textlintPresets: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]> = {\n \"@r_masseater/preset-ja\": japanesePreset(\"@r_masseater/textlint-rule-preset-ja\", presetJa),\n \"@textlint-ja/preset-ai-writing\": japanesePreset(\n \"@textlint-ja/textlint-rule-preset-ai-writing\",\n required(\"@textlint-ja/textlint-rule-preset-ai-writing\"),\n ),\n \"preset-ja-technical-writing\": japanesePreset(\n \"textlint-rule-preset-ja-technical-writing\",\n required(\"textlint-rule-preset-ja-technical-writing\"),\n ),\n};\n","import { createRequire } from \"node:module\";\n\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, pipe } from \"effect\";\n\ntype Filter = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]>[string];\n\nconst isFilter = (value: unknown): value is Filter => Predicate.isFunction(value);\n\nconst filterIn = (specifier: string, loaded: unknown): Filter =>\n pipe(\n Option.liftPredicate(loaded, isFilter),\n Option.getOrThrowWith(() => new TypeError(`${specifier} does not export a textlint filter`)),\n );\n\nexport const textlintFilters: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]> =\n {\n comments: filterIn(\n \"textlint-filter-rule-comments\",\n createRequire(import.meta.url)(\"textlint-filter-rule-comments\"),\n ),\n };\n","import type { RuleEntry, Y8Config } from \"@r_masseater/y8\";\nimport { recommended } from \"@r_masseater/y8/presets\";\nimport type { RecommendedOptions } from \"@r_masseater/y8/presets\";\n\nconst INDEX_SKILL = \"masseater-style\";\n\nconst MASSEATER_DOCS: RecommendedOptions = {\n agents: {\n sections: [[\"Tech stack\"], [\"Commands\"], [\"Rules\"]],\n commands: [\"Commands\"],\n stack: [\"Tech stack\"],\n skillNames: { index: INDEX_SKILL },\n },\n skills: { skillNames: { index: INDEX_SKILL } },\n};\n\nconst MARKDOWN_IGNORES = [\n \".agents/skills/**\",\n \"**/fixtures/**\",\n \"**/upstream/**\",\n \"CHANGELOG.md\",\n \"**/CLAUDE.md\",\n];\n\nexport interface MarkdownOptions {\n readonly ignores?: readonly string[];\n readonly rules?: Readonly<Record<string, RuleEntry>>;\n readonly docs?: RecommendedOptions;\n}\n\nexport const markdownOf = ({ ignores = [], rules = {}, docs = {} }: MarkdownOptions): Y8Config => ({\n extends: [\n recommended({\n ...MASSEATER_DOCS,\n ...docs,\n agents: { ...MASSEATER_DOCS.agents, ...docs.agents },\n skills: { ...MASSEATER_DOCS.skills, ...docs.skills },\n }),\n ],\n rules: { \"agnix/XP-001\": \"off\", ...rules },\n reportUnusedDirectives: true,\n ignores: [...MARKDOWN_IGNORES, ...ignores],\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAM,UAAU;AAChB,MAAM,kBACJ;AAEF,MAAM,YAAY;AAClB,MAAM,oBACJ;AAEF,MAAM,0BACJ;AAEF,MAAM,qBACJ;AAEF,MAAM,YACJ;AAKF,MAAM,iBAAiB;AAEvB,MAAa,2BACX;CACE;EACE,UAAU,qHAAqH,QAAQ;EACvI,SAAS;CACX;CACA;EACE,UAAU,sFAAsF,QAAQ;EACxG,SAAS;CACX;CACA;EACE,UAAU,iIAAiI,UAAU;EACrJ,SAAS;CACX;CACA;EACE,UAAU,+HAA+H,UAAU;EACnJ,SAAS;CACX;CACA;EACE,UAAU,GAAG,UAAU;EACvB,SAAS;CACX;CACA;EACE,UAAU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iC,CAAC,SAAS,EAAE,oBAAoB,KAAK,CAAC;EACvE,mCAAmC,CAAC,SAAS,EAAE,iBAAiB,sBAAsB,CAAC;EACvF,gCAAgC,CAAC,SAAS,EAAE,YAAY,CAAC,MAAM,EAAE,CAAC;EAClE,gCAAgC,CAAC,SAAS,EAAE,kBAAkB,CAAC,OAAO,EAAE,CAAC;CA+DzE;CACA;EA5DA;EACA;EACA;GACE,OAAO;IAAC;IAAkB;IAAmB;GAAsB;GACnE,OAAO,EAAE,4BAA4B,MAAM;EAC7C;EACA;EACA;GACE,OAAO,CAAC,WAAW;GACnB,OAAO,EAAE,4BAA4B,MAAM;EAC7C;EACA;GACE,OAAO;IAAC;IAAgB;IAAiB;IAAwB;GAAmB;GACpF,OAAO,EACL,kCAAkC;IAChC;IACA,GAAG;IACH,GAAG;IACH,GAAG;GACL,EACF;EACF;EACA;GACE,OAAO,CAAC,mBAAmB;GAC3B,OAAO;IACL,oBAAoB;IACpB,iCAAiC;IACjC,4BAA4B;GAC9B;EACF;CA+BA;CACA,UAAU,GACP,qBAAqB;EACpB,OAAO;EACP,WAAW;EACX,IAAI;CACN,EACF;CACA,SAAS;EACP,WAAW;EACX,WAAW;EACX,cAAc;EACd,+BAA+B;CACjC;AACF;;ACnMA,MAAM,WAAW;AAEjB,MAAa,kBAAkB;AAC/B,MAAM,iBAAiB;AAEvB,MAAa,gBAA6D;EACvE,WAAW;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8CAA8C;EAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4CAA4C;EAC1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yBAAyB;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,qCAAqC;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yCAAyC;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yCAAyC;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8DAA8D,CAAC,QAAQ;CACvE,gCAAgC;EAC9B;EACA;EACA;EACA;EACA;EACA;CACF;CACA,kCAAkC;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,oBAAoB;EAClB;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4BAA4B;EAC1B;EACA;EACA;EACA;EACA;CACF;CACA,sEAAsE;EACpE;EACA;EACA;EACA;EACA;EACA;CACF;EACC,kBAAkB;EAAC;EAAoB;EAAY;CAAU;EAC7D,iBAAiB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;ACrLA,MAAa,cAAc;CACzB,2BAA2B;CAC3B,+BAA+B;AACjC;;ACCA,MAAa,gBAAgB,WAAW;CAAE,QAAQ;CAAa,OAAO,SAAS;AAAM,CAAC;;ACCtF,MAAM,WAAW,UAAU,IAAIC,OAAI,WAAW,GAAQ,CAAC;AAOvD,MAAa,eAAe,EAAE,SAAS,qBACrC,UAAU;CACR,OAAO;EAAC,UAAU,EAAE,OAAO,QAAQ,CAAC;EAAG,UAAU;EAAG,MAAM;CAAC;CAC3D,SAAS,KAAK,gBAAgBC,MAAI,OAAO,QAAQ,CAAC;AACpD,CAAC;ACbH,MAAM,QAAQ;AAEd,MAAa,0BAA0B,cAAsC;CAC3E,cAAc,EACZ,UAAU,WAAW,SAAS,gBAAgB;EAC5C,IAAI,cAAA,aACF,OAAO,YAAY,OAAO;GAAE,GAAG;GAAS,WAAW,YAAY;EAAI,CAAC;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AM,YAAY,WAAmB,WACnC,KACE,OAAO,cAAc,QAAQ,QAAQ,GACrC,OAAO,qCAAqB,IAAI,UAAU,GAAG,UAAU,mCAAmC,CAAC,CAC7F;AAEF,MAAa,kBACX,EACE,UAAU,SACR,iCACA,cAAc,YAAY,GAAG,CAAC,CAAC,+BAA+B,CAChE,EACF;;ACjBF,MAAM,cAAc;AAEpB,MAAM,iBAAqC;CACzC,QAAQ;EACN,UAAU;GAAC,CAAC,YAAY;GAAG,CAAC,UAAU;GAAG,CAAC,OAAO;EAAC;EAClD,UAAU,CAAC,UAAU;EACrB,OAAO,CAAC,YAAY;EACpB,YAAY,EAAE,OAAO,YAAY;CACnC;CACA,QAAQ,EAAE,YAAY,EAAE,OAAO,YAAY,EAAE;AAC/C;AAEA,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;AACF;AAQA,MAAa,cAAc,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,OAAO,CAAC,SAAoC;CACjG,SAAS,CACP,YAAY;EACV,GAAG;EACH,GAAG;EACH,QAAQ;GAAE,GAAG,eAAe;GAAQ,GAAG,KAAK;EAAO;EACnD,QAAQ;GAAE,GAAG,eAAe;GAAQ,GAAG,KAAK;EAAO;CACrD,CAAC,CACH;CACA,OAAO;EAAE,gBAAgB;EAAO,GAAG;CAAM;CACzC,wBAAwB;CACxB,SAAS,CAAC,GAAG,kBAAkB,GAAG,OAAO;AAC3C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies-C3kCe35Q.mjs","names":["MANIFEST_FILE","Str","Arr","Rec","Arr","Str"],"sources":["../src/entities/workspace/model/workspace-projects.ts","../src/entities/package/model/dependencies.ts"],"sourcesContent":["import { findWorkspaceProjectsNoCheck } from \"@pnpm/workspace.projects-reader\";\nimport type { Project } from \"@pnpm/workspace.projects-reader\";\nimport { Array as Arr, Effect, Option, Order, Schema, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceManifest } from \"./workspace-manifest.ts\";\nimport { WorkspaceUnreadable } from \"./workspace-unreadable.ts\";\n\nconst MANIFEST_FILE = \"package.json\";\nconst ROOT_DIRECTORY = \"\";\n\nexport interface WorkspaceProject {\n readonly directory: string;\n readonly packageName: Option.Option<string>;\n readonly description: Option.Option<string>;\n readonly published: boolean;\n readonly keywords: readonly string[];\n readonly files: Option.Option<readonly string[]>;\n}\n\nconst byDirectory = Order.mapInput(Str.Order, ({ directory }: WorkspaceProject) => directory);\n\nconst projectsMatching = (\n root: string,\n patterns: readonly string[],\n): Effect.Effect<readonly Project[]> =>\n Effect.tryPromise({\n try: () => findWorkspaceProjectsNoCheck(root, { patterns: [...patterns] }),\n catch: (cause) => WorkspaceUnreadable.make({ root, reason: String(cause) }),\n }).pipe(Effect.orElseSucceed((): readonly Project[] => []));\n\nconst workspacePatterns = Effect.fn(\"workspacePatterns\")(function* workspacePatterns(root: string) {\n const manifest = yield* workspaceManifest(root);\n return pipe(\n manifest,\n Option.flatMap(({ packages }) => Option.fromNullishOr(packages)),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n\n/** @internal */\nexport const workspaceProjects = Effect.fn(\"workspaceProjects\")(function* workspaceProjects(\n root: string,\n) {\n const files = yield* RepositoryFiles;\n const patterns = yield* workspacePatterns(root);\n if (!Arr.isReadonlyArrayNonEmpty(patterns)) {\n return [];\n }\n const projects = yield* projectsMatching(root, patterns);\n const found = pipe(\n projects,\n Arr.map(({ rootDir, manifest: own }): WorkspaceProject => ({\n directory: files.relative(root, rootDir),\n packageName: Option.fromUndefinedOr(own.name),\n description: Option.filter(Option.fromUndefinedOr(own.description), Str.isNonEmpty),\n published: own.private !== true,\n keywords: Option.getOrElse(Option.fromUndefinedOr(own.keywords), () => []),\n files: Option.fromUndefinedOr(own.files),\n })),\n Arr.filter(({ directory }) => Str.isNonEmpty(directory)),\n );\n return Arr.sort(found, byDirectory);\n});\n\n/** @internal */\nexport const workspaceDirectories = Effect.fn(\"workspaceDirectories\")(\n function* workspaceDirectories(root: string) {\n const projects = yield* workspaceProjects(root);\n return pipe(\n projects,\n Arr.map(({ directory }) => directory),\n );\n },\n);\n\nconst Strings = Schema.Array(Schema.String);\nconst RootManifest = Schema.fromJsonString(\n Schema.Struct({\n name: Schema.String,\n description: Schema.optional(Schema.String),\n private: Schema.optional(Schema.Boolean),\n keywords: Schema.optional(Strings),\n files: Schema.optional(Strings),\n }),\n);\n\nconst rootProject = Effect.fn(\"rootProject\")(function* rootProject(root: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, MANIFEST_FILE));\n return pipe(\n text,\n Option.flatMap(Schema.decodeOption(RootManifest)),\n Option.map((own): WorkspaceProject => ({\n directory: ROOT_DIRECTORY,\n packageName: Option.some(own.name),\n description: Option.filter(Option.fromUndefinedOr(own.description), Str.isNonEmpty),\n published: own.private !== true,\n keywords: own.keywords ?? [],\n files: Option.fromUndefinedOr(own.files),\n })),\n );\n});\n\n/** @internal */\nexport const publishedProjects = Effect.fn(\"publishedProjects\")(function* publishedProjects(\n root: string,\n) {\n const [own, members] = yield* Effect.all([rootProject(root), workspaceProjects(root)], {\n concurrency: \"unbounded\",\n });\n return pipe(\n Option.toArray(own),\n Arr.appendAll(members),\n Arr.filter(({ published }) => published),\n );\n});\n\nconst NEGATION = \"!\";\nconst MATCH_CONCURRENCY = 8;\n\n/** @internal */\nexport const unmatchedWorkspacePatterns = Effect.fn(\"unmatchedWorkspacePatterns\")(\n function* unmatchedWorkspacePatterns(root: string) {\n const listed = yield* workspacePatterns(root);\n const patterns = pipe(\n listed,\n Arr.filter((pattern) => !Str.startsWith(NEGATION)(pattern)),\n );\n const matched = yield* Effect.forEach(\n patterns,\n (pattern) =>\n projectsMatching(root, [pattern]).pipe(\n Effect.map((projects) => ({ pattern, matches: Arr.isReadonlyArrayNonEmpty(projects) })),\n ),\n { concurrency: MATCH_CONCURRENCY },\n );\n return pipe(\n matched,\n Arr.filter(({ matches }) => !matches),\n Arr.map(({ pattern }) => pattern),\n );\n },\n);\n","import {\n Array as Arr,\n Effect,\n Option,\n Order,\n Predicate,\n Schema,\n String as Str,\n Record as Rec,\n pipe,\n} from \"effect\";\n\nimport { RepositoryFiles, NODE_MODULES } from \"#/shared/lib/repository-files.ts\";\n\nimport { exportEntriesOf } from \"./export-subpaths.ts\";\nimport { ROOT_SUBPATH, SUBPATH_PREFIX, importSpecifierOf } from \"./import-specifier.ts\";\n\nexport interface DependencyEntry {\n readonly packageName: string;\n readonly specifier: string;\n readonly declarationsPath: string;\n}\n\nconst DependencyMap = Schema.optional(Schema.Record(Schema.String, Schema.String));\n\nconst PackageManifest = Schema.Struct({\n name: Schema.optional(Schema.String),\n dependencies: DependencyMap,\n devDependencies: DependencyMap,\n peerDependencies: DependencyMap,\n exports: Schema.optional(Schema.Unknown),\n types: Schema.optional(Schema.String),\n typings: Schema.optional(Schema.String),\n main: Schema.optional(Schema.String),\n native: Schema.optional(Schema.Unknown),\n});\n\nexport type Manifest = typeof PackageManifest.Type;\n\nexport const MANIFEST_FILE = \"package.json\";\nconst WORKSPACE_PROTOCOL = \"workspace:\";\nconst WILDCARD = \"*\";\nconst TYPES_CONDITION = \"types\";\nconst TYPES_SCOPE = \"@types/\";\nconst TYPES_SCOPE_SEPARATOR = \"__\";\nconst CONDITION_DEPTH_LIMIT = 8;\nconst ROOT_DEPTH = 0;\nconst DEPTH_STEP = 1;\nconst DECLARATIONS_SUFFIX = /\\.d\\.[cm]?ts$|\\.[cm]?tsx?$/u;\nconst SCRIPT_SUFFIX = /\\.(?<module>[cm]?)js$/u;\n\nexport const readManifest = Effect.fn(\"readManifest\")(function* readManifest(directory: string) {\n const files = yield* RepositoryFiles;\n const manifestText = yield* files.readFile(files.join(directory, MANIFEST_FILE));\n const text = yield* Effect.fromOption(manifestText);\n return yield* Schema.decodeEffect(Schema.fromJsonString(PackageManifest))(text);\n}, Effect.option);\n\nconst conditionsOf = (held: unknown): readonly (readonly [string, unknown])[] => {\n if (!Predicate.isObject(held)) {\n return [];\n }\n return Rec.toEntries(held);\n};\n\nconst typesConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n const entries = conditionsOf(held);\n const declared = Arr.findFirst(entries, ([condition, target]) =>\n Option.liftPredicate(\n target,\n (candidate) => condition === TYPES_CONDITION && Predicate.isString(candidate),\n ),\n ).pipe(Option.filter(Predicate.isString));\n return Option.orElse(declared, () =>\n Arr.findFirst(entries, ([, nested]) => typesConditionIn(nested, depth + DEPTH_STEP)),\n );\n};\n\nconst anyConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (Predicate.isString(held)) {\n return Option.some(held);\n }\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n return Arr.findFirst(conditionsOf(held), ([, nested]) =>\n anyConditionIn(nested, depth + DEPTH_STEP),\n );\n};\n\nconst targetPathsOf = (target: unknown): readonly string[] =>\n Arr.getSomes([typesConditionIn(target, ROOT_DEPTH), anyConditionIn(target, ROOT_DEPTH)]);\n\nconst isDeclaredSubpath = ([subpath]: readonly [string, unknown]): boolean =>\n (subpath === ROOT_SUBPATH || Str.startsWith(SUBPATH_PREFIX)(subpath)) &&\n !Str.includes(WILDCARD)(subpath);\n\nconst declarationsCandidateFor = (entryPath: string): Option.Option<string> => {\n if (DECLARATIONS_SUFFIX.test(entryPath)) {\n return Option.some(entryPath);\n }\n if (!SCRIPT_SUFFIX.test(entryPath)) {\n return Option.none();\n }\n return Option.some(Str.replace(SCRIPT_SUFFIX, \".d.$<module>ts\")(entryPath));\n};\n\nconst firstDeclarationsAmong = Effect.fn(\"firstDeclarationsAmong\")(function* firstDeclarations(\n directory: string,\n entryPaths: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const candidates = Arr.getSomes(\n pipe(\n entryPaths,\n Arr.map((entryPath) => declarationsCandidateFor(entryPath)),\n ),\n );\n const existing = yield* Effect.filter(\n pipe(\n candidates,\n Arr.map((candidate) => files.join(directory, candidate)),\n ),\n (candidate) => files.exists(candidate),\n );\n return yield* Option.match(Arr.head(existing), {\n onNone: (): Effect.Effect<Option.Option<string>> => Effect.succeedNone,\n onSome: (candidate) => files.realPath(candidate).pipe(Effect.asSome),\n });\n});\n\nconst importNameOf = (packageName: string): string => {\n if (!Str.startsWith(TYPES_SCOPE)(packageName)) {\n return packageName;\n }\n const unscoped = Str.slice(TYPES_SCOPE.length)(packageName);\n if (!Str.includes(TYPES_SCOPE_SEPARATOR)(unscoped)) {\n return unscoped;\n }\n return `@${Str.replace(TYPES_SCOPE_SEPARATOR, \"/\")(unscoped)}`;\n};\n\nconst rootEntryPaths = (manifest: Manifest): readonly string[] =>\n Arr.getSomes([\n Option.fromUndefinedOr(manifest.types),\n Option.fromUndefinedOr(manifest.typings),\n Option.fromUndefinedOr(manifest.main),\n ]);\n\nconst subpathEntriesOf = Effect.fn(\"subpathEntriesOf\")(function* subpathEntriesOf(\n packageName: string,\n directory: string,\n manifest: Manifest,\n) {\n const found = yield* Effect.forEach(\n pipe(exportEntriesOf(manifest.exports), Arr.filter(isDeclaredSubpath)),\n ([subpath, target]) =>\n firstDeclarationsAmong(directory, targetPathsOf(target)).pipe(\n Effect.map(\n Option.map((declarationsPath) => ({\n packageName,\n specifier: importSpecifierOf(importNameOf(packageName), subpath),\n declarationsPath,\n })),\n ),\n ),\n { concurrency: 1 },\n );\n return Arr.getSomes(found);\n});\n\nconst entriesOfDependency = Effect.fn(\"entriesOfDependency\")(function* entriesOfDependency(\n packageName: string,\n directory: string,\n) {\n const manifest = yield* readManifest(directory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const subpathEntries = yield* subpathEntriesOf(packageName, directory, manifest.value);\n const rootSpecifier = importSpecifierOf(importNameOf(packageName), ROOT_SUBPATH);\n if (\n pipe(\n subpathEntries,\n Arr.some((entry) => entry.specifier === rootSpecifier),\n )\n ) {\n return subpathEntries;\n }\n const rootDeclarations = yield* firstDeclarationsAmong(directory, rootEntryPaths(manifest.value));\n const rootEntries = rootDeclarations.pipe(\n Option.map((declarationsPath) => ({ packageName, specifier: rootSpecifier, declarationsPath })),\n Option.toArray,\n );\n return [...rootEntries, ...subpathEntries];\n});\n\nconst isWorkspaceRange = Str.startsWith(WORKSPACE_PROTOCOL);\n\nconst namesWhere = (\n keep: (range: string) => boolean,\n declared: Readonly<Record<string, string>>,\n): readonly string[] =>\n pipe(\n Rec.toEntries(declared),\n Arr.filter(([, range]) => keep(range)),\n Arr.map(([packageName]) => packageName),\n );\n\nconst declaredDependencies = (manifest: Manifest): readonly string[] =>\n namesWhere((range) => !isWorkspaceRange(range), {\n ...manifest.dependencies,\n ...manifest.devDependencies,\n ...manifest.peerDependencies,\n });\n\nexport const workspaceDependencies = (manifest: Manifest): readonly string[] =>\n namesWhere(isWorkspaceRange, { ...manifest.dependencies, ...manifest.devDependencies });\n\nconst entryOrder = Order.mapInput(Order.String, (entry: DependencyEntry) => entry.specifier);\n\nexport const dependencyEntries = Effect.fn(\"dependencyEntries\")(function* dependencyEntries(\n packageDirectory: string,\n) {\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(packageDirectory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const entries = yield* Effect.forEach(\n declaredDependencies(manifest.value),\n (packageName) =>\n entriesOfDependency(packageName, files.join(packageDirectory, NODE_MODULES, packageName)),\n { concurrency: 1 },\n );\n return Arr.sort(\n Arr.dedupeWith(entries.flat(), (left, right) => left.specifier === right.specifier),\n entryOrder,\n );\n});\n"],"mappings":";;;;;;AASA,MAAMA,kBAAgB;AACtB,MAAM,iBAAiB;AAWvB,MAAM,cAAc,MAAM,SAASC,SAAI,QAAQ,EAAE,gBAAkC,SAAS;AAE5F,MAAM,oBACJ,MACA,aAEA,OAAO,WAAW;CAChB,WAAW,6BAA6B,MAAM,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAE,CAAC;CACzE,QAAQ,UAAU,oBAAoB,KAAK;EAAE;EAAM,QAAQ,OA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GAAG,mBAAmB,CAAC,CAAC,UAAU,kBACxE,kBACA;CACA,MAAM,QAAQ,OAAO;CACrB,MAAM,WAAW,OAAO,aAAa,gBAAgB;CACrD,IAAI,OAAO,OAAO,QAAQ,GACxB,OAAO,CAAC;CAEV,MAAM,UAAU,OAAO,OAAO,QAC5B,qBAAqB,SAAS,KAAK,IAClC,gBACC,oBAAoB,aAAa,MAAM,KAAK,kBAAkB,cAAc,WAAW,CAAC,GAC1F,EAAE,aAAa,EAAE,CACnB;CACA,OAAOA,MAAI,KACTA,MAAI,WAAW,QAAQ,KAAK,IAAI,MAAM,UAAU,KAAK,cAAc,MAAM,SAAS,GAClF,UACF;AACF,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Array, Function, Predicate, Record, String, pipe } from "effect";
|
|
2
|
-
/** @internal */
|
|
3
|
-
const importSpecifierOf = Function.dual(2, (importName, subpath) => {
|
|
4
|
-
if (subpath === ".") return importName;
|
|
5
|
-
return `${importName}/${String.slice(2)(subpath)}`;
|
|
6
|
-
});
|
|
7
|
-
// src/entities/package/model/export-subpaths.ts
|
|
8
|
-
/** @internal */
|
|
9
|
-
const exportEntriesOf = (exportsField) => {
|
|
10
|
-
if (!Predicate.isObject(exportsField)) return [[".", exportsField]];
|
|
11
|
-
const entries = Record.toEntries(exportsField);
|
|
12
|
-
if (pipe(entries, Array.every(([subpath]) => String.startsWith(".")(subpath)))) return entries;
|
|
13
|
-
return [[".", exportsField]];
|
|
14
|
-
};
|
|
15
|
-
export { importSpecifierOf as n, exportEntriesOf as t };
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=export-subpaths-D6ZLYZGy.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export-subpaths-D6ZLYZGy.mjs","names":["Fn","Str","Rec","Arr","Str"],"sources":["../src/entities/package/model/import-specifier.ts","../src/entities/package/model/export-subpaths.ts"],"sourcesContent":["import { String as Str, Function as Fn } from \"effect\";\n\nconst DATA_FIRST_ARITY = 2;\n\n/** @internal */\nexport const ROOT_SUBPATH = \".\";\n\n/** @internal */\nexport const SUBPATH_PREFIX = \"./\";\n\n/** @internal */\nexport const importSpecifierOf: {\n (subpath: string): (importName: string) => string;\n (importName: string, subpath: string): string;\n} = Fn.dual(DATA_FIRST_ARITY, (importName: string, subpath: string): string => {\n if (subpath === ROOT_SUBPATH) {\n return importName;\n }\n return `${importName}/${Str.slice(SUBPATH_PREFIX.length)(subpath)}`;\n});\n","import { Array as Arr, Predicate, Record as Rec, String as Str, pipe } from \"effect\";\n\nimport { ROOT_SUBPATH } from \"./import-specifier.ts\";\n\n/** @internal */\nexport const exportEntriesOf = (exportsField: unknown): readonly (readonly [string, unknown])[] => {\n if (!Predicate.isObject(exportsField)) {\n return [[ROOT_SUBPATH, exportsField]];\n }\n const entries = Rec.toEntries(exportsField);\n if (\n pipe(\n entries,\n Arr.every(([subpath]) => Str.startsWith(ROOT_SUBPATH)(subpath)),\n )\n ) {\n return entries;\n }\n return [[ROOT_SUBPATH, exportsField]];\n};\n"],"mappings":";;AAWA,MAAa,oBAGTA,SAAG,KAAK,IAAmB,YAAoB,YAA4B;CAC7E,IAAI,YAAA,KACF,OAAO;CAET,OAAO,GAAG,WAAW,GAAGC,OAAI,MAAM,CAAqB,CAAC,CAAC,OAAO;AAClE,CAAC;;;ACdD,MAAa,mBAAmB,iBAAmE;CACjG,IAAI,CAAC,UAAU,SAAS,YAAY,GAClC,OAAO,CAAC,CAAA,KAAe,YAAY,CAAC;CAEtC,MAAM,UAAUC,OAAI,UAAU,YAAY;CAC1C,IACE,KACE,SACAC,MAAI,OAAO,CAAC,aAAaC,OAAI,WAAA,GAAuB,CAAC,CAAC,OAAO,CAAC,CAChE,GAEA,OAAO;CAET,OAAO,CAAC,CAAA,KAAe,YAAY,CAAC;AACtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-texts-K650kDy8.mjs","names":["Rec","Arr","Str","Arr"],"sources":["../src/entities/package/model/specifiers.ts","../src/shared/lib/base-revision.ts","../src/shared/lib/manifest-texts.ts"],"sourcesContent":["import { Array as Arr, Option, Record as Rec, Schema, String as Str, pipe } from \"effect\";\n\nconst START = 0;\n\n/** @internal */\nexport type Fields = Readonly<Record<string, unknown>>;\n\nconst FieldsSchema = Schema.Record(Schema.String, Schema.Unknown);\nconst decodeFields = Schema.decodeUnknownOption(FieldsSchema);\nconst decodeJson = Schema.decodeUnknownOption(Schema.fromJsonString(FieldsSchema));\nconst decodeString = Schema.decodeUnknownOption(Schema.String);\n\n/** @internal */\nexport const decodeManifest = (source: string): Option.Option<Fields> => decodeJson(source);\n\n/** @internal */\nexport const fieldsOf = (value: unknown): Fields =>\n Option.getOrElse(decodeFields(value), () => ({}));\n\n/** @internal */\nexport const namedCatalogsOf = (settings: Fields): readonly (readonly [string, unknown])[] =>\n Rec.toEntries(fieldsOf(settings[\"catalogs\"]));\n\n/** @internal */\nexport interface Specified {\n readonly name: string;\n readonly specifier: string;\n}\n\n/** @internal */\nexport const specifiedIn = (held: unknown): readonly Specified[] =>\n pipe(\n fieldsOf(held),\n Rec.toEntries,\n Arr.flatMap(([name, value]) =>\n pipe(\n decodeString(value),\n Option.map((specifier) => ({ name, specifier })),\n Option.toArray,\n ),\n ),\n );\n\n/** @internal */\nexport const quoted = (text: string): string =>\n Str.replaceAll(/[$()*+.?[\\\\\\]^{|}]/gu, String.raw`\\$&`)(text);\n\n/** @internal */\nexport const manifestPattern = ({ name, specifier }: Specified): RegExp =>\n new RegExp(`\"${quoted(name)}\"\\\\s*:\\\\s*\"${quoted(specifier)}\"`, \"u\");\n\n/** @internal */\nexport const offsetIn =\n (source: string) =>\n (pattern: RegExp): number =>\n pipe(\n Option.fromNullishOr(pattern.exec(source)),\n Option.map(({ index }) => index),\n Option.getOrElse(() => START),\n );\n\nconst SECTIONS = [\"dependencies\", \"devDependencies\", \"optionalDependencies\"] as const;\n\n/** @internal */\nexport const manifestSpecifiers = (source: string): readonly Specified[] =>\n pipe(\n decodeJson(source),\n Option.map((manifest) =>\n pipe(\n SECTIONS,\n Arr.flatMap((section) => specifiedIn(manifest[section])),\n ),\n ),\n Option.getOrElse((): readonly Specified[] => []),\n );\n","import { Config, Effect, Option } from \"effect\";\n\nimport { RepositoryFiles } from \"./repository-files.ts\";\n\nconst DEFAULT_BASE = \"origin/main\";\n\n/** @internal */\nexport const baseName = Config.option(Config.String(\"VPA_BASE\")).pipe(\n Effect.orDie,\n Effect.map(Option.getOrElse(() => DEFAULT_BASE)),\n);\n\n/** @internal */\nexport const baseRevision = Effect.fn(\"baseRevision\")(function* baseRevision(root: string) {\n const files = yield* RepositoryFiles;\n const base = yield* baseName;\n return yield* files.mergeBase(root, base);\n});\n","import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"./repository-files.ts\";\n\nconst MANIFEST = /(?:^|\\/)package\\.json$/u;\nconst READ_CONCURRENCY = 16;\n\n/** @internal */\nexport interface ManifestText {\n readonly file: string;\n readonly text: string;\n}\n\n/** @internal */\nexport const manifestTexts = Effect.fn(\"manifestTexts\")(function* manifestTexts(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const names = pipe(\n listed,\n Arr.filter((name) => MANIFEST.test(name)),\n );\n const read = yield* Effect.forEach(\n names,\n (file) =>\n Effect.map(\n files.readFile(files.join(root, file)),\n Option.map((text): ManifestText => ({ file, text })),\n ),\n { concurrency: READ_CONCURRENCY },\n );\n return Arr.getSomes(read);\n});\n"],"mappings":";;;AAEA,MAAM,QAAQ;AAKd,MAAM,eAAe,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO;AAChE,MAAM,eAAe,OAAO,oBAAoB,YAAY;AAC5D,MAAM,aAAa,OAAO,oBAAoB,OAAO,eAAe,YAAY,CAAC;AACjF,MAAM,eAAe,OAAO,oBAAoB,OAAO,MAAM;;AAG7D,MAAa,kBAAkB,WAA0C,WAAW,MAAM;;AAG1F,MAAa,YAA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