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.
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>
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>
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.
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>
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>
- 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
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`
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)
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.
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
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