BREAKING CHANGE(scope): update scope to @pushrocks

This commit is contained in:
Philipp Kunz 2018-09-20 00:47:15 +02:00
parent 42573648b9
commit 581bae156e
16 changed files with 2134 additions and 1407 deletions

View File

@ -3,69 +3,140 @@ image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
- .npmci_cache/
key: "$CI_BUILD_STAGE"
stages:
- security
- test
- release
- trigger
- pages
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
- notpriv
snyk:
stage: security
script:
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
# ====================
# test stage
# ====================
testLEGACY:
stage: test
script:
- npmci test legacy
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
allow_failure: true
testLTS:
stage: test
script:
- npmci test lts
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci test stable
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- docker
- notpriv
release:
stage: release
script:
- npmci publish
- npmci node install stable
- npmci npm publish
only:
- tags
- tags
tags:
- docker
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags:
- docker
- priv
trigger:
stage: trigger
stage: metadata
script:
- npmci trigger
- npmci trigger
only:
- tags
- tags
tags:
- docker
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
stage: metadata
script:
- npmci commadn yarn global add npmpage
- npmci command npmpage --publish gitlab
- npmci command npm install -g typedoc typescript
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags:
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true
windowsCompatibility:
image: stefanscherer/node-windows:10-build-tools
stage: metadata
script:
- npm install & npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- windows
allow_failure: true

View File

@ -1,13 +1,16 @@
# smartsass
smart wrapper for sass
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartsass)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartsass)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartsass)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartsass/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartsass/badges/master/build.svg)](https://GitLab.com/pushrocks/smartsass/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartsass/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartsass/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartsass.svg)](https://www.npmjs.com/package/smartsass)
@ -19,6 +22,7 @@ smart wrapper for sass
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for best in class instellisense.
```javascript
@ -39,6 +43,6 @@ let renderedString = mySmartsass.render()
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

22
dist/index.d.ts vendored
View File

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

58
dist/index.js vendored
View File

@ -1,58 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./smartsass.plugins");
class Smartsass {
constructor(optionsArg) {
this.includePaths = [];
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
*/
render() {
let done = plugins.smartq.defer();
plugins.sass.render({
file: this.entryFilePath,
includePaths: this.includePaths
}, function (err, result) {
if (err) {
console.log(err);
done.reject(err);
}
done.resolve(result);
});
return done.promise;
}
/**
* renders and stores
*/
renderAndStore(outputFilePath) {
return __awaiter(this, void 0, void 0, function* () {
let result = yield this.render();
yield plugins.smartfile.memory.toFs(result.css.toString(), outputFilePath);
});
}
}
exports.Smartsass = Smartsass;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoi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0FBQyxDQUFDLENBQUM7Z0JBQ1IsT0FBTyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQTtnQkFDaEIsSUFBSSxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQTtZQUNsQixDQUFDO1lBQ0QsSUFBSSxDQUFDLE9BQU8sQ0FBQyxNQUFNLENBQUMsQ0FBQTtRQUN0QixDQUFDLENBQUMsQ0FBQTtRQUNGLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFBO0lBQ3JCLENBQUM7SUFFRDs7T0FFRztJQUNHLGNBQWMsQ0FBRSxjQUFzQjs7WUFDMUMsSUFBSSxNQUFNLEdBQUcsTUFBTSxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUE7WUFDaEMsTUFBTSxPQUFPLENBQUMsU0FBUyxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxRQUFRLEVBQUUsRUFBRSxjQUFjLENBQUMsQ0FBQTtRQUM1RSxDQUFDO0tBQUE7Q0FDRjtBQTlDRCw4QkE4Q0MifQ==

View File

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

View File

@ -1,5 +0,0 @@
import 'typings-global';
import * as sass from 'node-sass';
import * as smartfile from 'smartfile';
import * as smartq from 'smartq';
export { sass, smartfile, smartq };

View File

@ -1,10 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("typings-global");
const sass = require("node-sass");
exports.sass = sass;
const smartfile = require("smartfile");
exports.smartfile = smartfile;
const smartq = require("smartq");
exports.smartq = smartq;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzYXNzLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHNhc3MucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2QixrQ0FBaUM7QUFLL0Isb0JBQUk7QUFKTix1Q0FBc0M7QUFLcEMsOEJBQVM7QUFKWCxpQ0FBZ0M7QUFLOUIsd0JBQU0ifQ==

View File

@ -1,7 +1,6 @@
{
"npmci": {
"globalNpmTools": [
"npmts"
]
"npmGlobalTools": [],
"npmAccessLevel": "public"
}
}

1978
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,13 @@
{
"name": "smartsass",
"name": "@pushrocks/smartsass",
"version": "1.0.5",
"private": false,
"description": "smart wrapper for sass",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts)"
"test": "(tstest test/)",
"build": "(tsbuild)"
},
"repository": {
"type": "git",
@ -23,10 +25,16 @@
},
"homepage": "https://gitlab.com/pushrocks/smartsass#README",
"dependencies": {
"@pushrocks/smartfile": "^6.0.8",
"@pushrocks/smartpromise": "^2.0.5",
"@types/node-sass": "^3.10.32",
"node-sass": "^4.5.0",
"smartfile": "^4.1.7",
"smartq": "^1.1.1",
"typings-global": "^1.0.14"
"node-sass": "^4.9.3"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tsrun": "^1.1.12",
"@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.10.1"
}
}

12
test/test.ts Normal file
View File

@ -0,0 +1,12 @@
import { tap, expect } from '@pushrocks/tapbundle';
import * as smartsass from '../ts/index';
tap.test('should create a valid instance of smartsass', async () => {
const testsmartSass = new smartsass.Smartsass({
data: 'hello'
})
expect(testsmartSass).to.be.instanceof(smartsass.Smartsass);
});
tap.start();

View File

@ -1,21 +1,22 @@
import * as plugins from './smartsass.plugins'
import * as plugins from './smartsass.plugins';
// interfaces
import { Result } from 'node-sass'
import { Result } from 'node-sass';
export interface ISmartsassConstructorOptions {
entryFilePath: string,
includePaths?: string[]
data?: string;
entryFilePath?: string;
includePaths?: string[];
}
export class Smartsass {
includePaths = []
entryFilePath: string
includePaths = [];
entryFilePath: string;
constructor(optionsArg: ISmartsassConstructorOptions) {
this.entryFilePath = optionsArg.entryFilePath
this.entryFilePath = optionsArg.entryFilePath;
if (optionsArg.includePaths) {
for (let includePath of optionsArg.includePaths) {
this.includePaths.push(includePath)
this.includePaths.push(includePath);
}
}
}
@ -23,9 +24,9 @@ export class Smartsass {
/**
* add further include paths
*/
addIncludePaths (includePathsArray: string[]) {
addIncludePaths(includePathsArray: string[]) {
for (let includePath of includePathsArray) {
this.includePaths.push(includePath)
this.includePaths.push(includePath);
}
}
@ -33,25 +34,28 @@ export class Smartsass {
* renders the Smartsass classes' entryfile and returns result as string
*/
render() {
let done = plugins.smartq.defer<plugins.sass.Result>()
plugins.sass.render({
file: this.entryFilePath,
includePaths: this.includePaths
}, function (err, result) {
if (err) {
console.log(err)
done.reject(err)
let done = plugins.smartpromise.defer<plugins.sass.Result>();
plugins.sass.render(
{
file: this.entryFilePath,
includePaths: this.includePaths
},
function(err, result) {
if (err) {
console.log(err);
done.reject(err);
}
done.resolve(result);
}
done.resolve(result)
})
return done.promise
);
return done.promise;
}
/**
* renders and stores
*/
async renderAndStore (outputFilePath: string) {
let result = await this.render()
await plugins.smartfile.memory.toFs(result.css.toString(), outputFilePath)
async renderAndStore(outputFilePath: string) {
let result = await this.render();
await plugins.smartfile.memory.toFs(result.css.toString(), outputFilePath);
}
}

View File

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

View File

@ -1,10 +1,5 @@
import 'typings-global'
import * as sass from 'node-sass'
import * as smartfile from 'smartfile'
import * as smartq from 'smartq'
import * as sass from 'node-sass';
import * as smartfile from '@pushrocks/smartfile';
import * as smartpromise from '@pushrocks/smartpromise';
export {
sass,
smartfile,
smartq
}
export { sass, smartfile, smartpromise };

1246
yarn.lock

File diff suppressed because it is too large Load Diff