Skip to content

Commit

Permalink
fix: re-enable sourcemaps and fix internal test coverage merging (#683)
Browse files Browse the repository at this point in the history
<!-- 👋 Hi, thanks for sending a PR to template-typescript-node-package!
💖.
Please fill out all fields below and make sure each item is true and [x]
checked.
Otherwise we may not be able to review your PR. -->

## PR Checklist

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

## Overview

Yeah, tsup needed to enable sourcemaps.

See also the `c8` docs:
https://github.com/bcoe/c8#checking-for-full-source-coverage-using---all
  • Loading branch information
JoshuaKGoldberg authored Aug 22, 2023
1 parent 3f501ac commit 21b4be0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion script/create-test-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ await $`rm -rf ${repository}`;

await $({
stdio: "inherit",
})`c8 -o ./coverage-create -r html -r lcov node ./bin/index.js --mode create --author ${author} --email ${email} --description ${description} --owner ${owner} --title ${title} --repository ${repository} --skip-contributors --skip-github-api`;
})`c8 -o ./coverage-create -r html -r lcov --src src node ./bin/index.js --mode create --author ${author} --email ${email} --description ${description} --owner ${owner} --title ${title} --repository ${repository} --skip-contributors --skip-github-api`;

process.chdir(repository);

Expand Down
2 changes: 1 addition & 1 deletion script/initialize-test-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ await $`pnpm i`;
await $`pnpm run build`;
await $({
stdio: "inherit",
})`c8 -o ./coverage-initialize -r html -r lcov node ./bin/index.js --description ${description} --mode initialize --owner ${owner} --title ${title} --repository ${repository} --skip-github-api --skip-removal --skip-restore`;
})`c8 -o ./coverage-initialize -r html -r lcov --src src node ./bin/index.js --description ${description} --mode initialize --owner ${owner} --title ${title} --repository ${repository} --skip-github-api --skip-removal --skip-restore`;
2 changes: 1 addition & 1 deletion script/migrate-test-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const title = "Template TypeScript Node Package";

await $({
stdio: "inherit",
})`c8 -o ./coverage-migrate -r html -r lcov node ./bin/index.js --mode migrate --description ${description} --owner ${owner} --title ${title} --repository ${repository} --skip-github-api --skip-contributors --skip-install`;
})`c8 -o ./coverage-migrate -r html -r lcov --src src node ./bin/index.js --mode migrate --description ${description} --owner ${owner} --title ${title} --repository ${repository} --skip-github-api --skip-contributors --skip-install`;

const { stdout: gitStatus } = await $`git status`;
console.log(`Stdout from running \`git status\`:\n${gitStatus}`);
Expand Down
5 changes: 3 additions & 2 deletions src/shared/getGitHubUserAsAllContributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function getGitHubUserAsAllContributor(owner: string) {
user = owner;
}

await $`npx -y [email protected] add ${user} ${[
const contributions = [
"code",
"content",
"doc",
Expand All @@ -27,7 +27,8 @@ export async function getGitHubUserAsAllContributor(owner: string) {
"maintenance",
"projectManagement",
"tool",
].join(",")}`;
].join(",");
await $`npx -y [email protected] add ${user} ${contributions}`;

return user;
}
1 change: 1 addition & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export default defineConfig({
entry: ["src/**/*.ts", "!src/**/*.test.*"],
format: "esm",
outDir: "lib",
sourcemap: true,
});

0 comments on commit 21b4be0

Please sign in to comment.