Skip to content

Commit b30d133

Browse files
committed
refactor: import order
1 parent 47037ac commit b30d133

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

packages/dobs/src/_types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ export type LooseObject<KnownKeys extends string, ValueType> = Partial<
33
> &
44
Record<string, ValueType>;
55

6+
export type LooseKey<K extends string> = K | (string & {});
7+
68
export type Promisable<T> = T | Promise<T>;
79
export type Maybe<T> = T | null | undefined;

packages/dobs/src/builder/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { unlinkSync, writeFileSync } from 'node:fs';
22
import { join } from 'node:path';
33

44
import { build, BuildOptions } from 'rolldown';
5+
import chalk from 'chalk';
56
import { compileModule } from 'module-loader-ts';
67

78
import nodeExternal from '~/dobs/server/plugins/external';
89
import { buildFiles, createRoutes, findFile } from '~/dobs/server/router';
910
import { ResolvedServerConfig } from '~/dobs/config';
10-
import chalk from 'chalk';
1111

1212
export async function buildServer(config: ResolvedServerConfig) {
1313
const routesDirectory = join(config.cwd, 'app');

packages/dobs/src/cli.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
#!/usr/bin/env node
2+
import { join } from 'node:path';
23

34
import animaux from 'animaux';
45
import { load } from 'module-loader-ts';
5-
66
import chalk from 'chalk';
77

88
import { createDobsServer } from '~/dobs/server';
99

10-
import { version } from '../package.json';
1110
import { resolveConfig, ServerConfig } from './config';
12-
import { join } from 'node:path';
1311
import { buildServer } from './builder';
12+
import { version } from '../package.json';
1413

1514
const app = animaux({ name: 'dobs', version: version });
1615

packages/dobs/src/experimental/cache.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Routes, Handler } from '../types';
2-
import { mutateObjectKeys, mutateObjectValues } from '../shared/object';
3-
import { Plugin } from '../plugin';
1+
import { Routes, Handler } from '~/dobs/types';
2+
import { mutateObjectKeys, mutateObjectValues } from '~/dobs/shared/object';
3+
import { Plugin } from '~/dobs/plugin';
44

55
export interface CacheOptions {
66
/**

packages/dobs/src/server/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { Server } from 'node:http';
22
import httpServer, { Middleware } from '@dobsjs/http';
3+
34
import { resolveConfig, ServerConfig } from '~/dobs/config';
5+
import { createPluginRunner } from '~/dobs/plugin';
6+
47
import { createRouterMiddleware } from './router';
5-
import { createPluginRunner } from '../plugin';
68

79
type CreateServerReturn<T extends ServerConfig> = T['mode'] extends 'middleware'
810
? Middleware[]

packages/dobs/src/server/router.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { mkdirSync, writeFileSync } from 'node:fs';
12
import { dirname, join, relative } from 'node:path';
23

34
import type { AppRequest, AppResponse, Middleware } from '@dobsjs/http';
@@ -10,11 +11,10 @@ import { scanDirectory } from '~/dobs/shared/fs';
1011
import { convertPathToRegex, matchUrlToRoute } from '~/dobs/shared/urlPath';
1112
import { isSamePath } from '~/dobs/shared/path';
1213
import { lowercaseKeyObject } from '~/dobs/shared/object';
14+
import { createPluginRunner } from '~/dobs/plugin';
1315

14-
import { dynamicImport } from './load';
1516
import nodeExternal from './plugins/external';
16-
import { mkdirSync, writeFileSync } from 'node:fs';
17-
import { createPluginRunner } from '../plugin';
17+
import { dynamicImport } from './load';
1818

1919
type HandlerType = ((req: AppRequest, res: AppResponse) => any) | Record<string, any>;
2020

0 commit comments

Comments
 (0)