@effect/language-service 0.59.0 → 0.61.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/README.md +3 -1
- package/cli.js +20 -10
- package/cli.js.map +1 -1
- package/effect-lsp-patch-utils.js +9 -3
- package/effect-lsp-patch-utils.js.map +1 -1
- package/index.js +558 -15
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/transform.js +9 -3
- package/transform.js.map +1 -1
package/README.md
CHANGED
|
@@ -100,6 +100,7 @@ And you're done! You'll now be able to use a set of refactors and diagnostics th
|
|
|
100
100
|
- Wrap an `Effect` expression with `Effect.gen`
|
|
101
101
|
- Toggle between pipe styles `X.pipe(Y)` and `pipe(X, Y)`
|
|
102
102
|
- Layer Magic: Automatically compose and build layers based on service dependencies
|
|
103
|
+
- Structural Type to Schema: Convert TypeScript interfaces and type aliases to Effect Schema classes, with automatic detection and reuse of existing schemas
|
|
103
104
|
|
|
104
105
|
### Codegens
|
|
105
106
|
|
|
@@ -141,7 +142,8 @@ Few options can be provided alongside the initialization of the Language Service
|
|
|
141
142
|
"importAliases": { "Array": "Arr" }, // allows to chose some different names for import name aliases (only when not chosing to import the whole module) (default: {})
|
|
142
143
|
"noExternal": false, // disables features that provides links to external websites (such as links to mermaidchart.com) (default: false)
|
|
143
144
|
"keyPatterns": [{ "target": "service", "pattern": "default", "skipLeadingPath": ["src/"] }], // configure the key patterns; recommended reading more on the section "Configuring Key Patterns"
|
|
144
|
-
"layerGraphFollowDepth": 0 // controls the depth level that the layer graph will follow when resolving layer dependencies, depth is counted only when exiting the currently hovered/analyzed layer definition (default: 0)
|
|
145
|
+
"layerGraphFollowDepth": 0, // controls the depth level that the layer graph will follow when resolving layer dependencies, depth is counted only when exiting the currently hovered/analyzed layer definition (default: 0)
|
|
146
|
+
"mermaidProvider": "mermaid.live" // which provider to use for mermaid, can also be a uri like http://localhost:8080 if running mermaid-live-editor locally.
|
|
145
147
|
}
|
|
146
148
|
]
|
|
147
149
|
}
|
package/cli.js
CHANGED
|
@@ -31275,7 +31275,8 @@ var defaults = {
|
|
|
31275
31275
|
}],
|
|
31276
31276
|
extendedKeyDetection: false,
|
|
31277
31277
|
pipeableMinArgCount: 1,
|
|
31278
|
-
layerGraphFollowDepth: 0
|
|
31278
|
+
layerGraphFollowDepth: 0,
|
|
31279
|
+
mermaidProvider: "mermaid.live"
|
|
31279
31280
|
};
|
|
31280
31281
|
function parseKeyPatterns(patterns) {
|
|
31281
31282
|
const result = [];
|
|
@@ -31313,7 +31314,8 @@ function parse4(config2) {
|
|
|
31313
31314
|
keyPatterns: isObject(config2) && hasProperty(config2, "keyPatterns") && isArray(config2.keyPatterns) ? parseKeyPatterns(config2.keyPatterns) : defaults.keyPatterns,
|
|
31314
31315
|
extendedKeyDetection: isObject(config2) && hasProperty(config2, "extendedKeyDetection") && isBoolean(config2.extendedKeyDetection) ? config2.extendedKeyDetection : defaults.extendedKeyDetection,
|
|
31315
31316
|
pipeableMinArgCount: isObject(config2) && hasProperty(config2, "pipeableMinArgCount") && isNumber(config2.pipeableMinArgCount) ? config2.pipeableMinArgCount : defaults.pipeableMinArgCount,
|
|
31316
|
-
layerGraphFollowDepth: isObject(config2) && hasProperty(config2, "layerGraphFollowDepth") && isNumber(config2.layerGraphFollowDepth) ? config2.layerGraphFollowDepth : defaults.layerGraphFollowDepth
|
|
31317
|
+
layerGraphFollowDepth: isObject(config2) && hasProperty(config2, "layerGraphFollowDepth") && isNumber(config2.layerGraphFollowDepth) ? config2.layerGraphFollowDepth : defaults.layerGraphFollowDepth,
|
|
31318
|
+
mermaidProvider: isObject(config2) && hasProperty(config2, "mermaidProvider") && isString(config2.mermaidProvider) ? config2.mermaidProvider : defaults.mermaidProvider
|
|
31317
31319
|
};
|
|
31318
31320
|
}
|
|
31319
31321
|
|
|
@@ -31625,7 +31627,11 @@ var getEditsForCodegen = fn2("LSP.getEditsForCodegen")(function* (codegens2, sou
|
|
|
31625
31627
|
service2(ChangeTracker),
|
|
31626
31628
|
map34((changeTracker) => {
|
|
31627
31629
|
changeTracker.deleteRange(sourceFile, range3);
|
|
31628
|
-
changeTracker.insertText(
|
|
31630
|
+
changeTracker.insertText(
|
|
31631
|
+
sourceFile,
|
|
31632
|
+
range3.pos,
|
|
31633
|
+
edit.hash.length > 0 ? `${codegen2.name}:${edit.hash}` : codegen2.name
|
|
31634
|
+
);
|
|
31629
31635
|
})
|
|
31630
31636
|
);
|
|
31631
31637
|
return {
|
|
@@ -33552,11 +33558,15 @@ var verbose = boolean5("verbose").pipe(
|
|
|
33552
33558
|
withDefault3(false),
|
|
33553
33559
|
withDescription3("Verbose output.")
|
|
33554
33560
|
);
|
|
33561
|
+
var force = boolean5("force").pipe(
|
|
33562
|
+
withDefault3(false),
|
|
33563
|
+
withDescription3("Force codegen even if no changes are needed.")
|
|
33564
|
+
);
|
|
33555
33565
|
var BATCH_SIZE = 50;
|
|
33556
33566
|
var codegen = make58(
|
|
33557
33567
|
"codegen",
|
|
33558
|
-
{ file: file4, project: project2, verbose },
|
|
33559
|
-
fn("codegen")(function* ({ file: file5, project: project3, verbose: verbose2 }) {
|
|
33568
|
+
{ file: file4, project: project2, verbose, force },
|
|
33569
|
+
fn("codegen")(function* ({ file: file5, force: force3, project: project3, verbose: verbose2 }) {
|
|
33560
33570
|
const path2 = yield* Path2;
|
|
33561
33571
|
const fs = yield* FileSystem;
|
|
33562
33572
|
const tsInstance = yield* getTypeScript;
|
|
@@ -33620,7 +33630,7 @@ var codegen = make58(
|
|
|
33620
33630
|
getEditsForCodegen([codegen2], sourceFile, range3),
|
|
33621
33631
|
orElse14(() => void_8)
|
|
33622
33632
|
);
|
|
33623
|
-
if (applicable && applicable.hash !== hash2) {
|
|
33633
|
+
if (applicable && (applicable.hash !== hash2 || force3)) {
|
|
33624
33634
|
const changes2 = tsInstance.textChanges.ChangeTracker.with(
|
|
33625
33635
|
{
|
|
33626
33636
|
formatContext,
|
|
@@ -36794,7 +36804,7 @@ var moduleNames = choice3("module", [
|
|
|
36794
36804
|
repeated4,
|
|
36795
36805
|
withDescription3("The name of the module to patch.")
|
|
36796
36806
|
);
|
|
36797
|
-
var
|
|
36807
|
+
var force2 = boolean5("force").pipe(
|
|
36798
36808
|
withDefault3(false),
|
|
36799
36809
|
withDescription3("Force patch even if already patched.")
|
|
36800
36810
|
);
|
|
@@ -36996,8 +37006,8 @@ var printRememberPrepareScript = fn("printRememberPrepareScript")(function* () {
|
|
|
36996
37006
|
}, ignore2);
|
|
36997
37007
|
var patch9 = make58(
|
|
36998
37008
|
"patch",
|
|
36999
|
-
{ dirPath: dirPath2, moduleNames, force },
|
|
37000
|
-
fn("patch")(function* ({ dirPath: dirPath4, force:
|
|
37009
|
+
{ dirPath: dirPath2, moduleNames, force: force2 },
|
|
37010
|
+
fn("patch")(function* ({ dirPath: dirPath4, force: force3, moduleNames: moduleNames3 }) {
|
|
37001
37011
|
const fs = yield* FileSystem;
|
|
37002
37012
|
const { version: effectLspVersion } = yield* getPackageJsonData(__dirname);
|
|
37003
37013
|
yield* logDebug2(`Searching for typescript in ${dirPath4}...`);
|
|
@@ -37012,7 +37022,7 @@ var patch9 = make58(
|
|
|
37012
37022
|
yield* logDebug2(
|
|
37013
37023
|
`Checking if ${filePath} is already patched with marker ${getPatchedMarker(effectLspVersion)}...`
|
|
37014
37024
|
);
|
|
37015
|
-
if (!
|
|
37025
|
+
if (!force3 && sourceText.indexOf(getPatchedMarker(effectLspVersion)) !== -1) {
|
|
37016
37026
|
yield* logInfo2(`${filePath} is already patched with version ${effectLspVersion}, skipped.`);
|
|
37017
37027
|
continue;
|
|
37018
37028
|
}
|