Skip to content

Conversation

@eatsjobs
Copy link
Contributor

@eatsjobs eatsjobs commented Apr 15, 2024

Types were generated with some relative paths for example
declare function initSsr(content: any, ...rest: any[]): typeof import("./keyed.js");
causing type resolution to fail if outDir is a different folder like types

The fix is to just let the types live aside the src files to let relative path resolution working.

I also added a small tool to check types are not wrong in different configuration.

To check types are not wrong run:
npm run build && npm run are-types-wrong to check it.

@eatsjobs eatsjobs mentioned this pull request Apr 15, 2024
@WebReflection WebReflection merged commit d15692a into WebReflection:main Apr 15, 2024
@WebReflection
Copy link
Owner

Uhm ... OK, this out of the build passes CI but it breaks locally:

> uhtml@4.6.0 postbuild
> npx tsc -p tsconfig.json && npx tsc -p tsconfig.cjs.json

error TS2318: Cannot find global type 'Array'.

error TS2318: Cannot find global type 'Boolean'.

error TS2318: Cannot find global type 'CallableFunction'.

error TS2318: Cannot find global type 'Function'.

error TS2318: Cannot find global type 'IArguments'.

error TS2318: Cannot find global type 'NewableFunction'.

error TS2318: Cannot find global type 'Number'.

error TS2318: Cannot find global type 'Object'.

error TS2318: Cannot find global type 'RegExp'.

error TS2318: Cannot find global type 'String'.

error TS2688: Cannot find type definition file for 'estree'.
  The file is in the program because:
    Entry point for implicit type library 'estree'

error TS2688: Cannot find type definition file for 'istanbul-lib-coverage'.
  The file is in the program because:
    Entry point for implicit type library 'istanbul-lib-coverage'

error TS2688: Cannot find type definition file for 'resolve'.
  The file is in the program because:
    Entry point for implicit type library 'resolve'

error TS6053: File '/home/ag/git/uhtml/node_modules/typescript/lib/lib.esnext.full.d.ts' not found.
  The file is in the program because:
    Default library for target 'esnext'

  tsconfig.json:4:15
    4     "target": "esnext",
                    ~~~~~~~~
    File is default library for target specified here.


Found 14 errors.

I can't update with this MR ... I did a mistake rushing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants