Migrate to ESM
continuous-integration/drone/push Build is passing Details

Signed-off-by: Sam Therapy <sam@samtherapy.net>
This commit is contained in:
Sam Therapy 2022-12-28 15:58:17 +01:00
parent a0985f5156
commit 31f7ea94ce
Signed by: sam
GPG Key ID: 4D8B07C18F31ACBD
3 changed files with 7 additions and 5 deletions

View File

@ -17,7 +17,7 @@
"typescript": "4.9.4"
},
"name": "@froth/feditoken",
"version": "1.2.2",
"version": "1.2.1",
"description": "Token Generation for the fediverse (Pleroma, Mastodon, Misskey)",
"main": "dist/token.js",
"bin": "dist/token.js",
@ -36,5 +36,6 @@
"license": "0BSD",
"files": [
"dist"
]
],
"type": "module"
}

View File

@ -1,7 +1,8 @@
#!/usr/bin/env node
// Takes a user inputted fediverse instance and generates a token for the bot, and adds it to the configuration file
import generator, { detector } from "megalodon"
import generatorPkg, { detector } from "megalodon"
const generator = generatorPkg.default
import readline from "node:readline"
import { writeFile } from "node:fs/promises"

View File

@ -2,7 +2,7 @@
"compilerOptions": {
/* Basic Options */
"target": "ESNext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"module": "ESNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
"lib": [
"es6"
] /* Specify library files to be included in the compilation. */,
@ -28,7 +28,7 @@
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
/* Module Resolution Options */
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
"moduleResolution": "NodeNext" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
"sourceMap": true /* Generates corresponding '.map' file. */