Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1 from rocjs/feature/initial
Browse files Browse the repository at this point in the history
Initial
  • Loading branch information
andreasrs committed Apr 1, 2016
2 parents 320c811 + 0307066 commit 7ee2061
Show file tree
Hide file tree
Showing 15 changed files with 207 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs.
# Requires EditorConfig JetBrains Plugin - http://github.com/editorconfig/editorconfig-jetbrains

# Set this file as the topmost .editorconfig
# (multiple files can be used, and are applied starting from current document location)
root = true

[{package.json}]
indent_style = space
indent_size = 2

# Use bracketed regexp to target specific file types or file locations
[*.{js,json}]

# Use hard or soft tabs ["tab", "space"]
indent_style = space

# Size of a single indent [an integer, "tab"]
indent_size = tab

# Number of columns representing a tab character [an integer]
tab_width = 4

# Line breaks representation ["lf", "cr", "crlf"]
end_of_line = lf

# ["latin1", "utf-8", "utf-16be", "utf-16le"]
charset = utf-8

# Remove any whitespace characters preceding newline characters ["true", "false"]
trim_trailing_whitespace = true

# Ensure file ends with a newline when saving ["true", "false"]
insert_final_newline = true
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
*.log
.DS_Store
lib
esdocs
coverage
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sudo: required
language: node_js
node_js:
- 4.2
- stable
before_script:
- npm run link
after_success:
- npm run build
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# roc-plugin-style-sass
# roc-plugin-style-sass
[![Build Status](https://travis-ci.org/rocjs/roc-plugin-style-sass.svg?branch=master)](https://travis-ci.org/rocjs/roc-plugin-style-sass)

__Plugin providing Sass support for Webpack__
- [roc-plugin-style-sass](/packages/roc-plugin-style-sass)
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "roc-plugin-style-sass",
"private": true,
"license": "MIT",
"scripts": {
"rid": "rid",
"build": "rid build",
"lint": "rid lint:alias",
"link": "rid link",
"test": "npm run lint"
},
"devDependencies": {
"@rocjs/roc-internal-dev": "^1.0.0"
}
}
3 changes: 3 additions & 0 deletions packages/roc-plugin-style-sass/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lib
esdocs
docs
13 changes: 13 additions & 0 deletions packages/roc-plugin-style-sass/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "vgno",

"parser": "babel-eslint",

"env": {
"es6": true
},

"ecmaFeatures": {
"modules": true
}
}
8 changes: 8 additions & 0 deletions packages/roc-plugin-style-sass/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# roc-plugin-style-sass
Plugin providing Sass support for Webpack.

## Documentation
- [Actions](/packages/roc-plugin-style-sass/docs/Actions.md)
- [Commands](/packages/roc-plugin-style-sass/docs/Commands.md)
- [Hooks](/packages/roc-plugin-style-sass/docs/Hooks.md)
- [Settings](/packages/roc-plugin-style-sass/docs/Settings.md)
14 changes: 14 additions & 0 deletions packages/roc-plugin-style-sass/docs/Actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Actions for `roc-plugin-style-sass`

## Actions
* [roc-plugin-style-sass](#roc-plugin-style-sass)
* [sass](#sass)

## roc-plugin-style-sass

### sass

Adds Sass support to Webpack.

__Connects to extension:__ `roc-plugin-style-css`
__Connects to hook:__ `add-style`
1 change: 1 addition & 0 deletions packages/roc-plugin-style-sass/docs/Commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No commands available.
1 change: 1 addition & 0 deletions packages/roc-plugin-style-sass/docs/Hooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
No hooks available.
9 changes: 9 additions & 0 deletions packages/roc-plugin-style-sass/docs/Settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Settings for `roc-plugin-style-sass`

## Build

### Sass

| Name | Description | Path | CLI option | Default | Type | Required |
| ---------- | -------------------------------------------------------------------------------------------------- | --------------------- | ----------------------- | ------- | --------- | -------- |
| useBourbon | If Bourbon should be made available to include easily with `@import "bourbon";`. | build.sass.useBourbon | --build-sass-useBourbon | `true` | `Boolean` | No |
37 changes: 37 additions & 0 deletions packages/roc-plugin-style-sass/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "roc-plugin-style-sass",
"version": "1.0.0-alpha.0",
"description": "Plugin providing Sass support for Webpack in Roc",
"main": "lib/index.js",
"scripts": {
"lint": "eslint .",
"test": "npm run lint"
},
"files": [
"lib"
],
"keywords": [
"roc",
"roc-package",
"webpack",
"roc-dev"
],
"repository": {
"type": "git",
"url": "https://github.com/rocjs/roc-plugin-style-sass.git"
},
"author": "VG",
"license": "MIT",
"dependencies": {
"bourbon": "~4.2.6",
"node-sass": "~3.4.2",
"roc": "^1.0.0-rc",
"sass-loader": "~3.1.2",
"webpack": "~1.12.14"
},
"devDependencies": {
"babel-eslint": "~5.0.0",
"eslint": "~1.10.3",
"eslint-config-vgno": "~5.0.0"
}
}
6 changes: 6 additions & 0 deletions packages/roc-plugin-style-sass/roc.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const path = require('path');

// Makes it possible for use to generate documentation for this package.
module.exports = {
packages: [path.join(__dirname, 'lib', 'index.js')]
};
46 changes: 46 additions & 0 deletions packages/roc-plugin-style-sass/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { isBoolean } from 'roc/validators';

export const roc = {
name: require('../package.json').name,
config: {
settings: {
build: {
sass: {
useBourbon: true
}
}
}
},
meta: {
settings: {
descriptions: {
build: {
sass: {
useBourbon: 'If Bourbon should be made available to include easily with `@import "bourbon";`.'
}
}
},

validations: {
build: {
sass: {
useBourbon: isBoolean
}
}
}
}
},
actions: {
sass: {
extension: 'roc-plugin-style-css',
hook: 'add-style',
description: 'Adds Sass support to Webpack.',
action: () => ({ settings }) => () => () => ({
extensions: ['sass', 'scss'],
loaders: `${require.resolve('sass-loader')}?sourceMap${settings.build.sass.useBourbon ?
'&includePaths[]=' + require('bourbon').includePaths : ''
}`
})
}
}
};

0 comments on commit 7ee2061

Please sign in to comment.