From 957e399a09a10dba19c50ce63250702d523ba0e7 Mon Sep 17 00:00:00 2001 From: Jared Wray Date: Fri, 25 Aug 2023 07:55:49 -0700 Subject: [PATCH 1/2] adding in parcel for minification browser version --- .github/workflows/tests.yaml | 3 +++ index.d.ts | 22 +++++++++++----------- package.json | 13 +++++++++++-- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b4accb8..591d1a3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -28,6 +28,9 @@ jobs: - name: Testing run: yarn test + - name: Build + run: yarn build + - name: Code Coverage uses: codecov/codecov-action@v3 with: diff --git a/index.d.ts b/index.d.ts index 80c32f6..f105987 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,16 +1,16 @@ -// Type definitions for handlebars-helpers 0.5 -// Project: http://assemble.io/helpers/, https://github.com/helpers/handlebars-helpers -// Definitions by: Toilal -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// index.d.ts -import Handlebars from "handlebars"; +// Importing types from the handlebars package +import { Handlebars } from 'handlebars'; -declare module "fumanchu" { - export = Fumanchu; - class Fumanchu extends Handlebars { - constructor(); - } +// Assuming helpers.js exports a function. Adjust as needed. +interface HelpersFunction { + (config: { handlebars: typeof Handlebars }): void; } +// Since you're exporting the handlebars instance itself: +declare const handlebars: typeof Handlebars; + +export = handlebars; + diff --git a/package.json b/package.json index 12ba0e4..5792769 100644 --- a/package.json +++ b/package.json @@ -64,15 +64,19 @@ "index.js", "helpers.js", "lib", + "dist", "index.d.ts" ], + "source": "index.js", "main": "index.js", "types": "index.d.ts", + "browser": "dist/fumanchu.min.js", "engines": { "node": ">=14" }, "scripts": { "test": "c8 mocha --reporter list", + "build": "parcel build --dist-dir dist", "clean": "rm -rf node_modules" }, "dependencies": { @@ -85,7 +89,7 @@ "for-own": "^1.0.0", "get-object": "^0.2.0", "get-value": "^3.0.1", - "handlebars": "^4.7.7", + "handlebars": "^4.7.8", "handlebars-helper-create-frame": "^0.1.0", "handlebars-utils": "^1.0.6", "has-value": "^2.0.2", @@ -110,6 +114,7 @@ "chai": "^4.3.8", "global-modules": "^2.0.0", "mocha": "^10.2.0", + "parcel": "^2.9.3", "template-helpers": "^1.0.1", "templates": "^1.2.9" }, @@ -144,5 +149,9 @@ "last 1 version", "> 1%", "not dead" - ] + ], + "targets": { + "main": false, + "types": false + } } From 481be4e18e3813bc5e68c7c2e2eb329c33f55904 Mon Sep 17 00:00:00 2001 From: Jared Wray Date: Fri, 25 Aug 2023 07:56:47 -0700 Subject: [PATCH 2/2] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 9503080..4b99d8a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,6 @@ **Please check if the PR fulfills these requirements** -- [ ] Followed the [Contributing](https://github.com/jaredwray/airhorn/blob/main/CONTRIBUTING.md) guidelines. -- [ ] Tests for the changes have been added (for bug fixes/features) with 100% code coverage. +- [ ] Followed the [Contributing](https://github.com/jaredwray/fumanchu/blob/main/CONTRIBUTING.md) guidelines. +- [ ] Tests for the changes have been added (for bug fixes/features) without decreasing code coverage. - [ ] Docs have been added / updated (for bug fixes / features) **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)