Commit Graph

57 Commits

Author SHA1 Message Date
Cathy Sarisky
967cf23091
🐛 Fixed search state bug & missing last result (#21417)
closes #21343 

This fixes an issue in sodo-search where early results (for example,
matching the first letter typed in the search box) would get "stuck" in
the display, due to failure to update state (or actually, lacking
state).

Converted PostItems to a component, and gave paginatedPosts state.

I also fixed an undocumented bug where the last search result didn't
appear, due to an error in with slice's register.
2024-10-28 12:50:15 +07:00
Fabien O'Carroll
76d4ef27c4 Bumbed sodo-search to 1.5.0 2024-10-25 12:35:44 +01:00
Fabien O'Carroll
18a52004e3 Fixed yarn ship for sodo-search
Previously we ran `git status` on the whole repo, and then would continue with
the shipping process regardless of the outcome.
2024-10-25 12:35:44 +01:00
Chris Raible
af0f26c75f
Added Dev Container setup (#21279)
no issue

- Dev Containers let you work on Ghost in a consistent, isolated
environment with all the necessary development dependencies
pre-installed. VSCode (or Cursor) can effectively run _inside_ the
container, providing a local quality development environment while
working in a well-defined, isolated environment.
- For now the default setup only works with "Clone repository in
Container Volume" or "Clone PR in Container Volume" — this allows for a
super quick and simple setup. We can also introduce another
configuration to allow opening an existing local checkout in a Dev
Container, but that's not quite ready yet.
- This PR also added the `yarn clean:hard` command which: deletes all
node_modules, cleans the yarn cache, and cleans the NX cache. This will
be necessary for opening a local checkout in a Dev Container.
- To learn more about Dev Containers, read this guide from VSCode:
https://code.visualstudio.com/docs/devcontainers/containers#_personalizing-with-dotfile-repositories

---------

Co-authored-by: Joe Grigg <joe@ghost.org>
Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-10-24 11:15:08 -07:00
Steve Larson
4f28e7ea43
Bumped sodo-search (#21346)
no ref
2024-10-20 13:24:21 +00:00
Cathy Sarisky
324211f64d
fix build for search, signup, comments = 80-90% reduction in size! (#21342)
no ref

This change to vite.config.js fixes errors in the sodo-search,
signup-form, and comments packages, preventing inclusion of all of
i18n/locales. As the number of translated strings has gotten larger,
these builds have increased significantly in size, bloated with strings
that aren't actually present in them (in 58 different languages!)

No obvious build errors are present with these changes, but an extra
eyes would be appreciated. Vite isn't my forte.

---------

Co-authored-by: Steve Larson <9larsons@gmail.com>
2024-10-17 12:35:56 -05:00
Steve Larson
8aa920e425
Bumped search (#21216)
no ref
- bumped to pull in i18n changes
2024-10-03 21:33:19 +00:00
renovate[bot]
34090f7370
Update dependency flexsearch to v0.7.43 (#19455)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [flexsearch](https://redirect.github.com/nextapps-de/flexsearch) |
[`0.7.21` ->
`0.7.43`](https://renovatebot.com/diffs/npm/flexsearch/0.7.21/0.7.43) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/flexsearch/0.7.43?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/flexsearch/0.7.43?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/flexsearch/0.7.21/0.7.43?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/flexsearch/0.7.21/0.7.43?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>nextapps-de/flexsearch (flexsearch)</summary>

###
[`v0.7.43`](12f48e64f7...4c3966709f)

[Compare
Source](12f48e64f7...4c3966709f)

###
[`v0.7.42`](a0a798d7fe...12f48e64f7)

[Compare
Source](a0a798d7fe...12f48e64f7)

###
[`v0.7.41`](5c54b465a8...a0a798d7fe)

[Compare
Source](5c54b465a8...a0a798d7fe)

###
[`v0.7.40`](b8279ebddc...5c54b465a8)

[Compare
Source](b8279ebddc...5c54b465a8)

###
[`v0.7.39`](f18da33d8f...b8279ebddc)

[Compare
Source](f18da33d8f...b8279ebddc)

###
[`v0.7.34`](1d620d68c4...f18da33d8f)

[Compare
Source](1d620d68c4...f18da33d8f)

###
[`v0.7.33`](https://redirect.github.com/nextapps-de/flexsearch/compare/0.7.31...1d620d68c498e6617192fdd6ff6e0e70c666b254)

[Compare
Source](https://redirect.github.com/nextapps-de/flexsearch/compare/0.7.31...1d620d68c498e6617192fdd6ff6e0e70c666b254)

###
[`v0.7.31`](65b027ca31...0.7.31)

[Compare
Source](65b027ca31...0.7.31)

</details>

---

### Configuration

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

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **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:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMjEuMCIsInVwZGF0ZWRJblZlciI6IjM4Ljk3LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-02 16:21:12 +01:00
Cathy Sarisky
6e599ef541
🌐 Added ⬅️RTL to sodo-search & improved tests (#21152)
no ref

- added dir prop, calculated by i18next from language (using the dir
function)
- tweaked a few styles to use me/ms/pe/ps instead of mr/ml/pr/pl
- added updated test that checks that stemming works in English, and added tests for partial and full-word searching with RTL content.
2024-10-01 18:04:54 +00:00
ココロ
300eba49ca
🌐 Improved sodo-search for CJK (#21148)
no ref

According to the flexsearch documentation, https://github.com/nextapps-de/flexsearch?tab=readme-ov-file#cjk-word-break-chinese-japanese-korean for searching CJK text, need to pass in a custom encode function for better search results.

This enhancement for CJK will only take effect when the ghost site locale is set to one of `zh`, `zh-Hans`, `zh-Hant`, `ja`, `ko`.

Co-authored-by: Cathy Sarisky <42299862+cathysarisky@users.noreply.github.com>
2024-10-01 18:01:54 +00:00
Hannah Wolfe
554920d20b
Shipped sodo-search@1.2.0 (#21090)
- This adds i18n support to search
2024-09-24 13:13:27 +01:00
Cathy Sarisky
2a2d7bb9ad
Added i18n support to search - ready for translator work! (#21055)
ref https://github.com/TryGhost/Ghost/issues/16628

This adds translation support to search, which should be the last missing piece of i18n support for Ghost's frontend  🎉
- Translation (t) helper added to sodo-search.
- Ghost head tweaked to include data-locale.
- All (I hope) strings in sodo-search wrapped in the t helper.
- Possibly poor-quality French translation strings added.

---------

Co-authored-by: Vikas Potluri <vikaspotluri123.github@gmail.com>
2024-09-24 12:39:32 +01:00
renovate[bot]
91e8aa1271 Update dependency jsdom to v24.1.3 2024-08-26 09:44:19 +02:00
renovate[bot]
eb7024da34 Update testing-library monorepo 2024-08-07 09:59:15 +02:00
renovate[bot]
cbd994d033 Update dependency jsdom to v24.1.1 2024-07-22 09:10:23 +02:00
Daniel Lockyer
ecc6053e5d Cleaned up jsdom dependency usage
- we don't need this in `ghost/core` as it's not used in there
- we need to declare this dependency for the apps, as they use it for
  running tests
- this doesn't change the lockfile but it means we're declaring the
  dependency in the right places now
2024-05-27 09:49:43 +02:00
renovate[bot]
60a3b5a913 Update TryGhost packages 2024-05-01 08:49:04 +02:00
renovate[bot]
3f960818eb Update dependency vite to v4.5.3 [SECURITY] 2024-04-16 09:21:49 +02:00
renovate[bot]
3575102462 Update dependency vite to v4.5.2 [SECURITY] 2024-01-22 09:25:09 +01:00
Daniel Lockyer
fc02ca8bbb Reverted "Update Vite packages"
refs https://ghost.slack.com/archives/C0568LN2CGJ/p1702454781859679

- this reverts commit cf60db85d8 as we've
  seen issues with the `vite-plugin-css-injected-by-js` dependency
2023-12-13 09:24:29 +01:00
renovate[bot]
cf60db85d8 Update Vite packages 2023-12-12 18:23:37 +01:00
renovate[bot]
a1c292b683 Update dependency @vitejs/plugin-react to v4.2.1 2023-12-04 19:41:11 +01:00
renovate[bot]
3267eb9843 Update dependency vite to v4.5.1 2023-12-04 12:56:21 +01:00
renovate[bot]
fa51b1b3dd Update dependency @vitejs/plugin-react to v4.2.0 2023-11-20 09:42:07 +01:00
Daniel Lockyer
ee804fc7af Hidden "info" Vite output unless in CI
refs https://github.com/TryGhost/DevOps/issues/104

- `info` is very verbose as it prints all files and their sizes
- we often don't care about this, so we can do away with `info` in favor
  of `warn`
2023-11-15 10:11:22 +01:00
Daniel Lockyer
53157f3c40 Disabled reporting compressed gzip size
refs https://vitejs.dev/config/build-options.html#build-reportcompressedsize

- this should make building a little bit quicker because it doesn't have
  to calculate the gzip size (I don't think we're likely to hit this
  because we don't have large projects, but it's still nice to clean up
  the output)
2023-11-15 09:11:12 +01:00
renovate[bot]
8d324a6257 Update dependency @vitejs/plugin-react to v4.1.1 2023-11-02 09:51:00 +01:00
renovate[bot]
057d9599f5 Update TryGhost packages 2023-10-31 20:54:17 +01:00
renovate[bot]
5844e5c9f1 Update dependency vite to v4.5.0 2023-10-24 09:13:06 +02:00
renovate[bot]
b2cebdc9b0 Update dependency vite to v4.4.11 2023-10-06 07:55:29 +02:00
renovate[bot]
6ec3a600cc Update dependency vite to v4.4.10 2023-10-04 08:35:18 +02:00
renovate[bot]
d9ec7a0b90 Update dependency @vitejs/plugin-react to v4.1.0 2023-09-27 09:36:39 +02:00
Daniel Lockyer
fc43d181e3 Released Sodo-Search v1.1.1 2023-09-22 18:33:10 +02:00
Mark Stosberg
7fa083d774
🐛 Fixed escaping search terms that contain special characters (#18151)
fixes https://github.com/TryGhost/Ghost/issues/18133

Before, Sodo Search was not escaping search input before using the search terms in a regular expression, so using special characters could result in an invalid regular expression which would crash JavaScript.

As regular expressions date back to Perl, so does a standard solution for this, which called quotemeta in Perl. It doesn't exist 1:1 in JavaScript, but StackOverflow had the answer: stackoverflow.com/questions/6318710/javascript-equivalent-of-perls-q-e-or-quotemeta

So a line of code is added to escape the special characters in the regex for passing them through. This is the same code that the quotemeta module on NPM would use.
2023-09-20 10:17:21 +02:00
renovate[bot]
c055179765 Update dependency vite-plugin-svgr to v3.3.0 2023-09-20 08:41:57 +02:00
Daniel Lockyer
caab89ff4d Reverted flexsearch to v0.7.21
refs https://github.com/TryGhost/Ghost/pull/18151
refs 1cbbe91a63

- something has broken within 0.7.31 and it's causing an error on the
  frontend
- this commit reverts the dependency back to the previous version
- also cleans up the dependency from announcement-bar, where it is not
  used
2023-09-15 15:07:57 +02:00
Daniel Lockyer
c6cb35074a Updated linting and testing packages 2023-09-01 15:51:17 +02:00
renovate[bot]
24300120c2 Update dependency vitest to v0.34.3 2023-08-29 18:52:13 +01:00
renovate[bot]
f9589ff7bd Update dependency vitest to v0.34.2 2023-08-23 11:45:02 +01:00
renovate[bot]
0424915a31 Update dependency @vitejs/plugin-react to v4.0.4 2023-08-09 11:43:08 +02:00
renovate[bot]
98dc4d7b06 Update dependency vite to v4.4.9 2023-08-09 10:09:03 +02:00
renovate[bot]
9f85124a2e Update dependency vitest to v0.34.1 2023-08-09 09:54:48 +02:00
renovate[bot]
ca7d829915 Update dependency vite to v4.4.8 2023-08-09 09:50:54 +02:00
John O'Nolan
c06ba9bec9
2023 (2) 2023-08-03 21:04:20 +01:00
Daniel Lockyer
c97cc08455 Updated ESLint config for React+Typescript packages
refs https://github.com/TryGhost/DevOps/issues/50

- `react-app` comes from `eslint-config-react-app`, which is a CRA package
- we're moving away from that so this commit switches the linting over
  to a more recently updated plugin
- once that was removed, we started using a newer version of
  `@typescript-eslint/eslint-plugin`, so there were plenty of
  updates/exemptions to make
2023-07-27 11:40:31 +02:00
Daniel Lockyer
5875962392 Converted CRA packages to Vite
refs https://github.com/TryGhost/DevOps/issues/50

- we're moving away from CRA in favor of Vite, so this switches the last
  packages over
2023-07-27 09:43:35 +02:00
Daniel Lockyer
d0f9c8cf0c Deduplicated eslint and eslint-plugin-ghost to top-level package.json
refs https://github.com/TryGhost/DevOps/issues/50

- this deduplicates where we define the version of `eslint` and
  `eslint-plugin-ghost` so it's easier to maintain
2023-07-24 16:21:47 +02:00
renovate[bot]
401c1a0d10 Update dependency postcss to v8.4.27 2023-07-21 14:42:30 +02:00
renovate[bot]
b8870dec99 Update dependency tailwindcss to v3.3.3 2023-07-14 08:58:58 +02:00
renovate[bot]
6a13e5e737 Update dependency postcss to v8.4.26 2023-07-14 08:16:06 +02:00