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

🚀 Feature: Skip dts generation in lint.yml's build #1162

Closed
3 tasks done
JoshuaKGoldberg opened this issue Dec 31, 2023 · 2 comments · Fixed by #1255
Closed
3 tasks done

🚀 Feature: Skip dts generation in lint.yml's build #1162

JoshuaKGoldberg opened this issue Dec 31, 2023 · 2 comments · Fixed by #1255
Assignees
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request

Comments

@JoshuaKGoldberg
Copy link
Owner

JoshuaKGoldberg commented Dec 31, 2023

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

Right now, if a repo is created with the bin option, lint.yml will run a build before lint:

- run: pnpm build || true
- run: pnpm lint

The only reason that happens is because the n/no-missing-import will report on the bin file pointing to a missing (not-yet-built) .js file.

There's no need to also generate TypeScript .d.ts files during build. Lint workflows in CI will be faster if the dts part of tsup is skipped.

Additional Info

I tried using pnpm build --dts false or pnpm run build --dts false. But that seems to configure tsup to try to build the file/module "false", not disable dts.

DTS Build start
RollupError: Could not resolve entry module "false".
    at Object.error (/Users/josh/repos/create-typescript-app/node_modules/.pnpm/rollup@4.5.1/node_modules/rollup/dist/shared/parseAst.js:279:30)
    at ModuleLoader.loadEntryModule (/Users/josh/repos/create-typescript-app/node_modules/.pnpm/rollup@4.5.1/node_modules/rollup/dist/shared/rollup.js:19030:32)
    at async Promise.all (index 0)
Error: error occured in dts build
    at Worker.<anonymous> (/Users/josh/repos/create-typescript-app/node_modules/.pnpm/tsup@8.0.1_typescript@5.3.3/node_modules/tsup/dist/index.js:2690:26)
    at Worker.emit (node:events:519:28)
    at MessagePort.<anonymous> (node:internal/worker:263:53)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:822:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)
DTS Build error
 ELIFECYCLE  Command failed with exit code 1.

Filed egoist/tsup#1070 to ask about this in tsup. Marking this issue as blocked for now.

Aside: I bet this could also be used in post-run cleanup too... see #1161.

@JoshuaKGoldberg
Copy link
Owner Author

Aha! Thanks @anubra266 -> https://github.com/chakra-ui/panda/pull/2016/files#r1454590849, TIL about no-dts!

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send a pull request to resolve this! and removed status: blocked Waiting for something else to be resolved labels Jan 17, 2024
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Jan 17, 2024
JoshuaKGoldberg added a commit that referenced this issue Jan 17, 2024
## PR Checklist

- [x] Addresses an existing open issue: fixes #1162
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

Uses the lovely, newly-discovered-by-me `--no-dts` option. Now the
builds done before CI linting (when `options.bin` is enabled) and in the
cleanup commands should be much faster.
Copy link

🎉 This is included in version v1.54.2 🎉

The release is available on:

Cheers! 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! type: feature New enhancement or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant