-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
[request] Command to only re-build theme.json
(or no-op)
#2139
Comments
theme.json
(or no-op)
For now, my inclination is to not add complexity and continue to treat it as a build artifact (like It is relatively easy to add as a bespoke script. Maybe import {factory} from '@roots/bud';
const bud = await factory();
await bud.extensions.add(`@roots/bud-wordpress-theme-json`)
//
const {path, ...json} = bud.wpjson.options
await bud.fs.json.write(path, json); Then add it to scripts in // ...
"scripts": {
"translate": "node ./build-scripts/pre-translate.js && wp translate ..."
}
// ... Not super ideal but I think this is a very particular need. Especially if there is js to translate, since that necessitates a build anyway? Willing to revisit this in the future or entertain follow up. I do think there is something to making it easier to generically script with bud.js. I've tried to make it simple but it's been secondary to the cli since that's how nearly 100% of users interface with it. |
Yes, this approach looks good. Would it make sense to have a
|
- improve: reuse cli instance - make instantiating with node api simpler - upgrade to ink 4 - docs: add pnpm install instructions refers: - #2139 ## Type of change **PATCH: backwards compatible change** This PR includes breaking changes to the following core packages: - none This PR includes breaking changes to the follow extensions: - none ## Dependencies ### Adds - none ### Removes - none
Message to comment on stale issues. If none provided, will not mark issues stale |
Agreement
The feature
A separate
bud
command (or from itstheme.json
extension) that re-generates thetheme.json
(or no-op if the
theme.json
generation bybud
is not enabled).E.g. something like
bud build theme.json
orbud build-themejson
maybe?Or is there already a sub-command or other flag/option that can be used to only build the
theme.json
?Use case
The
wp i18n
CLI tool can (and should) also scan thetheme.json
for source translation strings(as of colors, font-sizes, template parts, etc.).
When the
translate:pot
script of Sage theme is invoked, thetheme.json
should first be re-build(if generation is enabled, otherwise just no-op), for the
theme.json
to be scanned being up-to-date.A full rebuild otherwise can be too time consuming and also distracting,
as only the
theme.json
is (currently) relevant for scanning of translation source strings.Notes
Related issue (Sage theme): roots/sage#3076 (comment)
The text was updated successfully, but these errors were encountered: