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

[WIP] Wireit: TypeScript #2349

Merged
merged 46 commits into from
Jul 7, 2022
Merged

Conversation

scottrippey
Copy link
Member

@scottrippey scottrippey commented Jul 5, 2022

What

Adds TypeScript to build:

  • pnpm run types:create:pkgs Creates all .d.ts files. Ignores tests. Ignores errors, for ease-of-development's sake.
  • pnpm run types:check:pkgs Checks types for all packages, including tests. Does NOT ignore errors.

Work

  • Add types:create and types:check scripts
  • Automate wireit script dependency injection
  • Integrate into publish/build
  • Determine how to handle "broken builds"
  • Add types as a lint dependency

@scottrippey scottrippey changed the title Wireit: TypeScript [WIP] Wireit: TypeScript Jul 5, 2022
@ryan-roemer
Copy link
Member

ryan-roemer commented Jul 6, 2022

Great start!

Was able to run

$ pnpm -r --filter victory-core run types:create

and see the types output

Some directions for us from here:

  • Split types:create to types:create:cjs and types:create:esm
  • I really view this as part of "the build", so I think we're looking at making types:create:cjs a dependency of build:lib:cjs and types:create:esm a dependency of build:lib:esm in each workspace.
  • Manually code no-ops in victory-native and victory-vendor (like is done for much of build and jest stuff already)
  • I'm not sure if types:create:esm is a dependency of build/div/{min,prod}?
  • Aggregate the sync:* tasks to maybe just sync and update the git dirty check in GH actions.

@ryan-roemer
Copy link
Member

ryan-roemer commented Jul 6, 2022

For the "copy es to lib" approach, we're getting these output messages:

ℹ️ [packages/victory-voronoi-container:build:lib:cjs] Output files were modified since the previous run.
ℹ️ [packages/victory-group:build:lib:cjs] Output files were modified since the previous run.
ℹ️ [packages/victory-stack:build:lib:cjs] Output files were modified since the previous run.
ℹ️ [packages/victory-chart:build:lib:cjs] Output files were modified since the previous run.
ℹ️ [packages/victory-histogram:build:lib:cjs] Output files were modified since the previous run.
ℹ️ [packages/victory-canvas:build:lib:cjs] Output files were modified since the previous run.

Now things still run very quickly, but I do wonder if there's any higher level impact on things? Bouncing back and forth between pnpm run build and pnpm run types:create:pkgs has both repeating these warnings.

UPDATE: I updated and not sure if this is still happening. Will check again!

UPDATE 2: Latest changes show this is not an issue. Ignore!

@ryan-roemer
Copy link
Member

@scottrippey if you want to enable CI on this PR you can do:

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 18614bcb..76b19acf 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,12 +7,16 @@ on:
   push:
     branches:
       - main
+      # TODO(wireit): Remove before merge.
+      - pnpm-wireit
     paths:
       - '**'
       - '!docs/**'
   pull_request:
     branches:
       - main
+      # TODO(wireit): Remove before merge.
+      - pnpm-wireit
     paths:
       - '**'
       - '!docs/**'

I'm seeing failures in pnpm run types:check:pkgs

@scottrippey scottrippey marked this pull request as ready for review July 7, 2022 16:27
@scottrippey scottrippey merged commit dffb70b into infra/pnpm-wireit Jul 7, 2022
@scottrippey scottrippey deleted the infra/pnpm-wireit-typescript branch July 7, 2022 16:28
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