Skip to content

Commit

Permalink
🏷️ Convert to ES Modules and NodeNext (#314)
Browse files Browse the repository at this point in the history
* 🏷️ 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]>
  • Loading branch information
NatoBoram and MrRefactoring authored Jan 2, 2025
1 parent a650eb1 commit a40e1f3
Show file tree
Hide file tree
Showing 1,249 changed files with 5,547 additions and 5,298 deletions.
11 changes: 6 additions & 5 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parser: "@typescript-eslint/parser"
parser: '@typescript-eslint/parser'
extends:
- airbnb-base
- prettier
parserOptions:
ecmaVersion: 2018
project: ./tsconfig.lint.json
Expand All @@ -10,7 +11,7 @@ env:
node: true
browser: true
rules:
"@typescript-eslint/lines-between-class-members": off
'@typescript-eslint/lines-between-class-members': off
arrow-parens:
- error
- as-needed
Expand All @@ -37,7 +38,7 @@ rules:
padding-line-between-statements:
- error
- blankLine: always
prev: "*"
prev: '*'
next:
- block
- block-like
Expand All @@ -59,7 +60,7 @@ rules:
- import
- let
- var
next: "*"
next: '*'
- blankLine: any
prev:
- const
Expand All @@ -86,5 +87,5 @@ rules:
- export
settings:
import/parsers:
"@typescript-eslint/parser":
'@typescript-eslint/parser':
- .ts
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ out/
docs/
coverage/

pnpm-lock.yaml
yarn.lock
yarn-error.log
.DS_Store
Expand Down
3 changes: 2 additions & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
},
"dependencies": {
"jira.js": "latest"
}
},
"type": "module"
}
4 changes: 2 additions & 2 deletions examples/src/addFixVersion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Version3Client } from 'jira.js';
import { createIssue } from './utils';
import { apiToken, email, host } from './credentials';
import { createIssue } from './utils/index.js';
import { apiToken, email, host } from './credentials.js';

async function addFixVersion() {
const client = new Version3Client({
Expand Down
4 changes: 2 additions & 2 deletions examples/src/addWorklog.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Version3Client } from 'jira.js';
import { createIssue } from './utils';
import { apiToken, email, host } from './credentials';
import { createIssue } from './utils/index.js';
import { apiToken, email, host } from './credentials.js';

async function addWorklog() {
const client = new Version3Client({
Expand Down
11 changes: 5 additions & 6 deletions examples/src/basic.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Version3Client } from 'jira.js';
import { apiToken, email, host } from './credentials';
import { apiToken, email, host } from './credentials.js';

const client = new Version3Client({
host,
Expand Down Expand Up @@ -45,9 +45,8 @@ async function main() {
}
}

main()
.catch(e => {
console.error(e);
main().catch(e => {
console.error(e);

throw new Error(JSON.stringify(e));
});
throw new Error(JSON.stringify(e));
});
7 changes: 4 additions & 3 deletions examples/src/getAllWorklogs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Version3Client } from 'jira.js';
import { addWorklog, createIssue } from './utils';
import { apiToken, email, host } from './credentials';
import type { Worklog } from 'jira.js/out/version3/models';
import { apiToken, email, host } from './credentials.js';
import { addWorklog, createIssue } from './utils/index.js';

async function getAllWorklogs() {
const client = new Version3Client({
Expand All @@ -19,7 +20,7 @@ async function getAllWorklogs() {
await addWorklog(client, issue);

// The main part responsible for getting the worklogs
const worklogs = [];
const worklogs: Worklog[] = [];

let offset = 0;
let total = 0;
Expand Down
4 changes: 2 additions & 2 deletions examples/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './addWorklog';
export * from './createIssue';
export * from './addWorklog.js';
export * from './createIssue.js';
Loading

0 comments on commit a40e1f3

Please sign in to comment.