@r_masseater/msch 0.131.0 → 0.132.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/cli.mjs +5 -5
- package/dist/config-B3SYjao5.mjs.map +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +13 -2
- package/dist/config.mjs.map +1 -1
- package/dist/decision-rules.d.mts +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-PLWK5HYf.mjs → define-lint-preset-Cd0FMUQq.mjs} +11 -188
- package/dist/define-lint-preset-Cd0FMUQq.mjs.map +1 -0
- package/dist/{index-C93QRE06.d.mts → index-BF-ubMH2.d.mts} +1 -6
- package/dist/{index-BUNJ7vH_.d.mts → index-D0JFyFgM.d.mts} +1 -4
- package/dist/lint.d.mts +2 -2
- package/dist/lint.mjs +1 -1
- package/dist/{published-BdMq0wXq.mjs → published-BYVJ_t-U.mjs} +2 -2
- package/dist/{published-BdMq0wXq.mjs.map → published-BYVJ_t-U.mjs.map} +1 -1
- package/dist/{repository-text-Dy8EkFIh.mjs → repository-text-C9iSj4BY.mjs} +3 -3
- package/dist/{repository-text-Dy8EkFIh.mjs.map → repository-text-C9iSj4BY.mjs.map} +1 -1
- package/dist/required-stack-BLSiAmpx.mjs +188 -0
- package/dist/required-stack-BLSiAmpx.mjs.map +1 -0
- package/dist/{workspace-projects-eapoa0az.mjs → workspace-projects-CqSL9R26.mjs} +3 -3
- package/dist/workspace-projects-CqSL9R26.mjs.map +1 -0
- package/dist/workspace-settings.d.mts +2 -2
- package/dist/workspace-settings.mjs +18 -18
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +1 -1
- package/skills/msch-checks/SKILL.md +1 -1
- package/skills/msch-publishing/SKILL.md +1 -1
- package/skills/msch-repository-config/SKILL.md +7 -14
- package/skills/msch-workspace-settings/SKILL.md +8 -10
- package/src/app/vite.d.ts +1 -2
- package/dist/define-lint-preset-PLWK5HYf.mjs.map +0 -1
- package/dist/workspace-projects-eapoa0az.mjs.map +0 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
// src/shared/config/required-stack.ts
|
|
2
|
+
const UI_STATE = "UI 状態は effect-atom だけで扱う";
|
|
3
|
+
const INSTRUMENTATION = "計装は Effect のトレーシングだけで扱う";
|
|
4
|
+
const INFRASTRUCTURE = "インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない";
|
|
5
|
+
const requiredStack = {
|
|
6
|
+
[UI_STATE]: [
|
|
7
|
+
"zustand",
|
|
8
|
+
"jotai",
|
|
9
|
+
"valtio",
|
|
10
|
+
"recoil",
|
|
11
|
+
"mobx",
|
|
12
|
+
"mobx-*",
|
|
13
|
+
"redux",
|
|
14
|
+
"@reduxjs/*",
|
|
15
|
+
"react-redux",
|
|
16
|
+
"xstate",
|
|
17
|
+
"@xstate/*",
|
|
18
|
+
"nanostores",
|
|
19
|
+
"@nanostores/*",
|
|
20
|
+
"@preact/signals*"
|
|
21
|
+
],
|
|
22
|
+
"サーバー状態は TanStack Query と Eden だけで扱う": [
|
|
23
|
+
"swr",
|
|
24
|
+
"react-query",
|
|
25
|
+
"@apollo/*",
|
|
26
|
+
"urql",
|
|
27
|
+
"@urql/*",
|
|
28
|
+
"axios",
|
|
29
|
+
"ky",
|
|
30
|
+
"ofetch",
|
|
31
|
+
"got",
|
|
32
|
+
"node-fetch",
|
|
33
|
+
"graphql-request",
|
|
34
|
+
"@trpc/*"
|
|
35
|
+
],
|
|
36
|
+
"ルーティングとサーバーは TanStack Start と Elysia だけで扱う": [
|
|
37
|
+
"react-router",
|
|
38
|
+
"react-router-dom",
|
|
39
|
+
"next",
|
|
40
|
+
"@remix-run/*",
|
|
41
|
+
"wouter",
|
|
42
|
+
"express",
|
|
43
|
+
"hono",
|
|
44
|
+
"fastify",
|
|
45
|
+
"koa",
|
|
46
|
+
"@nestjs/*"
|
|
47
|
+
],
|
|
48
|
+
"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する": [
|
|
49
|
+
"prisma",
|
|
50
|
+
"@prisma/*",
|
|
51
|
+
"typeorm",
|
|
52
|
+
"sequelize",
|
|
53
|
+
"kysely",
|
|
54
|
+
"knex",
|
|
55
|
+
"@mikro-orm/*",
|
|
56
|
+
"better-sqlite3",
|
|
57
|
+
"pg",
|
|
58
|
+
"mysql2"
|
|
59
|
+
],
|
|
60
|
+
"認証は better-auth だけで扱う": [
|
|
61
|
+
"next-auth",
|
|
62
|
+
"@auth/*",
|
|
63
|
+
"lucia",
|
|
64
|
+
"passport",
|
|
65
|
+
"passport-*",
|
|
66
|
+
"@clerk/*",
|
|
67
|
+
"firebase/auth",
|
|
68
|
+
"@supabase/*"
|
|
69
|
+
],
|
|
70
|
+
"UI は shadcn/ui と Tailwind CSS だけで組む": [
|
|
71
|
+
"@mui/*",
|
|
72
|
+
"antd",
|
|
73
|
+
"@chakra-ui/*",
|
|
74
|
+
"@mantine/*",
|
|
75
|
+
"styled-components",
|
|
76
|
+
"@emotion/*",
|
|
77
|
+
"bootstrap",
|
|
78
|
+
"react-bootstrap"
|
|
79
|
+
],
|
|
80
|
+
"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う": [
|
|
81
|
+
"zod",
|
|
82
|
+
"yup",
|
|
83
|
+
"joi",
|
|
84
|
+
"valibot",
|
|
85
|
+
"arktype",
|
|
86
|
+
"io-ts",
|
|
87
|
+
"superstruct",
|
|
88
|
+
"moment",
|
|
89
|
+
"dayjs",
|
|
90
|
+
"date-fns",
|
|
91
|
+
"luxon",
|
|
92
|
+
"winston",
|
|
93
|
+
"pino",
|
|
94
|
+
"bunyan",
|
|
95
|
+
"loglevel",
|
|
96
|
+
"lodash",
|
|
97
|
+
"lodash-es",
|
|
98
|
+
"ramda",
|
|
99
|
+
"rxjs",
|
|
100
|
+
"fp-ts",
|
|
101
|
+
"neverthrow",
|
|
102
|
+
"ts-results",
|
|
103
|
+
"purify-ts"
|
|
104
|
+
],
|
|
105
|
+
"CSV は effect/encoding の Csv だけで読み書きする": [
|
|
106
|
+
"papaparse",
|
|
107
|
+
"csv-parse",
|
|
108
|
+
"csv-parser",
|
|
109
|
+
"csv-stringify",
|
|
110
|
+
"fast-csv",
|
|
111
|
+
"@fast-csv/*",
|
|
112
|
+
"d3-dsv"
|
|
113
|
+
],
|
|
114
|
+
"tar は effect/encoding の Tar だけで読み書きする": [
|
|
115
|
+
"modern-tar",
|
|
116
|
+
"nanotar",
|
|
117
|
+
"tar",
|
|
118
|
+
"tar-stream",
|
|
119
|
+
"tar-fs",
|
|
120
|
+
"tar-js",
|
|
121
|
+
"tarts",
|
|
122
|
+
"it-tar"
|
|
123
|
+
],
|
|
124
|
+
"エージェントスキルは vite.config.ts の skills に書き、msch --prepare で入れる": ["skills"],
|
|
125
|
+
"フィーチャーフラグは OpenFeature だけで扱う": [
|
|
126
|
+
"launchdarkly-*",
|
|
127
|
+
"@launchdarkly/*",
|
|
128
|
+
"@growthbook/*",
|
|
129
|
+
"unleash-client",
|
|
130
|
+
"flagsmith",
|
|
131
|
+
"@vercel/flags"
|
|
132
|
+
],
|
|
133
|
+
"テストは Vitest と Playwright だけで扱う": [
|
|
134
|
+
"jest",
|
|
135
|
+
"jest-*",
|
|
136
|
+
"@jest/*",
|
|
137
|
+
"ts-jest",
|
|
138
|
+
"mocha",
|
|
139
|
+
"jasmine",
|
|
140
|
+
"jasmine-core",
|
|
141
|
+
"ava",
|
|
142
|
+
"cypress",
|
|
143
|
+
"tap",
|
|
144
|
+
"uvu"
|
|
145
|
+
],
|
|
146
|
+
"決済は Stripe だけで扱う": [
|
|
147
|
+
"@paypal/*",
|
|
148
|
+
"paypal-rest-sdk",
|
|
149
|
+
"braintree",
|
|
150
|
+
"@paddle/*",
|
|
151
|
+
"@lemonsqueezy/*",
|
|
152
|
+
"square"
|
|
153
|
+
],
|
|
154
|
+
"整形は Vite+ の vp fmt だけで扱う": [
|
|
155
|
+
"prettier",
|
|
156
|
+
"prettier-plugin-*",
|
|
157
|
+
"@prettier/*",
|
|
158
|
+
"@biomejs/*",
|
|
159
|
+
"dprint"
|
|
160
|
+
],
|
|
161
|
+
"lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む": [
|
|
162
|
+
"eslint",
|
|
163
|
+
"@eslint/*",
|
|
164
|
+
"eslint-config-*",
|
|
165
|
+
"tslint",
|
|
166
|
+
"standard",
|
|
167
|
+
"xo"
|
|
168
|
+
],
|
|
169
|
+
[INSTRUMENTATION]: [
|
|
170
|
+
"@opentelemetry/*",
|
|
171
|
+
"dd-trace",
|
|
172
|
+
"newrelic"
|
|
173
|
+
],
|
|
174
|
+
[INFRASTRUCTURE]: [
|
|
175
|
+
"wrangler",
|
|
176
|
+
"miniflare",
|
|
177
|
+
"@cloudflare/vite-plugin",
|
|
178
|
+
"@vercel/*",
|
|
179
|
+
"@netlify/*",
|
|
180
|
+
"aws-cdk",
|
|
181
|
+
"aws-cdk-lib",
|
|
182
|
+
"@pulumi/*",
|
|
183
|
+
"cdktf"
|
|
184
|
+
]
|
|
185
|
+
};
|
|
186
|
+
export { requiredStack as n, INSTRUMENTATION as t };
|
|
187
|
+
|
|
188
|
+
//# sourceMappingURL=required-stack-BLSiAmpx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required-stack-BLSiAmpx.mjs","names":[],"sources":["../src/shared/config/required-stack.ts"],"sourcesContent":["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"],"mappings":";AAAA,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"}
|
|
@@ -119,11 +119,11 @@ const settingsInvalid = (file) => (reason) => WorkspaceSettingsInvalid.make({
|
|
|
119
119
|
file,
|
|
120
120
|
message: `${file}: ${reason}`
|
|
121
121
|
});
|
|
122
|
-
const notLiteral = ([outer, inner]) => `${outer}.${inner} must be written with literal values, because the root vite.config.ts reads it without running this file.
|
|
122
|
+
const notLiteral = ([outer, inner]) => `${outer}.${inner} must be written with literal values, because the root vite.config.ts reads it without running this file. Write the values in place instead of importing them.`;
|
|
123
123
|
const merged = (records) => pipe(records, Array.flatMap(Record.toEntries), Record.fromEntries);
|
|
124
124
|
const usedFrom = Effect.fn("usedFrom")(function* usedFrom(file, sets, used) {
|
|
125
125
|
const unknownSets = pipe(used, Array.filter((name) => !Record.has(sets, name)));
|
|
126
|
-
if (Array.isReadonlyArrayNonEmpty(unknownSets)) return yield* settingsInvalid(file)(`msch
|
|
126
|
+
if (Array.isReadonlyArrayNonEmpty(unknownSets)) return yield* settingsInvalid(file)(`msch has no set named ${Array.join(unknownSets, ", ")}. Sets msch has: ${Array.join(Record.keys(sets), ", ")}.`);
|
|
127
127
|
return pipe(used, Array.flatMap((name) => Option.toArray(Record.get(sets, name))));
|
|
128
128
|
});
|
|
129
129
|
const singleValue = Effect.fn("singleValue")(function* singleValue(source, path) {
|
|
@@ -265,4 +265,4 @@ const unmatchedWorkspacePatterns = Effect.fn("unmatchedWorkspacePatterns")(funct
|
|
|
265
265
|
});
|
|
266
266
|
export { childrenOf as C, propertyValue as D, nestedValues as E, stringsIn as O, KeySchema as S, literalOf as T, merged as _, workspaceManifest as a, usedFrom as b, TASK_NAMES as c, definesTask as d, hasCargoTask as f, literalSettings as g, testsItself as h, workspaceProjects as i, TEST_TASK_NAMES as l, tasksOf as m, unmatchedWorkspacePatterns as n, NO_TASKS as o, hasVerifyTask as p, workspaceDirectories as r, RUN_TASKS as s, publishedProjects as t, VERIFY_TASK as u, programOf as v, keyName as w, workspaceConfigOf as x, settingsInvalid as y };
|
|
267
267
|
|
|
268
|
-
//# sourceMappingURL=workspace-projects-
|
|
268
|
+
//# sourceMappingURL=workspace-projects-CqSL9R26.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-projects-CqSL9R26.mjs","names":["Arr","Rec","Arr","Rec","Arr","Str","Arr"],"sources":["../src/entities/workspace/model/config-literal.ts","../src/entities/workspace/model/workspace-config-source.ts","../src/entities/workspace/model/workspace-tasks.ts","../src/entities/workspace/model/workspace-manifest.ts","../src/entities/workspace/model/workspace-projects.ts"],"sourcesContent":["import { Array as Arr, Match, Option, Predicate, Record as Rec, Schema, pipe } from \"effect\";\nimport type { ESTree } from \"vite-plus/lint/plugins\";\n\nexport type Literal = string | number | boolean | null | readonly Literal[] | LiteralObject;\n\nexport interface LiteralObject {\n readonly [key: string]: Literal;\n}\n\nconst WRAPPERS = [\"TSAsExpression\", \"TSSatisfiesExpression\", \"ParenthesizedExpression\"] as const;\n\nexport const KeySchema = Schema.Union([\n Schema.Struct({ type: Schema.Literal(\"Identifier\"), name: Schema.String }),\n Schema.Struct({ type: Schema.Literal(\"Literal\"), value: Schema.String }),\n]);\nconst Quasi = Schema.Struct({ value: Schema.Struct({ cooked: Schema.String }) });\nconst PropertyNode = Schema.Struct({\n type: Schema.Literal(\"Property\"),\n computed: Schema.Literal(false),\n key: KeySchema,\n value: Schema.Unknown,\n});\nconst WrappedNode = Schema.Struct({ type: Schema.Literals(WRAPPERS), expression: Schema.Unknown });\nconst ValueNode = Schema.Union([\n Schema.Struct({\n type: Schema.Literal(\"Literal\"),\n value: Schema.Union([Schema.String, Schema.Finite, Schema.Boolean, Schema.Null]),\n }),\n Schema.Struct({\n type: Schema.Literal(\"TemplateLiteral\"),\n expressions: Schema.Tuple([]),\n quasis: Schema.Array(Quasi),\n }),\n Schema.Struct({\n type: Schema.Literal(\"ArrayExpression\"),\n elements: Schema.Array(Schema.Unknown),\n }),\n Schema.Struct({\n type: Schema.Literal(\"ObjectExpression\"),\n properties: Schema.Array(PropertyNode),\n }),\n]);\n\nconst decodeWrapped = Schema.decodeUnknownOption(WrappedNode);\nconst decodeValue = Schema.decodeUnknownOption(ValueNode);\nconst decodeProperty = Schema.decodeUnknownOption(\n Schema.Struct({ type: Schema.Literal(\"Property\"), key: KeySchema, value: Schema.Unknown }),\n);\nconst decodeObject = Schema.decodeUnknownOption(\n Schema.Struct({\n type: Schema.Literal(\"ObjectExpression\"),\n properties: Schema.Array(Schema.Unknown),\n }),\n);\n\nexport const keyName = (key: typeof KeySchema.Type): string =>\n Match.value(key).pipe(\n Match.discriminatorsExhaustive(\"type\")({\n Identifier: (identifier) => identifier.name,\n Literal: (literal) => literal.value,\n }),\n );\n\nexport const literalOf = (node: unknown): Option.Option<Literal> => {\n const wrapped = decodeWrapped(node);\n if (Option.isSome(wrapped)) {\n return literalOf(wrapped.value.expression);\n }\n return pipe(\n decodeValue(node),\n Option.flatMap((value) =>\n Match.value(value).pipe(\n Match.discriminatorsExhaustive(\"type\")({\n Literal: (scalar): Option.Option<Literal> => Option.some(scalar.value),\n TemplateLiteral: (template): Option.Option<Literal> =>\n Option.some(\n pipe(\n template.quasis,\n Arr.map((quasi) => quasi.value.cooked),\n Arr.join(\"\"),\n ),\n ),\n ArrayExpression: (array): Option.Option<Literal> =>\n pipe(array.elements, Arr.map(literalOf), Option.all),\n ObjectExpression: (object): Option.Option<Literal> =>\n pipe(\n object.properties,\n Arr.map((property) =>\n pipe(\n literalOf(property.value),\n Option.map((literal) => [keyName(property.key), literal] as const),\n ),\n ),\n Option.all,\n Option.map(Rec.fromEntries),\n ),\n }),\n ),\n ),\n );\n};\n\nexport const propertyValue =\n (name: string) =>\n (object: unknown): Option.Option<unknown> =>\n pipe(\n decodeObject(object),\n Option.flatMap(({ properties }) =>\n pipe(\n properties,\n Arr.findFirst((property) =>\n pipe(\n decodeProperty(property),\n Option.filter(({ key }) => keyName(key) === name),\n Option.map(({ value }) => value),\n ),\n ),\n ),\n ),\n );\n\nexport const childrenOf = (node: unknown): readonly unknown[] => {\n if (Arr.isArray(node)) {\n return node;\n }\n if (Predicate.isReadonlyObject(node)) {\n return Rec.values(node);\n }\n return [];\n};\n\nexport const nestedValues =\n (path: readonly [string, string]) =>\n (node: unknown): readonly unknown[] => {\n const [outer, inner] = path;\n const own = pipe(\n Option.some(node),\n Option.flatMap(propertyValue(outer)),\n Option.flatMap(propertyValue(inner)),\n Option.toArray,\n );\n return [...own, ...pipe(childrenOf(node), Arr.flatMap(nestedValues(path)))];\n };\n\nconst StringNode = Schema.Union([\n Schema.Struct({\n type: Schema.Literal<ESTree.StringLiteral[\"type\"]>(\"Literal\"),\n value: Schema.String,\n start: Schema.Finite,\n }),\n Schema.Struct({\n type: Schema.Literal<ESTree.TemplateElement[\"type\"]>(\"TemplateElement\"),\n value: Schema.Struct({ cooked: Schema.String }),\n start: Schema.Finite,\n }),\n]);\nconst decodeStringNode = Schema.decodeUnknownOption(StringNode);\n\nexport interface FoundString {\n readonly text: string;\n readonly start: number;\n}\n\nconst textOf = (node: typeof StringNode.Type): string => {\n if (node.type === \"Literal\") {\n return node.value;\n }\n return node.value.cooked;\n};\n\nexport const stringsIn = (node: unknown): readonly FoundString[] => {\n const own = pipe(\n decodeStringNode(node),\n Option.map((found) => ({ text: textOf(found), start: found.start })),\n Option.toArray,\n );\n return [...own, ...pipe(childrenOf(node), Arr.flatMap(stringsIn))];\n};\n","import { Array as Arr, Effect, Option, Record as Rec, Schema, pipe } from \"effect\";\nimport { parse } from \"vite-plus\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { literalOf, nestedValues } from \"./config-literal.ts\";\n\nconst SINGLE = 1;\nconst CONFIG_FILE = \"vite.config.ts\";\n\nconst taggedError = Schema.TaggedError;\n\nclass WorkspaceSettingsInvalid extends taggedError<\n WorkspaceSettingsInvalid,\n { readonly brand: unique symbol }\n>()(\"WorkspaceSettingsInvalid\", { file: Schema.String, message: Schema.String }) {}\n\nexport const settingsInvalid =\n (file: string) =>\n (reason: string): WorkspaceSettingsInvalid =>\n WorkspaceSettingsInvalid.make({ file, message: `${file}: ${reason}` });\n\nexport interface WorkspaceSource {\n readonly file: string;\n readonly directory: string;\n readonly program: unknown;\n}\n\nexport type SettingsPath = readonly [string, string];\n\nconst notLiteral = ([outer, inner]: SettingsPath): string =>\n `${outer}.${inner} must be written with literal values, because the root vite.config.ts reads it without running this file. Write the values in place instead of importing them.`;\n\nexport const merged = <Value>(\n records: readonly Readonly<Record<string, Value>>[],\n): Record<string, Value> => pipe(records, Arr.flatMap(Rec.toEntries), Rec.fromEntries);\n\nexport const usedFrom = Effect.fn(\"usedFrom\")(function* usedFrom<Value>(\n file: string,\n sets: Readonly<Record<string, Value>>,\n used: readonly string[],\n) {\n const unknownSets = pipe(\n used,\n Arr.filter((name) => !Rec.has(sets, name)),\n );\n if (Arr.isReadonlyArrayNonEmpty(unknownSets)) {\n return yield* settingsInvalid(file)(\n `msch has no set named ${Arr.join(unknownSets, \", \")}. Sets msch has: ${Arr.join(Rec.keys(sets), \", \")}.`,\n );\n }\n return pipe(\n used,\n Arr.flatMap((name) => Option.toArray(Rec.get(sets, name))),\n );\n});\n\nconst singleValue = Effect.fn(\"singleValue\")(function* singleValue(\n source: WorkspaceSource,\n path: SettingsPath,\n) {\n const found = nestedValues(path)(source.program);\n if (found.length > SINGLE) {\n return yield* settingsInvalid(source.file)(`${Arr.join(path, \".\")} appears more than once.`);\n }\n return Arr.head(found);\n});\n\nexport interface LiteralSettingsRequest<Settings> {\n readonly source: WorkspaceSource;\n readonly path: SettingsPath;\n readonly decode: (input: unknown) => Effect.Effect<Settings, Schema.SchemaError>;\n}\n\nexport const literalSettings = <Settings>({\n source,\n path,\n decode,\n}: LiteralSettingsRequest<Settings>): Effect.Effect<\n Option.Option<Settings>,\n WorkspaceSettingsInvalid\n> =>\n Effect.gen(function* literalSettingsIn() {\n const node = yield* singleValue(source, path);\n if (Option.isNone(node)) {\n return Option.none();\n }\n const literal = literalOf(node.value);\n if (Option.isNone(literal)) {\n return yield* settingsInvalid(source.file)(notLiteral(path));\n }\n const settings = yield* decode(literal.value).pipe(\n Effect.mapError((error) => settingsInvalid(source.file)(error.message)),\n );\n return Option.some(settings);\n });\n\nexport const programOf = Effect.fn(\"programOf\")(function* programOf(file: string, text: string) {\n const parsed = yield* Effect.promise(() => parse(file, text, { lang: \"ts\" }));\n if (Arr.isReadonlyArrayNonEmpty(parsed.errors)) {\n return yield* settingsInvalid(file)(\"vite.config.ts does not parse.\");\n }\n const program: unknown = parsed.program;\n return program;\n});\n\n/** @internal */\nexport interface WorkspaceConfig {\n readonly file: string;\n readonly source: string;\n readonly program: unknown;\n}\n\nexport const workspaceConfigOf = Effect.fn(\"workspaceConfigOf\")(function* workspaceConfigOf(\n root: string,\n directory: string,\n) {\n const files = yield* RepositoryFiles;\n const file = files.join(root, directory, CONFIG_FILE);\n const text = yield* files.readFile(file);\n if (Option.isNone(text)) {\n return Option.none<WorkspaceConfig>();\n }\n const program = yield* programOf(file, text.value);\n return Option.some<WorkspaceConfig>({ file, source: text.value, program });\n});\n\nexport type { WorkspaceSettingsInvalid };\n","import type { PackageJson } from \"@r_masseater/masseater-utils/kestrion\";\nimport { Array as Arr, Effect, Option, Predicate, Schema, pipe } from \"effect\";\nimport { resolveConfigFromFile } from \"vite-plus\";\n\nimport { nestedValues, propertyValue, stringsIn } from \"./config-literal.ts\";\nimport type { FoundString } from \"./config-literal.ts\";\nimport { settingsInvalid } from \"./workspace-config-source.ts\";\n\nexport const TASK_NAMES = { verify: \"verify\", test: \"test\", cargoTest: \"cargo-test\" } as const;\n\nexport const TEST_TASK_NAMES: readonly string[] = [TASK_NAMES.test, TASK_NAMES.cargoTest];\n\nexport const VERIFY_TASK = [\"tasks\", TASK_NAMES.verify] as const;\n\nexport const TEST_TASK = [\"tasks\", TASK_NAMES.test] as const;\n\nconst CARGO_TEST_TASK = [\"tasks\", TASK_NAMES.cargoTest] as const;\n\nconst NATIVE_TASK = [\"tasks\", \"native\"] as const;\n\nexport const RUN_TASKS = [\"run\", \"tasks\"] as const;\n\nexport interface WorkspaceTasks {\n readonly verify: readonly string[];\n readonly test: readonly string[];\n readonly native: readonly string[];\n}\n\nexport const NO_TASKS: WorkspaceTasks = { verify: [], test: [], native: [] };\n\nconst Tasks = Schema.Struct({ verify: Schema.Unknown });\nconst isVerified = Schema.is(Schema.Struct({ run: Schema.Struct({ tasks: Tasks }) }));\n\nexport const definesTask =\n (path: readonly [string, string]) =>\n (program: unknown): boolean =>\n Arr.isReadonlyArrayNonEmpty(nestedValues(path)(program));\n\nconst DEPENDS_ON = \"dependsOn\";\n\nconst testsInVerify = (program: unknown): readonly FoundString[] =>\n pipe(\n nestedValues(VERIFY_TASK)(program),\n Arr.flatMap((verify) => Option.toArray(propertyValue(DEPENDS_ON)(verify))),\n Arr.flatMap(stringsIn),\n Arr.filter(({ text }) => text === TASK_NAMES.test),\n );\n\nexport const testsItself = (program: unknown): boolean =>\n definesTask(TEST_TASK)(program) || Arr.isReadonlyArrayNonEmpty(testsInVerify(program));\n\nconst CargoTasks = Schema.Struct({ cargo: Schema.Unknown });\nconst checksCargo = Schema.is(Schema.Struct({ run: Schema.Struct({ tasks: CargoTasks }) }));\n\nconst resolvedConfig = (file: string): Effect.Effect<Option.Option<unknown>> =>\n Effect.tryPromise({\n try: () => resolveConfigFromFile(file),\n catch: () => settingsInvalid(file)(\"vite.config.ts does not load.\"),\n }).pipe(Effect.option);\n\nexport const hasVerifyTask = Effect.fn(\"hasVerifyTask\")(function* hasVerifyTask(file: string) {\n const config = yield* resolvedConfig(file);\n return Option.exists(config, isVerified);\n});\n\nexport const hasCargoTask = Effect.fn(\"hasCargoTask\")(function* hasCargoTask(file: string) {\n const config = yield* resolvedConfig(file);\n return Option.exists(config, checksCargo);\n});\n\nconst shipsAddon = (manifest: Option.Option<PackageJson>): boolean =>\n Option.exists(manifest, (found) => Predicate.isNotUndefined(found.native));\n\nexport const tasksOf =\n (manifest: Option.Option<PackageJson>) =>\n (program: unknown): WorkspaceTasks =>\n pipe(\n manifest,\n Option.flatMap((found) => Option.fromUndefinedOr(found.name)),\n Option.match({\n onNone: () => NO_TASKS,\n onSome: (name) => ({\n verify: Arr.filter([`${name}#verify`], () => definesTask(VERIFY_TASK)(program)),\n test: Arr.getSomes([\n Option.liftPredicate(`${name}#test`, () => definesTask(TEST_TASK)(program)),\n Option.liftPredicate(`${name}#cargo-test`, () => definesTask(CARGO_TEST_TASK)(program)),\n ]),\n native: Arr.filter(\n [`${name}#native`],\n () => definesTask(NATIVE_TASK)(program) || shipsAddon(manifest),\n ),\n }),\n }),\n );\n","import { readWorkspaceManifest } from \"@r_masseater/masseater-utils/kestrion/pnpm\";\nimport type { WorkspaceManifest } from \"@r_masseater/masseater-utils/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","import { PACKAGE_JSON_FILE } from \"@r_masseater/masseater-utils/kestrion\";\nimport { decodePackageJson } from \"@r_masseater/masseater-utils/kestrion/npm\";\nimport { findWorkspaceProjects } from \"@r_masseater/masseater-utils/kestrion/pnpm\";\nimport type { Project } from \"@r_masseater/masseater-utils/kestrion/pnpm\";\nimport { Array as Arr, Effect, Option, Order, Predicate, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceManifest } from \"./workspace-manifest.ts\";\n\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 findWorkspaceProjects(root, patterns).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 rootProject = Effect.fn(\"rootProject\")(function* rootProject(root: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, PACKAGE_JSON_FILE));\n return pipe(\n text,\n Option.flatMap(decodePackageJson),\n Option.filter((own) => Predicate.isNotUndefined(own.name)),\n Option.map((own): WorkspaceProject => ({\n directory: ROOT_DIRECTORY,\n packageName: Option.fromUndefinedOr(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"],"mappings":";;;;;;;AASA,MAAM,WAAW;CAAC;CAAkB;CAAyB;AAAyB;AAEtF,MAAa,YAAY,OAAO,MAAM,CACpC,OAAO,OAAO;CAAE,MAAM,OAAO,QAAQ,YAAY;CAAG,MAAM,OAAO;AAAO,CAAC,GACzE,OAAO,OAAO;CAAE,MAAM,OAAO,QAAQ,SAAS;CAAG,OAAO,OAAO;AAAO,CAAC,CACzE,CAAC;AACD,MAAM,QAAQ,OAAO,OAAO,EAAE,OAAO,OAAO,OAAO,EAAE,QAAQ,OAAO,OAAO,CAAC,EAAE,CAAC;AAC/E,MAAM,eAAe,OAAO,OAAO;CACjC,MAAM,OAAO,QAAQ,UAAU;CAC/B,UAAU,OAAO,QAAQ,KAAK;CAC9B,KAAK;CACL,OAAO,OAAO;AAChB,CAAC;AACD,MAAM,cAAc,OAAO,OAAO;CAAE,MAAM,OAAO,SAAS,QAAQ;CAAG,YAAY,OAAO;AAAQ,CAAC;AACjG,MAAM,YAAY,OAAO,MAAM;CAC7B,OAAO,OAAO;EACZ,MAAM,OAAO,QAAQ,SAAS;EAC9B,OAAO,OAAO,MAAM;GAAC,OAAO;GAAQ,OAAO;GAAQ,OAAO;GAAS,OAAO;EAAI,CAAC;CACjF,CAAC;CACD,OAAO,OAAO;E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C,MAAM,WAAW,KACf,QACAA,MAAI,QAAQ,YAAY,CAACD,OAAI,WAAW,QAAQ,CAAC,CAAC,OAAO,CAAC,CAC5D;CACA,MAAM,UAAU,OAAO,OAAO,QAC5B,WACC,YACC,iBAAiB,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAChC,OAAO,KAAK,cAAc;EAAE;EAAS,SAASC,MAAI,wBAAwB,QAAQ;CAAE,EAAE,CACxF,GACF,EAAE,aAAa,kBAAkB,CACnC;CACA,OAAO,KACL,SACAA,MAAI,QAAQ,EAAE,cAAc,CAAC,OAAO,GACpCA,MAAI,KAAK,EAAE,cAAc,OAAO,CAClC;AACF,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { type AddedRulesValue, type DependencyAllowance, type
|
|
1
|
+
import { a as workspaceSettings, c as ignoredDirectories, i as WorkspaceSettings, l as WorkspaceTasks, n as SettingsOptions, o as DependencyAllowance, r as WorkspaceLint, s as IgnoredDirectory, t as AddedRulesValue } from "./index-BF-ubMH2.mjs";
|
|
2
|
+
export { type AddedRulesValue, type DependencyAllowance, type IgnoredDirectory, type SettingsOptions, type WorkspaceLint, type WorkspaceSettings, type WorkspaceTasks, ignoredDirectories, workspaceSettings };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Array, Effect, Option, Order, Predicate, Record, Schema, String, pipe } from "effect";
|
|
2
2
|
import { r as readManifest } from "./dependencies-Bjn3xWkq.mjs";
|
|
3
|
-
import { _ as shadcnUiIn, c as publicEntriesOf, f as splitFrontmatter, g as deployEntries, l as modDirectories, n as entriesOf, p as linkedPaths, t as PackEntry, u as INDEX_SKILL, y as prefixed } from "./published-
|
|
3
|
+
import { _ as shadcnUiIn, c as publicEntriesOf, f as splitFrontmatter, g as deployEntries, l as modDirectories, n as entriesOf, p as linkedPaths, t as PackEntry, u as INDEX_SKILL, y as prefixed } from "./published-BYVJ_t-U.mjs";
|
|
4
4
|
import { i as nodeRepositoryFiles, r as RepositoryFiles } from "./repository-files-C_GzAnYp.mjs";
|
|
5
|
-
import { E as nestedValues, T as literalOf, _ as merged, b as usedFrom, g as literalSettings, h as testsItself, i as workspaceProjects, m as tasksOf, o as NO_TASKS, r as workspaceDirectories, v as programOf, y as settingsInvalid } from "./workspace-projects-
|
|
5
|
+
import { E as nestedValues, T as literalOf, _ as merged, b as usedFrom, g as literalSettings, h as testsItself, i as workspaceProjects, m as tasksOf, o as NO_TASKS, r as workspaceDirectories, v as programOf, y as settingsInvalid } from "./workspace-projects-CqSL9R26.mjs";
|
|
6
6
|
import { n as FINGERPRINT_FILE, r as LOCK_FILE, t as CLOSURE_FILE } from "./locked-closure-paths-_N_97Dbp.mjs";
|
|
7
7
|
import { depPathsOf, readWantedLockfile } from "@r_masseater/masseater-utils/kestrion/pnpm";
|
|
8
8
|
import { i as reachable, r as ignoredDirectories, t as collectIgnoredDirectories } from "./ignored-directories-CaTFIbjo.mjs";
|
|
9
|
+
import { n as requiredStack } from "./required-stack-BLSiAmpx.mjs";
|
|
9
10
|
import { PACKAGE_JSON_FILE } from "@r_masseater/masseater-utils/kestrion";
|
|
10
11
|
import { decodePackageJson } from "@r_masseater/masseater-utils/kestrion/npm";
|
|
11
12
|
// src/entities/workspace/model/structure-members.ts
|
|
@@ -138,6 +139,7 @@ const EnabledWithOptions = Schema.mutable(Schema.TupleWithRest(Schema.Tuple([Ena
|
|
|
138
139
|
const AddedRule = Schema.Union([Enabled, EnabledWithOptions]);
|
|
139
140
|
const AddedRules = Schema.Record(Schema.String, AddedRule);
|
|
140
141
|
// src/features/build-workspace-settings/model/dependency-allowances.ts
|
|
142
|
+
const DEPENDENCY_SETS = { instrumentation: requiredStack["計装は Effect のトレーシングだけで扱う"] ?? [] };
|
|
141
143
|
const MSCH_DEV_DEPENDENCIES = ["msch", "devDependencies"];
|
|
142
144
|
const MSCH_DEPENDENCIES = ["msch", "dependencies"];
|
|
143
145
|
const Names$1 = Schema.String.pipe(Schema.Array, Schema.optional);
|
|
@@ -146,21 +148,21 @@ const DependencySettings = Schema.Struct({
|
|
|
146
148
|
dependencies: Names$1
|
|
147
149
|
});
|
|
148
150
|
const WorkspaceDependencyAllowances = Schema.Record(Schema.String, DependencySettings);
|
|
149
|
-
const allowanceOf = Effect.fn("allowanceOf")(function* allowanceOf(source,
|
|
150
|
-
const sets = yield* usedFrom(source.file,
|
|
151
|
+
const allowanceOf = Effect.fn("allowanceOf")(function* allowanceOf(source, [reason, allowance]) {
|
|
152
|
+
const sets = yield* usedFrom(source.file, DEPENDENCY_SETS, allowance.use ?? []);
|
|
151
153
|
const dependencies = [...Array.flatten(sets), ...allowance.dependencies ?? []];
|
|
152
154
|
return [`${source.directory}: ${reason}`, {
|
|
153
155
|
workspaces: [source.directory],
|
|
154
156
|
dependencies
|
|
155
157
|
}];
|
|
156
158
|
});
|
|
157
|
-
const allowancesOf = Effect.fn("allowancesOf")(function* allowancesOf(source,
|
|
159
|
+
const allowancesOf = Effect.fn("allowancesOf")(function* allowancesOf(source, path) {
|
|
158
160
|
const allowed = (yield* literalSettings({
|
|
159
161
|
source,
|
|
160
162
|
path,
|
|
161
163
|
decode: Schema.decodeUnknownEffect(WorkspaceDependencyAllowances)
|
|
162
164
|
})).pipe(Option.getOrElse(() => ({})), Record.toEntries);
|
|
163
|
-
const entries = yield* Effect.forEach(allowed, (entry) => allowanceOf(source,
|
|
165
|
+
const entries = yield* Effect.forEach(allowed, (entry) => allowanceOf(source, entry), { concurrency: 1 });
|
|
164
166
|
return Record.fromEntries(entries);
|
|
165
167
|
});
|
|
166
168
|
// src/features/build-workspace-settings/model/test-project.ts
|
|
@@ -248,15 +250,13 @@ const Names = Schema.String.pipe(Schema.Array, Schema.optional);
|
|
|
248
250
|
const WorkspaceOverride = Schema.Struct({
|
|
249
251
|
files: Schema.Array(Schema.String),
|
|
250
252
|
excludeFiles: Names,
|
|
251
|
-
rules: Schema.
|
|
252
|
-
use: Names
|
|
253
|
+
rules: Schema.Record(Schema.String, Schema.Unknown)
|
|
253
254
|
});
|
|
254
255
|
const WorkspaceLintSettings = Schema.Struct({ overrides: WorkspaceOverride.pipe(Schema.Array, Schema.optional) });
|
|
255
256
|
const WorkspaceTextSettings = Schema.Struct({ use: Schema.Array(Schema.Literal("zenn")) });
|
|
256
|
-
const overrideOf = Effect.fn("overrideOf")(function* overrideOf(source,
|
|
257
|
+
const overrideOf = Effect.fn("overrideOf")(function* overrideOf(source, override) {
|
|
257
258
|
const { file, directory } = source;
|
|
258
|
-
const
|
|
259
|
-
const rules = yield* decodeRules(merged([...fromSets, override.rules ?? {}])).pipe(Effect.mapError((error) => settingsInvalid(file)(error.message)));
|
|
259
|
+
const rules = yield* decodeRules(override.rules).pipe(Effect.mapError((error) => settingsInvalid(file)(error.message)));
|
|
260
260
|
const files = pipe(override.files, Array.map(prefixed(directory)));
|
|
261
261
|
return pipe(Option.fromUndefinedOr(override.excludeFiles), Option.match({
|
|
262
262
|
onNone: () => ({
|
|
@@ -270,14 +270,14 @@ const overrideOf = Effect.fn("overrideOf")(function* overrideOf(source, ruleSets
|
|
|
270
270
|
})
|
|
271
271
|
}));
|
|
272
272
|
});
|
|
273
|
-
const lintOf = Effect.fn("lintOf")(function* lintOf(source
|
|
273
|
+
const lintOf = Effect.fn("lintOf")(function* lintOf(source) {
|
|
274
274
|
const settings = yield* literalSettings({
|
|
275
275
|
source,
|
|
276
276
|
path: MSCH_LINT,
|
|
277
277
|
decode: Schema.decodeUnknownEffect(WorkspaceLintSettings, { onExcessProperty: "error" })
|
|
278
278
|
});
|
|
279
279
|
const lint = Option.getOrElse(settings, () => ({}));
|
|
280
|
-
return { overrides: yield* Effect.forEach(lint.overrides ?? [], (override) => overrideOf(source,
|
|
280
|
+
return { overrides: yield* Effect.forEach(lint.overrides ?? [], (override) => overrideOf(source, override), { concurrency: 1 }) };
|
|
281
281
|
});
|
|
282
282
|
const articlesOf = Effect.fn("articlesOf")(function* articlesOf(source) {
|
|
283
283
|
const settings = yield* literalSettings({
|
|
@@ -287,11 +287,11 @@ const articlesOf = Effect.fn("articlesOf")(function* articlesOf(source) {
|
|
|
287
287
|
});
|
|
288
288
|
return pipe(settings, Option.filter(({ use }) => Array.contains(use, "zenn")), Option.map(() => pipe(ZENN_FILES, Array.map(prefixed(source.directory)))), Option.getOrElse(() => []));
|
|
289
289
|
});
|
|
290
|
-
const settingsOf = Effect.fn("settingsOf")(function* settingsOf(source
|
|
291
|
-
const lint = yield* lintOf(source
|
|
290
|
+
const settingsOf = Effect.fn("settingsOf")(function* settingsOf(source) {
|
|
291
|
+
const lint = yield* lintOf(source);
|
|
292
292
|
const articles = yield* articlesOf(source);
|
|
293
|
-
const devDependencies = yield* allowancesOf(source,
|
|
294
|
-
const dependencies = yield* allowancesOf(source,
|
|
293
|
+
const devDependencies = yield* allowancesOf(source, MSCH_DEV_DEPENDENCIES);
|
|
294
|
+
const dependencies = yield* allowancesOf(source, MSCH_DEPENDENCIES);
|
|
295
295
|
const ownTests = testsItself(source.program);
|
|
296
296
|
const files = yield* RepositoryFiles;
|
|
297
297
|
const manifest = yield* readManifest(files.dirname(source.file));
|
|
@@ -339,7 +339,7 @@ const workspaceIn = Effect.fn("workspaceIn")(function* workspaceIn(options, dire
|
|
|
339
339
|
file,
|
|
340
340
|
directory,
|
|
341
341
|
program
|
|
342
|
-
}
|
|
342
|
+
});
|
|
343
343
|
const publicEntries = yield* publicEntryFiles(options.root, directory, Option.some(program));
|
|
344
344
|
return {
|
|
345
345
|
...settings,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-settings.mjs","names":["READ_CONCURRENCY","Arr","READ_CONCURRENCY","Arr","Rec","Arr","Str","Str","Arr","Rec","READ_CONCURRENCY","Arr","Names","Arr","Rec","Arr","Arr","Arr"],"sources":["../src/entities/workspace/model/structure-members.ts","../src/entities/workspace/model/site-entries.ts","../src/entities/workspace/model/locked-closures.ts","../src/entities/workspace/model/locked-closure-files.ts","../src/entities/workspace/model/index-skill.ts","../src/shared/lib/added-rules.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, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceProjects } from \"./workspace-projects.ts\";\n\nconst ROOT_WORKSPACE = \".\";\nconst PLUGIN_MANIFEST = \".claude-plugin/plugin.json\";\nconst READ_CONCURRENCY = 16;\n\nconst isPlugin = Effect.fn(\"isPlugin\")(function* isPlugin(root: string, directory: string) {\n const files = yield* RepositoryFiles;\n return yield* files.exists(files.join(root, directory, PLUGIN_MANIFEST));\n});\n\nexport const pluginWorkspaces = Effect.fn(\"pluginWorkspaces\")(function* pluginWorkspaces(\n root: string,\n directories: readonly string[],\n) {\n return yield* Effect.filter(directories, (directory) => isPlugin(root, directory), {\n concurrency: READ_CONCURRENCY,\n });\n});\n\nexport const sourcePlugins = Effect.fn(\"sourcePlugins\")(function* sourcePlugins(\n root: string,\n directories: readonly string[],\n) {\n const plugins = yield* pluginWorkspaces(root, directories);\n const projects = yield* workspaceProjects(root);\n const published = pipe(\n projects,\n Arr.filter((project) => project.published),\n Arr.map(({ directory }) => directory),\n );\n return pipe(\n plugins,\n Arr.filter((directory) => !Arr.contains(published, directory)),\n );\n});\n\nexport const structureMembers = Effect.fn(\"structureMembers\")(function* structureMembers(\n root: string,\n directories: readonly string[],\n) {\n const plugins = yield* pluginWorkspaces(root, directories);\n return pipe(\n directories,\n Arr.filter((directory) => directory !== ROOT_WORKSPACE && !Arr.contains(plugins, directory)),\n );\n});\n","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/masseater-utils/kestrion/pnpm\";\nimport type { ResolvedDependencies } from \"@r_masseater/masseater-utils/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] = recorded.pipe(\n Option.getOrElse(() => \"\"),\n Str.split(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 = closures.pipe(\n Option.getOrElse(() => ({})),\n Rec.toEntries,\n );\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, Order, Predicate, pipe } from \"effect\";\n\nimport { splitFrontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport type { Frontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport { INDEX_SKILL } from \"#/shared/lib/index-skill.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst SKILL_DIRECTORIES = [\".agents/skills\", \".claude/skills\", \"skills\"];\nconst PLUGINS = \"plugins\";\nconst SKILLS = \"skills\";\nconst SKILL_FILE = \"SKILL.md\";\nconst READ_CONCURRENCY = 16;\n\nconst nameOf = ({ fields }: Frontmatter): Option.Option<string> =>\n Option.filter(Option.fromNullishOr(fields[\"name\"]), Predicate.isString);\n\nconst skillDirectories = Effect.fn(\"skillDirectories\")(function* skillDirectories(root: string) {\n const files = yield* RepositoryFiles;\n const plugins = yield* files.readDirectory(files.join(root, PLUGINS));\n return [\n ...SKILL_DIRECTORIES,\n ...pipe(\n plugins,\n Arr.map((plugin) => files.join(PLUGINS, plugin, SKILLS)),\n ),\n ];\n});\n\nconst skillFiles = Effect.fn(\"skillFiles\")(function* skillFiles(root: string) {\n const files = yield* RepositoryFiles;\n const directories = yield* skillDirectories(root);\n const found = yield* Effect.forEach(\n directories,\n (directory) =>\n files\n .readDirectory(files.join(root, directory))\n .pipe(Effect.map(Arr.map((name) => files.join(directory, name, SKILL_FILE)))),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(Arr.flatten(found), Arr.sortBy(Order.String));\n});\n\nconst indexNameAt = Effect.fn(\"indexNameAt\")(function* indexNameAt(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const source = yield* files.readFile(files.join(root, file));\n return pipe(\n source,\n Option.filter(() => INDEX_SKILL.test(file)),\n Option.flatMap(splitFrontmatter),\n Option.flatMap(nameOf),\n );\n});\n\nexport const indexSkillIn = Effect.fn(\"indexSkillIn\")(function* indexSkillIn(root: string) {\n const found = yield* skillFiles(root);\n const names = yield* Effect.forEach(found, (file) => indexNameAt(root, file), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.head(Arr.getSomes(names));\n});\n","import { Schema } from \"effect\";\n\nconst Enabled = Schema.Literals([\"error\", \"deny\"]);\n\nconst EnabledWithOptions = Schema.mutable(\n Schema.TupleWithRest(Schema.Tuple([Enabled]), [Schema.Unknown]),\n);\n\nconst AddedRule = Schema.Union([Enabled, EnabledWithOptions]);\n\nexport const AddedRules = Schema.Record(Schema.String, AddedRule);\n\nexport type AddedRulesValue = typeof AddedRules.Type;\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 = settings.pipe(\n Option.getOrElse(() => ({})),\n Rec.toEntries,\n );\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/masseater-utils/kestrion\";\nimport { Array as Arr, Effect, Option, Predicate, Schema, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { literalSettings, modDirectories } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.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: {\n readonly name: string;\n readonly isolate: false;\n readonly exclude?: readonly string[];\n };\n}\n\nexport type TestProject = string | SharedTestProject;\n\nexport interface ProjectPlace {\n readonly directory: string;\n readonly config: string | false;\n readonly mods: readonly string[];\n}\n\nconst DEFAULT_EXCLUDE = [\"**/node_modules/**\", \"**/.git/**\"];\n\nconst excludeOf = (mods: readonly string[]): { readonly exclude?: readonly string[] } =>\n pipe(\n mods,\n Option.liftPredicate(Arr.isReadonlyArrayNonEmpty),\n Option.match({\n onNone: () => ({}),\n onSome: (directories) => ({\n exclude: [\n ...DEFAULT_EXCLUDE,\n ...pipe(\n directories,\n Arr.map((directory) => `${directory}**/*.test.{ts,tsx}`),\n ),\n ],\n }),\n }),\n );\n\nexport const sharedTestProject =\n (manifest: Option.Option<PackageJson>) =>\n ({ directory, config, mods }: 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 ...excludeOf(mods),\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 const files = yield* RepositoryFiles;\n const mods = yield* modDirectories(files.dirname(source.file));\n return sharedTestProject(manifest)({ directory: source.directory, config, mods });\n});\n\nexport type VitestProject = NonNullable<NonNullable<UserConfig[\"test\"]>[\"projects\"]>[number];\n\nconst excludeCopy = (exclude: readonly string[] | undefined): { exclude?: string[] } =>\n pipe(\n Option.fromUndefinedOr(exclude),\n Option.match({ onNone: () => ({}), onSome: (patterns) => ({ exclude: [...patterns] }) }),\n );\n\n/** @internal */\nexport const vitestProjectOf = (project: TestProject): VitestProject => {\n if (Predicate.isString(project)) {\n return project;\n }\n const { name, isolate, exclude } = project.test;\n return {\n extends: project.extends,\n root: project.root,\n test: { name, isolate, ...excludeCopy(exclude) },\n };\n};\n","import { PACKAGE_JSON_FILE } from \"@r_masseater/masseater-utils/kestrion\";\nimport { decodePackageJson } from \"@r_masseater/masseater-utils/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, Schema, pipe } from \"effect\";\nimport type { OxlintOverride } from \"vite-plus/lint\";\n\nimport { readManifest } from \"#/entities/package/index.ts\";\nimport {\n deployEntries,\n indexSkillIn,\n literalSettings,\n modDirectories,\n merged,\n sourcePlugins,\n programOf,\n settingsInvalid,\n siteEntries,\n structureMembers,\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 { AddedRules } from \"#/shared/lib/added-rules.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, vitestProjectOf } from \"./test-project.ts\";\nimport type { TestProject, VitestProject } 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 MSCH_LINT = [\"msch\", \"lint\"] as const;\nconst MSCH_TEXT = [\"msch\", \"text\"] as const;\nconst ZENN_FILES = [\"articles/**/*.md\", \"books/**/*.md\"];\n\nconst decodeRules = Schema.decodeUnknownEffect(AddedRules);\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 overrides: WorkspaceOverride.pipe(Schema.Array, Schema.optional),\n});\n\nconst WorkspaceTextSettings = Schema.Struct({ use: Schema.Array(Schema.Literal(\"zenn\")) });\n\nexport interface WorkspaceLint {\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 plugins: readonly string[];\n readonly ignoredDirectories: readonly IgnoredDirectory[];\n readonly testProjects: readonly VitestProject[];\n readonly tasks: WorkspaceTasks;\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n readonly indexSkill: Option.Option<string>;\n readonly articles: readonly string[];\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 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 readonly articles: 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, { onExcessProperty: \"error\" }),\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 return { overrides };\n});\n\nconst articlesOf = Effect.fn(\"articlesOf\")(function* articlesOf(source: WorkspaceSource) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_TEXT,\n decode: Schema.decodeUnknownEffect(WorkspaceTextSettings, { onExcessProperty: \"error\" }),\n });\n return pipe(\n settings,\n Option.filter(({ use }) => Arr.contains(use, \"zenn\")),\n Option.map(() => pipe(ZENN_FILES, Arr.map(prefixed(source.directory)))),\n Option.getOrElse((): readonly string[] => []),\n );\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 articles = yield* articlesOf(source);\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 articles,\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 const mods = yield* modDirectories(files.join(root, directory));\n return {\n directory,\n overrides: [],\n articles: [],\n devDependencies: {},\n dependencies: {},\n ownTests: false,\n testProject: sharedTestProject(manifest)({ directory, config: false, mods }),\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 test: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.test),\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: yield* structureMembers(options.root, directories),\n plugins: yield* sourcePlugins(options.root, directories),\n ignoredDirectories: yield* collectIgnoredDirectories(options.root),\n lint: {\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 }) => vitestProjectOf(testProject)),\n ),\n tasks: mergedTasks(found),\n ...mergedAllowances(found),\n indexSkill: yield* indexSkillIn(options.root),\n articles: pipe(\n found,\n Arr.flatMap(({ articles }) => articles),\n ),\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":";;;;;;;;;;;AAMA,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;AACxB,MAAMA,qBAAmB;AAEzB,MAAM,WAAW,OAAO,GAAG,UAAU,CAAC,CAAC,UAAU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,CAC3D;EACA,OAAO,YAAY,KAAK;EACxB,GAAG,iBAAiB,KAAK;EACzB,YAAY,OAAO,aAAa,QAAQ,IAAI;EAC5C,UAAU,KACR,OACAA,MAAI,SAAS,EAAE,eAAe,QAAQ,CACxC;CACF;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","READ_CONCURRENCY","Arr","Rec","Arr","Str","Str","Arr","Rec","READ_CONCURRENCY","Arr","Names","Arr","Rec","Arr","Arr","Arr"],"sources":["../src/entities/workspace/model/structure-members.ts","../src/entities/workspace/model/site-entries.ts","../src/entities/workspace/model/locked-closures.ts","../src/entities/workspace/model/locked-closure-files.ts","../src/entities/workspace/model/index-skill.ts","../src/shared/lib/added-rules.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, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { workspaceProjects } from \"./workspace-projects.ts\";\n\nconst ROOT_WORKSPACE = \".\";\nconst PLUGIN_MANIFEST = \".claude-plugin/plugin.json\";\nconst READ_CONCURRENCY = 16;\n\nconst isPlugin = Effect.fn(\"isPlugin\")(function* isPlugin(root: string, directory: string) {\n const files = yield* RepositoryFiles;\n return yield* files.exists(files.join(root, directory, PLUGIN_MANIFEST));\n});\n\nexport const pluginWorkspaces = Effect.fn(\"pluginWorkspaces\")(function* pluginWorkspaces(\n root: string,\n directories: readonly string[],\n) {\n return yield* Effect.filter(directories, (directory) => isPlugin(root, directory), {\n concurrency: READ_CONCURRENCY,\n });\n});\n\nexport const sourcePlugins = Effect.fn(\"sourcePlugins\")(function* sourcePlugins(\n root: string,\n directories: readonly string[],\n) {\n const plugins = yield* pluginWorkspaces(root, directories);\n const projects = yield* workspaceProjects(root);\n const published = pipe(\n projects,\n Arr.filter((project) => project.published),\n Arr.map(({ directory }) => directory),\n );\n return pipe(\n plugins,\n Arr.filter((directory) => !Arr.contains(published, directory)),\n );\n});\n\nexport const structureMembers = Effect.fn(\"structureMembers\")(function* structureMembers(\n root: string,\n directories: readonly string[],\n) {\n const plugins = yield* pluginWorkspaces(root, directories);\n return pipe(\n directories,\n Arr.filter((directory) => directory !== ROOT_WORKSPACE && !Arr.contains(plugins, directory)),\n );\n});\n","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/masseater-utils/kestrion/pnpm\";\nimport type { ResolvedDependencies } from \"@r_masseater/masseater-utils/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] = recorded.pipe(\n Option.getOrElse(() => \"\"),\n Str.split(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 = closures.pipe(\n Option.getOrElse(() => ({})),\n Rec.toEntries,\n );\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, Order, Predicate, pipe } from \"effect\";\n\nimport { splitFrontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport type { Frontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport { INDEX_SKILL } from \"#/shared/lib/index-skill.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst SKILL_DIRECTORIES = [\".agents/skills\", \".claude/skills\", \"skills\"];\nconst PLUGINS = \"plugins\";\nconst SKILLS = \"skills\";\nconst SKILL_FILE = \"SKILL.md\";\nconst READ_CONCURRENCY = 16;\n\nconst nameOf = ({ fields }: Frontmatter): Option.Option<string> =>\n Option.filter(Option.fromNullishOr(fields[\"name\"]), Predicate.isString);\n\nconst skillDirectories = Effect.fn(\"skillDirectories\")(function* skillDirectories(root: string) {\n const files = yield* RepositoryFiles;\n const plugins = yield* files.readDirectory(files.join(root, PLUGINS));\n return [\n ...SKILL_DIRECTORIES,\n ...pipe(\n plugins,\n Arr.map((plugin) => files.join(PLUGINS, plugin, SKILLS)),\n ),\n ];\n});\n\nconst skillFiles = Effect.fn(\"skillFiles\")(function* skillFiles(root: string) {\n const files = yield* RepositoryFiles;\n const directories = yield* skillDirectories(root);\n const found = yield* Effect.forEach(\n directories,\n (directory) =>\n files\n .readDirectory(files.join(root, directory))\n .pipe(Effect.map(Arr.map((name) => files.join(directory, name, SKILL_FILE)))),\n { concurrency: READ_CONCURRENCY },\n );\n return pipe(Arr.flatten(found), Arr.sortBy(Order.String));\n});\n\nconst indexNameAt = Effect.fn(\"indexNameAt\")(function* indexNameAt(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const source = yield* files.readFile(files.join(root, file));\n return pipe(\n source,\n Option.filter(() => INDEX_SKILL.test(file)),\n Option.flatMap(splitFrontmatter),\n Option.flatMap(nameOf),\n );\n});\n\nexport const indexSkillIn = Effect.fn(\"indexSkillIn\")(function* indexSkillIn(root: string) {\n const found = yield* skillFiles(root);\n const names = yield* Effect.forEach(found, (file) => indexNameAt(root, file), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.head(Arr.getSomes(names));\n});\n","import { Schema } from \"effect\";\n\nconst Enabled = Schema.Literals([\"error\", \"deny\"]);\n\nconst EnabledWithOptions = Schema.mutable(\n Schema.TupleWithRest(Schema.Tuple([Enabled]), [Schema.Unknown]),\n);\n\nconst AddedRule = Schema.Union([Enabled, EnabledWithOptions]);\n\nexport const AddedRules = Schema.Record(Schema.String, AddedRule);\n\nexport type AddedRulesValue = typeof AddedRules.Type;\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\";\nimport { INSTRUMENTATION, requiredStack } from \"#/shared/config/index.ts\";\n\nconst DEPENDENCY_SETS: Readonly<Record<string, readonly string[]>> = {\n instrumentation: requiredStack[INSTRUMENTATION] ?? [],\n};\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 [reason, allowance]: readonly [string, typeof DependencySettings.Type],\n) {\n const sets = yield* usedFrom(source.file, DEPENDENCY_SETS, 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 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 = settings.pipe(\n Option.getOrElse(() => ({})),\n Rec.toEntries,\n );\n const entries = yield* Effect.forEach(allowed, (entry) => allowanceOf(source, entry), {\n concurrency: 1,\n });\n return Rec.fromEntries(entries);\n});\n","import type { PackageJson } from \"@r_masseater/masseater-utils/kestrion\";\nimport { Array as Arr, Effect, Option, Predicate, Schema, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { literalSettings, modDirectories } from \"#/entities/workspace/index.ts\";\nimport type { WorkspaceSource } from \"#/entities/workspace/index.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.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: {\n readonly name: string;\n readonly isolate: false;\n readonly exclude?: readonly string[];\n };\n}\n\nexport type TestProject = string | SharedTestProject;\n\nexport interface ProjectPlace {\n readonly directory: string;\n readonly config: string | false;\n readonly mods: readonly string[];\n}\n\nconst DEFAULT_EXCLUDE = [\"**/node_modules/**\", \"**/.git/**\"];\n\nconst excludeOf = (mods: readonly string[]): { readonly exclude?: readonly string[] } =>\n pipe(\n mods,\n Option.liftPredicate(Arr.isReadonlyArrayNonEmpty),\n Option.match({\n onNone: () => ({}),\n onSome: (directories) => ({\n exclude: [\n ...DEFAULT_EXCLUDE,\n ...pipe(\n directories,\n Arr.map((directory) => `${directory}**/*.test.{ts,tsx}`),\n ),\n ],\n }),\n }),\n );\n\nexport const sharedTestProject =\n (manifest: Option.Option<PackageJson>) =>\n ({ directory, config, mods }: 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 ...excludeOf(mods),\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 const files = yield* RepositoryFiles;\n const mods = yield* modDirectories(files.dirname(source.file));\n return sharedTestProject(manifest)({ directory: source.directory, config, mods });\n});\n\nexport type VitestProject = NonNullable<NonNullable<UserConfig[\"test\"]>[\"projects\"]>[number];\n\nconst excludeCopy = (exclude: readonly string[] | undefined): { exclude?: string[] } =>\n pipe(\n Option.fromUndefinedOr(exclude),\n Option.match({ onNone: () => ({}), onSome: (patterns) => ({ exclude: [...patterns] }) }),\n );\n\n/** @internal */\nexport const vitestProjectOf = (project: TestProject): VitestProject => {\n if (Predicate.isString(project)) {\n return project;\n }\n const { name, isolate, exclude } = project.test;\n return {\n extends: project.extends,\n root: project.root,\n test: { name, isolate, ...excludeCopy(exclude) },\n };\n};\n","import { PACKAGE_JSON_FILE } from \"@r_masseater/masseater-utils/kestrion\";\nimport { decodePackageJson } from \"@r_masseater/masseater-utils/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, Schema, pipe } from \"effect\";\nimport type { OxlintOverride } from \"vite-plus/lint\";\n\nimport { readManifest } from \"#/entities/package/index.ts\";\nimport {\n deployEntries,\n indexSkillIn,\n literalSettings,\n modDirectories,\n merged,\n sourcePlugins,\n programOf,\n settingsInvalid,\n siteEntries,\n structureMembers,\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 { AddedRules } from \"#/shared/lib/added-rules.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 } from \"./dependency-allowances.ts\";\nimport { sharedTestProject, testProjectOf, vitestProjectOf } from \"./test-project.ts\";\nimport type { TestProject, VitestProject } from \"./test-project.ts\";\nimport { publicEntryFiles } from \"./workspace-public-entries.ts\";\n\nconst CONFIG_FILE = \"vite.config.ts\";\nconst READ_CONCURRENCY = 16;\nconst MSCH_LINT = [\"msch\", \"lint\"] as const;\nconst MSCH_TEXT = [\"msch\", \"text\"] as const;\nconst ZENN_FILES = [\"articles/**/*.md\", \"books/**/*.md\"];\n\nconst decodeRules = Schema.decodeUnknownEffect(AddedRules);\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.Record(Schema.String, Schema.Unknown),\n});\nconst WorkspaceLintSettings = Schema.Struct({\n overrides: WorkspaceOverride.pipe(Schema.Array, Schema.optional),\n});\n\nconst WorkspaceTextSettings = Schema.Struct({ use: Schema.Array(Schema.Literal(\"zenn\")) });\n\nexport interface WorkspaceLint {\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 plugins: readonly string[];\n readonly ignoredDirectories: readonly IgnoredDirectory[];\n readonly testProjects: readonly VitestProject[];\n readonly tasks: WorkspaceTasks;\n readonly devDependencies: DependencyAllowances;\n readonly dependencies: DependencyAllowances;\n readonly indexSkill: Option.Option<string>;\n readonly articles: readonly string[];\n}\n\nexport interface SettingsOptions {\n readonly root: string;\n}\n\ninterface Workspace {\n readonly directory: 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 readonly articles: readonly string[];\n}\n\nconst overrideOf = Effect.fn(\"overrideOf\")(function* overrideOf(\n source: WorkspaceSource,\n override: typeof WorkspaceOverride.Type,\n) {\n const { file, directory } = source;\n const rules = yield* decodeRules(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) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_LINT,\n decode: Schema.decodeUnknownEffect(WorkspaceLintSettings, { onExcessProperty: \"error\" }),\n });\n const lint = Option.getOrElse(settings, (): typeof WorkspaceLintSettings.Type => ({}));\n const overrides = yield* Effect.forEach(\n lint.overrides ?? [],\n (override) => overrideOf(source, override),\n { concurrency: 1 },\n );\n return { overrides };\n});\n\nconst articlesOf = Effect.fn(\"articlesOf\")(function* articlesOf(source: WorkspaceSource) {\n const settings = yield* literalSettings({\n source,\n path: MSCH_TEXT,\n decode: Schema.decodeUnknownEffect(WorkspaceTextSettings, { onExcessProperty: \"error\" }),\n });\n return pipe(\n settings,\n Option.filter(({ use }) => Arr.contains(use, \"zenn\")),\n Option.map(() => pipe(ZENN_FILES, Arr.map(prefixed(source.directory)))),\n Option.getOrElse((): readonly string[] => []),\n );\n});\n\nconst settingsOf = Effect.fn(\"settingsOf\")(function* settingsOf(source: WorkspaceSource) {\n const lint = yield* lintOf(source);\n const articles = yield* articlesOf(source);\n const devDependencies = yield* allowancesOf(source, MSCH_DEV_DEPENDENCIES);\n const dependencies = yield* allowancesOf(source, 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 articles,\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 const mods = yield* modDirectories(files.join(root, directory));\n return {\n directory,\n overrides: [],\n articles: [],\n devDependencies: {},\n dependencies: {},\n ownTests: false,\n testProject: sharedTestProject(manifest)({ directory, config: false, mods }),\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 });\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 test: pipe(\n found,\n Arr.flatMap(({ tasks }) => tasks.test),\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: yield* structureMembers(options.root, directories),\n plugins: yield* sourcePlugins(options.root, directories),\n ignoredDirectories: yield* collectIgnoredDirectories(options.root),\n lint: {\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 }) => vitestProjectOf(testProject)),\n ),\n tasks: mergedTasks(found),\n ...mergedAllowances(found),\n indexSkill: yield* indexSkillIn(options.root),\n articles: pipe(\n found,\n Arr.flatMap(({ articles }) => articles),\n ),\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":";;;;;;;;;;;;AAMA,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;AACxB,MAAMA,qBAAmB;AAEzB,MAAM,WAAW,OAAO,GAAG,UAAU,CAAC,CAAC,UAAU,SAAS,MAAc,WAAmB;CACzF,MAAM,QAAQ,OAAO;CACrB,OAAO,OAAO,MAAM,OAAO,MAAM,KAAK,MAAM,WAAW,eAAe,CAAC;AACzE,CAAC;AAED,MAAa,mBAAmB,OAAO,GAAG,kBAAkB,CAAC,CAAC,UAAU,iBACtE,MACA,aACA;CACA,OAAO,OAAO,OAAO,OAAO,cAAc,cAAc,SAAS,MAAM,SAAS,GAAG,EACjF,aAAaA,mBACf,CAAC;AACH,CAAC;AAED,MAAa,gBAAgB,OAAO,GAAG,eAAe,CAAC,CAAC,UAAU,cAChE,MACA,aACA;CACA,MAAM,UAAU,OAAO,iBAAiB,MAAM,WAAW;CACzD,MAAM,WAAW,OAAO,kBAAkB,IAAI;CAC9C,MAAM,YAAY,KAChB,UACAC,MAAI,QAAQ,YAAY,QAAQ,SAAS,GACzCA,MAAI,KAAK,EAAE,gBAAgB,SAAS,CACtC;CACA,OAAO,KACL,SACAA,MAAI,QAAQ,cAAc,CAACA,MAAI,SAAS,WAAW,SAAS,CAAC,CAC/D;AACF,CAAC;AAED,MAAa,mBAAmB,OAAO,GAAG,kBAAkB,CAAC,CAAC,UAAU,iBACtE,MACA,aACA;CACA,MAAM,UAAU,OAAO,iBAAiB,MAAM,WAAW;CACzD,OAAO,KACL,aACAA,MAAI,QAAQ,cAAc,cAAc,kBAAkB,CAACA,MAAI,SAAS,SAAS,SAAS,CAAC,CAC7F;AACF,CAAC;;AC9CD,MAAMC,qBAAmB;AAC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