Skip to content

Commit

Permalink
update to TypeScript 5.6, ts-morph 24.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajvincent committed Oct 10, 2024
1 parent 88fdee2 commit a9fe274
Show file tree
Hide file tree
Showing 8 changed files with 380 additions and 305 deletions.
140 changes: 69 additions & 71 deletions dist/exports.js

Large diffs are not rendered by default.

505 changes: 291 additions & 214 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@
"ts-node": "^10.9.2",
"tslib": "^2.6.3",
"type-fest": "^4.20.1",
"typescript": "^5.5.4",
"typescript": "^5.6.3",
"typescript-eslint": "^8.0.1",
"which": "^4.0.0"
},
"dependencies": {
"mixin-decorators": "^1.0.1"
},
"peerDependencies": {
"ts-morph": "^23.0.0"
"ts-morph": "^24.0.0"
},
"imports": {
"#stage_one/*": "./stage_1_snapshot/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* When this file fails to compile, it means `ReadonlyArrayProxyHandler.#safeMembers` may need updating.
*/
class ArrayNotImplementedCanary implements Omit<Array<unknown>, number> {
[Symbol.iterator](): IterableIterator<unknown> {
[Symbol.iterator](): ArrayIterator<unknown> {
throw new Error("Function not implemented.");
}
get [Symbol.unscopables](): {
Expand Down Expand Up @@ -88,13 +88,13 @@ class ArrayNotImplementedCanary implements Omit<Array<unknown>, number> {
copyWithin(target: number, start?: number | undefined, end?: number | undefined): unknown[] {
throw new Error("Function not implemented.");
}
entries(): IterableIterator<[number, unknown]> {
entries(): ArrayIterator<[number, unknown]> {
throw new Error("Function not implemented.");
}
keys(): IterableIterator<number> {
keys(): ArrayIterator<number> {
throw new Error("Function not implemented.");
}
values(): IterableIterator<unknown> {
values(): ArrayIterator<unknown> {
throw new Error("Function not implemented.");
}
includes(searchElement: unknown, fromIndex?: number | undefined): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* When this file fails to compile, it means `ReadonlyArrayProxyHandler.#safeMembers` may need updating.
*/
class ArrayNotImplementedCanary implements Omit<Array<unknown>, number> {
[Symbol.iterator](): IterableIterator<unknown> {
[Symbol.iterator](): ArrayIterator<unknown> {
throw new Error("Function not implemented.");
}
get [Symbol.unscopables](): {
Expand Down Expand Up @@ -88,13 +88,13 @@ class ArrayNotImplementedCanary implements Omit<Array<unknown>, number> {
copyWithin(target: number, start?: number | undefined, end?: number | undefined): unknown[] {
throw new Error("Function not implemented.");
}
entries(): IterableIterator<[number, unknown]> {
entries(): ArrayIterator<[number, unknown]> {
throw new Error("Function not implemented.");
}
keys(): IterableIterator<number> {
keys(): ArrayIterator<number> {
throw new Error("Function not implemented.");
}
values(): IterableIterator<unknown> {
values(): ArrayIterator<unknown> {
throw new Error("Function not implemented.");
}
includes(searchElement: unknown, fromIndex?: number | undefined): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* When this file fails to compile, it means `ReadonlyArrayProxyHandler.#safeMembers` may need updating.
*/
class ArrayNotImplementedCanary implements Omit<Array<unknown>, number> {
[Symbol.iterator](): IterableIterator<unknown> {
[Symbol.iterator](): ArrayIterator<unknown> {
throw new Error("Function not implemented.");
}
get [Symbol.unscopables](): {
Expand Down Expand Up @@ -133,13 +133,13 @@ class ArrayNotImplementedCanary implements Omit<Array<unknown>, number> {
): unknown[] {
throw new Error("Function not implemented.");
}
entries(): IterableIterator<[number, unknown]> {
entries(): ArrayIterator<[number, unknown]> {
throw new Error("Function not implemented.");
}
keys(): IterableIterator<number> {
keys(): ArrayIterator<number> {
throw new Error("Function not implemented.");
}
values(): IterableIterator<unknown> {
values(): ArrayIterator<unknown> {
throw new Error("Function not implemented.");
}
includes(searchElement: unknown, fromIndex?: number | undefined): boolean {
Expand Down
4 changes: 2 additions & 2 deletions use-cases/build/StringStringMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function modifyMethodSignature(method: MethodSignatureImpl): void {
if (method.name === "keys") {
const { returnTypeStructure } = method;
assert.equal(returnTypeStructure?.kind, TypeStructureKind.TypeArgumented, "Expected a type-argumented type.");
assert.equal(returnTypeStructure.objectType, LiteralTypeStructureImpl.get("IterableIterator"), "Expected an IterableIterator");
assert.equal(returnTypeStructure.objectType, LiteralTypeStructureImpl.get("MapIterator"), "Expected a MapIterator for " + method.name);
assert.equal(returnTypeStructure.childTypes.length, 1);
assert.equal(returnTypeStructure.childTypes[0], LiteralTypeStructureImpl.get("K"));

Expand All @@ -154,7 +154,7 @@ function modifyMethodSignature(method: MethodSignatureImpl): void {
if ((method.name === "entries") || (method.name === "[Symbol.iterator]")) {
const { returnTypeStructure } = method;
assert.equal(returnTypeStructure?.kind, TypeStructureKind.TypeArgumented, "Expected a type-argumented type.");
assert.equal(returnTypeStructure.objectType, LiteralTypeStructureImpl.get("IterableIterator"), "Expected an IterableIterator");
assert.equal(returnTypeStructure.objectType, LiteralTypeStructureImpl.get("MapIterator"), "Expected a MapIterator for " + method.name);
assert.equal(returnTypeStructure.childTypes.length, 1);

assert.equal(returnTypeStructure.childTypes[0].kind, TypeStructureKind.Tuple);
Expand Down
8 changes: 4 additions & 4 deletions use-cases/dist/StringStringMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class StringStringMap<V> {
}

/** Returns an iterable of entries in the map. */
*[Symbol.iterator](): IterableIterator<[string, string, V]> {
*[Symbol.iterator](): MapIterator<[string, string, V]> {
for (const x of this.#hashMap[Symbol.iterator]()) {
const [ firstKey, secondKey ] = StringStringMap.#parseKeys(x[0]);
yield [firstKey, secondKey, x[1]];
Expand All @@ -83,14 +83,14 @@ export default class StringStringMap<V> {
/**
* Returns an iterable of key, value pairs for every entry in the map.
*/
entries(): IterableIterator<[string, string, V]> {
entries(): MapIterator<[string, string, V]> {
return this[Symbol.iterator]();
}

/**
* Returns an iterable of keys in the map
*/
*keys(): IterableIterator<[string, string]> {
*keys(): MapIterator<[string, string]> {
for (const x of this.#hashMap.keys()) {
const [ firstKey, secondKey ] = StringStringMap.#parseKeys(x[0]);
yield [firstKey, secondKey];
Expand All @@ -100,7 +100,7 @@ export default class StringStringMap<V> {
/**
* Returns an iterable of values in the map
*/
values(): IterableIterator<V> {
values(): MapIterator<V> {
return this.#hashMap.values()
}
}

0 comments on commit a9fe274

Please sign in to comment.