Commit Graph

11 Commits

Author SHA1 Message Date
Hannah Wolfe
1daa6eda61 Improved typing in package-json
- fixed type warnings
- introduced explicit use of bluebird to help with type warnings and also make it clear when we're actually using Bluebird features
2021-06-09 15:44:04 +01:00
Hannah Wolfe
93e4577caf Removed class pattern
- removed the class pattern in the simplest possible way
- have package-json expose only the public methods
- move parse to an independent, not public file so that we can test it independently still
2021-06-09 14:39:41 +01:00
Hannah Wolfe
dd129e0920 Removed use of i18n in package-json
- We are going to get rid of the internal i18n tool because it doesn't solve a real use case
- Instead, we have a new tpl utility that does basic string interpolation
- This makes this module less complex as it no longer requires dependency injection to work
2021-06-09 14:10:04 +01:00
Daniel Lockyer
95cfa97747 Changed Error to IncorrectUsageError in package-json
no issue

- `Error` is very generic for this case and `IncorrectUsageError`
  will populate the resulting error with the correct error code
- the `message` was pulled out to its own statement so we can avoid long
  lines
2021-05-06 13:22:59 +01:00
Aileen Nowak
7f4d2bb06e Updated links to ghost.org sites
no issue

Follow-up task of the updated Ghost Docs structure. Updated links reflecting the new structure to prevent unnecessary 404s and redirects.
2021-01-20 09:59:45 +13:00
Thibaut Patel
bd3afeb112 Made the package-json module ready to be exported (#12451)
no issue
2020-12-10 11:37:43 +01:00
Daniel Lockyer
6d42c391c5 Added JSDoc comments into package-json lib 2020-11-25 11:29:04 +00:00
Daniel Lockyer
7f09052ba1 Reverted "Refactored remaining function in package-json lib to use async-await"
- this reverts commit 2be01e7cbd.
- reverting until I can figure out why the tests are broken
2020-11-25 10:57:55 +00:00
Daniel Lockyer
2be01e7cbd Refactored remaining function in package-json lib to use async-await
- this helps simplify the code and gets rid of Promise chaining
- apparently I can't easily use an async function within filter, so I've
  left it for now
2020-11-25 10:44:15 +00:00
Daniel Lockyer
0971506948 Refactored package-json lib to use more async-await
- this helps get rid of all the promise chaining and indentation,
  resulting in cleaner code
2020-11-25 09:19:35 +00:00
Daniel Lockyer
9d29686f6a Refactored package-json lib into a class
- this helps bring all the code together so we can extract it in the
  future
- turning it into a class also lets us easily inject the i18n instance
  and store it locally
2020-11-25 09:19:35 +00:00