Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turborepo typescript fix build #1370

Merged
merged 4 commits into from
Sep 20, 2024

Conversation

kestarumper
Copy link
Member

@kestarumper kestarumper commented Sep 15, 2024

Shell dumps:

1. List `@types/node` package
npm ls @types/node
uniforms-repository@ /Users/adrianmucha/uniforms
├─┬ @types/[email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └─┬ @jest/[email protected]
│ │     └── @types/[email protected] deduped
│ └─┬ [email protected]
│   └─┬ @jest/[email protected]
│     └── @types/[email protected] deduped
├─┬ [email protected]
│ ├─┬ @jest/[email protected]
│ │ └── @types/[email protected] deduped
│ ├─┬ @jest/[email protected]
│ │ └── @types/[email protected] deduped
│ ├─┬ @jest/[email protected]
│ │ └── @types/[email protected] deduped
│ ├─┬ @types/[email protected]
│ │ └── @types/[email protected] deduped
│ ├── @types/[email protected]
│ ├─┬ [email protected]
│ │ └── @types/[email protected] deduped
│ └─┬ [email protected]
│   └── @types/[email protected] deduped
├─┬ [email protected]
│ └─┬ @jest/[email protected]
│   ├─┬ @jest/[email protected]
│   │ └── @types/[email protected] deduped
│   ├─┬ @jest/[email protected]
│   │ ├── @types/[email protected] deduped
│   │ └─┬ [email protected]
│   │   └── @types/[email protected] deduped
│   ├── @types/[email protected] deduped
│   ├─┬ [email protected]
│   │ ├── @types/[email protected] deduped
│   │ ├─┬ [email protected]
│   │ │ └── @types/[email protected] deduped
│   │ └─┬ [email protected]
│   │   └── @types/[email protected] deduped
│   ├─┬ [email protected]
│   │ ├─┬ @types/[email protected]
│   │ │ └── @types/[email protected] deduped
│   │ └── @types/[email protected] deduped
│   ├─┬ [email protected]
│   │ └── @types/[email protected] deduped
│   ├─┬ [email protected]
│   │ └── @types/[email protected] deduped
│   └─┬ [email protected]
│     └── @types/[email protected] deduped
└─┬ [email protected] -> ./packages/uniforms-bridge-simple-schema-2
  └─┬ @types/[email protected]
    └─┬ @types/[email protected]
      ├─┬ @types/[email protected]
      │ └── @types/[email protected] deduped
      └─┬ [email protected]
        └─┬ [email protected]
          └─┬ @types/[email protected]
            └── @types/[email protected] deduped
2. `AbortSignal` colliding declarations
../../node_modules/@types/node/globals.d.ts:72:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'AbortSignal' must be of type '{ new (): AbortSignal; prototype: AbortSignal; abort(reason?: any): AbortSignal; any(signals: AbortSignal[]): AbortSignal; timeout(milliseconds: number): AbortSignal; }', but here has type '{ new (): AbortSignal; prototype: AbortSignal; }'.
uniforms:build:esm:
uniforms:build:esm: 72 declare var AbortSignal: {
uniforms:build:esm:                ~~~~~~~~~~~
uniforms:build:esm:
uniforms:build:esm:   ../../node_modules/typescript/lib/lib.dom.d.ts:2360:13
uniforms:build:esm:     2360 declare var AbortSignal: {
uniforms:build:esm:                      ~~~~~~~~~~~
uniforms:build:esm:     'AbortSignal' was also declared here.
uniforms:build:esm:
uniforms:build:esm:
uniforms:build:esm: Found 1 error.
uniforms:build:esm:
3. After installing `@types/node@18`, the `Model_1` doesn't exist
../uniforms/cjs/QuickForm.d.ts:14:32 - error TS2552: Cannot find name 'Model_1'. Did you mean 'Model'?
uniforms-bridge-simple-schema-2:build:esm:
uniforms-bridge-simple-schema-2:build:esm: 14             id?: BaseFormProps<Model_1>["id"];
uniforms-bridge-simple-schema-2:build:esm:                                   ~~~~~~~
uniforms-bridge-simple-schema-2:build:esm:
uniforms-bridge-simple-schema-2:build:esm: ../uniforms/cjs/QuickForm.d.ts:16:39 - error TS2552: Cannot find name 'Model_1'. Did you mean 'Model'?
4. After changing `id` and `noValidate` types to explicit types instead of referencing
../../node_modules/antd/lib/select/index.d.ts:14:69 - error TS2344: Type 'VT' does not satisfy the constraint 'DefaultValueType'.
uniforms-antd:build:cjs:   Type 'VT' is not assignable to type 'RawValueType[]'.
uniforms-antd:build:cjs:
uniforms-antd:build:cjs: 14 export interface InternalSelectProps<VT> extends Omit<RcSelectProps<VT>, 'mode'> {
uniforms-antd:build:cjs:                                                                        ~~
uniforms-antd:build:cjs:
uniforms-antd:build:cjs:   ../../node_modules/antd/lib/select/index.d.ts:14:38
uniforms-antd:build:cjs:     14 export interface InternalSelectProps<VT> extends Omit<RcSelectProps<VT>, 'mode'> {
uniforms-antd:build:cjs:                                             ~~
uniforms-antd:build:cjs:     This type parameter might need an `extends RawValueType[]` constraint.
uniforms-antd:build:cjs:   ../../node_modules/antd/lib/select/index.d.ts:14:38
uniforms-antd:build:cjs:     14 export interface InternalSelectProps<VT> extends Omit<RcSelectProps<VT>, 'mode'> {
uniforms-antd:build:cjs:                                             ~~
uniforms-antd:build:cjs:     This type parameter might need an `extends DefaultValueType` constraint.
uniforms-antd:build:cjs:
uniforms-antd:build:cjs:
uniforms-antd:build:cjs: Found 1 error.
uniforms-antd:build:cjs:

Notes

TBH, I'm not confident about this one, but the build passes now.
Fixes #1369.

@kestarumper kestarumper added this to the v4.0 milestone Sep 15, 2024
@github-actions github-actions bot added Area: Infra Affects the repository itself (e.g., CI, dependencies) Area: Core Affects the uniforms package labels Sep 15, 2024
Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (turborepo-typescript-2@f6590b2). Learn more about missing BASE report.

Additional details and impacted files
@@                    Coverage Diff                    @@
##             turborepo-typescript-2    #1370   +/-   ##
=========================================================
  Coverage                          ?   96.34%           
=========================================================
  Files                             ?      175           
  Lines                             ?     2869           
  Branches                          ?      775           
=========================================================
  Hits                              ?     2764           
  Misses                            ?       59           
  Partials                          ?       46           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kestarumper kestarumper merged commit a874ffd into turborepo-typescript-2 Sep 20, 2024
7 checks passed
@kestarumper kestarumper deleted the turborepo-typescript-fix-build branch September 20, 2024 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Core Affects the uniforms package Area: Infra Affects the repository itself (e.g., CI, dependencies)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants