feat: all cjs export (#3189)

* feat: all cjs export

* test: fix deno test

* style: fix error  Expected space or tab before '*/' in comment  spaced-comment

* fix: deno import map

* fix: sneak in a fix for yarn
This commit is contained in:
Jonathan Ho
2023-11-27 01:17:54 +00:00
committed by GitHub
parent 887596125e
commit 1974834b20
24 changed files with 1020 additions and 53 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript",
@@ -20,5 +21,5 @@
"lazy": false,
"noInterop": false
},
"sourceMaps": true
}
"sourceMaps": "inline"
}
+9 -4
View File
@@ -1,8 +1,13 @@
{
"name": "@discordeno/bot",
"version": "19.0.0-alpha.1",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./dist/esm/index.js",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
},
"types": "./dist/types/index.d.ts",
"type": "module",
"license": "Apache-2.0",
"repository": {
@@ -10,8 +15,8 @@
"url": "https://github.com/discordeno/discordeno.git"
},
"scripts": {
"build": "swc --delete-dir-on-start src --out-dir dist",
"build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist",
"build": "swc src --delete-dir-on-start src --out-dir dist/esm && swc --delete-dir-on-start src --out-dir dist/cjs -C module.type=commonjs && node ../../scripts/fixCjsExtension.js",
"build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist/types",
"release-build": "yarn build && yarn build:type",
"fmt": "eslint --fix \"src/**/*.ts*\"",
"lint": "eslint \"src/**/*.ts*\"",