diff --git a/package.json b/package.json index a2a81a2e..0e8507c0 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,12 @@ "description": "Shared Editing Library", "main": "./dist/yjs.cjs", "module": "./src/index.js", + "types": "./dist/src/index.d.ts", "sideEffects": false, "scripts": { "test": "npm run dist && node ./dist/tests.cjs --repitition-time 50", "test-exhaustive": "npm run lint && npm run dist && node ./dist/tests.cjs --production --repitition-time 10000", - "dist": "rm -rf dist && rollup -c", + "dist": "rm -rf dist && rollup -c && tsc", "watch": "rollup -wc", "lint": "markdownlint README.md && standard && tsc", "docs": "rm -rf docs; jsdoc --configure ./.jsdoc.json --verbose --readme ./README.md --package ./package.json || true", diff --git a/tsconfig.json b/tsconfig.json index 54eacaa0..828d8c88 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. */ + // "outFile": "./dist/yjs.js", /* Concatenate and emit output to single file. */ + "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": true, /* 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. */ @@ -62,6 +63,6 @@ "maxNodeModuleJsDepth": 5, // "types": ["./src/utils/typedefs.js"] }, - "include": ["./src/**/*", "./tests/**/*"], + "include": ["./src/**/*.js", "./tests/**/*.js"], "exclude": ["../lib0/**/*", "node_modules/**/*", "dist", "dist/**/*.js"] }