Skip to content

Commit

Permalink
Alpha Browser Support
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Best-Codes committed Jul 25, 2024
1 parent 656a34d commit b97bf70
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
10 changes: 5 additions & 5 deletions dist/browser/best-bible.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/browser/best-bible.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "best-bible",
"version": "1.4.4",
"version": "1.4.5",
"description": "Fetch, parse, and analyze the Bible easily with JavaScript",
"scripts": {
"build:cjs": "tsc --project tsconfig.cjs.json || true && mkdir -p dist/cjs/data && cp src/data/bible.json dist/cjs/data/",
"build:esm": "tsc --project tsconfig.esm.json || true && mkdir -p dist/esm/data && cp src/data/bible.json dist/esm/data/",
"build:browser": "esbuild src/browser.ts --bundle --minify --sourcemap --format=iife --global-name=BestBible --platform=browser --target=es2015 --outfile=dist/browser/best-bible.min.js",
"build:browser": "esbuild src/browser.ts --bundle --minify --sourcemap --format=iife --platform=browser --target=es2015 --outfile=dist/browser/best-bible.min.js",
"build": "npm run build:cjs && npm run build:esm && npm run build:browser",
"prepublishOnly": "npm run build"
},
Expand Down
17 changes: 2 additions & 15 deletions src/browser.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
import { getVerse, getChapter, getBook, getRange, getChapterCount, getVerseCount, getBibleBooks, searchVerse, parseVerse, resolveAbbreviation, bibleStats, bibleValidation } from './index';
import * as BestBible from "./index";

// Expose the functions to the global scope
(window as any).BestBible = {
getVerse,
getChapter,
getBook,
getRange,
getChapterCount,
getVerseCount,
getBibleBooks,
searchVerse,
parseVerse,
resolveAbbreviation,
bibleStats,
bibleValidation
};
(window as any).BestBible = BestBible;
17 changes: 17 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script src="../dist/browser/best-bible.min.js"></script>

<script>
document.addEventListener("DOMContentLoaded", () => {
console.log(BestBible.getVerse("Genesis", 1, 1));
});
</script>
</body>
</html>

0 comments on commit b97bf70

Please sign in to comment.