diff --git a/package.json b/package.json index 6f7c040..3a7f4e5 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,11 @@ "description": "Websockets provider for Yjs", "main": "./dist/y-websocket.cjs", "module": "./src/y-websocket.js", + "types": "./dist/src/y-websocket.d.ts", "sideEffects": false, "scripts": { "start": "node ./bin/server.js", - "dist": "rm -rf dist && rollup -c", + "dist": "rm -rf dist && rollup -c && tsc", "lint": "standard && tsc", "preversion": "npm run lint && npm run dist" }, diff --git a/tsconfig.json b/tsconfig.json index 5118228..235a1cd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,15 +6,15 @@ "allowJs": true, /* Allow javascript files to be compiled. */ "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ - // "outDir": "./build", /* Redirect output structure to the directory. */ - // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ + "outDir": "./dist", /* Redirect output structure to the directory. */ + "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ // "composite": true, /* Enable project compilation */ // "removeComments": true, /* Do not emit comments to output. */ - "noEmit": true, /* Do not emit outputs. */ + // "noEmit": true, /* Do not emit outputs. */ // "importHelpers": true, /* Import emit helpers from 'tslib'. */ // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ @@ -22,6 +22,7 @@ /* Strict Type-Checking Options */ "strict": true, /* Enable all strict type-checking options. */ "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */ + "emitDeclarationOnly": true, // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */