classmodel / class-web

Web version of CLASS
https://classmodel.github.io/class-web
GNU General Public License v3.0
0 stars 0 forks source link

Prep publish package #9

Closed sverhoeven closed 1 month ago

sverhoeven commented 1 month ago

Follow up on #5 to publish @classmodel/class package to jsr.io

JSR reports slow types ```shell npx jsr publish --dry-run Checking for slow types in the public API... error[missing-explicit-type]: missing explicit type in the public API --> /home/stefanv/git/classmodel/class-web/packages/class/src/config.ts:7:7 | 7 | const initialState = z | ^^^^^^^^^^^^ this symbol is missing an explicit type | = hint: add an explicit type annotation to the symbol info: all symbols in the public API must have an explicit type docs: https://jsr.io/go/slow-type-missing-explicit-type error[missing-explicit-type]: missing explicit type in the public API --> /home/stefanv/git/classmodel/class-web/packages/class/src/config.ts:29:7 | 29 | const timeControl = z | ^^^^^^^^^^^ this symbol is missing an explicit type | = hint: add an explicit type annotation to the symbol info: all symbols in the public API must have an explicit type docs: https://jsr.io/go/slow-type-missing-explicit-type error[missing-explicit-type]: missing explicit type in the public API --> /home/stefanv/git/classmodel/class-web/packages/class/src/config.ts:40:7 | 40 | const mixedLayer = z | ^^^^^^^^^^ this symbol is missing an explicit type | = hint: add an explicit type annotation to the symbol info: all symbols in the public API must have an explicit type docs: https://jsr.io/go/slow-type-missing-explicit-type error[missing-explicit-type]: missing explicit type in the public API --> /home/stefanv/git/classmodel/class-web/packages/class/src/config.ts:78:7 | 78 | const radiation = z | ^^^^^^^^^ this symbol is missing an explicit type | = hint: add an explicit type annotation to the symbol info: all symbols in the public API must have an explicit type docs: https://jsr.io/go/slow-type-missing-explicit-type error[missing-explicit-type]: missing explicit type in the public API --> /home/stefanv/git/classmodel/class-web/packages/class/src/config.ts:87:14 | 87 | export const classConfig = z.object({ | ^^^^^^^^^^^ this symbol is missing an explicit type | = hint: add an explicit type annotation to the symbol info: all symbols in the public API must have an explicit type docs: https://jsr.io/go/slow-type-missing-explicit-type error[missing-explicit-type]: missing explicit type in the public API --> /home/stefanv/git/classmodel/class-web/packages/class/src/config.ts:95:14 | 95 | export const classDefaultConfigSchema = zodToJsonSchema( | ^^^^^^^^^^^^^^^^^^^^^^^^ this symbol is missing an explicit type | = hint: add an explicit type annotation to the symbol info: all symbols in the public API must have an explicit type docs: https://jsr.io/go/slow-type-missing-explicit-type This package contains errors for slow types. Fixing these errors will: 1. Significantly improve your package users' type checking performance. 2. Improve the automatic documentation generation. 3. Enable automatic .d.ts generation for Node.js. Don't want to bother? You can choose to skip this step by providing the --allow-slow-types flag. error: Found 6 problems Child process exited with: 1 ``` We could generate type declarations (src/config.d.ts) manually with ``` ./node_modules/.bin/tsc --emitDeclarationOnly --declaration --target esnext --moduleresolution nodenext --module nodenext src/config.ts ``` but this gives a chicken (type) and egg (zod) problem. ``