[WIP] Implementation of issue #6's proposal #7
Conversation
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 README.md file for the usage of the packages with the latest changes. I would expect to see the guide on how to use the package as cli and also if changes for the development process are made, those should be updated/added to the documentation.
@@ -1,22 +0,0 @@ | |||
const path = require('path'); |
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.
pls keep in mind that this file is used in the build-theme
and build-theme:watch
scripts. These scripts should be updated accordingly.
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.
Indeed ma'am, will do!
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.
@iwwwi I've refactored the code a little bit so that if we do:
node_modules/.bin/travix-ui-kit -c ./myDestForCss -j ./myDestForJs -t ./myThemeYamlFile.yml -w
it will detect changes on the yaml file and re-bundles the themes.scss
which then re-triggers the bundling of the ui-bundle.*
files.
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.
Now I am changing the package.json
to basically use the builder :)
Working on the tests, bear with me on this one :D |
Almost...there. |
Options: | ||
|
||
-h, --help output usage information | ||
-V, --version output the version number |
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.
Why is V
capital?
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.
It comes from commander
: tj/commander.js#560
Nevertheless it is also more common to do -v
to add verbosity on node CLI tools. Still, it is possible to provide an override of the help I think.
9e5eae8
to
77e69bb
Compare
77e69bb
to
9177675
Compare
Refactors code to have a CLI (registering the binary in the package.json) and watcher embedded Moves the saving of the theme file to the getStyles.js, renaming it to 'getStylesAndSaveTheme.js' Updates the jest.config.json to be compliant with the latest Jest's config format Updates the package.json to use the builder for building and watching purposes Updates the README.md with the usage of the CLI Updates the development section Adds comments to the code and fixes the 'usage name' of a module Changes the jest config to include non-covered scripts Adds tests for the builder/* files and creates a new module to specifically handle the generation of the theme file Improves the linting and jest's config to work properly Adds wallaby.js (a config file for wallabyjs.com's tool) Adds the files with a '100%' coverage on statements Updates the package.json to run the babel command in parallel with the build:*/build process Fixes the missing commands
7e49bf2
to
8270be8
Compare
💖 |
What does this PR do:
Changes the way
travix-ui-kit
works. Currently in order to build the UI bundles we need to access thenode_modules/travix-ui-kit/
and run thewebpack
command in it in order to generate the bundles.Also the theming capability was dependent on if an ENV var was set (
THEME_PATH
)So, according to #6 's proposal, I created this PR to implement to concept of a builder which can also be imported via
require('travix-ui-kit/builder');
So, usage of the CLI:
When not provided, the theme file falls back to the
_default.yaml
.Honestly I think the watcher is a goodie for this project's development only. Don't see a case where you want a watcher to the UI Kit in an external project.
Where should the reviewer start:
npm link
, then try to use it on an existing or new code (by doingnpm link travix-ui-kit
on the folder you want to use this project on).Unit and/or functional tests:
Still working on them (hence the WIP on the title)