Skip to content

Commit

Permalink
switch to ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Jan 28, 2024
1 parent 39af09a commit c44dba4
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 77 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Using Node 16
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- name: Using Node 18
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
- name: Update npm version to latest
run: npm install -g npm@latest
- name: Install dependencies
Expand All @@ -32,10 +32,10 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
registry-url: https://npm.pkg.github.com
scope: "@${{github.repository_owner}}"
- run: |
Expand All @@ -51,10 +51,10 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
registry-url: "https://registry.npmjs.org"
scope: "@${{github.repository_owner}}"
- run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.PAT }}"
Expand Down
4 changes: 4 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@
],
"spec": [
"test/**/*.spec.*"
],
"node-option": [
"experimental-specifier-resolution=node",
"loader=ts-node/esm"
]
}
91 changes: 30 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"homepage": "https://github.com/userscripters/stackexchange-helpers#readme",
"devDependencies": {
"@types/chai": "^4.3.11",
"@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.6",
"@userscripters/stackexchange-api-types": "^3.4.0",
"@types/node": "^20.11.8",
Expand All @@ -43,14 +42,14 @@
"@typescript-eslint/parser": "^6.19.1",
"@userscripters/generate-readme": "^2.3.1",
"@userscripters/stackexchange-global-types": "^2.8.0",
"chai": "^4.4.1",
"chai-as-promised": "^7.1.1",
"chai": "^5.0.3",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"mocha": "^10.2.0",
"sinon": "^17.0.1",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"uglify-js": "^3.17.4"
}
},
"type": "module"
}
3 changes: 2 additions & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"chai",
"sinon"
],
"module": "CommonJS"
"module": "esnext",
"esModuleInterop": true
},
"include": ["."],
"exclude": []
Expand Down

0 comments on commit c44dba4

Please sign in to comment.