diff --git a/cspell.json b/cspell.json index 9d7082c..dceb633 100644 --- a/cspell.json +++ b/cspell.json @@ -5,6 +5,7 @@ "dictionaries": [], "words": [ "Aragorn", + "Evalles", "Langtail", "undici" ], diff --git a/package.json b/package.json index c3ee1e4..108505c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "langtail", - "version": "0.3.0-beta.2", + "version": "0.3.0", "description": "", "main": "./dist/LangtailNode.js", "packageManager": "pnpm@8.15.6", @@ -44,6 +44,11 @@ "require": "./dist/LangtailNode.js", "import": "./dist/LangtailNode.mjs", "types": "./dist/LangtailNode.d.ts" + }, + "./dist/getOpenAIBody": { + "require": "./dist/getOpenAIBody.js", + "import": "./dist/getOpenAIBody.mjs", + "types": "./dist/getOpenAIBody.d.ts" } }, "files": [ diff --git a/src/template.ts b/src/template.ts index 9f5a570..d628573 100644 --- a/src/template.ts +++ b/src/template.ts @@ -1,12 +1,14 @@ -import handlebars from "@langtail/handlebars-evalless" -import { Visitor } from "handlebars" +import * as handlebarsEvalles from "@langtail/handlebars-evalless" +import vanillaHandlebars from "handlebars" import { handlebarsDateHelper, operatorHelpers } from "./handlebars-helpers" import { JSONValue } from "./jsonType" import { ContentArray } from "./schemas" +const handlebars = handlebarsEvalles.default handlebars.registerHelper("$date", handlebarsDateHelper) handlebars.registerHelper(operatorHelpers) +const Visitor = vanillaHandlebars.Visitor /* * This class is used to wrap the input object to be used in handlebars templates. Without this JSON objects are rendered as [object Object] diff --git a/tsconfig.json b/tsconfig.json index b429ff3..b2cd13a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,7 @@ /* Interop Constraints */ "declaration": true, "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, - + "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, /* Type Checking */