Commit Graph

3934 Commits

Author SHA1 Message Date
renovate[bot]
c8c89a9fa3 Update dependency concurrently to v7.5.0 2022-10-24 10:23:48 +07:00
Daniel Lockyer
8ec071a47c
Update dependency eslint-plugin-ghost to v2.16.0 (#15551)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-10-10 10:23:24 +01:00
renovate[bot]
9cd15ec9fb Update dependency husky to v8.0.1 2022-10-10 15:49:51 +07:00
Daniel Lockyer
a37b2cd24e Switched to Husky + lint-staged for git hooks
- up until this commit, git hooks were only used by a handful of people
  because they were a pain:
  - they'd only be set up when you did `yarn setup`
  - the existing hooks ran `yarn lint` on all projects, which was
    incredibly slow
- as a result, not many of us actually had them enabled, but this would
  cause issues in CI because people were pushing un-linted commits
- other JS projects tend to use husky to automate the git hook setup and
  lint-staged to speed up linting on changed files
- this commit switches to using them both
  - `lint-staged` only runs `eslint` on staged JS files that are about to
    be committed - if there's a linting error, it will stop the commit
  - I've configured the pre-commit hook to successfully exit in CI because we
    don't want to run pre-commit hooks right now
- this means we can remove Grunt - yay!
2022-10-10 15:10:48 +07:00
renovate[bot]
9eb3c84a23
Updated @tryghost dependencies (#15434)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-27 08:31:35 +07:00
Daniel Lockyer
a94c93e1c0
Added yarn build command
refs https://github.com/TryGhost/Toolbox/issues/390

- this allows us to run `yarn build` and make it output a .tgz file
  which can be installed with `ghost install --archive ...`
2022-09-26 18:28:30 +07:00
Daniel Lockyer
2bff2a22e0
Extracted dev tooling to separate script
refs https://github.com/TryGhost/Toolbox/issues/426

- we're going to need to support more complex combinations of dev
  commands soon, with other packages optionally running and env
  variables being altered
- this command pulls out a lot of the dev env scripting into a single
  scripts
- also cleans up the use of grunt-shell so we can remove the dependency
2022-09-23 15:02:35 +02:00
renovate[bot]
225765241c
Updated @tryghost dependencies (#15404)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-09-19 12:09:33 +01:00
renovate[bot]
10f285d22e
Update dependency nodemon to v2.0.20 2022-09-16 18:19:50 +00:00
renovate[bot]
4438a72095 Update dependency concurrently to v7.4.0 2022-09-07 13:44:35 +01:00
Daniel Lockyer
7a2f766668
Added logging configuration option for timestamps to use the local timezone
fixes https://github.com/TryGhost/Ghost/issues/15190
refs https://github.com/TryGhost/framework/pull/76

- log output always uses UTC timestamps, but it may be desirable to
  configure logs to use the local machine timezone
- a new config option has been added to `@tryghost/logging` so you can
  switch the logs to the local timezone
- this commit bumps the package and sets the default config option to
  `false`, so it doesn't suddenly change the timezone of the logs
- docs will be updated soon but if you'd like to use the
  timezone-altered timestamps, you can set `logging.useLocalTime` to
  `true`
- credits to https://github.com/levee223 for the implementation and PR
2022-08-31 10:29:55 +01:00
Daniel Lockyer
f18cc0185b
Fixed showing colors when using yarn dev:debug
- because we use `concurrently`, `debug` thinks it's not inside a TTY,
  so it doesn't show colors
- we can force it to show colors using the DEBUG_COLORS env variable, as
  done in this commit
2022-08-18 15:52:28 +02: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
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
cee420d884
Restored eslint plugin compatibility for Node 14.17.0
- `eslint-plugin-ghost` v2.15.0 bumped `eslint-plugin-unicorn` to a
  version that required Node 14.18.0
- we don't support that minimum right now so this commit bumps the Ghost
  plugin which contains a revert to that plugin
2022-08-09 16:01:52 +02: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
Daniel Lockyer
c45dfe05ef
Fixed postcss dependency bumps to Core package
- this Renovate config was pulled from Admin but it's inadvertantly
  stopping `postcss` updates in core
- this commit restricts the dependency updates to the Admin package only
2022-08-09 12:19:49 +02: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
42b6a14380
Fixed server not picking up package.json version
- removing the hardcoded JS file makes it run `yarn start`, which puts
  the CWD for the process in the correct place so it picks up the
  `package.json`
2022-08-05 16:13:38 +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
Daniel Lockyer
ce42dcfa50
Grouped together @tryghost packages
- we're doing this to reduce the repo PR noise when a separate monorepo
  get published
- you can still update your dependency with yarn, and then this rollup
  PR will be occasionally merged
2022-08-05 14:24:46 +02:00
Daniel Lockyer
714845b02d
Fixed yarn main
- this was referencing to a use of `subgrunt:init` that no longer exists
  in the new monorepo w/ Admin setup
2022-08-03 17:14:37 +02:00
Daniel Lockyer
b12b1c9290
Fixed yarn fix command
- we no longer need to have subcommands because the Admin dependencies
  are in the top-level `node_modules` folder
2022-08-03 16:06:13 +02:00
Daniel Lockyer
2854f6151c
Cleaned up extraneous files and references in Admin
refs https://github.com/TryGhost/Toolbox/issues/365

- these files are no longer needed now they're in the main Ghost repo
- re-adds the Renovate rules into the top-level Renovate config
2022-08-03 16:05:04 +02:00
Daniel Lockyer
f8939fb344
Added internalPackages metadata entry to package.json
- our internal tooling needs to know when to add LICENSE files
- unfortunately, setting a package to private gives it a LICENSE file of
  a closed source app, which is not the case here
- my MVP solution is just to add a key here so I can detect it in Slimer
2022-08-02 15:30:27 +02:00
Daniel Lockyer
2f1844e7e9
Added monorepo metadata to package.json
- we need this so our tooling can add new packages with the correct
  scope and visibility
- this mimics the metadata used by Lerna
2022-08-02 12:40:51 +02:00
Daniel Lockyer
9f08264e0d
Added knex-migrator script to top-level package.json
- now we've switched to a monorepo, commands like `knex-migrator health`
  won't work from the top-level directory because they expect to be run
  alongside the MigratorConfig.js file
- this commit adds a `knex-migrator` script in the top-level
  package.json so you can run `yarn knex-migrator ...`
- whilst this is only a bandaid, it should give a route forwards for
  running knex-migrator commands from your top-level directory
2022-07-27 14:21:31 +02:00
Daniel Lockyer
c376587288
Moved yarn main functionality up to root yarn script
- since we've turned the repo into a monorepo, the `yarn main` scripts
  have lived in their original place under `ghost/core` package.json and
  Gruntfile.js
- for one, we want to remove grunt because it's terribly old and our use
  is hacked together
- secondly, `yarn main` applies to the monorepo + submodules as a whole,
  and not just the Ghost core folder
- this commit extracts the functionality into yarn scripts in the
  top-level and removes the dependency that was required
2022-07-25 18:30:21 +02:00
Daniel Lockyer
57d47a79f9
Added yarn setup to root scripts
- we had this working in the Ghost repo before switching to a monorepo
- this commit adds a `setup` script to the root package.json so we can
  maintain the functionality
2022-07-25 08:35:57 +02:00
Daniel Lockyer
184149492d
Lifted "fix repo" scripts up to root package.json
- these scripts are useful for just trying to fix your repo when
  node_modules is playing up
- as we now have a monorepo, they should be lifted up to the root and
  not hidden in the ghost package
2022-07-25 08:35:55 +02:00
Daniel Lockyer
ac3d4d5085
Restored yarn main
- still a bit of a hack right now but it should pull down the latest
  changes
2022-07-21 10:11:54 +02:00
Daniel Lockyer
796961329a
Fixed yarn test from top-level repo
- we probably don't want it to be this long term but it allows us to
  enable tests on the new packages
2022-07-20 17:41:11 +02:00
Daniel Lockyer
3d989eba23 Converted Ghost repo into a monorepo
refs https://github.com/TryGhost/Toolbox/issues/354

- this commit turns the Ghost repo into a monorepo so we can bring our
  internal packages back in, which makes life easier when working on
  Ghost
2022-07-20 16:41:05 +02:00
renovate[bot]
ecfa22efab
Update dependency metascraper to v5.29.18 2022-07-20 12:33:47 +00:00
renovate[bot]
b671504a2c
Update Test & linting packages 2022-07-19 19:25:37 +00:00
Daniel Lockyer
8be9db7bcf
Merged v5.4.1 into main
v5.4.1
2022-07-19 16:01:04 +02:00
Daniel Lockyer
e39937ae21 v5.4.1 2022-07-19 14:57:42 +01:00
Daniel Lockyer
445d5b4da2
🐛 Fixed new member count helpers not included in GScan helpers
- this was due to GScan not being published and bumped before the member
  count helpers were merged into Ghost and released
2022-07-19 15:41:02 +02:00
Daniel Lockyer
48194ff444
Refactored release workflow
- up until now, we've been running `grunt release` before publishing to
  NPM or pushing the canary zip
- this command runs the production asset build and generates a zip
- this zip isn't used by the NPM publishing task because that does an
  `npm pack`
- we only use it for the canary build, but this should be brought more
  inline with the NPM process to make the gaps smaller
- this commit refactors the `grunt release` task to become a lot smaller
  by removing the generated zip steps
- the expected workflow is now to just to an `npm pack`, which will run
  the `prepack` task to generate a `.tgz` archive
- this should still respect `.npmignore`, so it'll just include the
  files we expect
- the test of the canary workflow is being updated to handle this
- also cleans up a dev dependency that is no longer used, along with 2
  imports
2022-07-19 08:32:54 +02:00
renovate[bot]
94072c4a32
Update dependency knex to v2.2.0 2022-07-18 22:37:53 +00:00
renovate[bot]
fb074f6fba
Update dependency eslint to v8.20.0 2022-07-18 00:52:24 +00:00
renovate[bot]
45594680c0
Update dependency @sentry/node to v7.7.0 2022-07-15 15:01:46 +00:00
Daniel Lockyer
2ff53ef0da v5.4.0 2022-07-15 16:00:33 +01:00
Daniel Lockyer
388c28f4b5
Updated dependency knex-migrator to v5.0.1
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-07-15 15:35:51 +01:00
renovate[bot]
7b6bf4cf67 Update dependency sqlite3 to v5.0.9 2022-07-15 12:18:48 +01:00
Fabien 'egg' O'Carroll
e60806de45
Redirected Members to previous post/page upon sign-in
refs https://github.com/TryGhost/Team/issues/1174
refs https://github.com/TryGhost/Members/pull/408

When logged out members navigate a site and want to interact with, for example
comments, they are redirected to the homepage after sign-in with the magic link,
this is disorientating, and means they then need to navigate back to the content
they were interacting with.

This change means that sign-in's will be redirected to the page from which they 
were initiated, allowing a more streamlined flow for logged out members wanting
to add comments.

We've restricted the redirect to URI's which are on the same domain as the site,
and we also do a relative redirect, this is to ensure that a malicious actor does not
send magic links which redirect off-site and leak authentication details
2022-07-15 11:55:09 +01:00
naz
6901c3c435
🐛 Fixed 'comped' flag behavior in Member API (#15030)
closes https://github.com/TryGhost/Team/issues/1674

- The comped flag in Members API unintentionally stopped working when v3 API was dropped with the release of Ghost v5. The flag is deprecated but should be back-compatible for now - we don't want to break integratons like Zapier.
- To properly deprecate the flag we need to plan it's removal and start signalling about it through the version headers

Co-authored-by: Simon Backx <simon@ghost.org>
2022-07-15 11:16:06 +01:00
Ronald Langeveld
a0c8db46fb
Member Counter template helpers (#15013)
ref https://github.com/TryGhost/Team/issues/1667

Introducing 2 new helper handlebars tags, `{{total_members}}` and `{{total_paid_members}}` ideal for Member Sites who want to display these metrics to incentivise users to upgrade.
2022-07-14 10:10:02 +02:00
renovate[bot]
b6818b77bd Update dependency @playwright/test to v1.23.3 2022-07-14 08:42:49 +01:00
renovate[bot]
000fc98f24
Update dependency analytics-node to v6.1.0 2022-07-13 20:00:15 +00:00