seek-oss / sku

Front-end development toolkit
https://seek-oss.github.io/sku
MIT License
479 stars 35 forks source link

Use Relative path for sku Config #1028

Closed jahredhope closed 3 months ago

jahredhope commented 3 months ago

Fixes a situation when an incorrect path would be used for ignore files.

Previously you might get a list with whatever the users current directory was, minus the app name, with 'dist' on the end:

.gitignore

.eslintcache
.eslintrc
.prettierrc
/users/current/dir/dist/
coverage/
report/
tsconfig.json

Now this value will just be dist/, as it would be if running sku configure.

More information in changeset.


Changed sku-init test to also check generated files so we can potentially catch this in the future, and make changes to init steps with more confidence.

I needed to special-case package.json as we don't want to update the snapshot when there are new dependency versions.

Whilst jest does support Property Matchers, I chose to implement this by just replacing the version as it's easier to still test WHICH dependencies were installed (regardless of the version), and IMO it's a cleaner snapshot.

changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: fae4aa02a40f25fd95033c3a9b706381f2bf84bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ---- | ----- | | sku | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

jahredhope commented 3 months ago

Can we add a snapshot of .gitignore in https://github.com/seek-oss/sku/blob/48ae90b810ff1b3fe9cdb18eb90d331d64539403/fixtures/sku-init/sku-init.test.js?

Yes good idea. But I'd prefer to go further and also snapshot package.json. Will update PR soon.