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
Parse Single File? #4
Comments
i got you: https://github.com/AlleyFord/schematic?tab=readme-ov-file#running-on-a-single-section-file beware, zero testing outside of making sure it can resolve paths =) HMU with any probs you encounter and i'll be happy to get fixes worked in |
Amazing. On CLI, currently it only works on the liquid file, correct? Seems a little backwards, ideally you'd save the .js file since that is what would change the schema inside the liquid file. Can the command be updated to pass in the schema.js file and where to look for section files (and have a sane default)? Similar to the Currently my watch command for schematic watches my Also I'm having to use |
that's a really good point: you'd watch the schema dir for changes and want the shopify files updated. interestingly, the way it works now is it starts with the shopify files then works backwards to resolve schema files, then applies that schema to the shopify files. i think i can work something up. what may be a gotcha though is it'll be difficult to then apply any updated schema that would affect multiple files back into those files. for example, you change some icon definitions that are pulled into would have to work out some more complicated way to scan & then update anything where there would be changes to schema. i think i'll build in the ability to pass a schema file path, and then leave dependency resolution up to the user. but a single execution of |
|
Awesome re: running on the .js file. I think it's the "right" way to do it. However, if it's too much of a pain because of dependencies and the gotcha mentioned: maybe just an option to suppress the "found no change" type messages? So it would still run on the whole folder but would only show messages if it actually had changes. My (admittedly quite unique) use case for this I have a parent theme Currently, the theme dev has the choice to either cd into Theoretically i could just have a note that says "run the watch task inside base" but not as slick lol. Not a huge deal, but maybe being able to specify the theme folder in the npx command or something 🤔 |
pushed a new minor ver which supports passing in a single file which can be liquid or schema ( the theme setup you're talking about is actually super interesting to me. i've been thinking about a solve for the same use case: you develop 1 theme to rule them all, then shopify instances you spin up use the base theme as a package, and can have localized override files. think a main theme which includes some default icons, then each instance of it can have its own appended icons. if you add a new whizbang feature to the base theme, all themes that use it can get it automatically by using i'm doing this manually right now for two sites. i think once i get the underlying theme in a more developed spot, i may try to create something usable and publish it. for your use case currently, wouldn't hurt to create your own way of invoking schematic outside of |
I think you're right, I'm just gonna use Yeah that's exactly what I've set up. It's a heavily modified Dawn with Tailwind supporting the font sizing, colors, etc. I set up Schematic to use the tailwind |
Testing out the new runSection I get this error:
instance/src/schema/sections/custom-section.js:
instance/sections/custom-section.liquid:
argv.path: Not sure if I'm doing something wrong, lemme know if you need more info. If i run the normal |
can whip up a local test prob later today. my gut thinks it's maybe an issue with where the script is being executed. it wants to be executed in the shopify theme root, even if would be a child theme. if you're up for it, i'm happy to clone your repo and noodle until i can get a solution for ya |
I don't think so, it no longer fails |
Hi again! Love this package.
I'm using it in a watch type task but obviously it runs through all of the files regardless of changes / re-parses them etc.
I was wondering if there's an existing way (or possible to add as a feature) to only parse a single file? I'm using https://github.com/open-cli-tools/chokidar-cli and it allows passing the path. This would mostly just be to clean up the excess terminal output messages that show up when running my
node schematic.js
command.Thanks!
The text was updated successfully, but these errors were encountered: