diff --git a/.gitignore b/.gitignore index b50d83fd2e..35888493fa 100644 --- a/.gitignore +++ b/.gitignore @@ -4,14 +4,14 @@ node_modules *.map /src/compile/internal-exports.ts -/compiler.* -/index.* -/internal.* -/store.* -/easing.* -/motion.* -/transition.* -/animate.* +/compiler.*js +/index.*js +/internal.*js +/store.*js +/easing.*js +/motion.*js +/transition.*js +/animate.*js /scratch/ /coverage/ /coverage.lcov/ @@ -21,6 +21,7 @@ node_modules /test/sourcemaps/samples/*/output.css.map /yarn-error.log _actual*.* +/dist /site/cypress/screenshots/ /site/__sapper__/ diff --git a/animate.d.ts b/animate.d.ts new file mode 100644 index 0000000000..3284bfd8c0 --- /dev/null +++ b/animate.d.ts @@ -0,0 +1 @@ +export * from './dist/animate'; diff --git a/compiler.d.ts b/compiler.d.ts new file mode 100644 index 0000000000..977efefb6d --- /dev/null +++ b/compiler.d.ts @@ -0,0 +1 @@ +export * from './dist/compiler'; diff --git a/easing.d.ts b/easing.d.ts new file mode 100644 index 0000000000..c07764f4f0 --- /dev/null +++ b/easing.d.ts @@ -0,0 +1 @@ +export * from './dist/easing'; diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000000..e4ddc9027e --- /dev/null +++ b/index.d.ts @@ -0,0 +1 @@ +export * from './dist/index'; diff --git a/internal.d.ts b/internal.d.ts new file mode 100644 index 0000000000..be034cd88a --- /dev/null +++ b/internal.d.ts @@ -0,0 +1 @@ +export * from './dist/internal'; diff --git a/motion.d.ts b/motion.d.ts new file mode 100644 index 0000000000..2fdaa86c4e --- /dev/null +++ b/motion.d.ts @@ -0,0 +1 @@ +export * from './dist/motion'; diff --git a/package.json b/package.json index 8665648abb..7963e2178d 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "pretest": "npm run build", "posttest": "agadoo internal.mjs", "prepublishOnly": "export PUBLISH=true && npm run lint && npm test", - "tsd": "tsc -d src/store.ts --outDir .", - "typecheck": "tsc --noEmit" + "tsd": "tsc -p . --emitDeclarationOnly", + "typecheck": "tsc -p . --noEmit" }, "repository": { "type": "git", diff --git a/store.d.ts b/store.d.ts new file mode 100644 index 0000000000..2c1307011b --- /dev/null +++ b/store.d.ts @@ -0,0 +1 @@ +export * from './dist/store'; diff --git a/transition.d.ts b/transition.d.ts new file mode 100644 index 0000000000..54d5f036da --- /dev/null +++ b/transition.d.ts @@ -0,0 +1 @@ +export * from './dist/transition'; diff --git a/tsconfig.json b/tsconfig.json index acbca11ac7..ff11591679 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,34 @@ { - "compilerOptions": { - "target": "ES6", - "diagnostics": true, - "noImplicitThis": true, - "noEmitOnError": true, - "allowJs": true, - "lib": ["es5", "es6", "dom"], - "importHelpers": true, - "moduleResolution": "node", - "baseUrl": ".", - "paths": { - "svelte/*": ["./src/*"] - } - }, - "include": [ - "src" - ], - "exclude": [ - "./*.*js", - "node_modules" - ] + "compilerOptions": { + "target": "es2015", + "module": "es6", + "declarationDir": "./dist", + "outDir": "./dist", + "declaration": true, + "noImplicitThis": true, + "noEmitOnError": true, + "lib": [ + "es5", + "es6", + "dom", + "es2015" + ], + "importHelpers": true, + "moduleResolution": "node", + "baseUrl": ".", + "paths": { + "svelte/*": [ + "./src/*" + ] + }, + "typeRoots": [ + "node_modules/@types" + ] + }, + "include": [ + "src/**/*" + ], + "exclude": [ + "dist" + ] }