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

Don't thread the package file data #34

Closed
WesCossick opened this issue Mar 10, 2021 · 0 comments · Fixed by #40
Closed

Don't thread the package file data #34

WesCossick opened this issue Mar 10, 2021 · 0 comments · Fixed by #40
Assignees
Labels
Milestone

Comments

@WesCossick
Copy link
Member

Right now, we retrieve the package.json file's contents in the index.ts file and then thread that object through to steps that need it. Here's where we retrieve it, and here's where we thread it through.

We used to do this with the config file, too, but refactored our code to create and use a getConfig() function instead. This function only parses the config file once, and just returns the already-parsed version if it has it. That way, we can call the getConfig() function anywhere we need config values without a performance hit.

We should do essentially the same thing for the package.json file data, via a function called getPackageFile().

We'll probably also want to create a get-package-file.test.ts file with appropriate tests.

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

Successfully merging a pull request may close this issue.

2 participants