Commit Graph

2705 Commits

Author SHA1 Message Date
Hannah Wolfe
0ef9a7e415
Added quick commands for resetting yarn
- We keep having test issues caused by yarn, these fix commands help quickly check it's not a yarn problem
- Have renamed fixmodulenotrequired to fix:client to make a nice consistent naming pattern that's easy to remember and type
2021-06-23 20:55:03 +01:00
Fabien O'Carroll
ccd917ff8c Handled products column for CSV import & export
refs https://github.com/TryGhost/Team/issues/765

This includes the changes to @tryghost/members-csv so that we can read
and write the `product` column from/to csv files. Allowing us to include
products in exports, as well as use them in imports.
2021-06-23 13:53:34 +01:00
Renovate Bot
f9dab79d2e
Update metascraper to v5.22.2 2021-06-23 11:32:05 +00:00
Daniel Lockyer
d2adc08c18
v4.8.0 2021-06-22 15:25:52 +01:00
Naz
0d2c990013 Reverted Added detection of conditional partials in themes"
This reverts commit bab12ca3d1.

- Revert was due to 500 errors which would come up when the Ghost instance runst in "production" mode.
2021-06-22 17:49:12 +04:00
Renovate Bot
2f93ce7495 Update dependency @tryghost/logging to v0.1.2 2021-06-22 09:10:44 +01:00
Renovate Bot
7e05c402c9
Update dependency @sentry/node to v6.7.2 2021-06-21 16:25:40 +00:00
Renovate Bot
aae9388098 Update dependency @tryghost/version to v0.1.1 2021-06-21 17:24:43 +01:00
Renovate Bot
d379e18728 Update dependency @tryghost/validator to v0.1.2 2021-06-21 16:47:51 +01:00
Renovate Bot
ed4bdbd6e7 Update dependency @tryghost/root-utils to v0.3.1 2021-06-21 16:47:40 +01:00
Renovate Bot
d6ea82dbd0 Update dependency @tryghost/request to v0.1.2 2021-06-21 16:33:18 +01:00
Renovate Bot
b91cb8172d Update dependency @tryghost/debug to v0.1.2 2021-06-21 16:33:02 +01:00
Renovate Bot
8275a52204 Update dependency @tryghost/bookshelf-plugins to v0.1.3 2021-06-21 14:48:25 +01:00
Renovate Bot
484387ba51 Update dependency nconf to v0.11.3 2021-06-21 13:13:38 +01:00
Renovate Bot
d87d6a7d4e Update dependency @tryghost/members-ssr to v1.0.4 2021-06-21 13:13:25 +01:00
Renovate Bot
968543f967 Update dependency @tryghost/magic-link to v1.0.4 2021-06-21 13:12:53 +01:00
Renovate Bot
ace1513e9f Update dependency @tryghost/image-transform to v1.0.13 2021-06-21 13:12:03 +01:00
Renovate Bot
9aadfdf1bd Update dependency @tryghost/package-json to v1.0.2 2021-06-21 12:14:25 +01:00
Renovate Bot
587f6806df Update dependency @tryghost/session-service to v0.1.24 2021-06-21 08:26:36 +01:00
Renovate Bot
ced89e3777 Update dependency @tryghost/tpl to v0.1.3 2021-06-21 08:26:07 +01:00
Renovate Bot
9b5fc217dc Update dependency @tryghost/adapter-manager to v0.2.14 2021-06-21 08:26:01 +01:00
Renovate Bot
249f316177 Update dependency @tryghost/request to v0.1.1 2021-06-21 08:25:38 +01:00
Renovate Bot
e47c2e6fd9 Update dependency @tryghost/mw-session-from-token to v0.1.22 2021-06-21 08:25:28 +01:00
Renovate Bot
43b9084c86 Update dependency @tryghost/helpers to v1.1.47 2021-06-21 08:25:17 +01:00
Renovate Bot
df4c8ed1c9
Update dependency eslint to v7.29.0 2021-06-18 20:53:18 +00:00
Hannah Wolfe
2f3d60c87e
Updated to use config-url-helpers in urlUtils 2021-06-18 21:49:28 +01:00
Renovate Bot
3a43f0a776 Pin dependency @tryghost/config-url-helpers to 0.1.0 2021-06-18 21:29:00 +01:00
Hannah Wolfe
6aafb735b1
Added config-url-helpers to config
- getSubdir, getSiteUrl & getAdminUrl were currently part of @tryghost/url-utils
- They have been split out into their own library, and refactored so that they expect to be bound to nconf
- With this commit we can do e.g. config.getSubdir() rather than needing @tryghost/url-utils
- These functions will be passed to url-utils via DI
- This is the first step in breaking down url-utils into smaller pieces
- This commit only does a single change in Gruntfile.js to use the new funtions - this will be rolled out slowly
2021-06-18 20:05:00 +01:00
Renovate Bot
536d7a76d6 Update dependency mocha to v9.0.1 2021-06-18 17:02:20 +00:00
Fabien O'Carroll
5b66933981 Supported directly assigning products to members
refs https://github.com/TryGhost/Team/issues/748

This updates the @tryghost/members-api MemberRepository to stop ignoring
the `products` data passed to write operations, and to attach products
directly to members. As this logic is part of a new feature, we are
maintaining existing functionality by deleting the products data when
the feature flag is not enabled.

This functionality allows us to give members complimentary access to a
product without needing to use a Stripe Subscription internally.
2021-06-17 16:57:53 +01:00
Renovate Bot
bab12ca3d1 Added detection of conditional partials in themes
refs https://github.com/TryGhost/Team/issues/781
refs https://github.com/TryGhost/Team/issues/774

- Previous versions of gscan weren't able to detect partial usage inside
of a heprer, e.g.: "{{#if author}}{{> "missingpartial"}}{{/if}}". It's
important to be able to detect these on theme upload/validation stage to
avoid errors during the runtime.
- The updated version provides additional information about used and
unused partials and helpers.
- With this change users might start seeing a "fatal" error during an
upload/activation of a theme previously passing validation. Currently
active themes with partials used in the context will still allow for a
 boot, but will log a 422 error pointing to missing partial.
2021-06-17 16:33:03 +04:00
Naz
2b73d0f66f Revert "Update dependency gscan to v4.1.0"
This reverts commit d010ab4490.
2021-06-17 16:33:03 +04:00
Naz
3092f779ec Revemod stray gulp dependency
refs 44a6e399dd

- The change seems unintentionall and prevents from clean revert of gscan commit
2021-06-17 16:11:50 +04:00
Sam Lord
44a6e399dd Upgrade @tryghost/validator
no issue
Fixes the build - as test checks for instanceof ValidationError, and
we were using 2 versions of @tryghost/errors between Ghost and
@tryghost/validator.
2021-06-17 12:59:59 +01:00
Sam Lord
44053553f5 Upgrade @tryghost/errors to use @tryghost/ignition-errors
no issue
Part of the de-coupling project - takes us closer to an Ignition-free
Ghost.
2021-06-17 11:11:03 +01:00
Renovate Bot
941635508e Update dependency postcss to v8.3.5 2021-06-17 10:44:22 +01:00
Renovate Bot
d010ab4490
Update dependency gscan to v4.1.0 2021-06-16 15:53:16 +00:00
Renovate Bot
0ebf8e0161 Update dependency @tryghost/logging to v0.1.1 2021-06-16 15:57:03 +01:00
Renovate Bot
26356b8a5e Update dependency @tryghost/bookshelf-plugins to v0.1.2 2021-06-16 15:33:59 +01:00
Renovate Bot
c394b82cd7 Update dependency @tryghost/package-json to v1.0.1 2021-06-16 15:33:45 +01:00
Renovate Bot
736c878dcf Update dependency @tryghost/tpl to v0.1.2 2021-06-16 15:33:38 +01:00
Sam Lord
3f0bab4389 Replaced request module with @tryghost/request
no issue
Part of the effort to break up Ghost into smaller, decoupled modules.
2021-06-16 13:16:15 +01:00
Sam Lord
24332c3d24 Replaced ghost-version.js with @tryghost/version
no issue
Part of the effort to break up the Ghost codebase into smaller, decoupled modules.
2021-06-16 13:16:15 +01:00
Fabien 'egg' O'Carroll
8ea577b58b
Added support for canceling subscriptions (#13039)
refs https://github.com/TryGhost/Team/issues/775

As we currently do not delete canceled subscriptions and they are
exposed via the API, this functionality has been added to the
editSubscription controller method under the PUT HTTP method.

The cancelSubscription method in @tryghost/members-api was updated to
handle deleting by member id
2021-06-16 11:25:19 +01:00
Hannah Wolfe
526993965a
Switch to @trghost/validator, remove validator
- Part of the effort to split Ghost down into smaller, decoupled pieces
- Moved out our internal validator tooling to a separate library
- Replaced all usage of our own tooling and validatorjs directly with @tryghost/validator
- Removed the validatorjs dependency and removed the renovate pin
- This gives us a consistant, smaller, clearer public API for validations
- It will eventually be used on Ghost Admin too
- This way we can start getting up to date with validator whilst not increasing build size
2021-06-16 08:11:22 +01:00
Sam Lord
35e51e364b Switch to @tryghost/debug, remove ghost-ignition
no issue
The only pieces of Ghost-Ignition used in Ghost were debug and
logging. Both of these modules have been superceded by the Framework
monorepo, and all usages of Ignition have now been removed, replaced
with @tryghost/debug and @tryghost/logging.
2021-06-15 17:24:22 +01:00
Hannah Wolfe
f8524cb0a9
Bumped validator to same version as admin
- validator has seen a lot of change, this one bump is safe
- after this we need to go through and make API updates as isURL has changed quite significantly!
2021-06-15 16:45:48 +01:00
Sam Lord
caea330647 Change to use @tryghost/logging
no issue

Logging is now controlled by a logginrc.js file in the root of the project - and now we can just import @tryghost/logging everywhere
2021-06-15 15:59:11 +01:00
Sam Lord
160cb07e02 Added @tryghost/root-utils to the ghost-version module
no issue
Part of the effort to split ghost into smaller, decoupled parts. The
@root-utils package lets us avoid hard-coding a path to package.json,
and means that the ghost-version.js file could eventually be moved
into a separate module.

This commit uses a patched version of @tryghost/root-utils which
checks for the existence of a `current` directory, as used in
Ghost-CLI. Since this is very specific to Ghost and Ghost CLI, there's
a new method called "getGhostRoot" for this purpose.
2021-06-15 15:06:31 +01:00
Renovate Bot
5b2e7d2c71
Update dependency @sentry/node to v6.7.1 2021-06-15 12:48:02 +00:00
Daniel Lockyer
495ef867c2 Extracted Bookshelf plugins from Ghost to Framework repo
refs:
  - cf15f60085
  - dd20cc649b
  - ccf27f7009
  - abf146d61f
  - 2b54c92a14
  - bb029a53f6
  - 95bd7ee675
  - 9018b4df22
  - df01a6e5f4
  - d313726b34

- these plugins were in a state where they were independent enough to be
  pulled out into their own packages, which is what we did in the
  referenced commits above
- each package is named like `@tryghost/bookshelf-<plugin>`
- to avoid requiring multiple packages into Ghost, we've also created a
  wrapper package called `@tryghost/bookshelf-plugins` which re-exports
  all these plugins, so the changes in Ghost are very simple - dbebdd43b5
- this commit deletes the plugins + tests, and replaces with our new
  package with some minor code changes
2021-06-15 12:49:38 +01:00
Renovate Bot
3092eb344d Update dependency postcss to v8.3.4 2021-06-15 08:55:48 +01:00
Renovate Bot
7cc021c114 Update dependency ghost-ignition to v4.6.3 2021-06-14 18:55:39 +00:00
Sam Lord
1ec79bfaea Revert "Added @root-utils to the ghost-version module"
This reverts commit 846e9f1bbc.
2021-06-14 18:42:40 +01:00
Sam Lord
846e9f1bbc Added @root-utils to the ghost-version module
no issue
Part of the effort to split ghost into smaller, decoupled parts. The
@root-utils package lets us avoid hard-coding a path to package.json,
and means that the ghost-version.js file could eventually be moved
into a separate module.
2021-06-14 16:33:53 +01:00
Renovate Bot
1ec7c70c6f
Update dependency @sentry/node to v6.7.0 2021-06-14 10:06:31 +00:00
Renovate Bot
ed87d1837a Update dependency postcss to v8.3.3 2021-06-14 09:41:29 +01:00
Renovate Bot
aa531dc28b Update dependency @tryghost/members-csv to v1.0.1 2021-06-11 17:44:57 +01:00
Renovate Bot
aee829db15 Update dependency @tryghost/helpers to v1.1.46 2021-06-11 13:37:21 +01:00
Renovate Bot
8d9f06f7c9 Update dependency @tryghost/tpl to v0.1.1 2021-06-11 13:29:43 +01:00
Renovate Bot
07bc610e7e Update dependency @tryghost/session-service to v0.1.23 2021-06-11 13:27:04 +01:00
Renovate Bot
1811e0029f Update dependency @tryghost/vhost-middleware to v1.0.15 2021-06-11 13:26:04 +01:00
Renovate Bot
6cbb6c3c17 Update dependency @tryghost/image-transform to v1.0.12 2021-06-11 13:23:56 +01:00
Renovate Bot
8f7bba3a0e Update dependency @tryghost/mw-session-from-token to v0.1.21 2021-06-11 13:23:50 +01:00
Renovate Bot
d312a05f22 Update dependency @tryghost/promise to v0.1.9 2021-06-11 13:23:43 +01:00
Renovate Bot
def12e0951 Update CSS preprocessors 2021-06-11 13:23:29 +01:00
Renovate Bot
8baad6af30 Update dependency @tryghost/errors to v0.2.12 2021-06-11 13:23:17 +01:00
Renovate Bot
d89ef63317 Update dependency @tryghost/constants to v0.1.8 2021-06-11 13:23:07 +01:00
Renovate Bot
cd5b186b00 Update dependency @tryghost/bootstrap-socket to v0.2.9 2021-06-11 12:29:08 +01:00
Renovate Bot
d9883d6060 Update dependency @tryghost/adapter-manager to v0.2.13 2021-06-11 12:28:50 +01:00
Renovate Bot
13c2d84e1e Update dependency @tryghost/job-manager to v0.8.7 2021-06-11 12:28:38 +01:00
Renovate Bot
3bd03d2bca Update dependency @tryghost/limit-service to v0.6.1 2021-06-11 12:28:32 +01:00
Renovate Bot
99b06682f5 Update dependency @tryghost/security to v0.2.9 2021-06-11 12:28:20 +01:00
Renovate Bot
ff5b1be4e1 Update dependency @tryghost/zip to v1.1.14 2021-06-11 12:28:06 +01:00
Kevin Ansfield
1bc57b584a
Added posts_meta.feature_image_{alt,caption} columns (#13030)
refs https://github.com/TryGhost/Team/issues/770

We want post feature image functionality to better match what's available inside the editor, to do that we'll need somewhere to store alt and caption meta data. `posts_meta` chosen because even though we want to make this generic for other tables in the future those tables also have a `feature_image` (or closely related) field.

- updated schema with new columns
- added migration to create columns
- cleaned new columns from API output
  - not output on v2/v3
  - conditionally output on v4/canary output based on labs flag
- bumped `@tryghost/admin-api-schema` to allow new columns through in canary API requests
  - silently clean properties from input when labs flag is disabled
  - updated acceptance tests so they fail if `admin-api-schema` is not letting the new fields through
2021-06-10 20:35:56 +01:00
Renovate Bot
b53de12e12
Update dependency eslint-plugin-ghost to v2.3.0 2021-06-10 16:13:31 +00:00
Renovate Bot
3472d7b63d
Update dependency @sentry/node to v6.6.0 2021-06-10 14:30:48 +00:00
Renovate Bot
139cf448d7
Update metascraper to v5.22.1 2021-06-09 15:53:54 +00:00
Hannah Wolfe
1f11bd9012
Updated package-json lib to not need DI
- The underlying package-json package has had i18n ripped out using the new tpl utility instead
- It's also then been refactored to not be a class that needs instantiating
- This means it can be required directly and its public interface methods used where needed
- This is a much nicer, neater pattern for what is a mature utility library :)
2021-06-09 16:48:19 +01:00
Daniel Lockyer
1e54db2720
Moved @tryghost/tpl to dependencies
refs 971ac479dc

- `@tryghost/tpl` was accidentally placed in `devDependencies` but
  Ghost needs this to run so it would cause Ghost-CLI to fail when it
  only installs `dependencies`
- this commit moves the dependency to `dependencies`
- also pins the dependency to `0.1.0`
2021-06-09 13:48:32 +01:00
Hannah Wolfe
971ac479dc
Updated ghost-server to use new minimal tpl helper
- 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 pattern will make it easier for us to decouple the codebase, and the new tool helps to keep the refactor surface area really small
- This is the first example of using the new tpl helper, so it also adds @tryghost/tpl
2021-06-09 12:20:59 +01:00
Daniel Lockyer
faf9598d7a
v4.7.0 2021-06-08 17:06:37 +01:00
Renovate Bot
a0f11282d3
Update dependency mocha to v9 2021-06-07 17:05:28 +00:00
Sam Lord
905a228cb7 Merged 4.6.6 into main 2021-06-07 18:03:33 +01:00
Sam Lord
a2b798ce2e v4.6.6 2021-06-07 17:59:45 +01:00
Sam Lord
573b0db76a Merged 4.6.5 into main 2021-06-07 11:31:01 +01:00
Sam Lord
4de81087cc v4.6.5 2021-06-07 11:25:17 +01:00
Renovate Bot
8e0b097c2c
Update dependency eslint to v7.28.0 2021-06-04 23:10:06 +00:00
Rishabh
def46df589 Updated portal plan settings to use named values
refs https://github.com/TryGhost/Team/issues/753

This bumps members-api to handle migration to revert portal settings to named values again as well as handle migration cleanup for old portal settings.
2021-06-04 19:25:39 +05:30
Renovate Bot
a947f7f829 Pin dependency @tryghost/update-check-service to 0.1.0 2021-06-04 13:37:54 +01:00
Kevin Ansfield
b81e5c26dc Added postcss as explicit dev dependency
no issue

- `cssnano` requires `postcss` as a peer dependency which was causing warnings when running `yarn`
- `postcss` was available because it's a sub-dependency of `sanitize-html` so nothing was broken but explicitly adding it to `package.json` resolves the warnings
2021-06-04 12:46:09 +01:00
Fabien O'Carroll
def07d595e Added monthly & yearly price support to products
refs https://github.com/TryGhost/Team/issues/712

The ProductRepository in members-api has been updated to accept
monthly_price & yearly_price when creating and updating products, as
well as including them when reading.
2021-06-03 17:02:32 +01:00
Naz
7d05da6185 Removed update check service in favor of external package
refs https://github.com/TryGhost/Team/issues/728

- The code of update check has been extracted into it's own package as a part of TryGhost/Core monorepo. This commit is a cleanup of the leftover files
2021-06-03 13:24:19 +04:00
Renovate Bot
71a0572f8a
Update dependency @sentry/node to v6.5.1 2021-06-02 18:07:24 +00:00
Fabien O'Carroll
c066dd157a Migrated members_{month,year}ly_price_id settings
refs https://github.com/TryGhost/Team/issues/711

Since we need to support multiple products, which will each have a
monthly and yearly price, we are moving away from storing these ids in
settings, and instead in a column on the products table. The migration
depends on the settings being prepopulated, which is done outside of
knex-migrator, in members-api, so this migration must also be done there.
2021-06-02 10:04:38 +01:00
Renovate Bot
66924486cf Update dependency nock to v13.1.0 2021-06-01 16:44:43 +01:00
Kevin Ansfield
035a38680e Bumped Koenig packages
no issue

- includes sub-dependency bumps for `markdown-it` packages for markdown renderer bug fixes and to keep Ghost and Admin markdown rendering in sync
2021-06-01 09:40:20 +01:00
Renovate Bot
fa2e116474
Update metascraper to v5.22.0 2021-05-31 15:30:42 +00:00
Renovate Bot
514e2ca821
Update dependency @sentry/node to v6.5.0 2021-05-31 10:52:51 +00:00
Renovate Bot
56fb8efccb Update dependency papaparse to v5.3.1 2021-05-31 08:59:54 +01:00