Skip to content

Conversation

cmwhited
Copy link
Collaborator

Description

Making updates to typesync to make it a publishable cli package.

  • switch tsup to format dist files in esm and handle dynamic imports
  • bumped versions
  • package.json updates to support publish (and bump version)

@graphprototol/typesync-cli is now a published package in npm and installable and runnable as a cli. But it has some issues:

  1. the client ui, which is shipped with the dist seems to not be able to be found when running the cli after installing typesync studio. not sure the issue, assumed since the migrations directory came over as expected, so would the /client/dist/ files.
  2. when the cli is ran, it creates a typesync.db for sqlite on the users machine. this might be fine. but wonder if we should make it as .typesync.db so that it is hidden by default?

Copy link

vercel bot commented Jun 14, 2025

@cmwhited is attempting to deploy a commit to the The Graph Foundation team on Vercel, but is not a member of this team. To resolve this issue, you can:

  • Make your repository public. Collaboration is free for open source and public repositories.
  • Add @cmwhited as a member. A Pro subscription is required to access Vercel's collaborative features.
    • If you're the owner of the team, click here and add @cmwhited as a member.
    • If you're the user who initiated this build request, click here to request access.
    • If you're already a member of the The Graph Foundation team, make sure that your Vercel account is connected to your GitHub account.

To read more about collaboration on Vercel, click here.

@marcusrein
Copy link
Member

Update

  • Merged latest main, resolved package-version conflicts, regenerated pnpm-lock.yaml.
  • Server build was failing because Prisma client wasn’t generated before tsup ran.
  • Re-ordered Dockerfile steps (prisma generate → pnpm build).
  • Marked Prisma client as external in tsup.config.

All CI checks now pass and Vercel previews are green. Ready to squash-and-merge.

# Generate the prisma client
pnpm --filter server prisma generate && \
# Build the monorepo packages
pnpm build && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmwhited can you revert this change? The dockerfile works and only want to make changes where necessary

format: ['esm'],
clean: true,
sourcemap: true,
external: ['../prisma/generated/client'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"@graphprotocol/grc-20": "^0.21.2",
"@graphql-codegen/cli": "^5.0.6",
"@graphql-codegen/client-preset": "^4.8.1",
"@graphprotocol/grc-20": "^0.18.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should not downgrade grc-20 here

@cmwhited cmwhited changed the title [WIP] fix(typesync | publish): tsup and package.json updates for publishing fix(typesync | publish): tsup and package.json updates for publishing Jun 27, 2025
provider = "prisma-client"
output = "generated/client"
moduleFormat = "esm"
provider = "prisma-client-js"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmwhited can you revert this change? The sync server is working fine for me locally and on fly.io. This change might break it and revert back to the old prisma client

'@graphprotocol/hypergraph-react':
'https://pkg.pr.new/graphprotocol/hypergraph/@graphprotocol/hypergraph-react@82b867a',
'@graphprotocol/hypergraph': '@graphprotocol/hypergraph',
'@graphprotocol/hypergraph-react': '@graphprotocol/hypergraph-react',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be a hard-coded version number that we also keep in sync with the published version, same for the file above

@nikgraf nikgraf merged commit b96eff5 into main Jun 29, 2025
6 checks passed
@nikgraf nikgraf deleted the chris.whited/fix-published-pkg branch June 29, 2025 07:03
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.

3 participants