From 7cdd1e25d51a9fea5fc670a77d784a3a01e55494 Mon Sep 17 00:00:00 2001 From: Markus Felten Date: Wed, 20 Mar 2024 13:50:33 +0100 Subject: [PATCH 1/3] fix(module): (exports..) chore(scripts): add npm run lint:docs && npm run lint:typescript (scripts.lint) chore(scripts): add npm run prepare:typescript (scripts.prepare) chore(scripts): add tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs (scripts.prepare:typescript) chore(scripts): add tsc --allowJs --checkJs --noEmit --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs (scripts.lint:typescript) chore(deps): add ^5.4.2 (devDependencies.typescript) --- package.json | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3d65a3f8..57860ff4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "provenance": true }, "exports": { - ".": "./src/expander.mjs" + ".": { + "default": "./src/expander.mjs" + } }, "description": "Expands expressions in config files", "keywords": [ @@ -22,12 +24,15 @@ ], "license": "BSD-2-Clause", "scripts": { + "prepare": "npm run prepare:typescript", + "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs", "test": "npm run test:ava", "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs", "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp", "docs": "documentation readme --section=API ./src/**/*.mjs", - "lint": "npm run lint:docs", - "lint:docs": "documentation lint ./src/**/*.mjs" + "lint": "npm run lint:docs && npm run lint:typescript", + "lint:docs": "documentation lint ./src/**/*.mjs", + "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs" }, "dependencies": { "expression-expander": "^7.2.4", @@ -37,7 +42,8 @@ "ava": "^6.1.2", "c8": "^9.1.0", "documentation": "^14.0.3", - "semantic-release": "^23.0.5" + "semantic-release": "^23.0.5", + "typescript": "^5.4.2" }, "engines": { "node": ">=16.20.2" @@ -53,7 +59,8 @@ "template": { "inheritFrom": [ "arlac77/template-arlac77-github", - "arlac77/template-javascript-component" + "arlac77/template-javascript-component", + "arlac77/template-typescript" ] } } From 401b37f95c55b55e7339262467c3225ab18181e3 Mon Sep 17 00:00:00 2001 From: Markus Felten Date: Wed, 20 Mar 2024 13:50:36 +0100 Subject: [PATCH 2/3] chore: add types () --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 34b68b29..c048cc2c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ bun.lockb *.dump *.node .DS_Store +types .test .tmp From de975fe2d1a492c409e26f40e6e9f586b394ad45 Mon Sep 17 00:00:00 2001 From: Markus Felten Date: Wed, 20 Mar 2024 13:50:37 +0100 Subject: [PATCH 3/3] docs(README): update from template --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e484abfd..22995ab2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![npm](https://img.shields.io/npm/v/config-expander.svg)](https://www.npmjs.com/package/config-expander) [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) +[![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org) [![bundlejs](https://deno.bundlejs.com/?q=config-expander\&badge=detailed)](https://bundlejs.com/?q=config-expander) [![downloads](http://img.shields.io/npm/dm/config-expander.svg?style=flat-square)](https://npmjs.org/package/config-expander) [![GitHub Issues](https://img.shields.io/github/issues/arlac77/config-expander.svg?style=flat-square)](https://github.com/arlac77/config-expander/issues)