@sayoriqwq/effect-harness 0.0.5 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -77
- package/diagnostics/effect-routes.md +6 -0
- package/diagnostics/index.md +10 -0
- package/diagnostics/tsgo-routes.md +5 -0
- package/dist/src/eslint.d.ts +57 -0
- package/dist/src/eslint.js +42 -0
- package/dist/src/eslint.js.map +1 -0
- package/dist/src/index.d.ts +2 -8
- package/dist/src/index.js +2 -15
- package/dist/src/index.js.map +1 -1
- package/dist/src/prelude.d.ts +6 -0
- package/dist/src/prelude.js +161 -0
- package/dist/src/prelude.js.map +1 -0
- package/package.json +18 -17
- package/prelude-assets/effect/managed/docs/diagnostics.md +6 -0
- package/prelude-assets/effect/managed/docs/editor-policy.md +5 -0
- package/prelude-assets/effect/managed/docs/effect-code.md +5 -0
- package/prelude-assets/effect/managed/docs/index.md +14 -0
- package/prelude-assets/effect/managed/docs/managed-surfaces.md +5 -0
- package/prelude-assets/effect/managed/docs/package-config.md +20 -0
- package/prelude-assets/effect/managed/docs/quality-policy.md +5 -0
- package/prelude-assets/effect/managed/docs/source-identity.md +5 -0
- package/prelude-assets/guidance/eslint.md +15 -0
- package/HARNESS.md +0 -66
- package/dist/bin/effect-harness.d.ts +0 -2
- package/dist/bin/effect-harness.js +0 -23
- package/dist/bin/effect-harness.js.map +0 -1
- package/dist/src/cli/Main.d.ts +0 -7
- package/dist/src/cli/Main.js +0 -45
- package/dist/src/cli/Main.js.map +0 -1
- package/dist/src/harness/Errors.d.ts +0 -24
- package/dist/src/harness/Errors.js +0 -26
- package/dist/src/harness/Errors.js.map +0 -1
- package/dist/src/harness/Guardrails.d.ts +0 -7
- package/dist/src/harness/Guardrails.js +0 -50
- package/dist/src/harness/Guardrails.js.map +0 -1
- package/dist/src/harness/Model.d.ts +0 -52
- package/dist/src/harness/Model.js +0 -170
- package/dist/src/harness/Model.js.map +0 -1
- package/dist/src/harness/ModuleSources.d.ts +0 -5
- package/dist/src/harness/ModuleSources.js +0 -47
- package/dist/src/harness/ModuleSources.js.map +0 -1
- package/dist/src/harness/ProviderDiscovery.d.ts +0 -255
- package/dist/src/harness/ProviderDiscovery.js +0 -242
- package/dist/src/harness/ProviderDiscovery.js.map +0 -1
- package/dist/src/harness/SourcePin.d.ts +0 -4
- package/dist/src/harness/SourcePin.js +0 -214
- package/dist/src/harness/SourcePin.js.map +0 -1
- package/dist/src/harness/verify/JsonFields.d.ts +0 -1
- package/dist/src/harness/verify/JsonFields.js +0 -4
- package/dist/src/harness/verify/JsonFields.js.map +0 -1
- package/dist/src/harness/verify/Pipeline.d.ts +0 -7
- package/dist/src/harness/verify/Pipeline.js +0 -55
- package/dist/src/harness/verify/Pipeline.js.map +0 -1
- package/dist/src/harness/verify/ProviderProfile.d.ts +0 -3
- package/dist/src/harness/verify/ProviderProfile.js +0 -732
- package/dist/src/harness/verify/ProviderProfile.js.map +0 -1
- package/dist/src/harness/verify/ProviderRepository.d.ts +0 -4
- package/dist/src/harness/verify/ProviderRepository.js +0 -127
- package/dist/src/harness/verify/ProviderRepository.js.map +0 -1
- package/dist/src/harness/verify/Tsgo.d.ts +0 -3
- package/dist/src/harness/verify/Tsgo.js +0 -166
- package/dist/src/harness/verify/Tsgo.js.map +0 -1
- package/dist/src/harness/verify/TsgoMetadata.d.ts +0 -4
- package/dist/src/harness/verify/TsgoMetadata.js +0 -50
- package/dist/src/harness/verify/TsgoMetadata.js.map +0 -1
- package/dist/src/harness/verify/TsgoPolicy.d.ts +0 -208
- package/dist/src/harness/verify/TsgoPolicy.js +0 -143
- package/dist/src/harness/verify/TsgoPolicy.js.map +0 -1
- package/dist/src/harness/verify/TsgoSuppressions.d.ts +0 -2
- package/dist/src/harness/verify/TsgoSuppressions.js +0 -24
- package/dist/src/harness/verify/TsgoSuppressions.js.map +0 -1
- package/dist/src/harness/verify/VerifyStage.d.ts +0 -62
- package/dist/src/harness/verify/VerifyStage.js +0 -85
- package/dist/src/harness/verify/VerifyStage.js.map +0 -1
- package/dist/src/platform/Json.d.ts +0 -4
- package/dist/src/platform/Json.js +0 -16
- package/dist/src/platform/Json.js.map +0 -1
- package/dist/src/platform/Process.d.ts +0 -6
- package/dist/src/platform/Process.js +0 -35
- package/dist/src/platform/Process.js.map +0 -1
- package/harness/code.md +0 -83
- package/harness/diagnostic-layers.md +0 -94
- package/harness/effect-routes.md +0 -50
- package/harness/feedback-loop.md +0 -156
- package/harness/index.md +0 -83
- package/harness/offcial-guide.md +0 -50
- package/harness/offcial-migrate.md +0 -220
- package/harness/source.md +0 -91
- package/harness/tsgo-routes.md +0 -58
- package/harness/tsgo.md +0 -241
- package/provider/docs/diagnostics.md +0 -48
- package/provider/docs/discovery.md +0 -130
- package/provider/docs/editor-policy.md +0 -55
- package/provider/docs/effect-code.md +0 -41
- package/provider/docs/index.md +0 -48
- package/provider/docs/managed-surfaces.md +0 -51
- package/provider/docs/package-config.md +0 -71
- package/provider/docs/quality-policy.md +0 -68
- package/provider/docs/source-identity.md +0 -48
- package/provider/effect-harness.provider.json +0 -1021
- package/provider/index.md +0 -193
- package/provider/snippets/agents.md +0 -34
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { Effect, FileSystem, Result } from 'effect';
|
|
2
|
-
import { readJson } from "../../platform/Json.js";
|
|
3
|
-
import { commandString } from "../../platform/Process.js";
|
|
4
|
-
import { errorMessage, HarnessError } from "../Errors.js";
|
|
5
|
-
import { isRecord } from "./JsonFields.js";
|
|
6
|
-
import { readTsgoStrictRuleMap } from "./TsgoMetadata.js";
|
|
7
|
-
import { expectedEffectTsgoVersion, expectedPackageBaseline, requiredTsgoPolicyKeywords, strictDiagnosticGate, strictDiagnosticSeverity, strictLanguageServicePlugin, } from "./TsgoPolicy.js";
|
|
8
|
-
import { assertNoEffectDiagnosticSuppressions } from "./TsgoSuppressions.js";
|
|
9
|
-
function decodeJsonRecord(value, source) {
|
|
10
|
-
return isRecord(value)
|
|
11
|
-
? Effect.succeed(value)
|
|
12
|
-
: Effect.fail(new HarnessError({ message: `${source} must be a JSON object` }));
|
|
13
|
-
}
|
|
14
|
-
function recordField(errors, record, key, source) {
|
|
15
|
-
if (record === undefined) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
const value = record[key];
|
|
19
|
-
if (!isRecord(value)) {
|
|
20
|
-
errors.push(`${source}.${key} must be an object.`);
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
function arrayField(errors, record, key, source) {
|
|
26
|
-
if (record === undefined) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
const value = record[key];
|
|
30
|
-
if (!Array.isArray(value)) {
|
|
31
|
-
errors.push(`${source}.${key} must be an array.`);
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
return value;
|
|
35
|
-
}
|
|
36
|
-
function assertStringValue(errors, actual, expected, source) {
|
|
37
|
-
if (actual !== expected) {
|
|
38
|
-
errors.push(`${source} is ${String(actual ?? 'missing')}; expected ${expected}.`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function stableJson(value) {
|
|
42
|
-
if (Array.isArray(value)) {
|
|
43
|
-
return `[${value.map(stableJson).join(',')}]`;
|
|
44
|
-
}
|
|
45
|
-
if (isRecord(value)) {
|
|
46
|
-
return `{${Object.keys(value).sort().map(key => `${JSON.stringify(key)}:${stableJson(value[key])}`).join(',')}}`;
|
|
47
|
-
}
|
|
48
|
-
return JSON.stringify(value);
|
|
49
|
-
}
|
|
50
|
-
function assertDeepEqual(errors, actual, expected, source) {
|
|
51
|
-
if (stableJson(actual) !== stableJson(expected)) {
|
|
52
|
-
errors.push(`${source} does not match the strict tsgo policy.`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function findLanguageServicePlugin(errors, plugins, source) {
|
|
56
|
-
if (plugins === undefined) {
|
|
57
|
-
return undefined;
|
|
58
|
-
}
|
|
59
|
-
for (const plugin of plugins) {
|
|
60
|
-
if (isRecord(plugin) && plugin.name === '@effect/language-service') {
|
|
61
|
-
return plugin;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
errors.push(`${source} must include @effect/language-service plugin.`);
|
|
65
|
-
return undefined;
|
|
66
|
-
}
|
|
67
|
-
function assertLanguageServicePlugin(errors, plugin, source) {
|
|
68
|
-
if (plugin === undefined) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if ('options' in plugin) {
|
|
72
|
-
errors.push(`${source} must use the current @effect/language-service plugin shape.`);
|
|
73
|
-
}
|
|
74
|
-
if ('overrides' in plugin) {
|
|
75
|
-
errors.push(`${source}.overrides must not lower the strict tsgo policy.`);
|
|
76
|
-
}
|
|
77
|
-
if (plugin.diagnosticSeverity === null) {
|
|
78
|
-
errors.push(`${source}.diagnosticSeverity must not be null.`);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
assertDeepEqual(errors, plugin, strictLanguageServicePlugin, source);
|
|
82
|
-
}
|
|
83
|
-
function assertTsconfig(errors, tsconfig, source) {
|
|
84
|
-
const compilerOptions = recordField(errors, tsconfig, 'compilerOptions', source);
|
|
85
|
-
const plugins = arrayField(errors, compilerOptions, 'plugins', `${source}.compilerOptions`);
|
|
86
|
-
assertLanguageServicePlugin(errors, findLanguageServicePlugin(errors, plugins, `${source}.compilerOptions.plugins`), `${source}.compilerOptions.plugins[@effect/language-service]`);
|
|
87
|
-
}
|
|
88
|
-
function assertProviderTsgoPolicy(errors, codexProfile) {
|
|
89
|
-
const tsgoPolicy = recordField(errors, codexProfile, 'tsgoPolicy', 'provider profile.profiles.codex-effect-v4');
|
|
90
|
-
assertStringValue(errors, tsgoPolicy?.mode, 'strict-v4', 'provider profile tsgoPolicy.mode');
|
|
91
|
-
assertStringValue(errors, tsgoPolicy?.effectVersion, expectedPackageBaseline.effect, 'provider profile tsgoPolicy.effectVersion');
|
|
92
|
-
assertStringValue(errors, tsgoPolicy?.tsgoVersion, expectedPackageBaseline['@effect/tsgo'], 'provider profile tsgoPolicy.tsgoVersion');
|
|
93
|
-
assertStringValue(errors, tsgoPolicy?.languageServiceVersion, expectedPackageBaseline['@effect/language-service'], 'provider profile tsgoPolicy.languageServiceVersion');
|
|
94
|
-
assertStringValue(errors, tsgoPolicy?.sourceEntry, 'tsgo-official-source', 'provider profile tsgoPolicy.sourceEntry');
|
|
95
|
-
const nativeBackend = recordField(errors, tsgoPolicy, 'nativeBackend', 'provider profile tsgoPolicy');
|
|
96
|
-
assertStringValue(errors, nativeBackend?.package, '@typescript/native-preview', 'provider profile tsgoPolicy.nativeBackend.package');
|
|
97
|
-
assertStringValue(errors, nativeBackend?.version, expectedPackageBaseline['@typescript/native-preview'], 'provider profile tsgoPolicy.nativeBackend.version');
|
|
98
|
-
const diagnosticGate = recordField(errors, tsgoPolicy, 'diagnosticGate', 'provider profile tsgoPolicy');
|
|
99
|
-
assertDeepEqual(errors, diagnosticGate, strictDiagnosticGate, 'provider profile tsgoPolicy.diagnosticGate');
|
|
100
|
-
const ruleMapSource = recordField(errors, tsgoPolicy, 'ruleMapSource', 'provider profile tsgoPolicy');
|
|
101
|
-
assertStringValue(errors, ruleMapSource?.metadata, 'repos/tsgo/_packages/tsgo/src/metadata.json', 'provider profile tsgoPolicy.ruleMapSource.metadata');
|
|
102
|
-
assertStringValue(errors, ruleMapSource?.policy, 'harness/tsgo.md', 'provider profile tsgoPolicy.ruleMapSource.policy');
|
|
103
|
-
assertStringValue(errors, ruleMapSource?.supportedEffect, 'v4', 'provider profile tsgoPolicy.ruleMapSource.supportedEffect');
|
|
104
|
-
if (ruleMapSource?.ruleCount !== Object.keys(strictDiagnosticSeverity).length) {
|
|
105
|
-
errors.push(`provider profile tsgoPolicy.ruleMapSource.ruleCount is ${String(ruleMapSource?.ruleCount ?? 'missing')}; expected ${Object.keys(strictDiagnosticSeverity).length}.`);
|
|
106
|
-
}
|
|
107
|
-
assertDeepEqual(errors, recordField(errors, tsgoPolicy, 'diagnosticSeverity', 'provider profile tsgoPolicy'), strictDiagnosticSeverity, 'provider profile tsgoPolicy.diagnosticSeverity');
|
|
108
|
-
assertDeepEqual(errors, recordField(errors, tsgoPolicy, 'languageServicePlugin', 'provider profile tsgoPolicy'), strictLanguageServicePlugin, 'provider profile tsgoPolicy.languageServicePlugin');
|
|
109
|
-
}
|
|
110
|
-
function assertProviderTsgoContribution(errors, profile) {
|
|
111
|
-
const profiles = recordField(errors, profile, 'profiles', 'provider profile');
|
|
112
|
-
const codexProfile = recordField(errors, profiles, 'codex-effect-v4', 'provider profile.profiles');
|
|
113
|
-
const contributions = recordField(errors, codexProfile, 'contributions', 'provider profile.profiles.codex-effect-v4');
|
|
114
|
-
const tsconfig = recordField(errors, contributions, 'tsconfig', 'provider profile.profiles.codex-effect-v4.contributions');
|
|
115
|
-
const compilerOptions = recordField(errors, tsconfig, 'compilerOptions', 'provider profile contributions tsconfig');
|
|
116
|
-
const plugins = arrayField(errors, compilerOptions, 'plugins', 'provider profile contributions tsconfig.compilerOptions');
|
|
117
|
-
assertLanguageServicePlugin(errors, findLanguageServicePlugin(errors, plugins, 'provider profile contributions tsconfig.compilerOptions.plugins'), 'provider profile contributions tsconfig.compilerOptions.plugins[@effect/language-service]');
|
|
118
|
-
assertProviderTsgoPolicy(errors, codexProfile);
|
|
119
|
-
}
|
|
120
|
-
function assertStrictRuleMap(errors, metadataRuleMap) {
|
|
121
|
-
assertDeepEqual(errors, metadataRuleMap, strictDiagnosticSeverity, 'repos/tsgo metadata derived strict rule map');
|
|
122
|
-
}
|
|
123
|
-
function assertTsgoPolicyDocument(errors, text) {
|
|
124
|
-
for (const keyword of requiredTsgoPolicyKeywords) {
|
|
125
|
-
if (!text.includes(keyword)) {
|
|
126
|
-
errors.push(`harness/tsgo.md must contain policy keyword ${keyword}.`);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
for (const ruleName of Object.keys(strictDiagnosticSeverity)) {
|
|
130
|
-
if (!text.includes(ruleName)) {
|
|
131
|
-
errors.push(`harness/tsgo.md POLICY_RULE_MAP must record ${ruleName}.`);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
const verifyEffectTsgoBinary = Effect.fnUntraced(function* (errors, root) {
|
|
136
|
-
const result = yield* Effect.result(commandString('pnpm', ['exec', 'effect-tsgo', '--version'], { cwd: root }));
|
|
137
|
-
if (Result.isFailure(result)) {
|
|
138
|
-
errors.push(`effect-tsgo --version failed: ${errorMessage(result.failure)}`);
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
if (!result.success.includes(expectedEffectTsgoVersion)) {
|
|
142
|
-
errors.push(`effect-tsgo version output is ${result.success}; expected ${expectedEffectTsgoVersion}.`);
|
|
143
|
-
}
|
|
144
|
-
const tsgoResult = yield* Effect.result(commandString('pnpm', ['exec', 'tsgo', '--version'], { cwd: root }));
|
|
145
|
-
if (Result.isFailure(tsgoResult)) {
|
|
146
|
-
errors.push(`tsgo --version failed: ${errorMessage(tsgoResult.failure)}`);
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (!tsgoResult.success.includes(`effect-tsgo.${expectedEffectTsgoVersion}`)) {
|
|
150
|
-
errors.push(`tsgo version output is ${tsgoResult.success}; expected Effect TypeScript-Go ${expectedEffectTsgoVersion}.`);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
export const verifyTsgoBaseline = Effect.fnUntraced(function* (errors, harness) {
|
|
154
|
-
const fs = yield* FileSystem.FileSystem;
|
|
155
|
-
const tsconfig = yield* readJson(`${harness}/tsconfig.json`, decodeJsonRecord);
|
|
156
|
-
const providerProfile = yield* readJson(`${harness}/provider/effect-harness.provider.json`, decodeJsonRecord);
|
|
157
|
-
const tsgoPolicyText = yield* fs.readFileString(`${harness}/harness/tsgo.md`);
|
|
158
|
-
const metadataRuleMap = yield* readTsgoStrictRuleMap(harness);
|
|
159
|
-
assertTsconfig(errors, tsconfig, 'tsconfig.json');
|
|
160
|
-
assertProviderTsgoContribution(errors, providerProfile);
|
|
161
|
-
assertStrictRuleMap(errors, metadataRuleMap);
|
|
162
|
-
assertTsgoPolicyDocument(errors, tsgoPolicyText);
|
|
163
|
-
yield* assertNoEffectDiagnosticSuppressions(errors, harness);
|
|
164
|
-
yield* verifyEffectTsgoBinary(errors, harness);
|
|
165
|
-
});
|
|
166
|
-
//# sourceMappingURL=Tsgo.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Tsgo.js","sourceRoot":"","sources":["../../../../src/harness/verify/Tsgo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AACzD,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,oCAAoC,EAAE,MAAM,uBAAuB,CAAA;AAE5E,SAAS,gBAAgB,CAAC,KAAc,EAAE,MAAc;IACtD,OAAO,QAAQ,CAAC,KAAK,CAAC;QACpB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QACvB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,MAAM,wBAAwB,EAAE,CAAC,CAAC,CAAA;AACnF,CAAC;AAED,SAAS,WAAW,CAClB,MAAqB,EACrB,MAA2C,EAC3C,GAAW,EACX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AwB,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAChD,KAAK,CAAC,CAAC,oCAAoC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5D,KAAK,CAAC,CAAC,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAChD,CAAC,CAAC,CAAA","sourcesContent":["import { Effect, FileSystem, Result } from 'effect'\nimport { readJson } from '../../platform/Json.ts'\nimport { commandString } from '../../platform/Process.ts'\nimport { errorMessage, HarnessError } from '../Errors.ts'\nimport { isRecord } from './JsonFields.ts'\nimport { readTsgoStrictRuleMap } from './TsgoMetadata.ts'\nimport {\n expectedEffectTsgoVersion,\n expectedPackageBaseline,\n requiredTsgoPolicyKeywords,\n strictDiagnosticGate,\n strictDiagnosticSeverity,\n strictLanguageServicePlugin,\n} from './TsgoPolicy.ts'\nimport { assertNoEffectDiagnosticSuppressions } from './TsgoSuppressions.ts'\n\nfunction decodeJsonRecord(value: unknown, source: string) {\n return isRecord(value)\n ? Effect.succeed(value)\n : Effect.fail(new HarnessError({ message: `${source} must be a JSON object` }))\n}\n\nfunction recordField(\n errors: Array<string>,\n record: Record<string, unknown> | undefined,\n key: string,\n source: string,\n): Record<string, unknown> | undefined {\n if (record === undefined) {\n return undefined\n }\n const value = record[key]\n if (!isRecord(value)) {\n errors.push(`${source}.${key} must be an object.`)\n return undefined\n }\n return value\n}\n\nfunction arrayField(\n errors: Array<string>,\n record: Record<string, unknown> | undefined,\n key: string,\n source: string,\n): ReadonlyArray<unknown> | undefined {\n if (record === undefined) {\n return undefined\n }\n const value = record[key]\n if (!Array.isArray(value)) {\n errors.push(`${source}.${key} must be an array.`)\n return undefined\n }\n return value\n}\n\nfunction assertStringValue(\n errors: Array<string>,\n actual: unknown,\n expected: string,\n source: string,\n): void {\n if (actual !== expected) {\n errors.push(`${source} is ${String(actual ?? 'missing')}; expected ${expected}.`)\n }\n}\n\nfunction stableJson(value: unknown): string {\n if (Array.isArray(value)) {\n return `[${value.map(stableJson).join(',')}]`\n }\n if (isRecord(value)) {\n return `{${Object.keys(value).sort().map(key => `${JSON.stringify(key)}:${stableJson(value[key])}`).join(',')}}`\n }\n return JSON.stringify(value)\n}\n\nfunction assertDeepEqual(errors: Array<string>, actual: unknown, expected: unknown, source: string): void {\n if (stableJson(actual) !== stableJson(expected)) {\n errors.push(`${source} does not match the strict tsgo policy.`)\n }\n}\n\nfunction findLanguageServicePlugin(\n errors: Array<string>,\n plugins: ReadonlyArray<unknown> | undefined,\n source: string,\n): Record<string, unknown> | undefined {\n if (plugins === undefined) {\n return undefined\n }\n\n for (const plugin of plugins) {\n if (isRecord(plugin) && plugin.name === '@effect/language-service') {\n return plugin\n }\n }\n\n errors.push(`${source} must include @effect/language-service plugin.`)\n return undefined\n}\n\nfunction assertLanguageServicePlugin(\n errors: Array<string>,\n plugin: Record<string, unknown> | undefined,\n source: string,\n): void {\n if (plugin === undefined) {\n return\n }\n\n if ('options' in plugin) {\n errors.push(`${source} must use the current @effect/language-service plugin shape.`)\n }\n if ('overrides' in plugin) {\n errors.push(`${source}.overrides must not lower the strict tsgo policy.`)\n }\n if (plugin.diagnosticSeverity === null) {\n errors.push(`${source}.diagnosticSeverity must not be null.`)\n return\n }\n\n assertDeepEqual(errors, plugin, strictLanguageServicePlugin, source)\n}\n\nfunction assertTsconfig(errors: Array<string>, tsconfig: Record<string, unknown>, source: string): void {\n const compilerOptions = recordField(errors, tsconfig, 'compilerOptions', source)\n const plugins = arrayField(errors, compilerOptions, 'plugins', `${source}.compilerOptions`)\n assertLanguageServicePlugin(\n errors,\n findLanguageServicePlugin(errors, plugins, `${source}.compilerOptions.plugins`),\n `${source}.compilerOptions.plugins[@effect/language-service]`,\n )\n}\n\nfunction assertProviderTsgoPolicy(errors: Array<string>, codexProfile: Record<string, unknown> | undefined): void {\n const tsgoPolicy = recordField(errors, codexProfile, 'tsgoPolicy', 'provider profile.profiles.codex-effect-v4')\n assertStringValue(errors, tsgoPolicy?.mode, 'strict-v4', 'provider profile tsgoPolicy.mode')\n assertStringValue(errors, tsgoPolicy?.effectVersion, expectedPackageBaseline.effect, 'provider profile tsgoPolicy.effectVersion')\n assertStringValue(errors, tsgoPolicy?.tsgoVersion, expectedPackageBaseline['@effect/tsgo'], 'provider profile tsgoPolicy.tsgoVersion')\n assertStringValue(errors, tsgoPolicy?.languageServiceVersion, expectedPackageBaseline['@effect/language-service'], 'provider profile tsgoPolicy.languageServiceVersion')\n assertStringValue(errors, tsgoPolicy?.sourceEntry, 'tsgo-official-source', 'provider profile tsgoPolicy.sourceEntry')\n\n const nativeBackend = recordField(errors, tsgoPolicy, 'nativeBackend', 'provider profile tsgoPolicy')\n assertStringValue(errors, nativeBackend?.package, '@typescript/native-preview', 'provider profile tsgoPolicy.nativeBackend.package')\n assertStringValue(errors, nativeBackend?.version, expectedPackageBaseline['@typescript/native-preview'], 'provider profile tsgoPolicy.nativeBackend.version')\n\n const diagnosticGate = recordField(errors, tsgoPolicy, 'diagnosticGate', 'provider profile tsgoPolicy')\n assertDeepEqual(errors, diagnosticGate, strictDiagnosticGate, 'provider profile tsgoPolicy.diagnosticGate')\n\n const ruleMapSource = recordField(errors, tsgoPolicy, 'ruleMapSource', 'provider profile tsgoPolicy')\n assertStringValue(errors, ruleMapSource?.metadata, 'repos/tsgo/_packages/tsgo/src/metadata.json', 'provider profile tsgoPolicy.ruleMapSource.metadata')\n assertStringValue(errors, ruleMapSource?.policy, 'harness/tsgo.md', 'provider profile tsgoPolicy.ruleMapSource.policy')\n assertStringValue(errors, ruleMapSource?.supportedEffect, 'v4', 'provider profile tsgoPolicy.ruleMapSource.supportedEffect')\n if (ruleMapSource?.ruleCount !== Object.keys(strictDiagnosticSeverity).length) {\n errors.push(`provider profile tsgoPolicy.ruleMapSource.ruleCount is ${String(ruleMapSource?.ruleCount ?? 'missing')}; expected ${Object.keys(strictDiagnosticSeverity).length}.`)\n }\n\n assertDeepEqual(\n errors,\n recordField(errors, tsgoPolicy, 'diagnosticSeverity', 'provider profile tsgoPolicy'),\n strictDiagnosticSeverity,\n 'provider profile tsgoPolicy.diagnosticSeverity',\n )\n assertDeepEqual(\n errors,\n recordField(errors, tsgoPolicy, 'languageServicePlugin', 'provider profile tsgoPolicy'),\n strictLanguageServicePlugin,\n 'provider profile tsgoPolicy.languageServicePlugin',\n )\n}\n\nfunction assertProviderTsgoContribution(errors: Array<string>, profile: Record<string, unknown>): void {\n const profiles = recordField(errors, profile, 'profiles', 'provider profile')\n const codexProfile = recordField(errors, profiles, 'codex-effect-v4', 'provider profile.profiles')\n const contributions = recordField(errors, codexProfile, 'contributions', 'provider profile.profiles.codex-effect-v4')\n\n const tsconfig = recordField(errors, contributions, 'tsconfig', 'provider profile.profiles.codex-effect-v4.contributions')\n const compilerOptions = recordField(errors, tsconfig, 'compilerOptions', 'provider profile contributions tsconfig')\n const plugins = arrayField(errors, compilerOptions, 'plugins', 'provider profile contributions tsconfig.compilerOptions')\n assertLanguageServicePlugin(\n errors,\n findLanguageServicePlugin(errors, plugins, 'provider profile contributions tsconfig.compilerOptions.plugins'),\n 'provider profile contributions tsconfig.compilerOptions.plugins[@effect/language-service]',\n )\n assertProviderTsgoPolicy(errors, codexProfile)\n}\n\nfunction assertStrictRuleMap(errors: Array<string>, metadataRuleMap: Readonly<Record<string, string>>): void {\n assertDeepEqual(errors, metadataRuleMap, strictDiagnosticSeverity, 'repos/tsgo metadata derived strict rule map')\n}\n\nfunction assertTsgoPolicyDocument(errors: Array<string>, text: string): void {\n for (const keyword of requiredTsgoPolicyKeywords) {\n if (!text.includes(keyword)) {\n errors.push(`harness/tsgo.md must contain policy keyword ${keyword}.`)\n }\n }\n for (const ruleName of Object.keys(strictDiagnosticSeverity)) {\n if (!text.includes(ruleName)) {\n errors.push(`harness/tsgo.md POLICY_RULE_MAP must record ${ruleName}.`)\n }\n }\n}\n\nconst verifyEffectTsgoBinary = Effect.fnUntraced(function* (errors: Array<string>, root: string) {\n const result = yield* Effect.result(commandString('pnpm', ['exec', 'effect-tsgo', '--version'], { cwd: root }))\n\n if (Result.isFailure(result)) {\n errors.push(`effect-tsgo --version failed: ${errorMessage(result.failure)}`)\n return\n }\n\n if (!result.success.includes(expectedEffectTsgoVersion)) {\n errors.push(`effect-tsgo version output is ${result.success}; expected ${expectedEffectTsgoVersion}.`)\n }\n\n const tsgoResult = yield* Effect.result(commandString('pnpm', ['exec', 'tsgo', '--version'], { cwd: root }))\n\n if (Result.isFailure(tsgoResult)) {\n errors.push(`tsgo --version failed: ${errorMessage(tsgoResult.failure)}`)\n return\n }\n\n if (!tsgoResult.success.includes(`effect-tsgo.${expectedEffectTsgoVersion}`)) {\n errors.push(`tsgo version output is ${tsgoResult.success}; expected Effect TypeScript-Go ${expectedEffectTsgoVersion}.`)\n }\n})\n\nexport const verifyTsgoBaseline = Effect.fnUntraced(function* (errors: Array<string>, harness: string) {\n const fs = yield* FileSystem.FileSystem\n const tsconfig = yield* readJson(`${harness}/tsconfig.json`, decodeJsonRecord)\n const providerProfile = yield* readJson(`${harness}/provider/effect-harness.provider.json`, decodeJsonRecord)\n const tsgoPolicyText = yield* fs.readFileString(`${harness}/harness/tsgo.md`)\n const metadataRuleMap = yield* readTsgoStrictRuleMap(harness)\n\n assertTsconfig(errors, tsconfig, 'tsconfig.json')\n assertProviderTsgoContribution(errors, providerProfile)\n assertStrictRuleMap(errors, metadataRuleMap)\n assertTsgoPolicyDocument(errors, tsgoPolicyText)\n yield* assertNoEffectDiagnosticSuppressions(errors, harness)\n yield* verifyEffectTsgoBinary(errors, harness)\n})\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { TsgoDiagnosticSeverity } from './TsgoPolicy.ts';
|
|
2
|
-
import { Effect } from 'effect';
|
|
3
|
-
import { HarnessError } from '../Errors.ts';
|
|
4
|
-
export declare const readTsgoStrictRuleMap: (root: string) => Effect.Effect<Readonly<Record<string, TsgoDiagnosticSeverity>>, HarnessError | import("effect/PlatformError").PlatformError, import("effect/FileSystem").FileSystem>;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Effect } from 'effect';
|
|
2
|
-
import { readJson } from "../../platform/Json.js";
|
|
3
|
-
import { HarnessError } from "../Errors.js";
|
|
4
|
-
import { isRecord } from "./JsonFields.js";
|
|
5
|
-
function decodeTsgoMetadata(value, source) {
|
|
6
|
-
if (!isRecord(value) || !Array.isArray(value.rules)) {
|
|
7
|
-
return Effect.fail(new HarnessError({ message: `${source} must contain a rules array.` }));
|
|
8
|
-
}
|
|
9
|
-
const rules = [];
|
|
10
|
-
for (const [index, rule] of value.rules.entries()) {
|
|
11
|
-
if (!isRecord(rule)) {
|
|
12
|
-
return Effect.fail(new HarnessError({ message: `${source}.rules[${index}] must be an object.` }));
|
|
13
|
-
}
|
|
14
|
-
if (typeof rule.name !== 'string'
|
|
15
|
-
|| typeof rule.group !== 'string'
|
|
16
|
-
|| typeof rule.defaultSeverity !== 'string'
|
|
17
|
-
|| !Array.isArray(rule.supportedEffect)
|
|
18
|
-
|| rule.supportedEffect.some(effect => typeof effect !== 'string')) {
|
|
19
|
-
return Effect.fail(new HarnessError({ message: `${source}.rules[${index}] has an invalid rule shape.` }));
|
|
20
|
-
}
|
|
21
|
-
rules.push({
|
|
22
|
-
defaultSeverity: rule.defaultSeverity,
|
|
23
|
-
group: rule.group,
|
|
24
|
-
name: rule.name,
|
|
25
|
-
supportedEffect: rule.supportedEffect,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return Effect.succeed({ rules });
|
|
29
|
-
}
|
|
30
|
-
function strictSeverity(rule) {
|
|
31
|
-
if (rule.group === 'correctness' && rule.defaultSeverity === 'off') {
|
|
32
|
-
return 'error';
|
|
33
|
-
}
|
|
34
|
-
if (rule.group === 'effectNative') {
|
|
35
|
-
return 'warning';
|
|
36
|
-
}
|
|
37
|
-
if ((rule.group === 'antipattern' || rule.group === 'style') && rule.defaultSeverity === 'off') {
|
|
38
|
-
return 'warning';
|
|
39
|
-
}
|
|
40
|
-
return rule.defaultSeverity;
|
|
41
|
-
}
|
|
42
|
-
export const readTsgoStrictRuleMap = Effect.fnUntraced(function* (root) {
|
|
43
|
-
const metadata = yield* readJson(`${root}/repos/tsgo/_packages/tsgo/src/metadata.json`, decodeTsgoMetadata);
|
|
44
|
-
const entries = metadata.rules
|
|
45
|
-
.filter(rule => rule.supportedEffect.includes('v4'))
|
|
46
|
-
.map(rule => [rule.name, strictSeverity(rule)])
|
|
47
|
-
.sort(([left], [right]) => left.localeCompare(right));
|
|
48
|
-
return Object.fromEntries(entries);
|
|
49
|
-
});
|
|
50
|
-
//# sourceMappingURL=TsgoMetadata.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TsgoMetadata.js","sourceRoot":"","sources":["../../../../src/harness/verify/TsgoMetadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAS1C,SAAS,kBAAkB,CAAC,KAAc,EAAE,MAAc;IACxD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QACpD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,MAAM,8BAA8B,EAAE,CAAC,CAAC,CAAA;IAC5F,CAAC;IAED,MAAM,KAAK,GAA4B,EAAE,CAAA;IACzC,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,YAAY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ClB,CAAC;IACD,OAAO,IAAI,CAAC,eAAyC,CAAA;AACvD,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,IAAY;IAC5E,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,IAAI,8CAA8C,EAAE,kBAAkB,CAAC,CAAA;IAC3G,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK;SAC3B,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SACnD,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,CAAU,CAAC;SACvD,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAA;IAEvD,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAqD,CAAA;AACxF,CAAC,CAAC,CAAA","sourcesContent":["import type { TsgoDiagnosticSeverity } from './TsgoPolicy.ts'\nimport { Effect } from 'effect'\nimport { readJson } from '../../platform/Json.ts'\nimport { HarnessError } from '../Errors.ts'\nimport { isRecord } from './JsonFields.ts'\n\ninterface TsgoRuleMetadata {\n readonly name: string\n readonly group: string\n readonly defaultSeverity: string\n readonly supportedEffect: ReadonlyArray<string>\n}\n\nfunction decodeTsgoMetadata(value: unknown, source: string) {\n if (!isRecord(value) || !Array.isArray(value.rules)) {\n return Effect.fail(new HarnessError({ message: `${source} must contain a rules array.` }))\n }\n\n const rules: Array<TsgoRuleMetadata> = []\n for (const [index, rule] of value.rules.entries()) {\n if (!isRecord(rule)) {\n return Effect.fail(new HarnessError({ message: `${source}.rules[${index}] must be an object.` }))\n }\n if (\n typeof rule.name !== 'string'\n || typeof rule.group !== 'string'\n || typeof rule.defaultSeverity !== 'string'\n || !Array.isArray(rule.supportedEffect)\n || rule.supportedEffect.some(effect => typeof effect !== 'string')\n ) {\n return Effect.fail(new HarnessError({ message: `${source}.rules[${index}] has an invalid rule shape.` }))\n }\n\n rules.push({\n defaultSeverity: rule.defaultSeverity,\n group: rule.group,\n name: rule.name,\n supportedEffect: rule.supportedEffect as ReadonlyArray<string>,\n })\n }\n\n return Effect.succeed({ rules })\n}\n\nfunction strictSeverity(rule: TsgoRuleMetadata): TsgoDiagnosticSeverity {\n if (rule.group === 'correctness' && rule.defaultSeverity === 'off') {\n return 'error'\n }\n if (rule.group === 'effectNative') {\n return 'warning'\n }\n if ((rule.group === 'antipattern' || rule.group === 'style') && rule.defaultSeverity === 'off') {\n return 'warning'\n }\n return rule.defaultSeverity as TsgoDiagnosticSeverity\n}\n\nexport const readTsgoStrictRuleMap = Effect.fnUntraced(function* (root: string) {\n const metadata = yield* readJson(`${root}/repos/tsgo/_packages/tsgo/src/metadata.json`, decodeTsgoMetadata)\n const entries = metadata.rules\n .filter(rule => rule.supportedEffect.includes('v4'))\n .map(rule => [rule.name, strictSeverity(rule)] as const)\n .sort(([left], [right]) => left.localeCompare(right))\n\n return Object.fromEntries(entries) as Readonly<Record<string, TsgoDiagnosticSeverity>>\n})\n"]}
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
export type TsgoDiagnosticSeverity = 'error' | 'message' | 'suggestion' | 'warning';
|
|
2
|
-
export declare const expectedPackageBaseline: {
|
|
3
|
-
readonly effect: "4.0.0-beta.92";
|
|
4
|
-
readonly '@effect/platform-node': "4.0.0-beta.92";
|
|
5
|
-
readonly '@effect/vitest': "4.0.0-beta.92";
|
|
6
|
-
readonly '@effect/tsgo': "0.15.0";
|
|
7
|
-
readonly '@effect/language-service': "0.86.2";
|
|
8
|
-
readonly '@typescript/native-preview': "7.0.0-dev.20260630.1";
|
|
9
|
-
readonly '@antfu/eslint-config': "^9.0.0";
|
|
10
|
-
readonly eslint: "^10.3.0";
|
|
11
|
-
readonly vitest: "^4.1.8";
|
|
12
|
-
};
|
|
13
|
-
export declare const expectedEffectTsgoVersion = "0.15.0";
|
|
14
|
-
export declare const expectedPrepareCommand = "effect-tsgo patch";
|
|
15
|
-
export declare const expectedTypecheckCommand = "tsgo --noEmit";
|
|
16
|
-
export declare const strictDiagnosticSeverity: {
|
|
17
|
-
readonly anyUnknownInErrorContext: "error";
|
|
18
|
-
readonly asyncFunction: "warning";
|
|
19
|
-
readonly catchAllToMapError: "suggestion";
|
|
20
|
-
readonly catchToOrElseSucceed: "suggestion";
|
|
21
|
-
readonly catchUnfailableEffect: "suggestion";
|
|
22
|
-
readonly classSelfMismatch: "error";
|
|
23
|
-
readonly cryptoRandomUUID: "warning";
|
|
24
|
-
readonly cryptoRandomUUIDInEffect: "warning";
|
|
25
|
-
readonly deterministicKeys: "warning";
|
|
26
|
-
readonly duplicatePackage: "warning";
|
|
27
|
-
readonly effectDoNotation: "warning";
|
|
28
|
-
readonly effectFnIife: "warning";
|
|
29
|
-
readonly effectFnImplicitAny: "error";
|
|
30
|
-
readonly effectFnOpportunity: "suggestion";
|
|
31
|
-
readonly effectGenUsesAdapter: "warning";
|
|
32
|
-
readonly effectInFailure: "warning";
|
|
33
|
-
readonly effectInVoidSuccess: "warning";
|
|
34
|
-
readonly effectMapFlatten: "suggestion";
|
|
35
|
-
readonly effectMapVoid: "suggestion";
|
|
36
|
-
readonly effectSucceedWithVoid: "suggestion";
|
|
37
|
-
readonly extendsNativeError: "warning";
|
|
38
|
-
readonly floatingEffect: "error";
|
|
39
|
-
readonly genericEffectServices: "warning";
|
|
40
|
-
readonly globalConsole: "warning";
|
|
41
|
-
readonly globalConsoleInEffect: "warning";
|
|
42
|
-
readonly globalDate: "warning";
|
|
43
|
-
readonly globalDateInEffect: "warning";
|
|
44
|
-
readonly globalErrorInEffectCatch: "warning";
|
|
45
|
-
readonly globalErrorInEffectFailure: "warning";
|
|
46
|
-
readonly globalFetch: "warning";
|
|
47
|
-
readonly globalFetchInEffect: "warning";
|
|
48
|
-
readonly globalRandom: "warning";
|
|
49
|
-
readonly globalRandomInEffect: "warning";
|
|
50
|
-
readonly globalTimers: "warning";
|
|
51
|
-
readonly globalTimersInEffect: "warning";
|
|
52
|
-
readonly instanceOfSchema: "warning";
|
|
53
|
-
readonly layerMergeAllWithDependencies: "warning";
|
|
54
|
-
readonly lazyEffect: "suggestion";
|
|
55
|
-
readonly lazyPromiseInEffectSync: "warning";
|
|
56
|
-
readonly leakingRequirements: "suggestion";
|
|
57
|
-
readonly missedPipeableOpportunity: "warning";
|
|
58
|
-
readonly missingEffectContext: "error";
|
|
59
|
-
readonly missingEffectError: "error";
|
|
60
|
-
readonly missingLayerContext: "error";
|
|
61
|
-
readonly missingReturnYieldStar: "error";
|
|
62
|
-
readonly missingStarInYieldEffectGen: "error";
|
|
63
|
-
readonly multipleCatchTag: "suggestion";
|
|
64
|
-
readonly multipleEffectProvide: "warning";
|
|
65
|
-
readonly nestedEffectGenYield: "warning";
|
|
66
|
-
readonly newPromise: "warning";
|
|
67
|
-
readonly newSchemaClass: "warning";
|
|
68
|
-
readonly nodeBuiltinImport: "warning";
|
|
69
|
-
readonly outdatedApi: "warning";
|
|
70
|
-
readonly overriddenSchemaConstructor: "error";
|
|
71
|
-
readonly preferSchemaOverJson: "warning";
|
|
72
|
-
readonly processEnv: "warning";
|
|
73
|
-
readonly processEnvInEffect: "warning";
|
|
74
|
-
readonly redundantMapError: "suggestion";
|
|
75
|
-
readonly redundantOrDie: "suggestion";
|
|
76
|
-
readonly redundantSchemaTagIdentifier: "suggestion";
|
|
77
|
-
readonly returnEffectInGen: "suggestion";
|
|
78
|
-
readonly runEffectInsideEffect: "suggestion";
|
|
79
|
-
readonly schemaNumber: "suggestion";
|
|
80
|
-
readonly schemaStructWithTag: "suggestion";
|
|
81
|
-
readonly serviceNotAsClass: "warning";
|
|
82
|
-
readonly strictBooleanExpressions: "warning";
|
|
83
|
-
readonly strictEffectProvide: "warning";
|
|
84
|
-
readonly tryCatchInEffectGen: "suggestion";
|
|
85
|
-
readonly unknownInEffectCatch: "warning";
|
|
86
|
-
readonly unnecessaryArrowBlock: "warning";
|
|
87
|
-
readonly unnecessaryEffectGen: "suggestion";
|
|
88
|
-
readonly unnecessaryFailYieldableError: "suggestion";
|
|
89
|
-
readonly unnecessaryPipe: "suggestion";
|
|
90
|
-
readonly unnecessaryPipeChain: "suggestion";
|
|
91
|
-
readonly unnecessaryTypeofType: "suggestion";
|
|
92
|
-
readonly unsafeEffectTypeAssertion: "warning";
|
|
93
|
-
};
|
|
94
|
-
export declare const strictDiagnosticGate: {
|
|
95
|
-
readonly includeSuggestionsInTsc: true;
|
|
96
|
-
readonly ignoreEffectSuggestionsInTscExitCode: false;
|
|
97
|
-
readonly ignoreEffectWarningsInTscExitCode: false;
|
|
98
|
-
readonly ignoreEffectErrorsInTscExitCode: false;
|
|
99
|
-
};
|
|
100
|
-
export declare const strictLanguageServicePlugin: {
|
|
101
|
-
readonly diagnosticSeverity: {
|
|
102
|
-
readonly anyUnknownInErrorContext: "error";
|
|
103
|
-
readonly asyncFunction: "warning";
|
|
104
|
-
readonly catchAllToMapError: "suggestion";
|
|
105
|
-
readonly catchToOrElseSucceed: "suggestion";
|
|
106
|
-
readonly catchUnfailableEffect: "suggestion";
|
|
107
|
-
readonly classSelfMismatch: "error";
|
|
108
|
-
readonly cryptoRandomUUID: "warning";
|
|
109
|
-
readonly cryptoRandomUUIDInEffect: "warning";
|
|
110
|
-
readonly deterministicKeys: "warning";
|
|
111
|
-
readonly duplicatePackage: "warning";
|
|
112
|
-
readonly effectDoNotation: "warning";
|
|
113
|
-
readonly effectFnIife: "warning";
|
|
114
|
-
readonly effectFnImplicitAny: "error";
|
|
115
|
-
readonly effectFnOpportunity: "suggestion";
|
|
116
|
-
readonly effectGenUsesAdapter: "warning";
|
|
117
|
-
readonly effectInFailure: "warning";
|
|
118
|
-
readonly effectInVoidSuccess: "warning";
|
|
119
|
-
readonly effectMapFlatten: "suggestion";
|
|
120
|
-
readonly effectMapVoid: "suggestion";
|
|
121
|
-
readonly effectSucceedWithVoid: "suggestion";
|
|
122
|
-
readonly extendsNativeError: "warning";
|
|
123
|
-
readonly floatingEffect: "error";
|
|
124
|
-
readonly genericEffectServices: "warning";
|
|
125
|
-
readonly globalConsole: "warning";
|
|
126
|
-
readonly globalConsoleInEffect: "warning";
|
|
127
|
-
readonly globalDate: "warning";
|
|
128
|
-
readonly globalDateInEffect: "warning";
|
|
129
|
-
readonly globalErrorInEffectCatch: "warning";
|
|
130
|
-
readonly globalErrorInEffectFailure: "warning";
|
|
131
|
-
readonly globalFetch: "warning";
|
|
132
|
-
readonly globalFetchInEffect: "warning";
|
|
133
|
-
readonly globalRandom: "warning";
|
|
134
|
-
readonly globalRandomInEffect: "warning";
|
|
135
|
-
readonly globalTimers: "warning";
|
|
136
|
-
readonly globalTimersInEffect: "warning";
|
|
137
|
-
readonly instanceOfSchema: "warning";
|
|
138
|
-
readonly layerMergeAllWithDependencies: "warning";
|
|
139
|
-
readonly lazyEffect: "suggestion";
|
|
140
|
-
readonly lazyPromiseInEffectSync: "warning";
|
|
141
|
-
readonly leakingRequirements: "suggestion";
|
|
142
|
-
readonly missedPipeableOpportunity: "warning";
|
|
143
|
-
readonly missingEffectContext: "error";
|
|
144
|
-
readonly missingEffectError: "error";
|
|
145
|
-
readonly missingLayerContext: "error";
|
|
146
|
-
readonly missingReturnYieldStar: "error";
|
|
147
|
-
readonly missingStarInYieldEffectGen: "error";
|
|
148
|
-
readonly multipleCatchTag: "suggestion";
|
|
149
|
-
readonly multipleEffectProvide: "warning";
|
|
150
|
-
readonly nestedEffectGenYield: "warning";
|
|
151
|
-
readonly newPromise: "warning";
|
|
152
|
-
readonly newSchemaClass: "warning";
|
|
153
|
-
readonly nodeBuiltinImport: "warning";
|
|
154
|
-
readonly outdatedApi: "warning";
|
|
155
|
-
readonly overriddenSchemaConstructor: "error";
|
|
156
|
-
readonly preferSchemaOverJson: "warning";
|
|
157
|
-
readonly processEnv: "warning";
|
|
158
|
-
readonly processEnvInEffect: "warning";
|
|
159
|
-
readonly redundantMapError: "suggestion";
|
|
160
|
-
readonly redundantOrDie: "suggestion";
|
|
161
|
-
readonly redundantSchemaTagIdentifier: "suggestion";
|
|
162
|
-
readonly returnEffectInGen: "suggestion";
|
|
163
|
-
readonly runEffectInsideEffect: "suggestion";
|
|
164
|
-
readonly schemaNumber: "suggestion";
|
|
165
|
-
readonly schemaStructWithTag: "suggestion";
|
|
166
|
-
readonly serviceNotAsClass: "warning";
|
|
167
|
-
readonly strictBooleanExpressions: "warning";
|
|
168
|
-
readonly strictEffectProvide: "warning";
|
|
169
|
-
readonly tryCatchInEffectGen: "suggestion";
|
|
170
|
-
readonly unknownInEffectCatch: "warning";
|
|
171
|
-
readonly unnecessaryArrowBlock: "warning";
|
|
172
|
-
readonly unnecessaryEffectGen: "suggestion";
|
|
173
|
-
readonly unnecessaryFailYieldableError: "suggestion";
|
|
174
|
-
readonly unnecessaryPipe: "suggestion";
|
|
175
|
-
readonly unnecessaryPipeChain: "suggestion";
|
|
176
|
-
readonly unnecessaryTypeofType: "suggestion";
|
|
177
|
-
readonly unsafeEffectTypeAssertion: "warning";
|
|
178
|
-
};
|
|
179
|
-
readonly barrelImportPackages: readonly ["effect"];
|
|
180
|
-
readonly topLevelNamedReexports: "follow";
|
|
181
|
-
readonly effectFn: readonly ["span"];
|
|
182
|
-
readonly keyPatterns: readonly [{
|
|
183
|
-
readonly target: "service";
|
|
184
|
-
readonly pattern: "default";
|
|
185
|
-
readonly skipLeadingPath: readonly ["src/"];
|
|
186
|
-
}, {
|
|
187
|
-
readonly target: "error";
|
|
188
|
-
readonly pattern: "default";
|
|
189
|
-
readonly skipLeadingPath: readonly ["src/"];
|
|
190
|
-
}, {
|
|
191
|
-
readonly target: "custom";
|
|
192
|
-
readonly pattern: "default";
|
|
193
|
-
readonly skipLeadingPath: readonly ["src/"];
|
|
194
|
-
}];
|
|
195
|
-
readonly extendedKeyDetection: true;
|
|
196
|
-
readonly layerGraphFollowDepth: 1;
|
|
197
|
-
readonly noExternal: true;
|
|
198
|
-
readonly inlays: true;
|
|
199
|
-
readonly allowedDuplicatedPackages: readonly [];
|
|
200
|
-
readonly pipeableMinArgCount: 2;
|
|
201
|
-
readonly includeSuggestionsInTsc: true;
|
|
202
|
-
readonly ignoreEffectSuggestionsInTscExitCode: false;
|
|
203
|
-
readonly ignoreEffectWarningsInTscExitCode: false;
|
|
204
|
-
readonly ignoreEffectErrorsInTscExitCode: false;
|
|
205
|
-
readonly name: "@effect/language-service";
|
|
206
|
-
readonly diagnostics: true;
|
|
207
|
-
};
|
|
208
|
-
export declare const requiredTsgoPolicyKeywords: readonly ["POLICY_NATIVE_BACKEND", "POLICY_DIAGNOSTIC_GATE", "POLICY_RULE_MAP", "POLICY_IMPORT_STYLE", "POLICY_OVERRIDES", "POLICY_SUPPRESSIONS", "POLICY_KEY_PATTERNS", "POLICY_LAYER_GRAPH", "POLICY_UPGRADE_LOOP", "VERIFIER_CONTRACT"];
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
export const expectedPackageBaseline = {
|
|
2
|
-
'effect': '4.0.0-beta.92',
|
|
3
|
-
'@effect/platform-node': '4.0.0-beta.92',
|
|
4
|
-
'@effect/vitest': '4.0.0-beta.92',
|
|
5
|
-
'@effect/tsgo': '0.15.0',
|
|
6
|
-
'@effect/language-service': '0.86.2',
|
|
7
|
-
'@typescript/native-preview': '7.0.0-dev.20260630.1',
|
|
8
|
-
'@antfu/eslint-config': '^9.0.0',
|
|
9
|
-
'eslint': '^10.3.0',
|
|
10
|
-
'vitest': '^4.1.8',
|
|
11
|
-
};
|
|
12
|
-
export const expectedEffectTsgoVersion = '0.15.0';
|
|
13
|
-
export const expectedPrepareCommand = 'effect-tsgo patch';
|
|
14
|
-
export const expectedTypecheckCommand = 'tsgo --noEmit';
|
|
15
|
-
export const strictDiagnosticSeverity = {
|
|
16
|
-
anyUnknownInErrorContext: 'error',
|
|
17
|
-
asyncFunction: 'warning',
|
|
18
|
-
catchAllToMapError: 'suggestion',
|
|
19
|
-
catchToOrElseSucceed: 'suggestion',
|
|
20
|
-
catchUnfailableEffect: 'suggestion',
|
|
21
|
-
classSelfMismatch: 'error',
|
|
22
|
-
cryptoRandomUUID: 'warning',
|
|
23
|
-
cryptoRandomUUIDInEffect: 'warning',
|
|
24
|
-
deterministicKeys: 'warning',
|
|
25
|
-
duplicatePackage: 'warning',
|
|
26
|
-
effectDoNotation: 'warning',
|
|
27
|
-
effectFnIife: 'warning',
|
|
28
|
-
effectFnImplicitAny: 'error',
|
|
29
|
-
effectFnOpportunity: 'suggestion',
|
|
30
|
-
effectGenUsesAdapter: 'warning',
|
|
31
|
-
effectInFailure: 'warning',
|
|
32
|
-
effectInVoidSuccess: 'warning',
|
|
33
|
-
effectMapFlatten: 'suggestion',
|
|
34
|
-
effectMapVoid: 'suggestion',
|
|
35
|
-
effectSucceedWithVoid: 'suggestion',
|
|
36
|
-
extendsNativeError: 'warning',
|
|
37
|
-
floatingEffect: 'error',
|
|
38
|
-
genericEffectServices: 'warning',
|
|
39
|
-
globalConsole: 'warning',
|
|
40
|
-
globalConsoleInEffect: 'warning',
|
|
41
|
-
globalDate: 'warning',
|
|
42
|
-
globalDateInEffect: 'warning',
|
|
43
|
-
globalErrorInEffectCatch: 'warning',
|
|
44
|
-
globalErrorInEffectFailure: 'warning',
|
|
45
|
-
globalFetch: 'warning',
|
|
46
|
-
globalFetchInEffect: 'warning',
|
|
47
|
-
globalRandom: 'warning',
|
|
48
|
-
globalRandomInEffect: 'warning',
|
|
49
|
-
globalTimers: 'warning',
|
|
50
|
-
globalTimersInEffect: 'warning',
|
|
51
|
-
instanceOfSchema: 'warning',
|
|
52
|
-
layerMergeAllWithDependencies: 'warning',
|
|
53
|
-
lazyEffect: 'suggestion',
|
|
54
|
-
lazyPromiseInEffectSync: 'warning',
|
|
55
|
-
leakingRequirements: 'suggestion',
|
|
56
|
-
missedPipeableOpportunity: 'warning',
|
|
57
|
-
missingEffectContext: 'error',
|
|
58
|
-
missingEffectError: 'error',
|
|
59
|
-
missingLayerContext: 'error',
|
|
60
|
-
missingReturnYieldStar: 'error',
|
|
61
|
-
missingStarInYieldEffectGen: 'error',
|
|
62
|
-
multipleCatchTag: 'suggestion',
|
|
63
|
-
multipleEffectProvide: 'warning',
|
|
64
|
-
nestedEffectGenYield: 'warning',
|
|
65
|
-
newPromise: 'warning',
|
|
66
|
-
newSchemaClass: 'warning',
|
|
67
|
-
nodeBuiltinImport: 'warning',
|
|
68
|
-
outdatedApi: 'warning',
|
|
69
|
-
overriddenSchemaConstructor: 'error',
|
|
70
|
-
preferSchemaOverJson: 'warning',
|
|
71
|
-
processEnv: 'warning',
|
|
72
|
-
processEnvInEffect: 'warning',
|
|
73
|
-
redundantMapError: 'suggestion',
|
|
74
|
-
redundantOrDie: 'suggestion',
|
|
75
|
-
redundantSchemaTagIdentifier: 'suggestion',
|
|
76
|
-
returnEffectInGen: 'suggestion',
|
|
77
|
-
runEffectInsideEffect: 'suggestion',
|
|
78
|
-
schemaNumber: 'suggestion',
|
|
79
|
-
schemaStructWithTag: 'suggestion',
|
|
80
|
-
serviceNotAsClass: 'warning',
|
|
81
|
-
strictBooleanExpressions: 'warning',
|
|
82
|
-
strictEffectProvide: 'warning',
|
|
83
|
-
tryCatchInEffectGen: 'suggestion',
|
|
84
|
-
unknownInEffectCatch: 'warning',
|
|
85
|
-
unnecessaryArrowBlock: 'warning',
|
|
86
|
-
unnecessaryEffectGen: 'suggestion',
|
|
87
|
-
unnecessaryFailYieldableError: 'suggestion',
|
|
88
|
-
unnecessaryPipe: 'suggestion',
|
|
89
|
-
unnecessaryPipeChain: 'suggestion',
|
|
90
|
-
unnecessaryTypeofType: 'suggestion',
|
|
91
|
-
unsafeEffectTypeAssertion: 'warning',
|
|
92
|
-
};
|
|
93
|
-
export const strictDiagnosticGate = {
|
|
94
|
-
includeSuggestionsInTsc: true,
|
|
95
|
-
ignoreEffectSuggestionsInTscExitCode: false,
|
|
96
|
-
ignoreEffectWarningsInTscExitCode: false,
|
|
97
|
-
ignoreEffectErrorsInTscExitCode: false,
|
|
98
|
-
};
|
|
99
|
-
export const strictLanguageServicePlugin = {
|
|
100
|
-
name: '@effect/language-service',
|
|
101
|
-
diagnostics: true,
|
|
102
|
-
...strictDiagnosticGate,
|
|
103
|
-
diagnosticSeverity: strictDiagnosticSeverity,
|
|
104
|
-
barrelImportPackages: ['effect'],
|
|
105
|
-
topLevelNamedReexports: 'follow',
|
|
106
|
-
effectFn: ['span'],
|
|
107
|
-
keyPatterns: [
|
|
108
|
-
{
|
|
109
|
-
target: 'service',
|
|
110
|
-
pattern: 'default',
|
|
111
|
-
skipLeadingPath: ['src/'],
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
target: 'error',
|
|
115
|
-
pattern: 'default',
|
|
116
|
-
skipLeadingPath: ['src/'],
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
target: 'custom',
|
|
120
|
-
pattern: 'default',
|
|
121
|
-
skipLeadingPath: ['src/'],
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
extendedKeyDetection: true,
|
|
125
|
-
layerGraphFollowDepth: 1,
|
|
126
|
-
noExternal: true,
|
|
127
|
-
inlays: true,
|
|
128
|
-
allowedDuplicatedPackages: [],
|
|
129
|
-
pipeableMinArgCount: 2,
|
|
130
|
-
};
|
|
131
|
-
export const requiredTsgoPolicyKeywords = [
|
|
132
|
-
'POLICY_NATIVE_BACKEND',
|
|
133
|
-
'POLICY_DIAGNOSTIC_GATE',
|
|
134
|
-
'POLICY_RULE_MAP',
|
|
135
|
-
'POLICY_IMPORT_STYLE',
|
|
136
|
-
'POLICY_OVERRIDES',
|
|
137
|
-
'POLICY_SUPPRESSIONS',
|
|
138
|
-
'POLICY_KEY_PATTERNS',
|
|
139
|
-
'POLICY_LAYER_GRAPH',
|
|
140
|
-
'POLICY_UPGRADE_LOOP',
|
|
141
|
-
'VERIFIER_CONTRACT',
|
|
142
|
-
];
|
|
143
|
-
//# sourceMappingURL=TsgoPolicy.js.map
|