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

Set up release-it for publishing #1536

Merged
merged 11 commits into from
Oct 26, 2022
Merged

Set up release-it for publishing #1536

merged 11 commits into from
Oct 26, 2022

Conversation

chriskrycho
Copy link
Member

I never want to do the chore I did this morning for 5.2.0 again! 😂

@chriskrycho chriskrycho force-pushed the release-it-config branch 3 times, most recently from b50dca4 to dfdf102 Compare October 25, 2022 19:48
@chriskrycho chriskrycho enabled auto-merge October 25, 2022 19:48
@chriskrycho
Copy link
Member Author

The last thing here is to tweak the mocha invocation for CI to work (it works in development using ts-node but not in regular JS tests 🙄).

- Map our GitHub labels to our CHANGELOG conventions.
- Set up Git, GitHub, and lerna-changelog release-it config.
Arrays need type declarations if they don't start with values!
Technically `typeRoots` *works*, but we don't generally want people
doing that, and our tsconfig files get used as references. `paths` does
the same thing in a way that *does* match how we want people to work,
at least until such a time as we're in a more normal module resolution.
This allows us to correctly interop with the updated version of `got`
we had to pull in to get our types checking correctly, which was also
required because we use it directly *and* `release-it` uses it under
the hood, so we had to get to a usable resolution.
Unlike a couple commits back, where I removed something because we want
to avoid others copying it, here we end up *needing* to add it because
there is not presently a story for how to handle `@types` declarations
which are in the position `console-ui` is currently:

- The consuming app/library is using `Node16` resolution, but does not
  have `"type": "module"` set, so TS interprets any unspecified module
  as being CJS.
- The `@types` package itself depends on *another* package which is set
  to operate as ESM. Here, `console-ui`'s types point to `inquirer`'s
  types, which are set as ESM.

In this situation, the direct dependency gets interpreted as CJS, and
this produces an error, because it is CJS using `import` statements and
TS complains that since it will be run as `require()` in CJS, you
should switch to using dynamic import. But: it's a `.d.ts` file! We
*cannot* use dynamic import there!

Net, there is no current workaround for this that I have found; I have
raised it in the TS Discord, and we will want to come up with a better
solution (in this case: probably just by converting `console-ui` to
publish a dual-package mode package *and* publish its own types). And
in the meantime... we will ship this with `skipLibCheck`. :sigh:
We had missed some of the changes which affected how the two packages
related; bumping both gets us back to passing. In a future (separate!)
PR we can also bump ember-cli-babel to dodge a lot of these warnings,
and others can also take us to using ember-source v4.
At this point several of them *fail*, but that's progress.
5443048 introduced this to all the other configs, but it needs to
be in the app fixture as well so that the same issue flagged up
there does not blow up during the Ember build.
@chriskrycho chriskrycho merged commit c66a803 into master Oct 26, 2022
@chriskrycho chriskrycho deleted the release-it-config branch October 26, 2022 17:56
@dfreeman
Copy link
Member

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants