-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Is it possible to run scripts defined in a theme in an app? #13915
Comments
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing! Thanks for being a part of the Gatsby community! 💪💜 |
Not stale! I still don't think this is quite clear. |
I don't personally know of any way to call scripts defined in npm packages as if they were scripts defined in the root package.json. I think if you declared them as |
As @ChristopherBiscardi described you'll need to do something along the lines of https://blog.npmjs.org/post/118810260230/building-a-simple-command-line-tool-with-npm. Create a custom cli and add it to We're marking this issue as answered and closing it for now but please feel free to reopen this and comment if you would like to continue this discussion. We hope we managed to help and thank you for using Gatsby! 💜 |
Summary
I tried making a typescript theme: https://github.com/maecapozzi/gatsby-theme-typescript
I was exploring whether I could run some of the scripts I've written in the theme in another Gatsby app. Is this possible and I'm just missing something, or is it not possible?
Relevant information
I thought that it may be possible to write scripts in my theme, and have them be executable from an application's environment.
So if I wrote a script called
typecheck
ingatsby-theme-typescript
, and I includedgatsby-theme-typescript
inproject-a
, I though I'd be able to runyarn run typescript
fromproject-a
.Environment (if relevant)
System:
OS: macOS 10.14.4
CPU: x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.9.0 - ~/.nvm/versions/node/v10.9.0/bin/node
Yarn: 1.9.4 - ~/.nvm/versions/node/v10.9.0/bin/yarn
npm: 6.2.0 - ~/.nvm/versions/node/v10.9.0/bin/npm
Browsers:
Chrome: 74.0.3729.131
Firefox: 66.0.3
Safari: 12.1
npmGlobalPackages:
gatsby-cli: 2.4.2
File contents (if changed)
gatsby-config.js
:package.json
:gatsby-node.js
: N/Agatsby-browser.js
: N/Agatsby-ssr.js
: N/AThe text was updated successfully, but these errors were encountered: