Skip to content

fix release script#4053

Merged
TkDodo merged 3 commits into
TanStack:mainfrom
TkDodo:feature/fix-release-script
Aug 18, 2022
Merged

fix release script#4053
TkDodo merged 3 commits into
TanStack:mainfrom
TkDodo:feature/fix-release-script

Conversation

@TkDodo

@TkDodo TkDodo commented Aug 18, 2022

Copy link
Copy Markdown
Collaborator

No description provided.

TkDodo added 3 commits August 18, 2022 13:14
because the cipublish script does it internally, so we have been doing twice the tests now
any change in package should result in a package release - not just the `src` directory
the Package that's defined in config does not have dependencies / peerDependencies, so we need to iterate over the object we find package.json
@TkDodo

TkDodo commented Aug 18, 2022

Copy link
Copy Markdown
Collaborator Author

@DamianOsipiuk this should fix the release script :)

@codesandbox-ci

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5c25bc4:

Sandbox Source
@tanstack/query-example-react-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration

Comment thread .github/workflows/ci.yml
cache: 'npm'
- run: |
npm i
npm run test:ci

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

not needed because the publishci script also runs test

Comment thread scripts/publish.ts
: changedFiles.reduce((changedPackages, file) => {
const pkg = packages.find((p) =>
file.startsWith(path.join('packages', p.packageDir, p.srcDir)),
file.startsWith(path.join('packages', p.packageDir)),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

makes sure that we publish new versions whenever there are changes anywhere in the package directory, not just the src directory!

Comment thread scripts/publish.ts
)

if (
pkg.dependencies?.find((dep) =>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

pkg.dependencies does not exist - the type were wrong
so we need to find them in packgage.json

Comment thread scripts/publish.ts
Comment on lines -422 to +430
(pkg.dependencies ?? []).map(async (dep) => {
Object.keys(config.dependencies ?? {}).map(async (dep) => {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

same here - pkg.dependencies does not exist

Comment thread scripts/publish.ts
const depPackage = packages.find((d) => d.name === dep)

if (!depPackage) {
throw new Error(`Could not find package ${dep}`)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

throwing here is wrong as it fails the promise and Promise.all stops after the first rejection. We can just ignore dependencies that are not dependencies we care about

@codecov-commenter

codecov-commenter commented Aug 18, 2022

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.82%. Comparing base (eab6e2c) to head (5c25bc4).
⚠️ Report is 2964 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4053      +/-   ##
==========================================
+ Coverage   96.36%   96.82%   +0.45%     
==========================================
  Files          45       57      +12     
  Lines        2281     2673     +392     
  Branches      640      785     +145     
==========================================
+ Hits         2198     2588     +390     
- Misses         80       83       +3     
+ Partials        3        2       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DamianOsipiuk DamianOsipiuk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice 🥇

@TkDodo
TkDodo merged commit 213a85f into TanStack:main Aug 18, 2022
@TkDodo
TkDodo deleted the feature/fix-release-script branch August 18, 2022 19:42
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