Skip to content

Commit

Permalink
chore: migrate to esm
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemmmy committed Feb 11, 2024
1 parent 09c96be commit 9081ac3
Show file tree
Hide file tree
Showing 54 changed files with 2,000 additions and 1,824 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

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

7 changes: 7 additions & 0 deletions .idea/codeStyles/Project.xml

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

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

17 changes: 17 additions & 0 deletions .idea/highlightedFiles.xml

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

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

9 changes: 9 additions & 0 deletions .idea/krist.js.iml

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

14 changes: 14 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

14 changes: 14 additions & 0 deletions .idea/vcs.xml

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

10 changes: 8 additions & 2 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"extension": "ts",
"spec": "test/**/*.test.ts",
"require": "test/fixtures.ts",
"reporter": "mochawesome",
"exit": true
"exit": true,
"node-option": [
"experimental-specifier-resolution=node",
"import=tsx/esm",
"trace-uncaught"
]
}
85 changes: 42 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "krist",
"version": "2.0.4",
"version": "3.0.0",
"description": "Krist API library for Node.js and the browser",
"keywords": [
"krist"
Expand All @@ -10,7 +10,8 @@
"author": "Lemmmy",
"license": "GPL-3.0",
"private": false,
"main": "lib/node.js",
"type": "module",
"exports": "./lib/node.js",
"types": "lib/src/node.d.ts",
"files": [
"lib/**/*.{ts,js}",
Expand All @@ -24,60 +25,58 @@
"clean": "rimraf lib",
"build": "npm run clean && npm run rollup",
"rollup": "rollup --config rollup.config.js",
"test": "TS_NODE_PROJECT='./tsconfig.test.json' NODE_ENV=test ts-mocha 'test/**/*.test.ts'",
"test": "cross-env TS_NODE_PROJECT='./tsconfig.test.json' NODE_ENV=test mocha",
"test:coverage": "nyc npm run test",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"docs": "typedoc",
"watch:docs": "typedoc --watch"
},
"dependencies": {
"axios": "^0.27.2",
"@aws-crypto/sha256-js": "^5.2.0",
"axios": "^1.6.7",
"buffer": "^6.0.3",
"cross-fetch": "^3.1.5",
"limiter": "^2.1.0",
"sha.js": "^2.4.11",
"cross-fetch": "^4.0.0",
"limiter-es6-compat": "^2.1.2",
"tiny-typed-emitter": "^2.1.0",
"websocket-as-promised": "^2.0.1",
"ws": "^8.6.0"
"ws": "^8.16.0",
"wspromisify": "^2.4.4"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-typescript": "^8.3.2",
"@types/axios": "^0.14.0",
"@types/chai": "^4.3.1",
"@types/chai-as-promised": "^7.1.5",
"@types/chai-http": "^4.2.0",
"@types/mocha": "^9.1.1",
"@types/node": "^17.0.31",
"@types/sha.js": "^2.4.0",
"@types/sinon": "^10.0.11",
"@types/ws": "^8.5.3",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"chai": "^4.3.6",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/chai": "^4.3.11",
"@types/chai-as-promised": "^7.1.8",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.17",
"@types/sha.js": "^2.4.4",
"@types/sinon": "^17.0.3",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"chai": "^5.0.3",
"chai-as-promised": "^7.1.1",
"chai-http": "^4.3.0",
"eslint": "^8.14.0",
"eslint-plugin-tsdoc": "^0.2.16",
"mocha": "^9.2.2",
"chai-http": "^4.4.0",
"cross-env": "^7.0.3",
"eslint": "^8.56.0",
"eslint-plugin-tsdoc": "^0.2.17",
"mocha": "^10.3.0",
"mochawesome": "^7.1.3",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"rollup": "^2.71.1",
"rollup-plugin-dts": "^4.2.1",
"rollup-plugin-polyfill-node": "^0.9.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-visualizer": "^5.6.0",
"sinon": "^13.0.2",
"ts-loader": "^9.3.0",
"ts-mocha": "^9.0.2",
"ts-node": "^10.7.0",
"tslib": "^2.4.0",
"typedoc": "^0.23.7",
"typescript": "^4.6.4",
"utility-types": "^3.10.0"
"rimraf": "^5.0.5",
"rollup": "^4.10.0",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-polyfill-node": "^0.13.0",
"rollup-plugin-visualizer": "^5.12.0",
"sinon": "^17.0.1",
"ts-loader": "^9.5.1",
"tslib": "^2.6.2",
"tsx": "^4.7.1",
"typedoc": "^0.25.8",
"typescript": "^5.3.3",
"utility-types": "^3.11.0"
}
}
13 changes: 7 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 - 2022 Drew Edwards, tmpim
* Copyright 2022 - 2024 Drew Edwards, tmpim
*
* This file is part of Krist.js.
*
Expand All @@ -25,7 +25,7 @@ import pluginDts from "rollup-plugin-dts";
import { nodeResolve as pluginNodeResolve } from "@rollup/plugin-node-resolve";
import pluginNodePolyfills from "rollup-plugin-polyfill-node";
import pluginCommonjs from "@rollup/plugin-commonjs";
import { terser as pluginTerser } from "rollup-plugin-terser";
import pluginTerser from "@rollup/plugin-terser";
import { visualizer as pluginVisualizer } from "rollup-plugin-visualizer";

export default [
Expand All @@ -34,15 +34,16 @@ export default [
input: "src/node.ts",
output: {
dir: "lib",
format: "umd",
format: "es",
esModule: true,
name: "krist",
plugins: [
pluginTerser(),
]
},
plugins: [
pluginNodeResolve({ browser: false }),
pluginCommonjs({ include: ["node_modules/**"] }),
pluginCommonjs({ defaultIsModuleExports: true }),
pluginTypescript({ tsconfig: "./tsconfig.json" }),
pluginJson()
]
Expand All @@ -58,7 +59,7 @@ export default [
input: "src/browser.ts",
output: {
dir: "lib",
format: "umd",
format: "es",
esModule: true,
name: "krist",
globals: {
Expand All @@ -71,7 +72,7 @@ export default [
external: ["ws"],
plugins: [
pluginNodePolyfills(),
pluginCommonjs({ include: "node_modules/**" }),
pluginCommonjs({ defaultIsModuleExports: true }),
pluginNodeResolve({ browser: true }),
pluginTypescript({ sourceMap: true, tsconfig: "./tsconfig.json" }),
pluginJson(),
Expand Down
Loading

0 comments on commit 9081ac3

Please sign in to comment.