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/
|
||||
public/
|
||||
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
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
# gitzone ci_default
|
||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||
|
||||
cache:
|
||||
paths:
|
||||
@ -26,6 +26,7 @@ mirror:
|
||||
snyk:
|
||||
stage: security
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci command npm install -g snyk
|
||||
- npmci command npm install --ignore-scripts
|
||||
- npmci command snyk test
|
||||
@ -36,38 +37,29 @@ snyk:
|
||||
# ====================
|
||||
# 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:
|
||||
stage: test
|
||||
script:
|
||||
- npmci node install lts
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
|
||||
testSTABLE:
|
||||
testStable:
|
||||
stage: test
|
||||
script:
|
||||
- npmci npm prepare
|
||||
- npmci node install stable
|
||||
- npmci npm install
|
||||
- npmci npm test
|
||||
coverage: /\d+.?\d+?\%\s*coverage/
|
||||
tags:
|
||||
- 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
|
||||
|
||||
release:
|
||||
@ -86,19 +78,11 @@ release:
|
||||
# ====================
|
||||
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]
|
||||
- npmci command npm install -g tslint typescript
|
||||
- npmci npm install
|
||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||
tags:
|
||||
- docker
|
||||
- priv
|
||||
@ -114,12 +98,15 @@ trigger:
|
||||
- notpriv
|
||||
|
||||
pages:
|
||||
image: hosttoday/ht-docker-node:npmci
|
||||
image: hosttoday/ht-docker-dbase:npmci
|
||||
services:
|
||||
- docker:stable-dind
|
||||
stage: metadata
|
||||
script:
|
||||
- npmci command npm install -g typedoc typescript
|
||||
- npmci command npm install -g @gitzone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
@ -130,13 +117,3 @@ pages:
|
||||
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
|
||||
|
43
README.md
43
README.md
@ -1,32 +1,23 @@
|
||||
# smarthbs
|
||||
|
||||
# @pushrocks/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/)
|
||||
## Availabililty and Links
|
||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smarthbs)
|
||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/smarthbs)
|
||||
* [github.com (source mirror)](https://github.com/pushrocks/smarthbs)
|
||||
* [docs (typedoc)](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/)
|
||||
[](https://gitlab.com/pushrocks/smarthbs/commits/master)
|
||||
[](https://gitlab.com/pushrocks/smarthbs/commits/master)
|
||||
[](https://www.npmjs.com/package/@pushrocks/smarthbs)
|
||||
[](https://snyk.io/test/npm/@pushrocks/smarthbs)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
||||
## 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.
|
||||
@ -41,7 +32,9 @@ smarthbs.registerPartialDir(testPartialDir);
|
||||
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)
|
||||
For further information read the linked docs at the top of this readme.
|
||||
|
||||
[](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": {
|
||||
"npmGlobalTools": [],
|
||||
"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",
|
||||
"version": "2.0.2",
|
||||
"version": "2.0.7",
|
||||
"private": false,
|
||||
"description": "handlebars with better fs support",
|
||||
"main": "dist/index.js",
|
||||
@ -23,17 +23,28 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pkunz/smarthbs#README",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartfile": "^6.0.12",
|
||||
"@pushrocks/smartpromise": "^2.0.5",
|
||||
"@types/lodash": "^4.14.121",
|
||||
"handlebars": "^4.1.0",
|
||||
"lodash": "^4.17.11"
|
||||
"@pushrocks/smartfile": "^7.0.4",
|
||||
"@pushrocks/smartpromise": "^3.0.2",
|
||||
"handlebars": "^4.2.0",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash.uniq": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.8",
|
||||
"@gitzone/tsrun": "^1.1.17",
|
||||
"@gitzone/tstest": "^1.0.18",
|
||||
"@pushrocks/tapbundle": "^3.0.7",
|
||||
"@types/node": "^11.9.4"
|
||||
}
|
||||
"@gitzone/tsbuild": "^2.1.17",
|
||||
"@gitzone/tsrun": "^1.2.8",
|
||||
"@gitzone/tstest": "^1.0.24",
|
||||
"@pushrocks/tapbundle": "^3.0.13",
|
||||
"@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 lodash from 'lodash';
|
||||
import lodashUniq from 'lodash.uniq';
|
||||
import * as path from 'path';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
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);
|
||||
if (tripleCurlyMatches) {
|
||||
hbsString = hbsString.replace(tripleCurlyRegex, '[[[replaced]]]');
|
||||
varNameArray = plugins.lodash.concat(varNameArray, tripleCurlyMatches);
|
||||
varNameArray = varNameArray.concat(tripleCurlyMatches);
|
||||
}
|
||||
let doubleCurlyMatches = hbsString.match(doubleCurlyRegex);
|
||||
if (doubleCurlyMatches) {
|
||||
varNameArray = plugins.lodash.concat(varNameArray, doubleCurlyMatches);
|
||||
varNameArray = varNameArray.concat(doubleCurlyMatches);
|
||||
}
|
||||
|
||||
// make sure we are clean from curly brackets
|
||||
@ -31,7 +31,7 @@ export let findVarsInHbsString = async (hbsStringArg: string) => {
|
||||
});
|
||||
|
||||
// make sure are uniq
|
||||
varNameArray = plugins.lodash.uniq(varNameArray);
|
||||
varNameArray = plugins.lodashUniq(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