Compare commits

..

No commits in common. "master" and "v1.0.4" have entirely different histories.

19 changed files with 1435 additions and 2956 deletions

20
.gitignore vendored
View File

@ -1,22 +1,4 @@
.nogit/
# artifacts
coverage/ coverage/
node_modules/
public/ public/
pages/ pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@ -1,118 +1,68 @@
# gitzone ci_default # gitzone standard
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-node:npmci
cache: cache:
paths: paths:
- .npmci_cache/ - .yarn/
key: "$CI_BUILD_STAGE" key: "$CI_BUILD_STAGE"
stages: stages:
- security
- test - test
- release - release
- metadata - trigger
- pages
# ==================== testLEGACY:
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
- notpriv
snyk:
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
# ====================
# test stage
# ====================
testStable:
stage: test stage: test
script: script:
- npmci npm prepare - npmci test legacy
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- priv allow_failure: true
testBuild: testLTS:
stage: test stage: test
script: script:
- npmci npm prepare - npmci test lts
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
testSTABLE:
stage: test
script:
- npmci test stable
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release: release:
stage: release stage: release
script: script:
- npmci node install stable - npmci publish
- npmci npm publish
only: only:
- tags - tags
tags:
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags: tags:
- docker - docker
- notpriv
trigger:
stage: trigger
script:
- npmci trigger
only:
- tags
tags:
- docker
pages:
image: hosttoday/ht-docker-node:npmpage
stage: pages
script:
- npmci command npmpage --publish gitlab
only: only:
- tags - tags
artifacts: artifacts:
expire_in: 1 week expire_in: 1 week
paths: paths:
- public - public
allow_failure: true

View File

@ -1,50 +1,29 @@
# @pushrocks/smartsass # smartsass
smart wrapper for sass smart wrapper for sass
## Availabililty and Links ## Availabililty
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartsass) [![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartsass)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartsass) [![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartsass)
* [github.com (source mirror)](https://github.com/pushrocks/smartsass) [![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartsass)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartsass/) [![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartsass/)
## Status for master ## Status for master
[![build status](https://gitlab.com/pushrocks/smartsass/badges/master/build.svg)](https://gitlab.com/pushrocks/smartsass/commits/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) [![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/@pushrocks/smartsass.svg)](https://www.npmjs.com/package/@pushrocks/smartsass) [![npm downloads per month](https://img.shields.io/npm/dm/smartsass.svg)](https://www.npmjs.com/package/smartsass)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartsass/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartsass) [![Dependency Status](https://david-dm.org/pushrocks/smartsass.svg)](https://david-dm.org/pushrocks/smartsass)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) [![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartsass/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartsass/master/dependencies/npm)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) [![bitHound Code](https://www.bithound.io/github/pushrocks/smartsass/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartsass)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/) [![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage ## Usage
Use TypeScript for best in class instellisense. Use TypeScript for best in class instellisense.
```javascript
import * as smartsass from 'smartsass'
import * as bourbon from 'bourbon
import * as neat from 'neat'
let mySmartsass = new smartsass.Smartsass({
filePath: './some.css',
includePaths: bourbon.includePaths
})
mySmartsass.addIncludePaths(neat.includePaths)
let renderedString = mySmartsass.render()
```
For further information read the linked docs at the top of this README. For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) > 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) [![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
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)
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)

18
dist/index.d.ts vendored Normal file
View File

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

50
dist/index.js vendored Normal file
View File

@ -0,0 +1,50 @@
"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);
}
}
}
/**
* 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsK0NBQThDO0FBVTlDO0lBR0UsWUFBWSxVQUF3QztRQUZwRCxpQkFBWSxHQUFHLEVBQUUsQ0FBQTtRQUdmLElBQUksQ0FBQyxhQUFhLEdBQUcsVUFBVSxDQUFDLGFBQWEsQ0FBQTtRQUM3QyxFQUFFLENBQUEsQ0FBQyxVQUFVLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQztZQUMzQixHQUFHLENBQUMsQ0FBQyxJQUFJLFdBQVcsSUFBSSxVQUFVLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQztnQkFDaEQsSUFBSSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFDLENBQUE7WUFDckMsQ0FBQztRQUNILENBQUM7SUFDSCxDQUFDO0lBRUQ7O09BRUc7SUFDSCxNQUFNO1FBQ0osSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxLQUFLLEVBQXVCLENBQUE7UUFDdEQsT0FBTyxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUM7WUFDbEIsSUFBSSxFQUFFLElBQUksQ0FBQyxhQUFhO1lBQ3hCLFlBQVksRUFBRSxJQUFJLENBQUMsWUFBWTtTQUNoQyxFQUFFLFVBQVUsR0FBRyxFQUFFLE1BQU07WUFDdEIsRUFBRSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztnQkFDUixPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxDQUFBO2dCQUNoQixJQUFJLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFBO1lBQ2xCLENBQUM7WUFDRCxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFBO1FBQ3RCLENBQUMsQ0FBQyxDQUFBO1FBQ0YsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUE7SUFDckIsQ0FBQztJQUVEOztPQUVHO0lBQ0csY0FBYyxDQUFFLGNBQXNCOztZQUMxQyxJQUFJLE1BQU0sR0FBRyxNQUFNLElBQUksQ0FBQyxNQUFNLEVBQUUsQ0FBQTtZQUNoQyxNQUFNLE9BQU8sQ0FBQyxTQUFTLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLFFBQVEsRUFBRSxFQUFFLGNBQWMsQ0FBQyxDQUFBO1FBQzVFLENBQUM7S0FBQTtDQUNGO0FBckNELDhCQXFDQyJ9

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==

5
dist/smartsass.plugins.d.ts vendored Normal file
View File

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

10
dist/smartsass.plugins.js vendored Normal file
View File

@ -0,0 +1,10 @@
"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,19 +1,7 @@
{ {
"npmci": { "npmci": {
"npmGlobalTools": [], "globalNpmTools": [
"npmAccessLevel": "public" "npmts"
}, ]
"gitzone": {
"module": {
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartsass",
"shortDescription": "smart wrapper for sass",
"npmPackagename": "@push.rocks/smartsass",
"license": "MIT"
}
},
"tsdocs": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
} }
} }

2697
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,11 @@
{ {
"name": "@push.rocks/smartsass", "name": "smartsass",
"version": "2.0.6", "version": "1.0.4",
"private": false,
"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",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(npmts)"
"build": "(tsbuild)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -25,29 +23,10 @@
}, },
"homepage": "https://gitlab.com/pushrocks/smartsass#README", "homepage": "https://gitlab.com/pushrocks/smartsass#README",
"dependencies": { "dependencies": {
"@pushrocks/smartfile": "^7.0.6", "@types/node-sass": "^3.10.32",
"@pushrocks/smartpromise": "^3.0.6", "node-sass": "^4.5.0",
"@types/node-sass": "^4.11.0", "smartfile": "^4.1.7",
"node-sass": "^4.13.0" "smartq": "^1.1.1",
}, "typings-global": "^1.0.14"
"devDependencies": { }
"@gitzone/tsbuild": "^2.1.17",
"@gitzone/tsrun": "^1.2.8",
"@gitzone/tstest": "^1.0.28",
"@pushrocks/tapbundle": "^3.2.0",
"@types/node": "^13.1.6",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0"
},
"files": [
"ts/**/*",
"ts_web/**/*",
"dist/**/*",
"dist_web/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"cli.js",
"npmextra.json",
"readme.md"
]
} }

View File

@ -1,12 +0,0 @@
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,64 +1,48 @@
import * as plugins from './smartsass.plugins'; import * as plugins from './smartsass.plugins'
// interfaces // interfaces
import { Result } from 'node-sass'; import { Result } from 'node-sass'
export interface ISmartsassConstructorOptions { export interface ISmartsassConstructorOptions {
data?: string; entryFilePath: string,
entryFilePath?: string; includePaths?: string[]
includePaths?: string[];
} }
export class Smartsass { export class Smartsass {
includePaths = []; includePaths = []
entryFilePath: string; entryFilePath: string
data: string;
constructor(optionsArg: ISmartsassConstructorOptions) { constructor(optionsArg: ISmartsassConstructorOptions) {
this.entryFilePath = optionsArg.entryFilePath; this.entryFilePath = optionsArg.entryFilePath
this.data = optionsArg.data; if(optionsArg.includePaths) {
if (optionsArg.includePaths) {
for (let includePath of optionsArg.includePaths) { for (let includePath of optionsArg.includePaths) {
this.includePaths.push(includePath); this.includePaths.push(includePath)
} }
} }
} }
/**
* add further include paths
*/
addIncludePaths(includePathsArray: string[]) {
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
*/ */
render() { render() {
let done = plugins.smartpromise.defer<plugins.sass.Result>(); let done = plugins.smartq.defer<plugins.sass.Result>()
plugins.sass.render( plugins.sass.render({
{ file: this.entryFilePath,
data: this.data, includePaths: this.includePaths
file: this.entryFilePath, }, function (err, result) {
includePaths: this.includePaths if (err) {
}, console.log(err)
function(err, result) { done.reject(err)
if (err) {
console.log(err);
done.reject(err);
}
done.resolve(result);
} }
); done.resolve(result)
return done.promise; })
return done.promise
} }
/** /**
* renders and stores * renders and stores
*/ */
async renderAndStore(outputFilePath: string) { async renderAndStore (outputFilePath: string) {
let result = await this.render(); let result = await this.render()
await plugins.smartfile.memory.toFs(result.css.toString(), outputFilePath); 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,5 +1,10 @@
import * as sass from 'node-sass'; import 'typings-global'
import * as smartfile from '@pushrocks/smartfile'; import * as sass from 'node-sass'
import * as smartpromise from '@pushrocks/smartpromise'; import * as smartfile from 'smartfile'
import * as smartq from 'smartq'
export { sass, smartfile, smartpromise }; export {
sass,
smartfile,
smartq
}

View File

@ -1,14 +0,0 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}

3
tslint.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "tslint-config-standard"
}

1246
yarn.lock Normal file

File diff suppressed because it is too large Load Diff