@effect/tsgo 0.36.0 → 0.36.2
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/effect-tsgo.cjs +52 -16
- package/package.json +8 -8
package/dist/effect-tsgo.cjs
CHANGED
|
@@ -197939,7 +197939,7 @@ var FileReadError = class extends TaggedError$1("FileReadError") {
|
|
|
197939
197939
|
//#endregion
|
|
197940
197940
|
//#region package.json
|
|
197941
197941
|
var name = "@effect/tsgo";
|
|
197942
|
-
var version = "0.36.
|
|
197942
|
+
var version = "0.36.2";
|
|
197943
197943
|
|
|
197944
197944
|
//#endregion
|
|
197945
197945
|
//#region src/cli/setup/consts.ts
|
|
@@ -198521,16 +198521,54 @@ function deleteNodeFromList(tracker, sourceFile, nodeArray, nodeToDelete) {
|
|
|
198521
198521
|
});
|
|
198522
198522
|
} else tracker.delete(sourceFile, nodeToDelete);
|
|
198523
198523
|
}
|
|
198524
|
+
const emptyListInsertions = /* @__PURE__ */ new WeakMap();
|
|
198524
198525
|
/**
|
|
198525
198526
|
* Insert a node at the end of a list (array or object properties), handling commas properly
|
|
198526
198527
|
*/
|
|
198527
198528
|
function insertNodeAtEndOfList(tracker, sourceFile, nodeArray, newNode) {
|
|
198528
|
-
|
|
198529
|
-
|
|
198529
|
+
const formatOptions = getFormatOptions(sourceFile);
|
|
198530
|
+
if (nodeArray.length === 0) {
|
|
198531
|
+
const insertedLists = emptyListInsertions.get(tracker) ?? /* @__PURE__ */ new WeakSet();
|
|
198532
|
+
const hasPreviousInsertion = insertedLists.has(nodeArray);
|
|
198533
|
+
insertedLists.add(nodeArray);
|
|
198534
|
+
emptyListInsertions.set(tracker, insertedLists);
|
|
198535
|
+
const closingIndentation = getIndentationAtPosition(sourceFile, nodeArray.pos, formatOptions.tabSize);
|
|
198536
|
+
const hasFollowingLineBreak = /^[ \t]*\r?\n/.test(sourceFile.text.slice(nodeArray.pos));
|
|
198537
|
+
tracker.insertNodeAt(sourceFile, nodeArray.pos, newNode, {
|
|
198538
|
+
indentation: closingIndentation.column + formatOptions.indentSize,
|
|
198539
|
+
prefix: formatOptions.newLineCharacter,
|
|
198540
|
+
suffix: hasPreviousInsertion ? "," : hasFollowingLineBreak ? "" : `${formatOptions.newLineCharacter}${closingIndentation.text}`
|
|
198541
|
+
});
|
|
198542
|
+
} else {
|
|
198530
198543
|
const lastElement = nodeArray[nodeArray.length - 1];
|
|
198531
|
-
|
|
198544
|
+
const indentation = getIndentationAtPosition(sourceFile, lastElement.getStart(sourceFile), formatOptions.tabSize);
|
|
198545
|
+
tracker.insertNodeAt(sourceFile, lastElement.end, newNode, {
|
|
198546
|
+
indentation: indentation.column,
|
|
198547
|
+
prefix: `,${formatOptions.newLineCharacter}`
|
|
198548
|
+
});
|
|
198532
198549
|
}
|
|
198533
198550
|
}
|
|
198551
|
+
function getFormatOptions(sourceFile) {
|
|
198552
|
+
const indentation = sourceFile.text.match(/^([ \t]+)\S/m)?.[1];
|
|
198553
|
+
const indentSize = indentation?.includes(" ") ? 2 : indentation?.length ?? 2;
|
|
198554
|
+
const newLineCharacter = sourceFile.text.includes("\r\n") ? "\r\n" : "\n";
|
|
198555
|
+
return {
|
|
198556
|
+
...import_typescript.getDefaultFormatCodeSettings(newLineCharacter),
|
|
198557
|
+
indentSize,
|
|
198558
|
+
tabSize: indentSize,
|
|
198559
|
+
convertTabsToSpaces: !indentation?.includes(" "),
|
|
198560
|
+
newLineCharacter
|
|
198561
|
+
};
|
|
198562
|
+
}
|
|
198563
|
+
function getIndentationAtPosition(sourceFile, position, tabSize) {
|
|
198564
|
+
const { line } = sourceFile.getLineAndCharacterOfPosition(position);
|
|
198565
|
+
const lineStart = sourceFile.getPositionOfLineAndCharacter(line, 0);
|
|
198566
|
+
const text = sourceFile.text.slice(lineStart, position).match(/^[ \t]*/)?.[0] ?? "";
|
|
198567
|
+
return {
|
|
198568
|
+
column: [...text].reduce((column, character) => character === " " ? column + tabSize - column % tabSize : column + 1, 0),
|
|
198569
|
+
text
|
|
198570
|
+
};
|
|
198571
|
+
}
|
|
198534
198572
|
function findDependencyCollectionProperty(rootObj, dependencyType) {
|
|
198535
198573
|
return findPropertyInObject(rootObj, dependencyType);
|
|
198536
198574
|
}
|
|
@@ -198578,14 +198616,12 @@ const tsInternal = import_typescript;
|
|
|
198578
198616
|
/**
|
|
198579
198617
|
* Create a ChangeTracker context
|
|
198580
198618
|
*/
|
|
198581
|
-
function createTrackerContext() {
|
|
198619
|
+
function createTrackerContext(sourceFile) {
|
|
198582
198620
|
const host = createMinimalHost();
|
|
198621
|
+
const formatOptions = getFormatOptions(sourceFile);
|
|
198583
198622
|
return {
|
|
198584
198623
|
host,
|
|
198585
|
-
formatContext: tsInternal.formatting.getFormatContext(
|
|
198586
|
-
indentSize: 2,
|
|
198587
|
-
tabSize: 2
|
|
198588
|
-
}, host),
|
|
198624
|
+
formatContext: tsInternal.formatting.getFormatContext(formatOptions, host),
|
|
198589
198625
|
preferences: {}
|
|
198590
198626
|
};
|
|
198591
198627
|
}
|
|
@@ -198597,7 +198633,7 @@ const computePackageJsonChanges = (current, target) => {
|
|
|
198597
198633
|
const messages = [];
|
|
198598
198634
|
const rootObj = getRootObject(current.sourceFile);
|
|
198599
198635
|
if (!rootObj) return emptyFileChangesResult();
|
|
198600
|
-
const ctx = createTrackerContext();
|
|
198636
|
+
const ctx = createTrackerContext(current.sourceFile);
|
|
198601
198637
|
const fileChange = tsInternal.textChanges.ChangeTracker.with(ctx, (tracker) => {
|
|
198602
198638
|
const shouldAddTypescriptWithDependencyType = (dependencyType) => isSome(target.typescriptVersion) && isNone(current.typescriptVersion) && target.typescriptVersion.value.dependencyType === dependencyType;
|
|
198603
198639
|
const getTypescriptPackageName = (dependency) => dependency.packageName ?? defaultTypescriptPackageNames[0];
|
|
@@ -198767,7 +198803,7 @@ const computeTsConfigChanges = (current, target, lspVersion) => {
|
|
|
198767
198803
|
if (!target.manageIntegration) return emptyFileChangesResult();
|
|
198768
198804
|
const schemaProperty = findPropertyInObject(rootObj, "$schema");
|
|
198769
198805
|
if (!isEffectSchemaProperty(schemaProperty)) return emptyFileChangesResult();
|
|
198770
|
-
const ctx = createTrackerContext();
|
|
198806
|
+
const ctx = createTrackerContext(current.sourceFile);
|
|
198771
198807
|
const fileChange = tsInternal.textChanges.ChangeTracker.with(ctx, (tracker) => {
|
|
198772
198808
|
descriptions.push("Remove $schema from tsconfig");
|
|
198773
198809
|
deleteNodeFromList(tracker, current.sourceFile, rootObj.properties, schemaProperty);
|
|
@@ -198784,7 +198820,7 @@ const computeTsConfigChanges = (current, target, lspVersion) => {
|
|
|
198784
198820
|
messages
|
|
198785
198821
|
};
|
|
198786
198822
|
}
|
|
198787
|
-
const ctx = createTrackerContext();
|
|
198823
|
+
const ctx = createTrackerContext(current.sourceFile);
|
|
198788
198824
|
const fileChange = tsInternal.textChanges.ChangeTracker.with(ctx, (tracker) => {
|
|
198789
198825
|
const schemaProperty = findPropertyInObject(rootObj, "$schema");
|
|
198790
198826
|
const shouldAddSchema = isSome(target.schemaPath) && !schemaProperty;
|
|
@@ -198820,7 +198856,7 @@ const computeTsConfigChanges = (current, target, lspVersion) => {
|
|
|
198820
198856
|
};
|
|
198821
198857
|
}
|
|
198822
198858
|
const compilerOptions = compilerOptionsProperty.initializer;
|
|
198823
|
-
const ctx = createTrackerContext();
|
|
198859
|
+
const ctx = createTrackerContext(current.sourceFile);
|
|
198824
198860
|
const fileChange = tsInternal.textChanges.ChangeTracker.with(ctx, (tracker) => {
|
|
198825
198861
|
const schemaProperty = findPropertyInObject(rootObj, "$schema");
|
|
198826
198862
|
const pluginsProperty = findPropertyInObject(compilerOptions, "plugins");
|
|
@@ -198917,7 +198953,7 @@ const computeOxlintConfigChanges = (current, schemaPath) => {
|
|
|
198917
198953
|
const schemaProperty = findPropertyInObject(rootObj, "$schema");
|
|
198918
198954
|
if (schemaProperty && import_typescript.isStringLiteral(schemaProperty.initializer) && schemaProperty.initializer.text === schemaPath.value) return emptyFileChangesResult();
|
|
198919
198955
|
const schemaPropertyAssignment = import_typescript.factory.createPropertyAssignment(import_typescript.factory.createStringLiteral("$schema"), import_typescript.factory.createStringLiteral(schemaPath.value));
|
|
198920
|
-
const ctx = createTrackerContext();
|
|
198956
|
+
const ctx = createTrackerContext(current.sourceFile);
|
|
198921
198957
|
const fileChange = tsInternal.textChanges.ChangeTracker.with(ctx, (tracker) => {
|
|
198922
198958
|
if (schemaProperty) tracker.replaceNode(current.sourceFile, schemaProperty.initializer, schemaPropertyAssignment.initializer);
|
|
198923
198959
|
else tracker.insertNodeAtObjectStart(current.sourceFile, rootObj, schemaPropertyAssignment);
|
|
@@ -198943,7 +198979,7 @@ const computeVSCodeSettingsChanges = (current, target) => {
|
|
|
198943
198979
|
const messages = [];
|
|
198944
198980
|
const rootObj = getRootObject(current.sourceFile);
|
|
198945
198981
|
if (!rootObj) return emptyFileChangesResult();
|
|
198946
|
-
const ctx = createTrackerContext();
|
|
198982
|
+
const ctx = createTrackerContext(current.sourceFile);
|
|
198947
198983
|
const createSettingValue = (value) => typeof value === "string" ? import_typescript.factory.createStringLiteral(value) : typeof value === "boolean" ? value ? import_typescript.factory.createTrue() : import_typescript.factory.createFalse() : Array.isArray(value) && value.every((item) => typeof item === "string") ? import_typescript.factory.createArrayLiteralExpression(value.map((item) => import_typescript.factory.createStringLiteral(item))) : import_typescript.factory.createNull();
|
|
198948
198984
|
const fileChange = tsInternal.textChanges.ChangeTracker.with(ctx, (tracker) => {
|
|
198949
198985
|
if (rootObj.properties.length === 0) {
|
|
@@ -199940,7 +199976,7 @@ const gatherTargetOptions = (assessment) => gen(function* () {
|
|
|
199940
199976
|
var tags = {
|
|
199941
199977
|
"typescript": {
|
|
199942
199978
|
"latest": "7.0.2",
|
|
199943
|
-
"next": "7.1.0-dev.
|
|
199979
|
+
"next": "7.1.0-dev.20260808.1"
|
|
199944
199980
|
},
|
|
199945
199981
|
"oxlint": { "latest": "1.77.0" },
|
|
199946
199982
|
"oxlint-tsgolint": { "latest": "7.0.2001" }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/tsgo",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Effect Language Service for TypeScript-Go — Effect-specific diagnostics and hover features.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"schema.json"
|
|
42
42
|
],
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"@effect/tsgo-win32-x64": "0.36.
|
|
45
|
-
"@effect/tsgo-win32-arm64": "0.36.
|
|
46
|
-
"@effect/tsgo-linux-x64": "0.36.
|
|
47
|
-
"@effect/tsgo-linux-arm64": "0.36.
|
|
48
|
-
"@effect/tsgo-linux-arm": "0.36.
|
|
49
|
-
"@effect/tsgo-darwin-x64": "0.36.
|
|
50
|
-
"@effect/tsgo-darwin-arm64": "0.36.
|
|
44
|
+
"@effect/tsgo-win32-x64": "0.36.2",
|
|
45
|
+
"@effect/tsgo-win32-arm64": "0.36.2",
|
|
46
|
+
"@effect/tsgo-linux-x64": "0.36.2",
|
|
47
|
+
"@effect/tsgo-linux-arm64": "0.36.2",
|
|
48
|
+
"@effect/tsgo-linux-arm": "0.36.2",
|
|
49
|
+
"@effect/tsgo-darwin-x64": "0.36.2",
|
|
50
|
+
"@effect/tsgo-darwin-arm64": "0.36.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@effect/platform-node": "^4.0.0-beta.104",
|