build types on prepublish
MODIFY
packages/kit/.gitignore
packages/kit/.gitignore
/node_modules
/dist
/assets/client.*
+/types
+/client

MODIFY
packages/kit/package.json
packages/kit/package.json
},
"files": [
"assets",
- "dist"
+ "dist",
+ "client"
],
"scripts": {
"dev": "rollup -cw",
"build": "rollup -c",
"prepare": "npm run build",
- "prepublishOnly": "npm run build"
+ "prepublishOnly": "npm run build",
+ "prepublish": "tsc && cp -r types/src/client client"
}
}

MODIFY
packages/kit/src/ambient.d.ts
packages/kit/src/ambient.d.ts
@@ -2,6 +2,7 @@ declare module "MANIFEST" {
export const components: any[];
export const routes: any[];
export const Layout: any;
+ export const ErrorComponent: any;
}
declare module "ROOT" {

MODIFY
packages/kit/tsconfig.json
packages/kit/tsconfig.json
"target": "ES6",
"outDir": "build",
"esModuleInterop": true,
- "noEmit": true,
- "declarationDir": "declarations",
+ "emitDeclarationOnly": true,
+ "declarationDir": "types",
"declaration": true
},
+ "include": ["src/**/*", "types/src/**/*", "client"],
"lib": ["ES2020", "dom", "node"]
}

build types on prepublish