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 99fd997 commit 0c1f959
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-carrots-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vtbag/cam-shaft': 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 --bundle $OPTS --target=ESnext --outdir=lib

tsc
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "@vtbag/cam-shaft",
"type": "module",
"version": "1.0.0",
"main": "lib/index.js",
"description": "The Cam-Shaft bumps your view transition images into place to avoid the pseudo-smooth-scroll effect when applying view transitions to elements that are taller than the viewport.",
"files": [
"lib/index.js"
"lib/index.js",
"lib/index.d.ts"
],
"exports": {
".": "./lib/index.js"
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 0c1f959

Please sign in to comment.