Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
7299b3a9c6 | |||
cfd257d359 | |||
203ea05f67 | |||
f00a11bf9b | |||
7b0f2ab8d6 | |||
3ef9388979 | |||
1d35da50cd | |||
f5b86154db | |||
7474d208e4 |
22
.gitignore
vendored
22
.gitignore
vendored
@ -1,6 +1,22 @@
|
|||||||
node_modules/
|
.nogit/
|
||||||
|
|
||||||
|
# artifacts
|
||||||
coverage/
|
coverage/
|
||||||
public/
|
public/
|
||||||
pages/
|
pages/
|
||||||
test/testresult/
|
|
||||||
.nogit/
|
# installs
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.yarn/
|
||||||
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_web/
|
||||||
|
dist_serve/
|
||||||
|
dist_ts_web/
|
||||||
|
|
||||||
|
# custom
|
@ -1,5 +1,5 @@
|
|||||||
# gitzone standard
|
# gitzone ci_default
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
@ -26,6 +26,7 @@ mirror:
|
|||||||
snyk:
|
snyk:
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
- npmci command npm install -g snyk
|
- npmci command npm install -g snyk
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --ignore-scripts
|
||||||
- npmci command snyk test
|
- npmci command snyk test
|
||||||
@ -36,38 +37,29 @@ snyk:
|
|||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
testLEGACY:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci node install legacy
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
testLTS:
|
testStable:
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci node install lts
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
testSTABLE:
|
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci npm test
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
|
testBuild:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci node install stable
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command npm run build
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
release:
|
release:
|
||||||
@ -86,19 +78,11 @@ release:
|
|||||||
# ====================
|
# ====================
|
||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
image: docker:stable
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
services:
|
|
||||||
- docker:stable-dind
|
|
||||||
script:
|
script:
|
||||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
- npmci command npm install -g tslint typescript
|
||||||
- docker run
|
- npmci npm install
|
||||||
--env SOURCE_CODE="$PWD"
|
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||||
--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:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- priv
|
- priv
|
||||||
@ -114,12 +98,15 @@ trigger:
|
|||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: hosttoday/ht-docker-dbase:npmci
|
||||||
|
services:
|
||||||
|
- docker:stable-dind
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g typedoc typescript
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
@ -130,13 +117,3 @@ pages:
|
|||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
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
|
|
||||||
|
43
README.md
43
README.md
@ -1,32 +1,23 @@
|
|||||||
# smarthbs
|
# @pushrocks/smarthbs
|
||||||
|
|
||||||
handlebars with better fs support
|
handlebars with better fs support
|
||||||
|
|
||||||
## Availabililty
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smarthbs)
|
||||||
[](https://www.npmjs.com/package/smarthbs)
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smarthbs)
|
||||||
[](https://GitLab.com/pushrocks/smarthbs)
|
* [github.com (source mirror)](https://github.com/pushrocks/smarthbs)
|
||||||
[](https://github.com/pushrocks/smarthbs)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smarthbs/)
|
||||||
[](https://pushrocks.gitlab.io/smarthbs/)
|
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
|
[](https://gitlab.com/pushrocks/smarthbs/commits/master)
|
||||||
[](https://GitLab.com/pushrocks/smarthbs/commits/master)
|
[](https://gitlab.com/pushrocks/smarthbs/commits/master)
|
||||||
[](https://GitLab.com/pushrocks/smarthbs/commits/master)
|
[](https://www.npmjs.com/package/@pushrocks/smarthbs)
|
||||||
[](https://www.npmjs.com/package/smarthbs)
|
[](https://snyk.io/test/npm/@pushrocks/smarthbs)
|
||||||
[](https://david-dm.org/pushrocks/smarthbs)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://www.bithound.io/github/pushrocks/smarthbs/master/dependencies/npm)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://www.bithound.io/github/pushrocks/smarthbs)
|
[](https://prettier.io/)
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](http://standardjs.com/)
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Use TypeScript for best in class instellisense.
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
|
||||||
|
|
||||||
> Note: Why did we decide against a class based architecture?
|
> Note: Why did we decide against a class based architecture?
|
||||||
> Easy: handlebars.js is already pretty determined how things are handled internally, namely a global partial template registry
|
> Easy: handlebars.js is already pretty determined how things are handled internally, namely a global partial template registry
|
||||||
> It doesn't make sense to then introduce a scoped partial template approach.
|
> It doesn't make sense to then introduce a scoped partial template approach.
|
||||||
@ -41,7 +32,9 @@ smarthbs.registerPartialDir(testPartialDir);
|
|||||||
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json');
|
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json');
|
||||||
```
|
```
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
For further information read the linked docs at the top of this readme.
|
||||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
|
[](https://maintainedby.lossless.com)
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
# smarthbs
|
|
||||||
|
|
||||||
handlebars with better fs support
|
|
||||||
|
|
||||||
## Availabililty
|
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/smarthbs)
|
|
||||||
[](https://GitLab.com/pushrocks/smarthbs)
|
|
||||||
[](https://github.com/pushrocks/smarthbs)
|
|
||||||
[](https://pushrocks.gitlab.io/smarthbs/)
|
|
||||||
|
|
||||||
## Status for master
|
|
||||||
|
|
||||||
[](https://GitLab.com/pushrocks/smarthbs/commits/master)
|
|
||||||
[](https://GitLab.com/pushrocks/smarthbs/commits/master)
|
|
||||||
[](https://www.npmjs.com/package/smarthbs)
|
|
||||||
[](https://david-dm.org/pushrocks/smarthbs)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/smarthbs/master/dependencies/npm)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/smarthbs)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](http://standardjs.com/)
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Use TypeScript for best in class instellisense.
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
|
||||||
|
|
||||||
> Note: Why did we decide against a class based architecture?
|
|
||||||
> Easy: handlebars.js is already pretty determined how things are handled internally, namely a global partial template registry
|
|
||||||
> It doesn't make sense to then introduce a scoped partial template approach.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
import * as smarthbs from 'smarthbs';
|
|
||||||
|
|
||||||
// read all .hbs files in a directory and any child directories and use relative path as partial string identifier
|
|
||||||
smarthbs.registerPartialDir(testPartialDir);
|
|
||||||
|
|
||||||
// read all .hbs files in a particular directory and level, output them to a destination and specify a .json file to read any referenced data
|
|
||||||
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json');
|
|
||||||
```
|
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
||||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
@ -2,5 +2,15 @@
|
|||||||
"npmci": {
|
"npmci": {
|
||||||
"npmGlobalTools": [],
|
"npmGlobalTools": [],
|
||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"module": {
|
||||||
|
"githost": "gitlab.com",
|
||||||
|
"gitscope": "pushrocks",
|
||||||
|
"gitrepo": "smarthbs",
|
||||||
|
"shortDescription": "handlebars with better fs support",
|
||||||
|
"npmPackagename": "@pushrocks/smarthbs",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
800
package-lock.json
generated
800
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
35
package.json
35
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smarthbs",
|
"name": "@pushrocks/smarthbs",
|
||||||
"version": "2.0.2",
|
"version": "2.0.7",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "handlebars with better fs support",
|
"description": "handlebars with better fs support",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@ -23,17 +23,28 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pkunz/smarthbs#README",
|
"homepage": "https://gitlab.com/pkunz/smarthbs#README",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartfile": "^6.0.12",
|
"@pushrocks/smartfile": "^7.0.4",
|
||||||
"@pushrocks/smartpromise": "^2.0.5",
|
"@pushrocks/smartpromise": "^3.0.2",
|
||||||
"@types/lodash": "^4.14.121",
|
"handlebars": "^4.2.0",
|
||||||
"handlebars": "^4.1.0",
|
"lodash": "^4.17.11",
|
||||||
"lodash": "^4.17.11"
|
"lodash.uniq": "^4.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.8",
|
"@gitzone/tsbuild": "^2.1.17",
|
||||||
"@gitzone/tsrun": "^1.1.17",
|
"@gitzone/tsrun": "^1.2.8",
|
||||||
"@gitzone/tstest": "^1.0.18",
|
"@gitzone/tstest": "^1.0.24",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.0.13",
|
||||||
"@types/node": "^11.9.4"
|
"@types/node": "^12.7.4"
|
||||||
}
|
},
|
||||||
|
"files": [
|
||||||
|
"ts/*",
|
||||||
|
"ts_web/*",
|
||||||
|
"dist/*",
|
||||||
|
"dist_web/*",
|
||||||
|
"dist_ts_web/*",
|
||||||
|
"assets/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
1
test/testresult/index.html
Normal file
1
test/testresult/index.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<head></head>analyzed
|
1
test/testresult/index2.html
Normal file
1
test/testresult/index2.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
A second hbs file!
|
@ -1,7 +1,7 @@
|
|||||||
import * as handlebars from 'handlebars';
|
import * as handlebars from 'handlebars';
|
||||||
import * as lodash from 'lodash';
|
import lodashUniq from 'lodash.uniq';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as smartfile from '@pushrocks/smartfile';
|
import * as smartfile from '@pushrocks/smartfile';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
|
|
||||||
export { handlebars, lodash, path, smartfile, smartpromise };
|
export { handlebars, lodashUniq, path, smartfile, smartpromise };
|
||||||
|
@ -18,11 +18,11 @@ export let findVarsInHbsString = async (hbsStringArg: string) => {
|
|||||||
let tripleCurlyMatches = hbsString.match(tripleCurlyRegex);
|
let tripleCurlyMatches = hbsString.match(tripleCurlyRegex);
|
||||||
if (tripleCurlyMatches) {
|
if (tripleCurlyMatches) {
|
||||||
hbsString = hbsString.replace(tripleCurlyRegex, '[[[replaced]]]');
|
hbsString = hbsString.replace(tripleCurlyRegex, '[[[replaced]]]');
|
||||||
varNameArray = plugins.lodash.concat(varNameArray, tripleCurlyMatches);
|
varNameArray = varNameArray.concat(tripleCurlyMatches);
|
||||||
}
|
}
|
||||||
let doubleCurlyMatches = hbsString.match(doubleCurlyRegex);
|
let doubleCurlyMatches = hbsString.match(doubleCurlyRegex);
|
||||||
if (doubleCurlyMatches) {
|
if (doubleCurlyMatches) {
|
||||||
varNameArray = plugins.lodash.concat(varNameArray, doubleCurlyMatches);
|
varNameArray = varNameArray.concat(doubleCurlyMatches);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure we are clean from curly brackets
|
// make sure we are clean from curly brackets
|
||||||
@ -31,7 +31,7 @@ export let findVarsInHbsString = async (hbsStringArg: string) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// make sure are uniq
|
// make sure are uniq
|
||||||
varNameArray = plugins.lodash.uniq(varNameArray);
|
varNameArray = plugins.lodashUniq(varNameArray);
|
||||||
return varNameArray;
|
return varNameArray;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
16
tslint.json
16
tslint.json
@ -1,3 +1,17 @@
|
|||||||
{
|
{
|
||||||
"extends": "tslint-config-standard"
|
"extends": ["tslint:latest", "tslint-config-prettier"],
|
||||||
|
"rules": {
|
||||||
|
"semicolon": [true, "always"],
|
||||||
|
"no-console": false,
|
||||||
|
"ordered-imports": false,
|
||||||
|
"object-literal-sort-keys": false,
|
||||||
|
"member-ordering": {
|
||||||
|
"options":{
|
||||||
|
"order": [
|
||||||
|
"static-method"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultSeverity": "warning"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user