Skip to content

Commit

Permalink
chore: convert to esm
Browse files Browse the repository at this point in the history
  • Loading branch information
c100k committed Aug 5, 2024
1 parent 71dbbb4 commit 4122e0c
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 26 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "rebootx-on-prem",
"version": "0.3.0",
"type": "module",
"scripts": {
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --cache --debug --fix && prettier --write '**/*.json'",
"lint:ci": "eslint . --ext .js,.jsx,.ts,.tsx && prettier '**/*.json'",
Expand Down
11 changes: 7 additions & 4 deletions spec/controllers/DashboardsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import {
Tags,
} from 'tsoa';

import { DASHBOARDS, ERR_401, ERR_403 } from '../data';
import { ListDashboardsQueryParams, ListDashboardsRes } from '../model';
import { ErrorRes } from '../schema';
import { DashboardService } from '../services';
import { DASHBOARDS, ERR_401, ERR_403 } from '../data/index.js';
import {
ListDashboardsQueryParams,
ListDashboardsRes,
} from '../model/index.js';
import { ErrorRes } from '../schema/index.js';
import { DashboardService } from '../services/index.js';

@Route('dashboards')
@Produces('application/json')
Expand Down
8 changes: 4 additions & 4 deletions spec/controllers/RunnablesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ import {
RUNNABLE_OP_ASYNC_RES,
RUNNABLE_OP_SYNC_DESC,
RUNNABLE_OP_SYNC_RES,
} from '../data';
} from '../data/index.js';
import {
ListRunnablesQueryParams,
ListRunnablesRes,
Runnable,
RunnableOperationRes,
} from '../model';
import { ErrorRes } from '../schema';
import { RunnableService } from '../services';
} from '../model/index.js';
import { ErrorRes } from '../schema/index.js';
import { RunnableService } from '../services/index.js';

@Route('runnables')
@Produces('application/json')
Expand Down
2 changes: 1 addition & 1 deletion spec/data/dashboard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ListDashboardsRes } from '../model';
import { ListDashboardsRes } from '../model/index.js';

export const DASHBOARDS: ListDashboardsRes = {
items: [
Expand Down
6 changes: 3 additions & 3 deletions spec/data/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './dashboard';
export * from './error';
export * from './runnable';
export * from './dashboard.js';
export * from './error.js';
export * from './runnable.js';
2 changes: 1 addition & 1 deletion spec/data/runnable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ListRunnablesRes,
RunnableOperationRes,
RunnableStatus,
} from '../model';
} from '../model/index.js';

export const RUNNABLE_OP_ASYNC_DESC: string =
'The operation has been executed asynchronously and will eventually succeed';
Expand Down
2 changes: 1 addition & 1 deletion spec/model/dashboard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ListQueryParams, ListRes } from '../schema';
import { ListQueryParams, ListRes } from '../schema/index.js';

/**
* A collection of metrics
Expand Down
4 changes: 2 additions & 2 deletions spec/model/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './dashboard';
export * from './runnnable';
export * from './dashboard.js';
export * from './runnnable.js';
2 changes: 1 addition & 1 deletion spec/model/runnnable.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ListQueryParams, ListRes } from '../schema';
import { ListQueryParams, ListRes } from '../schema/index.js';

export interface ListRunnablesQueryParams extends ListQueryParams {
/**
Expand Down
4 changes: 2 additions & 2 deletions spec/schema/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './error';
export * from './list';
export * from './error.js';
export * from './list.js';
5 changes: 4 additions & 1 deletion spec/services/DashboardService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { ListDashboardsQueryParams, ListDashboardsRes } from '../model';
import {
ListDashboardsQueryParams,
ListDashboardsRes,
} from '../model/index.js';

export interface DashboardService {
list(params: ListDashboardsQueryParams): Promise<ListDashboardsRes>;
Expand Down
2 changes: 1 addition & 1 deletion spec/services/RunnableService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ListRunnablesRes,
Runnable,
RunnableOperationRes,
} from '../model';
} from '../model/index.js';

export interface RunnableService {
list(params: ListRunnablesQueryParams): Promise<ListRunnablesRes>;
Expand Down
4 changes: 2 additions & 2 deletions spec/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './DashboardService';
export * from './RunnableService';
export * from './DashboardService.js';
export * from './RunnableService.js';
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"declaration": true,
"experimentalDecorators": true,
"lib": ["esnext"],
"module": "esnext",
"moduleResolution": "node",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"noEmit": true,
"skipLibCheck": true,
"sourceMap": true,
"target": "esnext",
"target": "ESNext",

/* Type checking */
"strict": true,
Expand Down

0 comments on commit 4122e0c

Please sign in to comment.