Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defaultSemverRangePrefix: ""
enableConstraintsChecks: true
enableInlineBuilds: true
enableTelemetry: false
nodeLinker: node-modules
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { describe, expect, it } from "@jest/globals";

import "../Iterator.prototype.map";
import "../Iterator.prototype.filter";
import "../Iterator.prototype.map/index.ts";
import "../Iterator.prototype.filter/index.ts";

(globalThis as Record<string, unknown>).Iterator &&
delete (
(globalThis as Record<string, unknown>).Iterator as Record<string, unknown>
).from;

// eslint-disable-next-line import-x/first
import "./index";
// eslint-disable-next-line import-x/first -- This has to happen after we delete the built-in implementation.
import "./index.ts";

describe("Iterator.from", () => {
it("can convert an Array to an Iterator", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ declare global {
}

(globalThis as Record<string, unknown>).Iterator ??= {};

((globalThis as Record<string, unknown>).Iterator as { from: unknown }).from ??=
function <T>(
object: Iterator<T> | Iterable<T> | { next(): IteratorResult<T> },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,6 @@ iteratorPrototype.toIterable = function () {
};

globalThis.Iterator ??= {};

globalThis.Iterator.from ??= function (object) {
const toIterable = iteratorPrototype.toIterable;

Expand Down Expand Up @@ -3366,7 +3365,6 @@ iteratorPrototype.toIterable = function <T>(
};

(globalThis as Record<string, unknown>).Iterator ??= {};

((globalThis as Record<string, unknown>).Iterator as { from: unknown }).from ??=
function <T>(
object: Iterator<T> | Iterable<T> | { next(): IteratorResult<T> },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,6 @@ exports[`App can render goody: JavaScript Iterator.from 1`] = `
import "Iterator.prototype.toIterable";

globalThis.Iterator ??= {};

globalThis.Iterator.from ??= function (object) {
const toIterable = iteratorPrototype.toIterable;

Expand Down Expand Up @@ -1984,7 +1983,6 @@ declare global {
}

(globalThis as Record<string, unknown>).Iterator ??= {};

((globalThis as Record<string, unknown>).Iterator as { from: unknown }).from ??=
function <T>(
object: Iterator<T> | Iterable<T> | { next(): IteratorResult<T> },
Expand Down
1 change: 1 addition & 0 deletions workspaces/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"name": "Miorel-Lucian Palii",
"url": "https://github.com/miorel"
},
"type": "module",
"exports": {
".": "./eslint.config.mjs"
},
Expand Down
1 change: 1 addition & 0 deletions workspaces/generate-health-report/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { maybeThrow } from "@code-chronicles/util/maybeThrow";
import { spawnWithSafeStdio } from "@code-chronicles/util/spawnWithSafeStdio";

const COMMANDS = [
"yarn constraints",
"yarn test",
"yarn workspace @code-chronicles/adventure-pack build-app",
"yarn workspace @code-chronicles/adventure-pack build-chrome-extension",
Expand Down
File renamed without changes.
9 changes: 6 additions & 3 deletions workspaces/util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@
"name": "Miorel-Lucian Palii",
"url": "https://github.com/miorel"
},
"type": "module",
"exports": {
"./*": "./src/*.ts",
".": null,
"./__tests__/*": null
},
"scripts": {
"format": "prettier --color --write .",
"lint": "eslint --color --max-warnings=0 .",
"test": "tsx ./jest.config.mts",
"test": "tsx ./jest.config.ts",
"typecheck": "tsc --pretty --project ."
},
"dependencies": {
"peerDependencies": {
"invariant": "2.2.4",
"nullthrows": "patch:nullthrows@npm%3A1.1.1#~/.yarn/patches/nullthrows-npm-1.1.1-3d1f817134.patch",
"nullthrows": "*",
"zod": "3.23.8"
},
"devDependencies": {
"@code-chronicles/eslint-config": "workspace:*",
"@code-chronicles/util": "workspace:*",
"@jest/globals": "29.7.0",
"@types/node": "22.5.5",
"eslint": "9.11.0",
Expand Down
3 changes: 2 additions & 1 deletion workspaces/util/src/__tests__/distinctArray-test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { describe, expect, it } from "@jest/globals";
import { distinctArray } from "../distinctArray";

import { distinctArray } from "../distinctArray.ts";

describe("distinctArray", () => {
it("returns an empty list if given an empty list", () => {
Expand Down
2 changes: 1 addition & 1 deletion workspaces/util/src/__tests__/getLines-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import { getLines } from "../getLines";
import { getLines } from "../getLines.ts";

describe("getLines", () => {
it("gets lines when the new line at the begining", () => {
Expand Down
2 changes: 1 addition & 1 deletion workspaces/util/src/__tests__/isNonNullish-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { describe, expect, it } from "@jest/globals";

import { isNonNullish } from "../isNonNullish";
import { isNonNullish } from "../isNonNullish.ts";

describe("isNonNullish", () => {
it.each([[], {}, new Set(), new Map(), "hi", 4, Symbol(undefined)])(
Expand Down
2 changes: 1 addition & 1 deletion workspaces/util/src/__tests__/squashWhitespace-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import { squashWhitespace } from "../squashWhitespace";
import { squashWhitespace } from "../squashWhitespace.ts";

describe("squashWhitespace", () => {
it("removes whitespace between words if it exists", () => {
Expand Down
2 changes: 1 addition & 1 deletion workspaces/util/src/__tests__/stripPrefix-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import { stripPrefix } from "../stripPrefix";
import { stripPrefix } from "../stripPrefix.ts";

describe("stripPrefix", () => {
it("removes the prefix if it exists", () => {
Expand Down
2 changes: 1 addition & 1 deletion workspaces/util/src/__tests__/stripSuffix-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import { stripSuffix } from "../stripSuffix";
import { stripSuffix } from "../stripSuffix.ts";

describe("stripSuffix", () => {
it("removes the suffix if it exists", () => {
Expand Down
2 changes: 1 addition & 1 deletion workspaces/util/src/__tests__/stripSuffixOrThrow-test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import { stripSuffixOrThrow } from "../stripSuffixOrThrow";
import { stripSuffixOrThrow } from "../stripSuffixOrThrow.ts";

describe("stripSuffixOrThrow", () => {
it("removes the suffix if it exists", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "@jest/globals";

import { timestampInSecondsToYearMonthDay } from "../timestampInSecondsToYearMonthDay";
import { timestampInSecondsToYearMonthDay } from "../timestampInSecondsToYearMonthDay.ts";

describe("timestampInSecondsToYearMonthDay", () => {
it.each([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function* getCurrentGitRepositoryStatusPaths(): AsyncGenerator<

// Using a set to deduplicate, in case multiple files were "moved from" the
// same file. I'm not even completely sure if that's possible, but no harm in
// defending aagainst it.
// defending against it.
const yieldedPaths = new Set();

for (const line of getLines(gitCommandResult.stdout)) {
Expand Down
7 changes: 7 additions & 0 deletions yarn.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
async constraints({ Yarn }) {
for (const workspace of Yarn.workspaces()) {
workspace.set("type", "module");
}
},
};
8 changes: 5 additions & 3 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading