Skip to content

Commit

Permalink
Adds .d.ts declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Oct 6, 2024
1 parent 799a9d9 commit 961b31e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-rats-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vtbag/turn-signal': patch
---

Adds .d.ts declarations
2 changes: 2 additions & 0 deletions bin/bundle
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ else
(cd lib && rm *.js.map) >> /dev/null 2>&1
fi
npx esbuild src/index.ts src/forced-traversal.ts --bundle $OPTS --target=ESnext --outdir=lib

tsc
7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "@vtbag/turn-signal",
"type": "module",
"version": "1.0.2",
"main": "lib/index.js",
"description": "Turn-Signal is a lightweight script that enhances cross-document navigation by detecting the direction of browser navigation. It enables developers to create smooth, responsive transitions that adjust based on forward or backward navigation, delivering a more intuitive user experience.",
"files": [
"lib/index.js",
"lib/forced-traversal.js"
"lib/index.d.ts",
"lib/forced-traversal.js",
"lib/forced-traversal.d.ts"
],
"exports": {
".": "./lib/index.js",
Expand Down Expand Up @@ -48,6 +51,7 @@
"@changesets/cli": "^2.27.9",
"@eslint/js": "^9.12.0",
"@types/dom-navigation": "^1.0.4",
"@types/dom-view-transitions": "^1.0.5",
"esbuild": "^0.24.0",
"prettier": "^3.3.3",
"typescript": "^5.6.2"
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */

/* Emit */
//"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
Expand All @@ -71,7 +71,7 @@
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
"declarationDir": "./lib", /* Specify the output directory for generated declaration files. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down

0 comments on commit 961b31e

Please sign in to comment.