Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit c8cee44

Browse files
authored
fix: add extensions to imports (ES6 standart) (#62)
1 parent b20ffd9 commit c8cee44

File tree

16 files changed

+101
-83
lines changed

16 files changed

+101
-83
lines changed

package.json

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
11
{
2-
"name": "todoist-rest-client",
3-
"version": "3.0.4",
4-
"description": "A simple todoist-rest-api client",
5-
"author": "dubisdev",
6-
"license": "MIT",
7-
"keywords": [
8-
"todoist",
9-
"rest-client"
10-
],
11-
"type": "module",
12-
"main": "dist/index.js",
13-
"module": "dist/index.js",
14-
"files": [ "**/dist/**" ],
15-
"exports": {
16-
".": {
17-
"import": "./dist/index.js",
18-
"default": "./dist/index.js"
19-
}
20-
},
21-
"types": "dist/index.d.ts",
22-
"dependencies": {
23-
"axios": "^0.24.0",
24-
"uuid": "^8.3.2"
25-
},
26-
"devDependencies": {
27-
"@types/jest": "^27.0.2",
28-
"@types/uuid": "^8.3.1",
29-
"dotenv": "^10.0.0",
30-
"jest": "^27.3.1",
31-
"ts-jest": "^27.0.7",
32-
"typescript": "^4.4.4"
33-
},
34-
"scripts": {
35-
"prepublish": "tsc",
36-
"test": "jest"
37-
},
38-
"repository": {
39-
"type": "git",
40-
"url": "git+https://github.com/dubisdev/todoist-rest-client.git"
41-
},
42-
"bugs": {
43-
"url": "https://github.com/dubisdev/todoist-rest-client/issues"
44-
},
45-
"homepage": "https://github.com/dubisdev/todoist-rest-client#readme"
2+
"name": "todoist-rest-client",
3+
"version": "3.0.5",
4+
"type": "module",
5+
"description": "A simple todoist-rest-api client",
6+
"author": "dubisdev",
7+
"license": "MIT",
8+
"keywords": [
9+
"todoist",
10+
"rest-client"
11+
],
12+
"main": "dist/index.js",
13+
"files": [
14+
"**/dist/**"
15+
],
16+
"types": "dist/index.d.ts",
17+
"dependencies": {
18+
"axios": "^0.24.0",
19+
"uuid": "^8.3.2"
20+
},
21+
"devDependencies": {
22+
"@types/jest": "^27.0.2",
23+
"@types/uuid": "^8.3.1",
24+
"dotenv": "^10.0.0",
25+
"jest": "^27.3.1",
26+
"ts-jest": "^27.0.7",
27+
"typescript": "^4.4.4"
28+
},
29+
"scripts": {
30+
"prepublish": "tsc",
31+
"test": "jest"
32+
},
33+
"repository": {
34+
"type": "git",
35+
"url": "git+https://github.com/dubisdev/todoist-rest-client.git"
36+
},
37+
"bugs": {
38+
"url": "https://github.com/dubisdev/todoist-rest-client/issues"
39+
},
40+
"homepage": "https://github.com/dubisdev/todoist-rest-client#readme"
4641
}

src/TDSClient.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
import { task, project, section, label, comment, extras } from "./submodules";
2-
import { ClientConstructor, TDSClient } from "./definitions";
1+
import {
2+
task,
3+
project,
4+
section,
5+
label,
6+
comment,
7+
extras,
8+
} from "./submodules/index.js";
9+
import { ClientConstructor, TDSClient } from "./definitions/index.js";
310

411
const TDSClientConstructor: ClientConstructor = (apiToken): TDSClient => {
512
if (!apiToken) throw new Error("Missing api token");

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import TDSClient from "./TDSClient";
1+
import TDSClient from "./TDSClient.js";
22

3-
export * from "./resources";
4-
export * from "./definitions";
3+
export * from "./resources/index.js";
4+
export * from "./definitions/index.js";
55
export default TDSClient;

src/resources/Comment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CreatableComment, UserCreatedComment } from "../definitions";
1+
import { CreatableComment, UserCreatedComment } from "../definitions/index.js";
22

33
const Comment = (comment: UserCreatedComment): CreatableComment => {
44
const { content = "_No_Content_Provided_", ...restOfProperties } = comment;

src/resources/Label.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CreatableLabel, UserCreatedLabel } from "../definitions";
1+
import { CreatableLabel, UserCreatedLabel } from "../definitions/index.js";
22

33
const Label = (label: UserCreatedLabel = {}): CreatableLabel => {
44
const { name = "_No_Label_Name_Provided_", ...restOfProperties } = label;

src/resources/Project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CreatableProject, UserCreatedProject } from "../definitions";
1+
import { CreatableProject, UserCreatedProject } from "../definitions/index.js";
22

33
const Project = (project: UserCreatedProject = {}): CreatableProject => {
44
const { name = "_No_Project_Name_Provided_", ...restOfProperties } = project;

src/resources/Section.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CreatableSection, UserCreatedSection } from "../definitions";
1+
import { CreatableSection, UserCreatedSection } from "../definitions/index.js";
22

33
const Section = (section: UserCreatedSection): CreatableSection => {
44
const { name = "_No_Section_Name_Provided_", ...restOfProperties } = section;

src/resources/Task.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CreatableTask, UserCreatedTask } from "../definitions";
1+
import { CreatableTask, UserCreatedTask } from "../definitions/index.js";
22

33
const Task = (task: UserCreatedTask = {}): CreatableTask => {
44
const { content = "_No_Task_Name_Provided_", ...restOfProperties } = task;

src/resources/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import Task from "./Task";
2-
import Project from "./Project";
3-
import Section from "./Section";
4-
import Label from "./Label";
5-
import Comment from "./Comment";
1+
import Task from "./Task.js";
2+
import Project from "./Project.js";
3+
import Section from "./Section.js";
4+
import Label from "./Label.js";
5+
import Comment from "./Comment.js";
66

77
export { Task, Project, Section, Label, Comment };

src/submodules/comment.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
import { AuthHeader, APICommentObject, CommentModule } from "../definitions";
2-
import { get, del, post } from "../libs/apiRequests";
3-
import { COMMENTS_URL } from "../libs/constants";
1+
import {
2+
AuthHeader,
3+
APICommentObject,
4+
CommentModule,
5+
} from "../definitions/index.js";
6+
import { get, del, post } from "../libs/apiRequests.js";
7+
import { COMMENTS_URL } from "../libs/constants.js";
48

59
const commentClientModule = (headers: AuthHeader): CommentModule => {
610
return {

0 commit comments

Comments
 (0)