Commit Graph

99 Commits

Author SHA1 Message Date
renovate[bot]
ea5942ef3d
Update dependency luxon to v3.0.2 2022-08-29 00:09:28 +00:00
Daniel Lockyer
d986059a50 v5.12.0 2022-08-26 16:00:32 +01:00
Rishabh
281d52610f Added staff service to manage email alert notifications
refs TryGhost/Team#1826

- adds new service package that manages all the email alert notifications for free members and paid subscriptions
- includes email templates for free member signup and paid subscription start/cancel
- initializes staff service before members to allow managing email alert notifications
- passes staff service to members api for triggering alerts
2022-08-25 18:01:52 +05:30
Daniel Lockyer
ab8952dd46 v5.11.0 2022-08-24 15:04:56 +01:00
renovate[bot]
c860b5b715 Update dependency @playwright/test to v1.25.1 2022-08-24 08:42:13 +02:00
Daniel Lockyer
6ade771a9f v5.10.1 2022-08-19 17:50:40 +01:00
Daniel Lockyer
0df8ee8c72 v5.10.0 2022-08-19 16:02:37 +01:00
Simon Backx
da24d13601
Added member attribution events and storage (#15243)
refs https://github.com/TryGhost/Team/issues/1808
refs https://github.com/TryGhost/Team/issues/1809
refs https://github.com/TryGhost/Team/issues/1820
refs https://github.com/TryGhost/Team/issues/1814

### Changes in `member-events` package

- Added MemberCreatedEvent (event, not model)
- Added SubscriptionCreatedEvent (event, not model) 

### Added `member-attribution` package (new)

- Added the AttributionBuilder class which is able to convert a url history to an attribution object (exposed as getAttribution on the service itself, which handles the dependencies)
```
[{
    "path": "/",
    "time": 123
}]
```
to
```
{
    "url": "/",
    "id": null,
    "type": "url"
}
```

- event handler listens for MemberCreatedEvent and SubscriptionCreatedEvent and creates the corresponding models in the database.

### Changes in `members-api` package

- Added urlHistory to `sendMagicLink` endpoint body + convert the urlHistory to an attribution object that is stored in the tokenData of the magic link (sent by Portal in this PR: https://github.com/TryGhost/Portal/pull/256).
- Added urlHistory to `createCheckoutSession` endpoint + convert the urlHistory to attribution keys that are saved in the Stripe Session metadata (sent by Portal in this PR: https://github.com/TryGhost/Portal/pull/256).

- Added attribution data property to member repository's create method (when a member is created)
- Dispatch MemberCreatedEvent with attribution

###  Changes in `members-stripe-service` package (`ghost/stripe`)

- Dispatch SubscriptionCreatedEvent in WebhookController on subscription checkout (with attribution from session metadata)
2022-08-18 17:38:42 +02:00
Daniel Lockyer
f51226e5fb Organized package dependencies
- cleaned up unused dependencies
- adds missing dependencies that are used in the code
- this should help us be more explicit about the dependencies a package
  uses
2022-08-18 11:55:49 +02:00
renovate[bot]
0f998e30aa Update sentry-javascript monorepo to v7.11.1 2022-08-17 21:53:41 +02:00
renovate[bot]
79f28a82a3 Update sentry-javascript monorepo to v7.11.0 2022-08-17 21:16:25 +02:00
renovate[bot]
f348fc3223
Updated @tryghost dependencies (#15235)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-08-17 08:45:47 +02:00
Daniel Lockyer
d153b40c48 v5.9.4 2022-08-15 20:47:26 +01:00
Daniel Lockyer
d493fd7bf1 v5.9.3 2022-08-15 13:09:54 +01:00
Daniel Lockyer
fa6900b299 v5.9.2 2022-08-15 10:55:17 +01:00
renovate[bot]
7f5d95ffff Update @tryghost 2022-08-15 10:08:46 +02:00
renovate[bot]
7d3f5d3165 Update dependency eslint to v8.22.0 2022-08-15 10:07:34 +02:00
Daniel Lockyer
d2eda5cf51 Extracted oembed service to separate package
refs https://github.com/TryGhost/Toolbox/issues/363

- the oembed service is completely standalone and could do with some
  individual unit tests
- moving it out to a package allows us to draw the boundaries better and
  allows us to remove some dependencies from the core package.json
2022-08-15 10:07:06 +02:00
renovate[bot]
5250dd9a12 Update dependency cssnano to v5.1.13 2022-08-13 11:20:27 +02:00
Daniel Lockyer
54baa8d71e v5.9.1 2022-08-12 17:11:31 +01:00
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