Skip to content

Commit a40e1f3

Browse files
🏷️ Convert to ES Modules and NodeNext (#314)
* 🏷️ Convert to ES Modules and NodeNext * 🏷️ Convert examples and tests to ESM * πŸ”§ Modify test:unit script to use vitest * πŸ”§ npm i * βœ… Remove hard-coded leadAccountId * 🚨 pnpm lint:fix * πŸ”§ Add Rollup * πŸ”§ Add `vitest.config.ts` to `tsconfig.lint.json` * πŸ’š npm i --force * ⬆️ Re-upgrade some deps --------- Co-authored-by: Vladislav Tupikin <[email protected]>
1 parent a650eb1 commit a40e1f3

File tree

1,249 files changed

+5547
-5298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,249 files changed

+5547
-5298
lines changed

β€Ž.eslintrc.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
parser: "@typescript-eslint/parser"
1+
parser: '@typescript-eslint/parser'
22
extends:
33
- airbnb-base
4+
- prettier
45
parserOptions:
56
ecmaVersion: 2018
67
project: ./tsconfig.lint.json
@@ -10,7 +11,7 @@ env:
1011
node: true
1112
browser: true
1213
rules:
13-
"@typescript-eslint/lines-between-class-members": off
14+
'@typescript-eslint/lines-between-class-members': off
1415
arrow-parens:
1516
- error
1617
- as-needed
@@ -37,7 +38,7 @@ rules:
3738
padding-line-between-statements:
3839
- error
3940
- blankLine: always
40-
prev: "*"
41+
prev: '*'
4142
next:
4243
- block
4344
- block-like
@@ -59,7 +60,7 @@ rules:
5960
- import
6061
- let
6162
- var
62-
next: "*"
63+
next: '*'
6364
- blankLine: any
6465
prev:
6566
- const
@@ -86,5 +87,5 @@ rules:
8687
- export
8788
settings:
8889
import/parsers:
89-
"@typescript-eslint/parser":
90+
'@typescript-eslint/parser':
9091
- .ts

β€Ž.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ out/
55
docs/
66
coverage/
77

8+
pnpm-lock.yaml
89
yarn.lock
910
yarn-error.log
1011
.DS_Store

β€Žexamples/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
},
1919
"dependencies": {
2020
"jira.js": "latest"
21-
}
21+
},
22+
"type": "module"
2223
}

β€Žexamples/src/addFixVersion.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Version3Client } from 'jira.js';
2-
import { createIssue } from './utils';
3-
import { apiToken, email, host } from './credentials';
2+
import { createIssue } from './utils/index.js';
3+
import { apiToken, email, host } from './credentials.js';
44

55
async function addFixVersion() {
66
const client = new Version3Client({

β€Žexamples/src/addWorklog.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Version3Client } from 'jira.js';
2-
import { createIssue } from './utils';
3-
import { apiToken, email, host } from './credentials';
2+
import { createIssue } from './utils/index.js';
3+
import { apiToken, email, host } from './credentials.js';
44

55
async function addWorklog() {
66
const client = new Version3Client({

β€Žexamples/src/basic.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Version3Client } from 'jira.js';
2-
import { apiToken, email, host } from './credentials';
2+
import { apiToken, email, host } from './credentials.js';
33

44
const client = new Version3Client({
55
host,
@@ -45,9 +45,8 @@ async function main() {
4545
}
4646
}
4747

48-
main()
49-
.catch(e => {
50-
console.error(e);
48+
main().catch(e => {
49+
console.error(e);
5150

52-
throw new Error(JSON.stringify(e));
53-
});
51+
throw new Error(JSON.stringify(e));
52+
});

β€Žexamples/src/getAllWorklogs.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Version3Client } from 'jira.js';
2-
import { addWorklog, createIssue } from './utils';
3-
import { apiToken, email, host } from './credentials';
2+
import type { Worklog } from 'jira.js/out/version3/models';
3+
import { apiToken, email, host } from './credentials.js';
4+
import { addWorklog, createIssue } from './utils/index.js';
45

56
async function getAllWorklogs() {
67
const client = new Version3Client({
@@ -19,7 +20,7 @@ async function getAllWorklogs() {
1920
await addWorklog(client, issue);
2021

2122
// The main part responsible for getting the worklogs
22-
const worklogs = [];
23+
const worklogs: Worklog[] = [];
2324

2425
let offset = 0;
2526
let total = 0;

β€Žexamples/src/utils/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './addWorklog';
2-
export * from './createIssue';
1+
export * from './addWorklog.js';
2+
export * from './createIssue.js';

0 commit comments

Comments
Β (0)