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
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"prepare": "husky",
"build": "tsc",
"prepublishOnly": "npm run build",
"test": "xo && tsc --noEmit && c8 node --import=tsx/esm --test"
"test": "xo && tsc --noEmit && c8 node --test"
},
"files": [
"distribution/main.js",
Expand All @@ -36,16 +36,15 @@
"typescript"
],
"devDependencies": {
"@commitlint/cli": "^20.0.0",
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"@sindresorhus/tsconfig": "^8.0.1",
"@types/node": "^24.5.2",
"@sindresorhus/tsconfig": "^8.1.0",
"@types/node": "^24.10.0",
"c8": "^10.1.3",
"husky": "^9.1.7",
"lint-staged": "^16.2.1",
"tsx": "^4.20.6",
"typescript": "^5.9.2",
"xo": "^1.2.2"
"lint-staged": "^16.2.6",
"typescript": "^5.9.3",
"xo": "^1.2.3"
},
"commitlint": {
"extends": [
Expand Down
4 changes: 2 additions & 2 deletions sample/authorizer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {middleware} from '../main.js';
import type {Request} from './http.js';
import {middleware} from '../main.ts';
import type {Request} from './http.ts';

export type Claim = {
email: string;
Expand Down
20 changes: 10 additions & 10 deletions sample/case/create-task.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
assign, parallel, passthrough, pipe,
} from '../../main.js';
import {createAuthorizer, withAuthorization} from '../authorizer.js';
import {makeTaskRepository} from '../task/repository.js';
import {makeTaskService} from '../task/service.js';
import {makeUserRepository} from '../user/repository.js';
import {makeUserService} from '../user/service.js';
import {withValidation} from '../validator.js';
import {makeWithUser, notifyUserLogin} from '../user/middleware.js';
import {makeCreateTask, notifyTaskCreation} from '../task/middleware.js';
import type {Request} from '../http.js';
} from '../../main.ts';
import {createAuthorizer, withAuthorization} from '../authorizer.ts';
import {makeTaskRepository} from '../task/repository.ts';
import {makeTaskService} from '../task/service.ts';
import {makeUserRepository} from '../user/repository.ts';
import {makeUserService} from '../user/service.ts';
import {withValidation} from '../validator.ts';
import {makeWithUser, notifyUserLogin} from '../user/middleware.ts';
import {makeCreateTask, notifyTaskCreation} from '../task/middleware.ts';
import type {Request} from '../http.ts';

const authorizer = createAuthorizer({secret: 'youshallnotpass'});

Expand Down
10 changes: 5 additions & 5 deletions sample/task/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {middleware} from '../../main.js';
import type {Request} from '../http.js';
import type {Logged} from '../user/middleware.js';
import type {Task} from './schema.js';
import type {TaskService} from './service.js';
import {middleware} from '../../main.ts';
import type {Request} from '../http.ts';
import type {Logged} from '../user/middleware.ts';
import type {Task} from './schema.ts';
import type {TaskService} from './service.ts';

type WithTask = {
task: Task;
Expand Down
2 changes: 1 addition & 1 deletion sample/task/repository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {Task} from './schema.js';
import type {Task} from './schema.ts';

const tasks = new Map<string, Task>();

Expand Down
4 changes: 2 additions & 2 deletions sample/task/service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {randomUUID} from 'node:crypto';
import type {TaskRepository} from './repository.js';
import type {Task} from './schema.js';
import type {TaskRepository} from './repository.ts';
import type {Task} from './schema.ts';

export type TaskService = {
create(description: string, userId: string): Promise<Task>;
Expand Down
8 changes: 4 additions & 4 deletions sample/user/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {middleware} from '../../main.js';
import type {Authorized} from '../authorizer.js';
import type {User} from './schema.js';
import type {UserService} from './service.js';
import {middleware} from '../../main.ts';
import type {Authorized} from '../authorizer.ts';
import type {User} from './schema.ts';
import type {UserService} from './service.ts';

export type Logged = {
user: User;
Expand Down
2 changes: 1 addition & 1 deletion sample/user/repository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {User} from './schema.js';
import type {User} from './schema.ts';

const users = new Map<string, User>();

Expand Down
4 changes: 2 additions & 2 deletions sample/user/service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {randomUUID} from 'node:crypto';
import type {User} from './schema.js';
import type {UserRepository} from './repository.js';
import type {User} from './schema.ts';
import type {UserRepository} from './repository.ts';

export type UserService = {
create(name: string, email: string): Promise<User>;
Expand Down
2 changes: 1 addition & 1 deletion test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import test from 'node:test';
import assert from 'node:assert/strict';
import {
_, assign, middleware, parallel, passthrough, pipe,
} from './main.js';
} from './main.ts';

const getUser = async () => ({name: 'John Smith'});
const addAge = middleware(async () => ({age: 30}));
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "@sindresorhus/tsconfig"
"extends": "@sindresorhus/tsconfig",
"compilerOptions": {
"rewriteRelativeImportExtensions": true
}
}