0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00
Commit graph

40468 commits

Author SHA1 Message Date
Daniel Lockyer
d22856cc35 Added tests for data manipulation model plugin
- this file doesn't have any tests and we don't test the
  `fixDatesWhenFetch` function, so this commits adds tests for the
  functionality, to ensure we don't break it in the future
2025-02-24 10:52:55 +01:00
Sodbileg Gansukh
7e4a02f2b5
Reader improvements in ActivityPub (#22264)
ref AP-751

- Fixed the close button not working after typography settings opened
- Show table of contents only when there's more than one heading
- Added skeleton loader to the article to make it consistent with the
main screens
- Added `randomize` property to Skeleton component for easier random
placeholders
- Added Popover component to Shade and replaced the current one with
that
2025-02-24 17:47:40 +08:00
Ghost CI
9d610ab087 Merged v5.110.1 into main 2025-02-24 07:23:45 +00:00
Ghost CI
149840ca57 v5.110.1 2025-02-24 07:23:44 +00:00
Sodbileg Gansukh
0e80c4310c Fixed the initial state of the dark mode (#22265)
no issues

- when nightShift doesn't exist in the db, it defaulted to dark mode by
default
- this changes the initial state to light by default
2025-02-24 14:53:45 +08:00
Sodbileg Gansukh
ba0ef37481
Fixed the initial state of the dark mode (#22265)
no issues

- when nightShift doesn't exist in the db, it defaulted to dark mode by
default
- this changes the initial state to light by default
2025-02-24 14:30:31 +08:00
renovate[bot]
0d5228fc70
Update dependency rxjs to v7.8.2 (#22263)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [rxjs](https://rxjs.dev)
([source](https://redirect.github.com/reactivex/rxjs)) | [`7.8.1` ->
`7.8.2`](https://renovatebot.com/diffs/npm/rxjs/7.8.1/7.8.2) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/rxjs/7.8.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/rxjs/7.8.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/rxjs/7.8.1/7.8.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/rxjs/7.8.1/7.8.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>reactivex/rxjs (rxjs)</summary>

###
[`v7.8.2`](https://redirect.github.com/reactivex/rxjs/compare/7.8.1...e5351d02e225e275ac0e497c7b66eaa5f0c88791)

[Compare
Source](https://redirect.github.com/reactivex/rxjs/compare/7.8.1...7.8.2)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* * * * 1-5" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNzYuMiIsInVwZGF0ZWRJblZlciI6IjM5LjE3Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 00:53:34 +00:00
Ghost CI
e2fee384c9 v5.110.0 2025-02-21 15:08:08 +00:00
Steve Larson
841fac701f
🐛 Fixed missing attribution in new member and new subscription staff emails (#22252)
ref https://linear.app/ghost/issue/ENG-2030/

We had a couple spots where we could encounter race conditions with the way we emit and handle `DomainEvents` around the various subscriptions (`MemberCreatedEvent` + `SubscriptionActivatedEvent`). Instead of trying to always pull it from the created event in the db, we first try to grab it from memory/the subscription in the checkout session. This gives us more certainty before falling back to the event, in case the order is not as expected.
2025-02-20 20:53:37 +00:00
Peter Zimon
4b2f5fc358
Bumped ActivityPub version (#22256)
no ref.

- Bumping ActivityPub version to deploy frontend updates
2025-02-20 20:22:37 +00:00
renovate[bot]
467e31c084
Update dependency react-router to v7.2.0 (#22098)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [react-router](https://redirect.github.com/remix-run/react-router)
([source](https://redirect.github.com/remix-run/react-router/tree/HEAD/packages/react-router))
| [`7.1.4` ->
`7.2.0`](https://renovatebot.com/diffs/npm/react-router/7.1.4/7.2.0) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/react-router/7.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-router/7.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-router/7.1.4/7.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-router/7.1.4/7.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>remix-run/react-router (react-router)</summary>

###
[`v7.2.0`](https://redirect.github.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#720)

[Compare
Source](https://redirect.github.com/remix-run/react-router/compare/react-router@7.1.5...react-router@7.2.0)

##### Minor Changes

- New type-safe `href` utility that guarantees links point to actual
paths in your app
([#&#8203;13012](https://redirect.github.com/remix-run/react-router/pull/13012))

    ```tsx
    import { href } from "react-router";

    export default function Component() {
      const link = href("/blog/:slug", { slug: "my-first-post" });
      return (
        <main>
          <Link to={href("/products/:id", { id: "asdf" })} />
          <NavLink to={href("/:lang?/about", { lang: "en" })} />
        </main>
      );
    }
    ```

##### Patch Changes

- Fix typegen for repeated params
([#&#8203;13012](https://redirect.github.com/remix-run/react-router/pull/13012))

    In React Router, path parameters are keyed by their name.
So for a path pattern like `/a/:id/b/:id?/c/:id`, the last `:id` will
set the value for `id` in `useParams` and the `params` prop.
For example, `/a/1/b/2/c/3` will result in the value `{ id: 3 }` at
runtime.

Previously, generated types for params incorrectly modeled repeated
params with an array.
    So `/a/1/b/2/c/3` generated a type like `{ id: [1,2,3] }`.

To be consistent with runtime behavior, the generated types now
correctly model the "last one wins" semantics of path parameters.
    So `/a/1/b/2/c/3` now generates a type like `{ id: 3 }`.

- Don't apply Single Fetch revalidation de-optimization when in SPA mode
since there is no server HTTP request
([#&#8203;12948](https://redirect.github.com/remix-run/react-router/pull/12948))

- Properly handle revalidations to across a prerender/SPA boundary
([#&#8203;13021](https://redirect.github.com/remix-run/react-router/pull/13021))

- In "hybrid" applications where some routes are pre-rendered and some
are served from a SPA fallback, we need to avoid making `.data` requests
if the path wasn't pre-rendered because the request will 404
    -   We don't know all the pre-rendered paths client-side, however:
- All `loader` data in `ssr:false` mode is static because it's generated
at build time
        -   A route must use a `clientLoader` to do anything dynamic
- Therefore, if a route only has a `loader` and not a `clientLoader`, we
disable revalidation by default because there is no new data to retrieve
- We short circuit and skip single fetch `.data` request logic if there
are no server loaders with `shouldLoad=true` in our single fetch
`dataStrategy`
- This ensures that the route doesn't cause a `.data` request that would
404 after a submission

- Error at build time in `ssr:false` + `prerender` apps for the edge
case scenario of:
([#&#8203;13021](https://redirect.github.com/remix-run/react-router/pull/13021))

- A parent route has only a `loader` (does not have a `clientLoader`)
    -   The parent route is pre-rendered
    -   The parent route has children routes which are not prerendered
- This means that when the child paths are loaded via the SPA fallback,
the parent won't have any `loaderData` because there is no server on
which to run the `loader`
- This can be resolved by either adding a parent `clientLoader` or
pre-rendering the child paths
- If you add a `clientLoader`, calling the `serverLoader()` on
non-prerendered paths will throw a 404

- Add unstable support for splitting route modules in framework mode via
`future.unstable_splitRouteModules`
([#&#8203;11871](https://redirect.github.com/remix-run/react-router/pull/11871))

- Add `unstable_SerializesTo` brand type for library authors to register
types serializable by React Router's streaming format (`turbo-stream`)
([`ab5b05b02`](ab5b05b02f))

- Align dev server behavior with static file server behavior when
`ssr:false` is set
([#&#8203;12948](https://redirect.github.com/remix-run/react-router/pull/12948))

- When no `prerender` config exists, only SSR down to the root
`HydrateFallback` (SPA Mode)
- When a `prerender` config exists but the current path is not
prerendered, only SSR down to the root `HydrateFallback` (SPA Fallback)
    -   Return a 404 on `.data` requests to non-pre-rendered paths

- Improve prefetch performance of CSS side effects in framework mode
([#&#8203;12889](https://redirect.github.com/remix-run/react-router/pull/12889))

- Disable Lazy Route Discovery for all `ssr:false` apps and not just
"SPA Mode" because there is no runtime server to serve the
search-param-configured `__manifest` requests
([#&#8203;12894](https://redirect.github.com/remix-run/react-router/pull/12894))

- We previously only disabled this for "SPA Mode" which is `ssr:false`
and no `prerender` config but we realized it should apply to all
`ssr:false` apps, including those prerendering multiple pages
- In those `prerender` scenarios we would prerender the `/__manifest`
file assuming the static file server would serve it but that makes some
unneccesary assumptions about the static file server behaviors

- Properly handle interrupted manifest requests in lazy route discovery
([#&#8203;12915](https://redirect.github.com/remix-run/react-router/pull/12915))

###
[`v7.1.5`](https://redirect.github.com/remix-run/react-router/blob/HEAD/packages/react-router/CHANGELOG.md#715)

[Compare
Source](https://redirect.github.com/remix-run/react-router/compare/react-router@7.1.4...react-router@7.1.5)

##### Patch Changes

- Fix regression introduced in `7.1.4` via
[#&#8203;12800](https://redirect.github.com/remix-run/react-router/pull/12800)
that caused issues navigating to hash routes inside splat routes for
applications using Lazy Route Discovery (`patchRoutesOnNavigation`)
([#&#8203;12927](https://redirect.github.com/remix-run/react-router/pull/12927))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* * * * 1-5" (UTC), Automerge - At
any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/TryGhost/Ghost).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNDUuMCIsInVwZGF0ZWRJblZlciI6IjM5LjE3Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-20 16:20:16 +00:00
Peter Zimon
2914108819
ActivityPub profile view UI update (#22253)
ref AP-748

- The visuals of the Profile view of ActivityPub had to be updated to be
more coherent with the overall design
2025-02-20 16:13:08 +01:00
renovate[bot]
ccd149a3d8 Update dependency semver to v7.7.1 2025-02-20 15:59:43 +01:00
renovate[bot]
268b1da456 Update dependency cross-fetch to v4.1.0 2025-02-20 15:47:59 +01:00
renovate[bot]
cb57246e00 Update dependency fs-extra to v11.3.0 2025-02-20 15:46:55 +01:00
renovate[bot]
0a88bb4a39 Update dependency @probe.gl/bench to v4.1.0 2025-02-20 15:45:54 +01:00
renovate[bot]
ee4ff683d7 Update dependency semver to v7.7.0 2025-02-20 15:45:05 +01:00
Sodbileg Gansukh
52fbcd2678
Fixed dark mode in ActivityPub article view (#22249)
no issues

- the dark mode used to be applied only when refreshed — now it doesn't
require a refresh anymore
- also added dark mode support to the table of contents
2025-02-20 17:04:04 +08:00
Daniel Lockyer
25e5b3d8e7 Refactored raw-knex model plugin for readability
- this plugin was written quite a while ago so it's written in
  "old-style" JS, making it harder to read
- converted parameter extractions to object destructuring
- removed promise chaining to async-await
- pulled out bookshelfPrototype into a variable for brevity
- switched to some native array filter methods for brevity
2025-02-20 09:55:03 +01:00
Peter Zimon
4d36d0b754
ActivityPub UI design refinements (#22242)
ref AP-748

- Some minor design details have had to be updated for a more consistent and solid UX/visual.
2025-02-20 08:27:37 +01:00
Sodbileg Gansukh
e337c266bb
Added dark mode class to the root element of the Admin (#22239)
ref AP-755

- this adds `dark` class to the root <html> element, so it acts as the
source of truth for the apps embedded in the admin
- this also gets rid of the `dark` class from the current design system
and Shade, so the apps wrapped within the corresponding providers don't
output nested `dark` classes
2025-02-20 10:25:49 +08:00
Chris Raible
5547c0b6f0
Added .env.example file to simplify getting started with docker compose (#22247)
no issue

- To run Ghost itself in docker compose, you need to enable the `ghost`
compose profile by setting `COMPOSE_PROFILES=ghost`.
- This is done for you if you use the `yarn docker:*` commands, but if
you run any other `docker compose ...` commands manually, the `ghost`
profile won't be enabled by default.
- The easiest way to set `COMPOSE_PROFILES` is with a `.env` file in the
root of the repo. This `.env.example` file is a template than can be
easily copied to `.env` by running `cp .env.example .env`, which will in
turn enable the `ghost` profile.
- It also includes commented out environment variables that are useful
when running Ghost in Docker compose, such as stripe keys, app flags
(for running e.g. portal), and `DEBUG` modes.

This commit also includes some minor changes to the `dev.js` script:
- Adds a list of `availableFlags`, including all the app flags that it
will accept
- Adds validation to log an error and exit if any invalid flags are
passed. This will force us to keep this list up to date if/when we add
more app flags
- Adds a `show-flags` flag, which will print all the available flags,
along with a description, then immediately exit.

Ultimately this makes getting started with docker compose more straight
forward:
- Clone the repo
- Run `cp .env.example .env` to enable the `ghost` profile
- Run `docker compose up`
2025-02-19 13:16:30 -08:00
Steve Larson
8f7a7992ee
🐛 Fixed subscription attribution sometimes missing from SubscriptionCreatedEvent (#22219)
ref https://linear.app/ghost/issue/ENG-1561/

Depending on the path to upgrade a member, it was possible for the subscription attribution to not get set. This specifically patches the `SubscriptionCreatedEvent` missing the subscription attribution.

Note that we've identified other issues while exploring this causing subscription attribution to not display in certain cases, although it is being set appropriately. Those will be patched separately. See parent issue.
2025-02-19 14:08:36 -06:00
Chris Raible
cee2b99e37
Improved stripe listen command in dev.js script (#22245)
no issue

Problem:
- Running `yarn dev` with `--stripe` runs the `stripe listen ...`
command in a subprocess to forward webhook events to your local instance
of Ghost in development.
- Currently, you have to run `stripe login` manually before this will
work. If you fail to do so, the `yarn dev` script simply hangs
indefinitely without any logging to indicate why.
- Running `stripe login` manually is also a non-starter in Docker since
you'd have to do this for each new container instance, which isn't
practical.

Solution:
- Luckily the `stripe listen ...` command accepts an `--api-key`
argument, which expects your stripe secret key. This change updates the
`dev.js` script to read your stripe API key from the `STRIPE_SECRET_KEY`
environment variable if it's present. As long as `STRIPE_SECRET_KEY`
exists, you won't need to run `stripe login` anymore.
- It also adds a timeout of 5 seconds to the initial `stripe listen`
command and will exit the process if this step fails, indicating with a
clear log message that you need to either set the `STRIPE_SECRET_KEY`
variable or run `stripe login`
- I also added a bunch of debug statements to the dev script which were
useful in debugging this, and may prove useful for similar issues in the
future, so I'll leave them in there.
2025-02-19 11:04:30 -08:00
Daniel Lockyer
5a5e67aef2 Fixed collection of URL service init time metrics
- the original implementation of this was wrong in that it would
  calculate the init time from a static point in the boot process until
  "now", which would be fine for the boot process
- however, if someone uploads a routes.yaml file much later, it would
  still call `onFinished` and compare itself to the static time in the
  boot process, resulting in huge "url service init" metrics
- to fix that, we can just collect the timestamp from `_onQueueStarted`, calculate
  the diff in `_onQueueEnded` and then do logging/metrics
- as a result, we can then remove the `onFinished` function, as it's no
  longer necessary
2025-02-19 18:44:58 +01:00
Chris Raible
fa377b5ac0
Configured ssh agent forwarding for docker compose (#22232)
no issue

- Currently running any `git` commands in the docker container (i.e.
updating submodules) that use ssh are failing because the container
can't see your ssh keys. This commit adds a volume & environment
variable to enable forwarding your local ssh agent into the container.
As long as you've got an ssh agent running locally with your keys
enabled, this will allow you to e.g. push to a remote over ssh from
inside the container.
- It also mounts your local `.gitconfig` file into the container, so
your git configuration (i.e. name & email address) will also work inside
the container
- Finally, it adds githubs ssh keys to known_hosts in the development
target of the Dockerfile to avoid the prompt, which only works in
interactive environments and fails in any kind of script (like `yarn
main:submodules`).
2025-02-19 09:38:05 -08:00
Steve Larson
11ca9e3009
Removed job queue handling within the email analytics job (#22243)
ref https://linear.app/ghost/issue/ENG-2026/

This is being removed as the JobQueueManager is being removed. By
removing this, we can allow the queue to deplete itself before stripping
out that functionality.
2025-02-19 10:29:30 -06:00
Daniel Lockyer
6b7f65c0b0 Improved JSDoc and comments for URL service Queue class
- no implementation changes, just improving the JSDoc and comments to
  make this more readable
- also switches some assertions in the tests to use the spy instance to
  fix a typing issue
2025-02-19 13:18:59 +01:00
Daniel Lockyer
ceda978b38 Refactored roles E2E test to new test framework
- just a simple refactor to switch it to the new framework and add the
  new snapshots
2025-02-19 11:49:42 +01:00
Sanne de Vries
31bb7d11e2
Fixed responsive styles for CTA card frontend rendering (#22210)
Ref https://linear.app/ghost/issue/PLG-337/create-cta-card-web-design
- The minimal layout version now changes to a column layout on mobile
- The sponsor label color now inherits the theme color so that it works
on any background color
- The spacing is adjusted for mobile
2025-02-19 10:36:06 +00:00
Kevin Ansfield
453a53f5b8 Cleaned up i18n file formatting
no issue

- automatic formatting fixes from running the i18n script
2025-02-19 09:38:30 +00:00
Daniel Lockyer
76e91b8b10 Added support for Node 22
ref https://linear.app/ghost/issue/ENG-2013/add-node-22-support-to-ghost

- we're adding support for Node 22 because it's now LTS
- this adds the current latest Node 22 version to the package.json for
  Ghost + Admin, and adds Node 22 testing to CI
2025-02-19 10:00:50 +01:00
Daniel Lockyer
bf6bf51b8c Ensured only one Stripe settings handler is listening
- due to how our test framework works, we end up running the boot
  process many times
- each boot causes the Stripe service to re-add this handler
- that means we end up with like 100 handlers for `settings.edited`
- whilst it would be ideal if we could reset the event listener each
  boot, the simplest thing for now is to just remove and re-add it
- I've pulled `stripeSettingsChanged` out of the init function because
  `removeListener` only works on the specific instance of that function,
  so it won't clean it up if it's a local function
2025-02-19 09:41:38 +01:00
Daniel Lockyer
4a9575d179 Ensured only one XMLRPC handler is listening
- due to our testing framework, we run the boot over and over, but this
  means we constantly add new xmlrpc listeners
- from profiling, this accounts for ~3% of the total test time, which is
  minimal, but given it's an easy fix, this commit performs that
- ideally our test framework would reset the events between runs, or
  keep them completely separate, but that's a while away yet without a
  big refactor
2025-02-19 09:41:38 +01:00
Peter Zimon
3dfc275241
ActivityPub UI restructure (#22209)
ref AP-748

- The current structure of the AcitivyPub app makes it hard to scale and
extend, and it also lacks basic design heuristics. This PR adds a new header
and right sidebar for clear orientation and navigation.
2025-02-19 09:29:15 +01:00
renovate[bot]
3138701d7d Update dependency nx to v19.8.14 2025-02-19 08:32:47 +01:00
renovate[bot]
6d2151b8d0 Update dependency @doist/react-interpolate to v2 2025-02-19 07:44:57 +01:00
Sodbileg Gansukh
d984140f6b
Added dark mode support to ActivityPub (#22228)
ref AP-755
2025-02-19 14:29:46 +08:00
Chris Raible
0501610973
Added force recreate option to yarn docker:dev script (#22230)
no issue

- There is still some flaky behavior with the docker setup that seems to
be caused by the container not shutting down or cleaning up properly.
Sometimes `yarn dev` just hangs, or sometimes it only runs some of the
commands required. This seems to only happen when running `docker
compose up` after having previously run it and stopped it.
- Passing the `--force-recreate` option to docker compose recreates all
the containers, which seems to avoid this problem without incurring a
noticeable performance penalty.
2025-02-19 06:10:18 +00:00
Chris Raible
9dcb7d69e7
Removed lexical ports from docker compose config (#22229)
no issue

- Port 4173 and 41730 are used to load a locally running version of
lexical into Ghost, and these ports were added to the Dockerfile and
compose.yml along with the ports for portal, admin, etc. However,
lexical runs _outside_ the container, so we don't really need to expose
these ports.
2025-02-18 21:21:13 -08:00
Chris Raible
96bc01a3ae
Reduced the size of the development docker image by ~100 MB (#22226)
no issue

- This commit includes a few minor optimizations to the Dockerfile
- Removes `/var/lib/apt/lists` and runs `apt clean` to remove the apt
cache after each `apt install ...` command. This reduces the resulting
image size by about 100 MB
- Also moved the playwright install to after the `package.json` and
`yarn.lock` files are copied in, so we don't have to specifically pin
the version in the Dockerfile — it will instead just look at the version
specified in the `package.json` files.
2025-02-18 18:09:47 -08:00
Chris Raible
cf6ff55241
Improved configuration setup for Docker development (#22224)
no issue

- When running Ghost in docker compose, you need to set the database
connection, redis connection, and the server host to values that are
suitable for the environment.
- Previously this was done by automatically editing your
`config.local.json` file to update these parameters in the container's
entrypoint script. This made it somewhat annoying to switch from Docker
to local development because you have to remember to update your
`config.local.json` manually.
- This change adds a new static configuration file for running in docker
compose. The values set in this configuration file will override any of
the same keys in the `config.local.json` file, while still allowing the
use of `config.local.json` for any _other_ configuration keys. The
upshot of this is that you won't need to modify your `config.local.json`
file when switching back and forth between local and docker dev — you
can keep your local database, redis, etc configuration in
`config.local.json`, and they will simply be ignored when running in
docker.
- This also removes the script that updates your `config.local.json`
file from the entrypoint, since we no longer need to perform this step.
2025-02-18 17:49:18 -08:00
Chris Raible
1891c2a6be
Rename compose profile to ghost (#22223)
no issue

- Renamed the docker compose profile for Ghost from `full` to `ghost`,
because it is clearer and makes more sense this way
- Also added an explicit `GHOST_DEV_IS_DOCKER` environment variable to
the `compose.yml` file to make checking if running in docker less
fragile and more explicit.
2025-02-18 16:45:18 -08:00
Chris Raible
12f14ae891
Removed knex-migrator init from Docker entrypoint (#22222)
no issue

- This fails when running the Ghost container alone (i.e. for unit
tests) since there is no database available.
- The database will be initialized when running `yarn dev` for the first
time anyhow, so this isn't really necessary here.
2025-02-19 00:14:39 +00:00
Chris Raible
dd521a13ef
Removed git submodule update from Dockerfile (#22221)
no issue

- Doing the submodule update in the Dockerfile doesn't work if you cloned Ghost via ssh,
because the Docker container doesn't have access to your ssh keys.
2025-02-19 00:02:40 +00:00
Chris Raible
0665ed6e9d
Improved docker development setup (#22177)
no issue

This commit is a fairly significant rework of the docker development
setup, with the goal of improving the performance of the Ghost container
and generally improving the DX of the docker development setup.

**Enumerating `node_modules` directories as volume exclusions for the
bind mount**
- The main source of performance overhead with the docker setup is the
bind mount, which mounts all the code into the container. Especially on
macOS, the bind mount introduces quite a bit of file system overhead.
Currently the bind mount includes all the `node_modules` directories,
which adds up to many thousands of files in the bind mount. This change
attempts to reduce this overhead by mounting in named volumes for each
`node_modules` directory in the monorepo, which effectively tells the
main bind mount to ignore these directories, thus reducing the
filesystem overhead.

**Removing the `yarn install` from the entrypoint script and the `yarn
setup:docker` step**
- This change has two more benefits: since all the `node_modules` are
installed into named volumes, we can now be confident that our local
`node_modules` won't conflict with the `node_modules` in the container.
Therefore, we can install `node_modules` at build time in the Dockerfile
instead of in the entrypoint script, and we can also get rid of the
`yarn setup:docker` setup command, which nukes your local `node_modules`
before building the container.

**Build optimization - enumerating all `package.json` files**
- In a typical node app's Dockerfile, you copy the `package.json` and
`yarn.lock` files into the container first, then run `yarn install`,
then copy the rest of the code in. This takes advantage of Docker's
build cache to avoid having to reinstall `node_modules` on every build
if you've only changed code files, but not any dependencies.
- This is more challenging to do with the monorepo since we have many
`package.json` files. This commit brute forces our way through that by
copying every single `package.json` file in the Dockerfile before
installing dependencies and copying the code in. The result is that
Docker builds become much faster, after the initial full build.

**Additional scripts**
- Since enumerating all the `node_modules` directories and
`package.json` files is tedious to do manually, this commit also
includes two new scripts to automate this work. Ideally we'll eventually
integrate these scripts with Slimer, so when you add a new package to
the monorepo it automatically updates the `Dockerfile` and
`compose.yml`, but for now we can manage that ourselves since it's a
fairly rare occurrence.
2025-02-18 23:47:39 +00:00
Chris Raible
bc25569843
Improved docstrings in the Stripe service and added README.md (#22214)
no issue

- No real code changes
- Added README.md to stripe service as a starting point to document some of the more complex stripe related flows
- Added typedefs and docstrings to most of the Stripe service code for improved type safety and clarity
2025-02-18 19:16:40 +00:00
Techkrypt-xyz
5f465b14e6
🌐 Updated Slovak translations (#21800)
I have completed the translation of the Slovak language for the missing
phrases and edited some of them for grammatical correctness, word order
and context.

---------

Co-authored-by: Peter Gonda <pipo@pipoline.com>
Co-authored-by: Cathy Sarisky <42299862+cathysarisky@users.noreply.github.com>
2025-02-18 15:17:29 +00:00
Daniel Lockyer
3945931059 Switched prepareContentFolder in legacy E2E utils to async-await
- this is slightly faster than the sync methods and brings it inline
  with that we have in the E2E framework, so it'll be easier to switch
  down the line
2025-02-18 16:01:34 +01:00
Daniel Lockyer
ae81a3650c Removed real-world waits in test by replacing with sinon
- this test needs to pass some time to make it work, and the current
  method awaits a setTimeout, which means we're waiting in the real
  world for it to finish
- we can just replace this with sinon to fake the clock jumping a second
  ahead of time
- this saves 2s in tests
2025-02-18 14:53:58 +01:00