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
3 changes: 2 additions & 1 deletion commitlint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default {
},
// dependabot-auto-merge.yml lands Dependabot's rebase-merged commits on main verbatim, including its generated Bumps/Release notes/Changelog body, which routinely contains a markdown link line over the inherited body-max-line-length limit and cannot be reformatted by this repo. Skip linting entirely for those commits, identified by the "Signed-off-by: dependabot[bot]" trailer that fetch-metadata's auto-merge always appends, while leaving every rule fully enforced for human-authored commits.
ignores: [
(message: string) => /^Signed-off-by: dependabot\[bot\]/m.test(message),
(message: string): boolean =>
/^Signed-off-by: dependabot\[bot\]/m.test(message),
],
};
14 changes: 9 additions & 5 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { exadevConfig } from "@exadev/eslint-config";
import { defineConfig } from "eslint/config";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import globals from "globals";

// Lints the workspace root's own files -- its TypeScript tooling configs and its prose and data -- and nothing else.
//
// packages/** stays ignored here. The package keeps its own eslint.config.ts, because file scoping, tsconfig wiring, and the isomorphism import bans are genuinely per-package concerns; a root run that also walked the package would apply this program's tsconfig to source files it does not contain.
export default exadevConfig(
{},
/**
* Lints the workspace root's own files -- its TypeScript tooling configs and its prose and data -- and nothing else.
*
* packages/** stays ignored here. The package keeps its own eslint.config.ts, because file scoping, tsconfig wiring, and the isomorphism import bans are genuinely per-package concerns; a root run that also walked the package would apply this program's tsconfig to source files it does not contain.
*/
export default defineConfig(
...exadevConfig(),
{
ignores: [
"packages/**",
Expand All @@ -28,6 +31,7 @@ export default exadevConfig(
},
},
{
files: ["**/*.{ts,tsx,mts,cts}"],
rules: {
"@typescript-eslint/consistent-type-imports": [
"error",
Expand Down
3 changes: 3 additions & 0 deletions lint-staged.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function packageDirectoryOf(repoRelativePath: string): string | undefined {
) {
return undefined;
}

return `${PACKAGES_DIR}${sep}${second}`;
}

Expand All @@ -35,6 +36,7 @@ function groupByDirectory(
existing.push(repoRelativePath);
}
}

return grouped;
}

Expand All @@ -44,6 +46,7 @@ const config: Configuration = {
const pathsRelativeToDirectory = paths.map(
(path) => `"${directory === "." ? path : relative(directory, path)}"`,
);

return `pnpm --dir ${directory} exec eslint --fix ${pathsRelativeToDirectory.join(" ")}`;
}),
};
Expand Down
58 changes: 29 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
{
"name": "trilean-monorepo",
"private": true,
"description": "Workspace root for the trilean ecosystem. Never published -- it exists to hold the workspace, the task pipeline, the shared tooling configuration, and the release orchestration.",
"type": "module",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/ExaDev/trilean.git"
},
"homepage": "https://github.com/ExaDev/trilean#readme",
"bugs": {
"url": "https://github.com/ExaDev/trilean/issues"
},
"engines": {
"node": ">=20"
},
"packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
"scripts": {
"build": "turbo run _build",
"lint": "turbo run _lint",
"_lint": "eslint . --fix --cache --max-warnings 0",
"typecheck": "turbo run _typecheck _typecheck:attw",
"_typecheck": "tsc -p tsconfig.json",
"test": "turbo run _test",
"test:coverage": "turbo run _test:coverage",
"test:integration": "turbo run _test:integration",
"test:smoke": "turbo run _test:smoke",
"test:workers": "turbo run _test:workers",
"prepush": "turbo run _prepush",
"release": "semantic-release-workspace release --config release-workspace.config.ts",
"prepare": "husky"
},
"devDependencies": {
"@commitlint/cli": "^21.2.2",
"@commitlint/config-conventional": "^21.2.2",
"@eslint/js": "^10.0.1",
"@exadev/eslint-config": "2.12.1",
"@exadev/eslint-config": "3.0.0",
"@exadev/semantic-release-workspace": "3.0.2",
"@semantic-release/changelog": "^7.0.0",
"@semantic-release/commit-analyzer": "^13.0.1",
Expand All @@ -56,5 +29,32 @@
"turbo": "^2.11.5",
"typescript": "^6.0.3",
"typescript-eslint": "^8.68.0"
}
},
"engines": {
"node": ">=20"
},
"homepage": "https://github.com/ExaDev/trilean#readme",
"license": "MIT",
"packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/ExaDev/trilean.git"
},
"scripts": {
"_lint": "eslint . --fix --cache --max-warnings 0",
"_typecheck": "tsc -p tsconfig.json",
"build": "turbo run _build",
"lint": "turbo run _lint",
"prepare": "husky",
"prepush": "turbo run _prepush",
"release": "semantic-release-workspace release --config release-workspace.config.ts",
"test": "turbo run _test",
"test:coverage": "turbo run _test:coverage",
"test:integration": "turbo run _test:integration",
"test:smoke": "turbo run _test:smoke",
"test:workers": "turbo run _test:workers",
"typecheck": "turbo run _typecheck _typecheck:attw"
},
"type": "module"
}
6 changes: 4 additions & 2 deletions packages/trilean-regex/eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { builtinModules } from "node:module";
import { exadevConfig } from "@exadev/eslint-config";
import { defineConfig } from "eslint/config";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import globals from "globals";

Expand All @@ -14,8 +15,8 @@ const nodeBuiltinBaseModules = [
].sort();
const bareNodeBuiltinPattern = `^(${nodeBuiltinBaseModules.join("|")})(/.*)?$`;

export default exadevConfig(
{},
export default defineConfig(
...exadevConfig(),
{
ignores: ["dist", "coverage", "node_modules", ".turbo"],
},
Expand All @@ -29,6 +30,7 @@ export default exadevConfig(
},
},
{
files: ["**/*.{ts,tsx,mts,cts}"],
rules: {
"@typescript-eslint/consistent-type-imports": [
"error",
Expand Down
100 changes: 50 additions & 50 deletions packages/trilean-regex/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
{
"name": "trilean-regex",
"version": "1.0.3",
"description": "A portable regular-expression grammar -- a true regular language, with a Thompson-construction reference matcher -- so a pattern means the same thing in process and wherever trilean-sql can push it down to a database's own engine.",
"type": "module",
"repository": {
"type": "git",
"url": "git+https://github.com/ExaDev/trilean.git",
"directory": "packages/trilean-regex"
},
"homepage": "https://github.com/ExaDev/trilean/tree/main/packages/trilean-regex",
"version": "1.0.3",
"bugs": {
"url": "https://github.com/ExaDev/trilean/issues"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.5",
"@exadev/eslint-config": "3.0.0",
"@types/node": "^26.4.0",
"@vitest/coverage-v8": "^5.0.0",
"eslint": "^10.9.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.6",
"globals": "^17.11.0",
"prettier": "^3.9.6",
"publint": "^0.3.24",
"tsdown": "^0.23.0",
"turbo": "^2.10.12",
"typescript": "^6.0.3",
"typescript-eslint": "^8.68.0",
"vitest": "^5.0.0"
},
"engines": {
"node": ">=20"
},
"exports": {
".": {
"types": {
Expand All @@ -30,63 +43,50 @@
"require": "./dist/*.cjs"
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"homepage": "https://github.com/ExaDev/trilean/tree/main/packages/trilean-regex",
"keywords": [
"finite-automaton",
"isomorphic",
"nfa",
"parser",
"regex",
"regular-expression",
"regular-language",
"trilean"
],
"license": "MIT",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"publishConfig": {
"access": "public",
"provenance": true,
"registry": "https://registry.npmjs.org/"
},
"sideEffects": false,
"engines": {
"node": ">=20"
"repository": {
"type": "git",
"url": "git+https://github.com/ExaDev/trilean.git",
"directory": "packages/trilean-regex"
},
"license": "MIT",
"scripts": {
"build": "turbo run _build",
"_build": "tsdown",
"lint": "turbo run _lint",
"_lint": "eslint . --fix --cache --max-warnings 0",
"typecheck": "turbo run _typecheck _typecheck:attw",
"_prepush": "true",
"_test": "vitest run --project unit",
"_test:coverage": "vitest run --project unit --coverage",
"_typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.node.json",
"_typecheck:attw": "attw --pack",
"build": "turbo run _build",
"lint": "turbo run _lint",
"prepublishOnly": "pnpm run lint && pnpm run typecheck && pnpm run test && pnpm run build && publint && attw --pack",
"prepush": "turbo run _prepush",
"test": "turbo run _test",
"_test": "vitest run --project unit",
"test:coverage": "turbo run _test:coverage",
"_test:coverage": "vitest run --project unit --coverage",
"prepush": "turbo run _prepush",
"_prepush": "true",
"prepublishOnly": "pnpm run lint && pnpm run typecheck && pnpm run test && pnpm run build && publint && attw --pack"
"typecheck": "turbo run _typecheck _typecheck:attw"
},
"keywords": [
"regex",
"regular-expression",
"regular-language",
"finite-automaton",
"nfa",
"parser",
"trilean",
"isomorphic"
],
"devDependencies": {
"@arethetypeswrong/cli": "^0.18.5",
"@exadev/eslint-config": "2.12.1",
"@types/node": "^26.4.0",
"@vitest/coverage-v8": "^5.0.0",
"eslint": "^10.9.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.6",
"globals": "^17.11.0",
"prettier": "^3.9.6",
"publint": "^0.3.24",
"tsdown": "^0.23.0",
"turbo": "^2.10.12",
"typescript": "^6.0.3",
"typescript-eslint": "^8.68.0",
"vitest": "^5.0.0"
}
"sideEffects": false,
"type": "module",
"types": "./dist/index.d.ts"
}
1 change: 1 addition & 0 deletions packages/trilean-regex/src/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,6 @@ export function rangeContains(range: CharRange, unit: number): boolean {
/** Whether `unit` is a member of a character class, honouring `negated`. */
export function charClassMatches(node: CharClassNode, unit: number): boolean {
const inRanges = node.ranges.some((range) => rangeContains(range, unit));

return node.negated ? !inRanges : inRanges;
}
1 change: 1 addition & 0 deletions packages/trilean-regex/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
export class RegexParseError extends Error {
readonly pattern: string;

readonly index: number;

constructor(pattern: string, index: number, reason: string) {
Expand Down
4 changes: 4 additions & 0 deletions packages/trilean-regex/src/matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function closure(
break;
}
}

return result;
}

Expand All @@ -54,6 +55,7 @@ function step(
if (state?.kind !== "char") continue;
if (state.test(codeUnit)) next.add(state.to);
}

return next;
}

Expand All @@ -75,6 +77,7 @@ export function matchesNfa(nfa: CompiledNfa, input: string): boolean {
current = closure(nfa, [...stepped], pos + 1, length);
if (current.has(nfa.matchState)) return true;
}

return false;
}

Expand All @@ -92,6 +95,7 @@ export interface CompiledPattern {
*/
export function compilePattern(pattern: string): CompiledPattern {
const nfa = compileToNfa(parseRegex(pattern));

return { test: (input: string) => matchesNfa(nfa, input) };
}

Expand Down
Loading
Loading