diff --git a/.changeset/warm-carrots-teach.md b/.changeset/warm-carrots-teach.md new file mode 100644 index 0000000..e3d5568 --- /dev/null +++ b/.changeset/warm-carrots-teach.md @@ -0,0 +1,5 @@ +--- +'@vtbag/cam-shaft': patch +--- + +Adds .d.ts declarations diff --git a/bin/bundle b/bin/bundle index e2c4c47..3f0a29b 100755 --- a/bin/bundle +++ b/bin/bundle @@ -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 diff --git a/package.json b/package.json index fa7b7f2..11e8d95 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/tsconfig.json b/tsconfig.json index 66c3f62..3630d1d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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. */ @@ -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. */