From 2d526b60c5382a9b5f803f90e5069c11f2be9885 Mon Sep 17 00:00:00 2001 From: iamspdarsan Date: Sat, 18 May 2024 16:06:33 +0530 Subject: [PATCH] ecma and cjs interop fixed, types def bug fixed --- package.json | 20 +++++++------------- richie.ts | 2 +- test/main.test.ts | 2 +- tsconfig.json | 13 +++++++------ 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 1712427..454f84f 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,12 @@ "displayName": "Richie JS", "exports": { "import": "./dist/richie.js", - "require": "./dist/richie.js" + "require": "./dist/richie.js", + "types": "./dist/types/richie.d.ts" }, "description": "Rich Result Generator", - "version": "1.0.2", + "version": "1.0.3", "main": "./dist/richie.js", - "types": "./dist/types/", "files": [ "dist", "intellisense" @@ -16,28 +16,22 @@ "directories": { "lib": "./dist/lib" }, - "dist": { - "shasum": "not added" - }, - "icon": "not added", "engines": { "node": ">=21.7.3", "npm": ">=10.5.0" }, - "engineStrict": false, "preferGlobal": true, "bin": { "rjs": "./dist/lib/schemaWriter.js" }, "scripts": { "dev": "rimraf dist && tsc -p tscdev.json", - "build": "rimraf dist && tsc -b", - "watch": "tsc --watch", - "br": "cls && yarn dev && node ./dist/richie.js", + "dr": "cls && yarn dev && node ./dist/richie.js", "rp": "node ./dist/richie.js", - "clean": "cls && rimraf dist", - "bt": "cls && yarn dev && jest", "test": "jest", + "build": "cls && rimraf dist && tsc -p tsconfig.json", + "watch": "tsc --watch", + "clean": "cls && rimraf dist", "deploy": "yarn build && yarn publish --access public && git push" }, "repository": { diff --git a/richie.ts b/richie.ts index f53b508..f9aa7c0 100644 --- a/richie.ts +++ b/richie.ts @@ -116,7 +116,7 @@ const functionMap: Record = { }, }; -export default async function richie( +export async function richie( richieName: richies, filepath: string, destinationPath: string = "", diff --git a/test/main.test.ts b/test/main.test.ts index 47ada31..b928554 100644 --- a/test/main.test.ts +++ b/test/main.test.ts @@ -3,7 +3,7 @@ import { rmSync, existsSync } from "fs"; import { mkdirpSync } from "mkdirp"; import { basename, join } from "path"; import { richies, testProps } from "../lib/options"; -import richie from "../richie"; +import { richie } from "../richie"; const opfolder = "./test/outputs"; let iterN = 0; diff --git a/tsconfig.json b/tsconfig.json index 4721e07..317da5a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { - "target": "ES2022", - "module": "CommonJS", - "moduleResolution": "Node10", + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext", "baseUrl": ".", "rootDir": ".", "outDir": "dist", @@ -33,7 +33,8 @@ "removeComments": true }, "exclude": [ - "node_modules" - + "node_modules", + "test", + "jest.config.ts" ] -} +} \ No newline at end of file