Commit 7ef4ea47 authored by Philipp Nowinski's avatar Philipp Nowinski

[FEATURE] update readme

parent e27abe34
[![sgalinski Internet Services](http://www.sgalinski.de/_Resources/Static/Packages/SGalinski.SgalinskiDe/Images/logo.png "sgalinski Internet Services")](http://www.sgalinski.de/)
[![sgalinski Internet Services](https://www.sgalinski.de/fileadmin/files/for-external-usage/logo.svg "sgalinski")](https://www.sgalinski.de/typo3-produkte-webentwicklung/gulp-frontend-toolchain/)
# sgalinski command line interface
> **Please note:**
> The sgc currently only supports Linux and OSX operating systems. The CLI is intended to be used with bash or zsh.
> The CLI is intended to be used with bash or zsh. In order for scss-lint to work, you need to have ruby installed on your machine.
## Installation
......@@ -21,6 +21,18 @@ If you don't want to install the sgc command globally (e.g. in a server environm
./sgc-core/install.sh --local
```
### Windows
If you want to install the SGC on a Windows machine, there are some additional preparations are required:
* All commands are to be executed in **git-bash** window, do not try to use the cmd! You'll probably already have the git-bash
installed if you are using git for Windows.
* Install NVM for Windows: https://github.com/coreybutler/nvm-windows
* You might run into an error where the SGC is not able to install the scss_lint ruby gem. This is due to an SSL error
with rubygems that occurs on Windows. In this case, you will have to install scss_lint manually. Read more about that
error here: https://gist.github.com/luislavena/f064211759ee0f806c88
* You have to open git-bash with administrator privileges to run the installation script
## Configuration
To configure the frontend build process to your needs, you will have to modify the .sgc-config.json that the installer
......@@ -32,7 +44,10 @@ will put into your projects root-directory.
### directories
Holds the paths to the css, sass, javascript, images, sprites and inline-svgs, relative to the extensions root.
Holds the paths to the css, sass, javascript, images, sprites, sourcemaps and inline-svgs, relative to the extensions root.
* webPath: *path to your extension folder as seen from the web*
* basePath: *path to your extension folder as seen from the filesystem*
### abovethefold
......@@ -43,7 +58,11 @@ Configuration for the critical path css.
### js
* libraryPaths: *additional locations that should be searched when resolving CommonJS requires*
The SGC will support you with writing next generation JavaScript and executing it in Browsers today, by transpiling it
to EcmaScript 5 compliant code. Currently EcmaScript 6 Syntax and TypeScript are supported.
* compiler: *es6|typescript*
* libraryPaths: *additional locations that should be searched when resolving CommonJS require statements*
* excludeFromQa: *glob patterns with locations that hold JavaScript that does not need to be linted (vendor stuff)
### images
......@@ -54,9 +73,17 @@ Configuration for the critical path css.
A list of extensions that should be included in the watch task. Please note, that the very first extension in this list is expected to be your project_theme.
### browsersync
BrowserSync is a neat tool that will help you during the development and testing process. When you run `sgc`, it will spin
up a small webserver that proxies the URL specified in your .sgc-config.json. If you change a JavaScript or Sass file
inside an extension that is on your watch list (see the option above), BrowserSync will automatically reload the page
or inject your changes directly into the browser. You can also open several instances of the BrowserSync URL in different
browser windows and BS will take care of synchronizing all input and scroll events between them.
## Usage
You can run a specific task on a specific component, or start a watcher that will fire up BrowserSync and run tasks when
source files change. Extensions that will be watched are defined in [config.json](gulp/config.json).
source files change. Extensions that will be watched are defined in your .sgc-config.json file for each project.
If you run a specific task, you need to specify the extension you want the task to run on with the --ext parameter.
......@@ -76,10 +103,10 @@ the website in your browser, as a browsersync session (changed js and css will a
*Hint:* If you already have a browsersync instance open in your browser, you can pass the argument -s to restart the session without opening a browser.
### sprite task
### sprite task (will be called by the css task automatically)
```bash
sgc css:sprites --ext [extensions name]
sgc css:sprites --ext [extension name]
```
Triggers sprite generation inside the given directory.
......@@ -104,6 +131,37 @@ You can then use the following mixins:
The @sprite mixin already contains width and height. If you need these values for something else, use the @sprite-width
and @sprite-height functions.
### css:svg task (will be called by the css task automatically)
```bash
sgc css:svg --ext [extension name]
```
Triggers the generation of Sass-mixins for all SVGs inside the given directory. Each mixin will enable the usage of the
associated SVG as a css background image.
```scss
@import 'svg'; // imports the file with the generated mixins (inside your Sass-root)
.icon-globe {
@include inline-svg($icon-globe); // inserts the file icon-globe.svg as an inlined background-image
}
```
### css:abovethefold (will be called by the css task automatically)
```bash
svg css:abovethefold
```
This task will read the html file you specified as abovethefold.template, read every <link> statement in it and replace
it with the css styles the referenced file contains, as an inline style tag. To make use of this feature, you should
create a separate css file in your project (abovethefold.scss -> abovethefold.css), as well as an html-template file
that references this stylesheet (note that the path needs to be relative to the template file). You can then set this
template file as your [PageRenderTemplate](https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#pagerenderertemplatefile).
All styles inside your abovethefold.css file will now be inlined directly into the HTML of your website. Note that you
should think about what to put in this file only styles that should be available directly after the render process on
_every_ page should go there.
### css task
```bash
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment