Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support both ESM and CommonJS #15

Merged
merged 1 commit into from
May 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
dist
node_modules
14 changes: 0 additions & 14 deletions .eslintrc

This file was deleted.

21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"root": true,
"env": {
"es2015": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"rules": {
"prettier/prettier": ["error", { "endOfLine": "auto" }]
},
"overrides": []
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.DS_Store
node_modules
dist
/lib
/logs
.eslintcache
/coverage
Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# build stage
FROM node:17 as build

FROM node:18 as build
WORKDIR /app
COPY package*.json ./
RUN npm ci

# install pnpm
RUN npm i -g pnpm@8.5.0

COPY pnpm-lock.yaml package.json ./
RUN pnpm install --frozen-lockfile

COPY . ./
RUN npm run docs:build
RUN pnpm docs:build

# production stage
FROM nginx:stable-alpine
Expand Down
30 changes: 18 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
"description": "Library for quickly creating discord music and sound bots using discord.js v14.",
"version": "1.5.2",
"packageManager": "pnpm@8.5.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"license": "MIT",
"homepage": "https://discordplayerplus.lars-rickert.de",
"files": [
"lib",
"dist",
"CHANGELOG.md"
],
"author": {
Expand All @@ -20,11 +18,21 @@
"type": "git",
"url": "https://github.com/larsrickert/discord-player-plus"
},
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"scripts": {
"dev": "tsc -w",
"build": "tsc",
"lint": "tsc --noEmit && eslint --fix src --ignore-path .gitignore",
"format": "prettier --write src --ignore-path .gitignore",
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
"watch": "pnpm run build --watch src",
"lint": "eslint src --fix --ignore-path .gitignore",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:serve": "vitepress serve docs",
Expand Down Expand Up @@ -61,7 +69,8 @@
"prettier": "^2.8.8",
"semantic-release": "^21.0.2",
"simple-git-hooks": "^2.8.1",
"typescript": "^4.9.5",
"tsup": "^6.7.0",
"typescript": "^5.0.4",
"vitepress": "1.0.0-alpha.73",
"vitest": "~0.29.8",
"vitest-mock-extended": "^1.1.3"
Expand All @@ -70,10 +79,7 @@
"pre-commit": "npx lint-staged"
},
"lint-staged": {
"*.{js,ts}": [
"eslint --cache --fix",
"prettier --write --ignore-path .gitignore"
]
"*.{ts}": "eslint --fix --ignore-path .gitignore"
},
"engines": {
"node": ">=16.9.0"
Expand Down
Loading