7 Commits

Author SHA1 Message Date
cc91855a48 1.0.5 2017-03-12 10:59:26 +01:00
ef4ee3ee0b add inlude paths later on 2017-03-12 10:59:21 +01:00
975f27d241 update 2017-03-12 00:56:31 +01:00
33cb6ac697 1.0.4 2017-03-12 00:55:47 +01:00
df11f7fe64 add includePaths 2017-03-12 00:55:34 +01:00
42faa6a389 1.0.3 2017-03-05 20:03:25 +01:00
733a67b597 add npmextra.json 2017-03-05 20:03:21 +01:00
9 changed files with 63 additions and 6 deletions

View File

@ -1,5 +1,10 @@
# gitzone standard # gitzone standard
image: hosttoday/ht-docker-node:npmts image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
key: "$CI_BUILD_STAGE"
stages: stages:
- test - test
@ -11,6 +16,7 @@ testLEGACY:
stage: test stage: test
script: script:
- npmci test legacy - npmci test legacy
coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
allow_failure: true allow_failure: true
@ -19,6 +25,7 @@ testLTS:
stage: test stage: test
script: script:
- npmci test lts - npmci test lts
coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
@ -26,6 +33,7 @@ testSTABLE:
stage: test stage: test
script: script:
- npmci test stable - npmci test stable
coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker

6
dist/index.d.ts vendored
View File

@ -1,10 +1,16 @@
import { Result } from 'node-sass'; import { Result } from 'node-sass';
export interface ISmartsassConstructorOptions { export interface ISmartsassConstructorOptions {
entryFilePath: string; entryFilePath: string;
includePaths?: string[];
} }
export declare class Smartsass { export declare class Smartsass {
includePaths: any[];
entryFilePath: string; entryFilePath: string;
constructor(optionsArg: ISmartsassConstructorOptions); constructor(optionsArg: ISmartsassConstructorOptions);
/**
* add further include paths
*/
addIncludePaths(includePathsArray: string[]): void;
/** /**
* renders the Smartsass classes' entryfile and returns result as string * renders the Smartsass classes' entryfile and returns result as string
*/ */

19
dist/index.js vendored
View File

@ -11,7 +11,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./smartsass.plugins"); const plugins = require("./smartsass.plugins");
class Smartsass { class Smartsass {
constructor(optionsArg) { constructor(optionsArg) {
this.includePaths = [];
this.entryFilePath = optionsArg.entryFilePath; this.entryFilePath = optionsArg.entryFilePath;
if (optionsArg.includePaths) {
for (let includePath of optionsArg.includePaths) {
this.includePaths.push(includePath);
}
}
}
/**
* add further include paths
*/
addIncludePaths(includePathsArray) {
for (let includePath of includePathsArray) {
this.includePaths.push(includePath);
}
} }
/** /**
* renders the Smartsass classes' entryfile and returns result as string * renders the Smartsass classes' entryfile and returns result as string
@ -19,7 +33,8 @@ class Smartsass {
render() { render() {
let done = plugins.smartq.defer(); let done = plugins.smartq.defer();
plugins.sass.render({ plugins.sass.render({
file: this.entryFilePath file: this.entryFilePath,
includePaths: this.includePaths
}, function (err, result) { }, function (err, result) {
if (err) { if (err) {
console.log(err); console.log(err);
@ -40,4 +55,4 @@ class Smartsass {
} }
} }
exports.Smartsass = Smartsass; exports.Smartsass = Smartsass;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsK0NBQThDO0FBUzlDO0lBRUUsWUFBWSxVQUF3QztRQUNsRCxJQUFJLENBQUMsYUFBYSxHQUFHLFVBQVUsQ0FBQyxhQUFhLENBQUE7SUFDL0MsQ0FBQztJQUVEOztPQUVHO0lBQ0gsTUFBTTtRQUNKLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxNQUFNLENBQUMsS0FBSyxFQUF1QixDQUFBO1FBQ3RELE9BQU8sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDO1lBQ2xCLElBQUksRUFBRSxJQUFJLENBQUMsYUFBYTtTQUN6QixFQUFFLFVBQVUsR0FBRyxFQUFFLE1BQU07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SxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUE7WUFDaEMsTUFBTSxPQUFPLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxRQUFRLEVBQUUsRUFBRSxjQUFjLENBQUMsQ0FBQTtRQUM1RSxDQUFDO0tBQUE7Q0FDRjtBQTlDRCw4QkE4Q0MifQ==

0
dist/smartsass.includes.d.ts vendored Normal file
View File

3
dist/smartsass.includes.js vendored Normal file
View File

@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzYXNzLmluY2x1ZGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzYXNzLmluY2x1ZGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==

7
npmextra.json Normal file
View File

@ -0,0 +1,7 @@
{
"npmci": {
"globalNpmTools": [
"npmts"
]
}
}

View File

@ -1,6 +1,6 @@
{ {
"name": "smartsass", "name": "smartsass",
"version": "1.0.2", "version": "1.0.5",
"description": "smart wrapper for sass", "description": "smart wrapper for sass",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",

View File

@ -4,13 +4,29 @@ import * as plugins from './smartsass.plugins'
import { Result } from 'node-sass' import { Result } from 'node-sass'
export interface ISmartsassConstructorOptions { export interface ISmartsassConstructorOptions {
entryFilePath: string entryFilePath: string,
includePaths?: string[]
} }
export class Smartsass { export class Smartsass {
includePaths = []
entryFilePath: string entryFilePath: string
constructor(optionsArg: ISmartsassConstructorOptions) { constructor(optionsArg: ISmartsassConstructorOptions) {
this.entryFilePath = optionsArg.entryFilePath this.entryFilePath = optionsArg.entryFilePath
if (optionsArg.includePaths) {
for (let includePath of optionsArg.includePaths) {
this.includePaths.push(includePath)
}
}
}
/**
* add further include paths
*/
addIncludePaths (includePathsArray: string[]) {
for (let includePath of includePathsArray) {
this.includePaths.push(includePath)
}
} }
/** /**
@ -19,7 +35,8 @@ export class Smartsass {
render() { render() {
let done = plugins.smartq.defer<plugins.sass.Result>() let done = plugins.smartq.defer<plugins.sass.Result>()
plugins.sass.render({ plugins.sass.render({
file: this.entryFilePath file: this.entryFilePath,
includePaths: this.includePaths
}, function (err, result) { }, function (err, result) {
if (err) { if (err) {
console.log(err) console.log(err)

1
ts/smartsass.includes.ts Normal file
View File

@ -0,0 +1 @@
import * as plugins from './smartsass.plugins'