-
Notifications
You must be signed in to change notification settings - Fork 362
Conversation
The dirent class was added in Node 10, so might have to change that logic slightly to support older versions. |
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.
- Please update the PR description to include a description of the problem you're solving and summary of what the plugin is doing.
- Can we rename the plugin to slate-sections-plugin? Will allow us to add more functionality to the sections build in the future.
- You're doing a lot of file reading and writing here -- lets make sure we use async methods for concurrent operations.
- Include another level of nesting to make sure we're crawling through all nested layers?
packages/slate-locales-plugin/__tests__/compiler-tests.js
->packages/slate-locales-plugin/__tests__/index.test.js
- You could simplify the contents your fixtures, especially the Liquid. They should the minimum amount of code to pass your tests -- having them filled with extra stuff will make them harder to maintain
From @davidwarrington:
|
This is definitely something that can be done, however it is probably worth discussing whether we want to do it in this current PR or as a feature moving forward. |
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
Co-Authored-By: harshal317 <hbbrahmb@edu.uwaterloo.ca>
We haven't discussed that yet, however if it would be helpful to do so, I don't see why not. Could probably consider doing that through the CopyWebpackPlugin's transform as well. |
I believe we discussed having a deeper folder structure, and decided that it could be added as a feature moving forward. |
It's definitely helpful, and it reflects how we're already approaching merchant-facing translations (this is how locales are currently formatted in our themes for both the |
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.
🎩'd and works oh so smoothly :) good job
Didn't think this would be in so quick. Can't wait for |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What are you trying to accomplish with this PR?
In order to support a sections format that allows separating the schema from the liquid, and allowing a structure that makes it easy to maintain translations for many languages, @t-kelly and I came to a conclusion it may be a good idea to move away from CopyWebpackPlugin. Especially keeping in mind the potential for additional features to this plugin.
This plugin aims to support three basic structures
Having a sections folder consisting of simply liquid files, which will simply be copied to the dist sections path
Having a sections folder consisting of folders for each section following the naming convention /sections/example-section-name/ having a mandatory 'template.liquid' file, and an optional 'schema.json' file. If there is a schema file in the directory it will get appended to the liquid file adding the schema tags, and will be outputted to the dist sections path taking the name of the directory (example-section-name.liquid)
Similiar to option 2, however it extends the functionality by adding a locales folder which can have multiple json files for each language. The translations will automatically be added to the json object that gets appended to the liquid making it easier to maintain multiple languages and keeping a cleaner codebase
To Do
Checklist
For contributors:
For maintainers: