Commit Graph

79 Commits

Author SHA1 Message Date
Daniel Lockyer
b7ea57e2da
🐛 Fixed packaging issue with missing component
refs bf254b9c6a

- this was missing from the referenced commit in order to import the
  package into Ghost core
2022-08-12 17:48:40 +02:00
Daniel Lockyer
b06b7c5ddd v5.9.0 2022-08-12 16:00:29 +01:00
Daniel Lockyer
5f514a7d1b
Improved functionality of yarn setup
- we need to initialize the submodules in case they weren't done when
  cloning, otherwise Casper will be missing
- we can avoid doing an initial build because it'll get wiped when we do
  `yarn dev` anyway
2022-08-12 09:36:48 +02:00
renovate[bot]
9b7604b999 Update sentry-javascript monorepo to v7.10.0 2022-08-11 18:03:48 +02:00
Daniel Lockyer
687e68d5de Extracted shared API framework to separate package
refs https://github.com/TryGhost/Toolbox/issues/363

- this API framework is standalone and should be pulled out into a
  separate package so we can define its boundaries more clearly, and
  promote better testing of smaller parts
2022-08-11 17:44:59 +02:00
Daniel Lockyer
42e722d627
Moved Cache-Control middleware to separate package
refs https://github.com/TryGhost/Toolbox/issues/363

- this middleware is standalone and I suspect we're going to be touching
  it further when we work on Ghost's caching in the near future
2022-08-11 14:14:20 +02:00
renovate[bot]
74f1d9240b Update dependency @playwright/test to v1.25.0 2022-08-11 10:04:32 +02:00
Daniel Lockyer
bf254b9c6a Extracted Mailgun client to separate package
refs https://github.com/TryGhost/Toolbox/issues/363

- this commit pulls all code involving the Mailgun client SDK into one
  new package called `mailgun-client`
- this means we should be able to replace `mailgun-js` (deprecated) with
  `mailgun.js` (the new, official one) without editing code all over the
  place
- this also lays some groundwork for better testing of smaller
  components
2022-08-10 17:12:37 +02:00
Simon Backx
82a3133ace
Added replies/likes count and limited replies to comments (#15206)
refs https://github.com/TryGhost/Team/issues/1723

- Added count.replies to comments
- Added replies endpoint
- Limited returned replies to 3.
- Replaced likes_count with count.likes in comments
- Instead of fetching all the likes of a comment to determine the total count, we'll now use count.likes
- Instead of fetching all the likes of a comment to determine whether a member liked a comment, we'll now use count.liked (which returns the amount of likes of the current member, being 0 or 1). This is mapped to `liked` to make it more natural to work with.

The `members.test.snap` file changed because we no longer include `liked: false` if we didn't fetch the liked relation. And in the comments events of the activity feed the liked property is therefore removed.

These changes requires an update to the `bookshelf-include-count` plugin:
- Updated to also work for nested relations
- This moves the count queries from the `bookshelf-include-count` plugin to the `countRelations` method of each model.
- Updated to keep the counts after saving a model (crud.edit didn't return the counts before)
2022-08-10 16:12:35 +02:00
Daniel Lockyer
89106bce1c
Added monobundle as a prepack step
- in order to pack the tarball correctly, we need monobundle to run
  beforehand
- up until now, it's the responsibility of the release script to make sure
  to run it before `npm pack`
- this commit ensures it gets run, so the generated .tgz file is valid
2022-08-10 14:19:16 +02:00
Daniel Lockyer
509662b52b v5.8.3 2022-08-09 16:02:55 +01:00
Daniel Lockyer
6dde5e40e3
Updated Eslint ECMAScript compatibility to 2022
refs https://github.com/TryGhost/Toolbox/issues/345

- this commit bumps `eslint-plugin-ghost`, which bumps compatiblity to
  2022
- this also removes a lot of the manually-added
  `parserOptions.ecmaVersion` that we had in imported packages, in favor
  of the value set in `eslint-plugin-ghost`
2022-08-09 15:51:40 +02:00
renovate[bot]
ac2ddee8fb Update dependency postcss to v8.4.16 2022-08-09 12:54:15 +02:00
Rishabh
98b21d18f9 Allowed null value for trial days in tiers api
refs e26c977c66

- allows trial days to be null in admin api schema when set via tiers api
2022-08-09 14:14:22 +05:30
Daniel Lockyer
c2e45b657f Removed bthreads dependency in favor of native worker_threads
fixes https://github.com/TryGhost/Toolbox/issues/370

- we no longer need `bthreads` because we can use native
  `worker_threads` now we don't have to support Node 10 any longer
- this allows us to clean up a dependency and stick with native
  libraries
- the referenced node-sqlite3 issue should be fixed (or at least, we now
  maintain it so we can fix it if not)
2022-08-09 09:04:59 +02:00
renovate[bot]
db86e21512
Update dependency juice to v8.1.0 2022-08-09 05:03:08 +00:00
Daniel Lockyer
c11f5edc10 v5.8.2 2022-08-08 19:19:03 +01:00
Fabien 'egg' O'Carroll
e26c977c66
🐛 Fixed saving membership settings (#15196)
refs https://github.com/TryGhost/Ghost/commit/a58efd6b

The references commit updated the admin-api-schema to require the `trail_days`
property, which is not yet supported by the Admin. When saving membership
setting we also save all the Tiers, which then causes the validation to fail.

Until the Admin supports the property we should remove validation from the API
2022-08-08 19:10:54 +01:00
Daniel Lockyer
67aa8d5956 v5.8.1 2022-08-08 15:53:50 +01:00
Daniel Lockyer
e1984c8607
Cleaned up core package Gruntfile
- most of these tasks were duplicates or had been extracted out into
  npm/yarn scripts
- in order to get closer to removing Grunt, I've cleaned up the majority
  of those script
- this also removes an intermediate command to building Admin, so it starts
  ever so slightly quicker
2022-08-08 13:03:49 +02:00
Daniel Lockyer
71b599b632
Removed coffeescript dev dependency
refs 82dcc042cd

- `coffeescript` was only added in the first place because of an update
  to `grunt-bg-shell`, which required it
- since then, we've removed `grunt-bg-shell`, so we don't need this
  dependency any further
2022-08-08 12:37:07 +02:00
renovate[bot]
6d9a5cc28a
Update metascraper to v5.30.1 2022-08-05 19:09:11 +00:00
Daniel Lockyer
512c40b5d5 v5.8.0 2022-08-05 16:02:32 +01:00
renovate[bot]
342ced452e Update sentry-javascript monorepo to v7.9.0 2022-08-05 16:05:30 +02:00
Daniel Lockyer
ad209f3a7d
Improved yarn dev development tooling
- this commit switches our `yarn dev` workflow from heavily relying on
  Grunt, to using `nodemon` and `concurrently`
- we're doing this to reduce reliance on Grunt, but also to fix several
  nits with the way `yarn dev` works in the monorepo
- we now use `nodemon` to run the Ghost backend, and it should
  auto-refresh whenever you change a file in any of the packages (except
  `admin`)
- we use `concurrently` to simultaneously run `ghost` and `admin` at
  the same time. it seems to handle process cleanup well and has nice
  colored prefixes to help with differentiating between log output
- this commit ends up removing a handful of Grunt dependencies and
  reduces the functionality stored in the Gruntfile
- on the whole, it should keep existing functionality but there may be
  some small underlying changes to get used to
2022-08-05 15:54:37 +02:00
Rishabh
a58efd6ba1 Updated admin api schema to include trial days on tiers
refs https://github.com/TryGhost/Team/issues/1724
2022-08-05 17:23:40 +05:30
Daniel Lockyer
a0dca653e7
Updated @tryghost/* packages
- these were all published from the SDK repo
2022-08-05 13:30:50 +02:00
Daniel Lockyer
ba863966ad
Increased integration test threshold
- this is only a temporary fix until we have time to go and investigate
  some performance issues in the tests
- we keep seeing random failures due to timeouts in the integration
  tests, and it's incredibly distracting
2022-08-05 12:57:57 +02:00
Daniel Lockyer
dd41929251
Removed Grunt from Admin
- as part of our effort to reduce our usage of Grunt in favor of more
  maintainable (and maintained) alternatives, this commit removes Grunt
  from Admin
- the main difference here is switching from subgrunt to shell, which
  should be a nice stepping stone to removing Grunt altogether one day
2022-08-05 09:53:08 +02:00
renovate[bot]
7cb6bcac85
Update dependency @tryghost/kg-mobiledoc-html-renderer to v5.3.6 (#15118)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-04 21:23:54 +01:00
renovate[bot]
f4a31aae7d
Update dependency @tryghost/kg-default-atoms to v3.1.3 (#15115)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-04 12:17:58 +01:00
renovate[bot]
4957298e68
Update dependency @tryghost/kg-markdown-html-renderer to v5.1.6 (#15117)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-04 12:17:04 +01:00
renovate[bot]
88436506f4
Update dependency @tryghost/kg-default-cards to v5.16.3 (#15116)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-04 11:06:18 +01:00
renovate[bot]
4868989a4a
Update dependency @tryghost/kg-card-factory to v3.1.4 (#15114)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-04 11:05:55 +01:00
Daniel Lockyer
a398a0e57d
Cleaned up subgrunt usage between Ghost and Admin
refs https://github.com/TryGhost/Toolbox/issues/365

- some of this was barely used anyway, but now Admin is a package in the
  monorepo, we don't need to be installing dependencies twice
2022-08-03 17:05:57 +02:00
Daniel Lockyer
464b5ca426 Extracted html-to-plaintext shared lib into package
refs https://github.com/TryGhost/Toolbox/issues/363

- this shared library is standalone, and it used in various places of
  Ghost core, so we can pull it out to keep it easier to reason about
- we also use the `html-to-text` dependency in another package but it's
  outdated and could now switch to this new package
2022-08-03 16:51:56 +02:00
Daniel Lockyer
59c750a369 v5.7.1 2022-08-03 12:56:44 +01:00
renovate[bot]
81ce63f584 Pin dependency @types/common-tags to 1.8.1 2022-08-03 13:05:20 +02:00
Daniel Lockyer
02e696bd2f
Pinned dependency
- this should be pinned because Ghost is an application
2022-08-03 12:56:14 +02:00
Fabien "egg" O'Carroll
b8e3eb55cd Updated GScan to support comment_count and comments helpers
refs https://github.com/TryGhost/Team/issues/1695

Since these helpers take params now, we need to explicity add them
to the list of known helpers.
2022-08-03 11:52:08 +01:00
Fabien "egg" O'Carroll
023d85d561 Updated comment_count helper and frontend script
refs https://github.com/TryGhost/Team/issues/1695

This updates the comment_count helper from a block to inline, and the
frontend script to replace the entire element with the comment count
text. This means that theme designers will have the most flexibility
as they can choose whether or not to wrap the text in an element, as
well as which element.
2022-08-03 11:52:08 +01:00
renovate[bot]
3c47d61e68 Update dependency analytics-node to v6.2.0 2022-08-03 08:26:33 +02:00
Daniel Lockyer
82e7a0f103
Cleaned up Grunt copy plugin
refs 0a34be4012

- the admin html is no longer stored in core/server, and we don't need to
  copy the production file to default.html
- this commit cleans up the grunt command to do this, and removes the
  plugin whose only use was doing this
- this takes us another step closer to removing grunt
2022-08-02 21:14:04 +02:00
Daniel Lockyer
b9a0cc04b9
Switched out @lodder/grunt-postcss for postcss-cli
- this commit switches out the Grunt postcss plugin with the official
  postcss CLI
- this means we can remove yet another step from Grunt, which helps
  towards our goal of removing Grunt entirely
- I've confirmed the minified output is exactly the same as before
2022-08-02 20:27:44 +02:00
renovate[bot]
9652d5ab32 Update dependency luxon to v3 2022-08-02 17:17:29 +02:00
renovate[bot]
7147495f3a Update dependency @tryghost/html-to-mobiledoc to v1.8.7 2022-08-02 17:13:28 +02:00
renovate[bot]
f132475ff9
Update dependency @sentry/node to v7.8.1 2022-08-01 20:49:21 +00:00
Daniel Lockyer
9ca8e80990 v5.7.0 2022-08-01 15:23:39 +01:00
renovate[bot]
4cbb622334 Update dependency @tryghost/image-transform to v1.2.1 2022-08-01 15:28:09 +02:00
Simon Backx
b7f3892be0
Added format option to img-url helper (#14962)
fixes https://github.com/TryGhost/Ghost/issues/14323

- Fixed support for resizing images from Unsplash using the `img-url` helper (previously the size property was ignored for images from Unsplash)
- Added support for `avif` file formats (supported by sharp out of the box)
- Added support for setting the format of images, with a new  `format` option:

E.g. to convert an image to webp (only works in combination with size for now, except for Unsplash where you can use it without size):
```
{{img_url @site.cover_image size="s" format="webp"}}
```

This can help improve the performance of a theme, by serving assets in `<picture>` elements with webp and fallback image formats.

Usage example:
```html
<picture>
    <source 
        srcset="{{img_url feature_image size="s" format="avif"}} 300w,
                {{img_url feature_image size="m" format="avif"}} 600w,
                {{img_url feature_image size="l" format="avif"}} 1000w,
                {{img_url feature_image size="xl" format="avif"}} 2000w"
        sizes="(min-width: 1400px) 1400px, 92vw" 
        type="image/avif"
    >
    <source 
        srcset="{{img_url feature_image size="s" format="webp"}} 300w,
                {{img_url feature_image size="m" format="webp"}} 600w,
                {{img_url feature_image size="l" format="webp"}} 1000w,
                {{img_url feature_image size="xl" format="webp"}} 2000w"
        sizes="(min-width: 1400px) 1400px, 92vw" 
        type="image/webp"
    >
    <img
        srcset="{{img_url feature_image size="s"}} 300w,
                {{img_url feature_image size="m"}} 600w,
                {{img_url feature_image size="l"}} 1000w,
                {{img_url feature_image size="xl"}} 2000w"
        sizes="(min-width: 1400px) 1400px, 92vw"
        src="{{img_url feature_image size="xl"}}"
        alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
    >
</picture>
```
2022-08-01 14:45:54 +02:00