front-end-assistant

1.3.3 • Public • Published

front-end-assistant

front-end-assistant is a gulp assistant for those are working on sass, rtlcss, TFS .

By one task you can do the following on .scss file

  • sass to css.
  • css to rtlcss.
  • checkout file for TFS.

Features

  • Reduce the number of gulp tasks and Easy to use.
  • Deal with postcss and autoprefix.
  • Error handling, will display error on console and file its self.
  • Configuration file for disable rtlcss or TFS.

Installation

Use the package manager to install front-end-assistant.

npm install front-end-assistant

Usage

const utility = import(front - end - assistant);

var config = {
  target: "front-end-assistant/Content/SASS/",
  destnation: "front-end-assistant/Content/CSS/",
};

// for multiple files []
gulp.task("sass-all", function () {
  return utility.sass(config, ["**/**.scss"]);
});

// for single file
gulp.task("sass-single", function () {
  return utility.sass(config, "root.scss");
});

// for watching and update effected file only
gulp.task("watch-All", function () {
  return gulp.watch([config.target + "**/**.scss"]).on("change", function (file) {
    var fileName = utility.getFileName(file);
    var pathTarget = file.replace(fileName, "").replace(/\\/g, "/");
    var destTarget = pathTarget.replace("SASS", "CSS");
    return utility.sass(destTarget, pathTarget, fileName);
  });
});

Output

├───project
│    └───SASS
│    │     ├───Layout.scss
│    │     ├───Modules.scss
│    │     └───Templates.scss

/*auto generated by front-end-assistant*/

│    └───CSS
│		 ├───Layout.css
│		 ├───Modules.css
│		 └───Templates.css
│
│    └───CSS-RTL
│		 ├───Layout.css
│		 ├───Modules.css
│		 └───Templates.css

Configuration

Configuration can be set using one of the following method

  • Use a special file ui.config.json.
{
  "options": {
    "rtl": true,
    "tfs": true,
    "rtl_path": "-RTL/" /*relative path to original 'config.destnation' path of css file */
  }
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Author

Eskandar Hassan

License

MIT

Package Sidebar

Install

npm i front-end-assistant

Weekly Downloads

1

Version

1.3.3

License

MIT

Unpacked Size

16.7 kB

Total Files

11

Last publish

Collaborators

  • exxizor
  • engmrms