Skip to content
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

Build theme without changing directories #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bdimaggio
Copy link
Contributor

@bdimaggio bdimaggio commented Mar 5, 2020

Just wrote this to save me having to jump back and forth between the git root and the theme dir all the time. I'm a very novice shell scripter--feedback very welcome.

@bdimaggio bdimaggio requested a review from wxactly March 5, 2020 21:34
Copy link
Member

@wxactly wxactly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bdimaggio - I wish I could've saved you some trouble ahead of time! Here's a one-liner for your drupal site's theme dir that makes no assumptions about where it's located (drush 9):

drush dd $(drush st --field=theme)

@wxactly
Copy link
Member

wxactly commented Mar 5, 2020

Actually take this just one step further, this seems to work for me... does this work for you?

npm run start --prefix=$(drush dd $(drush st --field=theme))

@bdimaggio
Copy link
Contributor Author

ohhh this is brilliant ⭐️ I'm just gonna make aliases for this and its npm run build equivalent, at least for myself. Do you think it's worth adding those to this repo or would it be more helpful to just paste them into #tech-talk and/or #front-end? I don't really know whether we've established a standard for how things get into this repo.

@wxactly
Copy link
Member

wxactly commented Mar 9, 2020

I think it's fine for this to live in this repo. The more I think about this though, the more it makes me feel like maybe we should consider adding something like this to https://github.com/thinkshout/robo-drupal

Like what if we could do robo theme start or robo theme build and what it did behind the scenes was...

cd $(drush dd $(drush st --field=theme))
npm run $ARG

@wxactly
Copy link
Member

wxactly commented Mar 9, 2020

We could even have a special keyword for install (robo theme install) that did npm install instead.... still brainstorming ;)

@amydecat
Copy link

amydecat commented Mar 9, 2020

@bdimaggio and @wxactly - adding a script for this sounds like a valuable addition to ts_grid, and a PR would work just fine. That way others can test it out first before we add it in officially.

I usually end up with two terminal screens and keep the watcher running on one of them to see live updates. Since I haven't tried playing around with these solutions yet, I'm not sure how my flow might differ from the one(s) being proposed. Any insights here? The idea of getting to build the theme from the same directory we do work sounds like a great benefit. Let me know if I can be assistance!

@bdimaggio
Copy link
Contributor Author

bdimaggio commented Mar 9, 2020 via email

unclegcb added a commit to United-Philanthropy-Forum/km-starter-kit that referenced this pull request Mar 25, 2021
Enforcing this lets us do dynamic theme compilation per thinkshout/ts_recipes#14
Note that this is waiting on pantheon-systems/example-drops-8-composer#334 and km_collaborative to switch to that release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants