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

Support multiple dist configurations and ESM #13

Merged
merged 9 commits into from
Jun 9, 2021

Conversation

ardatan
Copy link
Collaborator

@ardatan ardatan commented Sep 4, 2020

No description provided.

src/commands/build.ts Outdated Show resolved Hide resolved
@ardatan ardatan force-pushed the support-multiple-dist branch from 101f326 to 227a048 Compare June 8, 2021 11:16
@ardatan ardatan changed the title Support multiple dist configurations Support multiple dist configurations and ESM Jun 8, 2021
@ardatan ardatan marked this pull request as ready for review June 8, 2021 12:07
Comment on lines +22 to +25
dists?: {
distDir: string;
distPath?: string;
}[]
Copy link
Owner

Choose a reason for hiding this comment

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

Do we need this or could we maybe have cjs, esm, nodeEsm flags? @ardatan

Copy link
Owner

Choose a reason for hiding this comment

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

what's the story behind dists?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Having es5 builds for graphql-tools
https://github.com/ardatan/graphql-tools/blob/master/bob.config.js#L9
We have needed that before in MSTeams

Copy link
Owner

Choose a reason for hiding this comment

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

oh, so it's an output from tsc?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes it is actually. https://github.com/ardatan/graphql-tools/blob/master/package.json#L10
Here we run tsc twice in parallel, one is for modern es and the other one is for es5.

Copy link
Collaborator Author

@ardatan ardatan Jun 8, 2021

Choose a reason for hiding this comment

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

I am not sure this old solution is the best but it worked for MSTeams :D It was a long time ago, we can change it for sure. But that was the reason behind having this dists thing.

Copy link
Owner

@kamilkisiela kamilkisiela Jun 8, 2021

Choose a reason for hiding this comment

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

@kamilkisiela @kamilkisiela (for me) add nodeEsm flag to the PR and merge it

Copy link
Owner

Choose a reason for hiding this comment

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

(also for me) update validation rules in bob validate to make sure it’s in sync

@kamilkisiela kamilkisiela merged commit 9e72e67 into kamilkisiela:master Jun 9, 2021
onError
);
shouldEqual(
pkg.module,
"dist/index.esm.js",
`${name}: 'module' should equal 'dist/index.esm.js'`,
"dist/index.msj",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is typo :D

Copy link
Owner

Choose a reason for hiding this comment

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

I think so too! :D

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