-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Replace data/*.json files with build time .cache/site.json #7074
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| import path from 'path'; | ||
| import chokidar from 'chokidar'; | ||
|
|
||
| import genSiteJson from './gen-site-json.mjs'; | ||
|
|
||
| const mdPath = path.join(process.cwd(), 'content'); | ||
|
|
||
| chokidar.watch(mdPath).on('change', async () => await genSiteJson()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably be replaced with chokidar-cli. The downside is I would need a file that runs genSiteJson() which would look like...
import genSiteJson from './gen-site-json.mjs';
genSiteJson();So for now I just made a single file, happy to iterate on this later.
chloerice
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 🎉 👏🏽
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @shopify/[email protected] ### Minor Changes - [#6890](#6890) [`267e1a9bd`](267e1a9) Thanks [@alex-page](https://github.com/alex-page)! - Add deprecated scss API to stylelint-polaris and use regex tests in the config ## @shopify/[email protected] ### Patch Changes - [#6840](#6840) [`90f325460`](90f3254) Thanks [@AndrewMusgrave](https://github.com/AndrewMusgrave)! - Removed additional reflows from IndexTable ## [email protected] ### Minor Changes - [#7074](#7074) [`ddfacd855`](ddfacd8) Thanks [@alex-page](https://github.com/alex-page)! - Replace data/\*.json files with build time .cache/site.json - [#7082](#7082) [`8ebb9fc3c`](8ebb9fc) Thanks [@selenehinkley](https://github.com/selenehinkley)! - Large edit of /contributing - [#7087](#7087) [`43ea7e5d5`](43ea7e5) Thanks [@alex-page](https://github.com/alex-page)! - Add automation to generate .cache/nav.json ### Patch Changes - [#7037](#7037) [`7dafdee00`](7dafdee) Thanks [@alex-page](https://github.com/alex-page)! - Move header logic to the API and out of next.config.js - [#7075](#7075) [`5933fc547`](5933fc5) Thanks [@alex-page](https://github.com/alex-page)! - Run gen-assets on build of website - Updated dependencies \[[`90f325460`](90f3254)]: - @shopify/[email protected] ## [email protected] ### Patch Changes - Updated dependencies \[[`90f325460`](90f3254)]: - @shopify/[email protected] Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This PR
.cache/site.jsonfile making sure the navigation and search do not need to be updated when creating new pagescomponents.jsonandfoundations.jsonwith.cache/site.jsonreadFilescript needed to access it.cache/site.jsonfile regenerate on changes to markdown filesFuture work
.cache/site.jsonin client side memory when generating the navigation.cache/site.jsonin client side memory when generating the components page categories