Compare commits
57 Commits
Author | SHA1 | Date | |
---|---|---|---|
7ab6922eed | |||
31bf5f7486 | |||
78d4df7082 | |||
74d2d980a5 | |||
49aa80aca8 | |||
b382256cc7 | |||
97400fa501 | |||
914a8eafce | |||
7299b3a9c6 | |||
cfd257d359 | |||
203ea05f67 | |||
f00a11bf9b | |||
7b0f2ab8d6 | |||
3ef9388979 | |||
1d35da50cd | |||
f5b86154db | |||
7474d208e4 | |||
74f4026c74 | |||
3808e4168f | |||
084bee68af | |||
9f6b67fa4e | |||
b749997aad | |||
9ac0a94f59 | |||
e2a93e1f47 | |||
02aaa042f3 | |||
0b14cca8cc | |||
f917820545 | |||
2246f101ba | |||
32d642bb70 | |||
dc50251538 | |||
93adff5c6d | |||
f3f7d1d5fe | |||
3da6842c4d | |||
6be8643e3f | |||
3845777ba4 | |||
75f3aff2c2 | |||
1fbf624c12 | |||
e1d9098eaa | |||
059111e071 | |||
903fc86c9f | |||
2d5bcc8a22 | |||
32941d5949 | |||
cacb7eff6c | |||
0382c410e9 | |||
2b50191093 | |||
4967bd6a60 | |||
69ff80cc2b | |||
fef292d81f | |||
34cfe010f7 | |||
9297711793 | |||
7c0e22ff02 | |||
8041ccdada | |||
4eebed4847 | |||
7478a3739f | |||
edd407ed21 | |||
c1333aab00 | |||
a1068832f0 |
19
.gitignore
vendored
19
.gitignore
vendored
@ -1,5 +1,20 @@
|
|||||||
node_modules/
|
.nogit/
|
||||||
|
|
||||||
|
# artifacts
|
||||||
coverage/
|
coverage/
|
||||||
public/
|
public/
|
||||||
pages/
|
pages/
|
||||||
.nogit/
|
|
||||||
|
# installs
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.yarn/
|
||||||
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_*/
|
||||||
|
|
||||||
|
# custom
|
128
.gitlab-ci.yml
Normal file
128
.gitlab-ci.yml
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
# gitzone ci_default
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- .npmci_cache/
|
||||||
|
key: '$CI_BUILD_STAGE'
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- security
|
||||||
|
- test
|
||||||
|
- release
|
||||||
|
- metadata
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- npm install -g @shipzone/npmci
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# security stage
|
||||||
|
# ====================
|
||||||
|
auditProductionDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install --production --ignore-scripts
|
||||||
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
auditDevDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install --ignore-scripts
|
||||||
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=dev
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# test stage
|
||||||
|
# ====================
|
||||||
|
|
||||||
|
testStable:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci node install stable
|
||||||
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
script:
|
||||||
|
- npmci node install stable
|
||||||
|
- npmci npm publish
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
# ====================
|
||||||
|
# metadata stage
|
||||||
|
# ====================
|
||||||
|
codequality:
|
||||||
|
stage: metadata
|
||||||
|
allow_failure: true
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
script:
|
||||||
|
- npmci command npm install -g typescript
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci npm install
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
stage: metadata
|
||||||
|
script:
|
||||||
|
- npmci trigger
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
|
pages:
|
||||||
|
stage: metadata
|
||||||
|
script:
|
||||||
|
- npmci node install stable
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci npm install
|
||||||
|
- npmci command npm run buildDocs
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- docker
|
||||||
|
- notpriv
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- public
|
||||||
|
allow_failure: true
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"command": "npm test",
|
||||||
|
"name": "Run npm test",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "node-terminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": ["/npmextra.json"],
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"npmci": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for npmci"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for gitzone",
|
||||||
|
"properties": {
|
||||||
|
"projectType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
38
README.md
38
README.md
@ -1,38 +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.
|
|
||||||
|
|
||||||
> 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')
|
|
||||||
```
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
15
dist/index.d.ts
vendored
15
dist/index.d.ts
vendored
@ -1,15 +0,0 @@
|
|||||||
/// <reference types="handlebars" />
|
|
||||||
import 'typings-global';
|
|
||||||
export declare type TTemplateStringType = 'filePath' | 'code';
|
|
||||||
/**
|
|
||||||
* registers a directory of partials to make them available within handlebars compilation
|
|
||||||
*/
|
|
||||||
export declare let registerPartialDir: (dirPathArg: string) => void;
|
|
||||||
/**
|
|
||||||
* compiles a directory and outputs it
|
|
||||||
*/
|
|
||||||
export declare let compileDirectory: (originDirPathArg: string, destinationDirPathArg: string, dataFileNameArg: string) => Promise<void>;
|
|
||||||
/**
|
|
||||||
* get a template for a file on disk
|
|
||||||
*/
|
|
||||||
export declare let getTemplateForFile: (filePathArg: string) => Promise<HandlebarsTemplateDelegate>;
|
|
52
dist/index.js
vendored
52
dist/index.js
vendored
@ -1,52 +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());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
require("typings-global");
|
|
||||||
const handlebars = require("handlebars");
|
|
||||||
const smartfile = require("smartfile");
|
|
||||||
const path = require("path");
|
|
||||||
/**
|
|
||||||
* registers a directory of partials to make them available within handlebars compilation
|
|
||||||
*/
|
|
||||||
exports.registerPartialDir = (dirPathArg) => {
|
|
||||||
smartfile.fs.listFileTree(dirPathArg, '**/*.hbs').then(hbsFileArrayArg => {
|
|
||||||
for (let hbsFilePath of hbsFileArrayArg) {
|
|
||||||
let parsedPath = path.parse(hbsFilePath);
|
|
||||||
let hbsFileString = smartfile.fs.toStringSync(path.join(dirPathArg, hbsFilePath));
|
|
||||||
if (parsedPath.dir === '') {
|
|
||||||
parsedPath.name = '/' + parsedPath.name;
|
|
||||||
}
|
|
||||||
let partialName = `partials${parsedPath.dir}${parsedPath.name}`;
|
|
||||||
handlebars.registerPartial(partialName, hbsFileString);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* compiles a directory and outputs it
|
|
||||||
*/
|
|
||||||
exports.compileDirectory = (originDirPathArg, destinationDirPathArg, dataFileNameArg) => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let hbsFilePathArray = smartfile.fs.listFilesSync(originDirPathArg, /.hbs/);
|
|
||||||
let data = smartfile.fs.toObjectSync(path.join(originDirPathArg, dataFileNameArg));
|
|
||||||
for (let hbsFilePath of hbsFilePathArray) {
|
|
||||||
let parsedPath = path.parse(hbsFilePath);
|
|
||||||
let hbsFileString = smartfile.fs.toStringSync(path.join(originDirPathArg, hbsFilePath));
|
|
||||||
let template = handlebars.compile(hbsFileString);
|
|
||||||
let output = template(data);
|
|
||||||
console.log('hi ' + output + ' hi');
|
|
||||||
smartfile.memory.toFsSync(output, path.join(destinationDirPathArg, parsedPath.name + '.html'));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* get a template for a file on disk
|
|
||||||
*/
|
|
||||||
exports.getTemplateForFile = (filePathArg) => __awaiter(this, void 0, void 0, function* () {
|
|
||||||
let filePathAbsolute = path.resolve(filePathArg);
|
|
||||||
return handlebars.compile(smartfile.fs.toStringSync(filePathAbsolute));
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBQSwwQkFBdUI7QUFDdkIseUNBQXdDO0FBQ3hDLHVDQUFzQztBQUN0Qyw2QkFBNEI7QUFHNUI7O0dBRUc7QUFDUSxRQUFBLGtCQUFrQixHQUFHLENBQUMsVUFBa0I7SUFDL0MsU0FBUyxDQUFDLEVBQUUsQ0FBQyxZQUFZLENBQUMsVUFBVSxFQUFFLFVBQVUsQ0FBQyxDQUFDLElBQUksQ0FBQyxlQUFlO1FBQ2xFLEdBQUcsQ0FBQyxDQUFDLElBQUksV0FBVyxJQUFJLGVBQWUsQ0FBQyxDQUFDLENBQUM7WUFDdEMsSUFBSSxVQUFVLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxXQUFXLENBQUMsQ0FBQTtZQUN4QyxJQUFJLGFBQWEsR0FBRyxTQUFTLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFVBQVUsRUFBRSxXQUFXLENBQUMsQ0FBQyxDQUFBO1lBQ2pGLEVBQUUsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxHQUFHLEtBQUssRUFBRSxDQUFDLENBQUMsQ0FBQztnQkFDeEIsVUFBVSxDQUFDLElBQUksR0FBRyxHQUFHLEdBQUcsVUFBVSxDQUFDLElBQUksQ0FBQTtZQUMzQyxDQUFDO1lBQ0QsSUFBSSxXQUFXLEdBQUcsV0FBVyxVQUFVLENBQUMsR0FBRyxHQUFHLFVBQVUsQ0FBQyxJQUFJLEVBQUUsQ0FBQTtZQUMvRCxVQUFVLENBQUMsZUFBZSxDQUFDLFdBQVcsRUFBRSxhQUFhLENBQUMsQ0FBQTtRQUMxRCxDQUFDO0lBQ0wsQ0FBQyxDQUFDLENBQUE7QUFDTixDQUFDLENBQUE7QUFFRDs7R0FFRztBQUNRLFFBQUEsZ0JBQWdCLEdBQUcsQ0FDMUIsZ0JBQXdCLEVBQ3hCLHFCQUE2QixFQUM3QixlQUF1QjtJQUV2QixJQUFJLGdCQUFnQixHQUFHLFNBQVMsQ0FBQyxFQUFFLENBQUMsYUFBYSxDQUFDLGdCQUFnQixFQUFFLE1BQU0sQ0FBQyxDQUFBO0lBQzNFLElBQUksSUFBSSxHQUFHLFNBQVMsQ0FBQyxFQUFFLENBQUMsWUFBWSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsZ0JBQWdCLEVBQUUsZUFBZSxDQUFDLENBQUMsQ0FBQTtJQUNsRixHQUFHLENBQUEsQ0FBQyxJQUFJLFdBQVcsSUFBSSxnQkFBZ0IsQ0FBQyxDQUFDLENBQUM7UUFDdEMsSUFBSSxVQUFVLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FBQyxXQUFXLENBQUMsQ0FBQTtRQUN4QyxJQUFJLGFBQWEsR0FBRyxTQUFTLENBQUMsRUFBRSxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLGdCQUFnQixFQUFFLFdBQVcsQ0FBQyxDQUFDLENBQUE7UUFDdkYsSUFBSSxRQUFRLEdBQUcsVUFBVSxDQUFDLE9BQU8sQ0FBQyxhQUFhLENBQUMsQ0FBQTtRQUNoRCxJQUFJLE1BQU0sR0FBRyxRQUFRLENBQUMsSUFBSSxDQUFDLENBQUE7UUFDM0IsT0FBTyxDQUFDLEdBQUcsQ0FBQyxLQUFLLEdBQUcsTUFBTSxHQUFHLEtBQUssQ0FBQyxDQUFBO1FBQ25DLFNBQVMsQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLE1BQU0sRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLHFCQUFxQixFQUFFLFVBQVUsQ0FBQyxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0FBQTtJQUNsRyxDQUFDO0FBQ0wsQ0FBQyxDQUFBLENBQUE7QUFFRDs7R0FFRztBQUNRLFFBQUEsa0JBQWtCLEdBQUcsQ0FBTyxXQUFtQjtJQUN0RCxJQUFJLGdCQUFnQixHQUFHLElBQUksQ0FBQyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUE7SUFDaEQsTUFBTSxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLEVBQUUsQ0FBQyxZQUFZLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxDQUFBO0FBQzFFLENBQUMsQ0FBQSxDQUFBIn0=
|
|
17
npmextra.json
Normal file
17
npmextra.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"npmci": {
|
||||||
|
"npmGlobalTools": [],
|
||||||
|
"npmAccessLevel": "public"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"projectType": "npm",
|
||||||
|
"module": {
|
||||||
|
"githost": "gitlab.com",
|
||||||
|
"gitscope": "pushrocks",
|
||||||
|
"gitrepo": "smarthbs",
|
||||||
|
"description": "handlebars with better fs support",
|
||||||
|
"npmPackagename": "@pushrocks/smarthbs",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
47
package.json
47
package.json
@ -1,11 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "smarthbs",
|
"name": "@pushrocks/smarthbs",
|
||||||
"version": "1.0.3",
|
"version": "3.0.1",
|
||||||
|
"private": false,
|
||||||
"description": "handlebars with better fs support",
|
"description": "handlebars with better fs support",
|
||||||
"main": "dist/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npmts)"
|
"test": "(tstest test/)",
|
||||||
|
"build": "(tsbuild --allowimplicitany)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -21,13 +24,33 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pkunz/smarthbs#README",
|
"homepage": "https://gitlab.com/pkunz/smarthbs#README",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/handlebars": "^4.0.31",
|
"@pushrocks/smartfile": "^10.0.2",
|
||||||
"handlebars": "^4.0.6",
|
"@pushrocks/smartpath": "^5.0.5",
|
||||||
"smartfile": "^4.1.4",
|
"@pushrocks/smartpromise": "^3.1.7",
|
||||||
"smartq": "^1.0.4",
|
"@types/lodash.uniq": "^4.5.7",
|
||||||
"typings-global": "^1.0.14"
|
"handlebars": "^4.7.7",
|
||||||
|
"lodash.uniq": "^4.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"typings-test": "^1.0.3"
|
"@gitzone/tsbuild": "^2.1.63",
|
||||||
}
|
"@gitzone/tsrun": "^1.2.37",
|
||||||
|
"@gitzone/tstest": "^1.0.72",
|
||||||
|
"@pushrocks/tapbundle": "^5.0.4",
|
||||||
|
"@types/node": "^18.0.6"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"ts/**/*",
|
||||||
|
"ts_web/**/*",
|
||||||
|
"dist/**/*",
|
||||||
|
"dist_*/**/*",
|
||||||
|
"dist_ts/**/*",
|
||||||
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
4393
pnpm-lock.yaml
generated
Normal file
4393
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
52
readme.md
Normal file
52
readme.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# @pushrocks/smarthbs
|
||||||
|
handlebars with better fs support
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
Status Category | Status Badge
|
||||||
|
-- | --
|
||||||
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
|
npm | [](https://lossless.cloud)
|
||||||
|
Snyk | [](https://lossless.cloud)
|
||||||
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
Code Style | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
|
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
> 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');
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
[](https://maintainedby.lossless.com)
|
@ -1 +1,2 @@
|
|||||||
{{> partials/header}}
|
{{> partials/header}}
|
||||||
|
{{__analyze 'partials/header'}}
|
1
test/hbs_testfiles/index2.hbs
Normal file
1
test/hbs_testfiles/index2.hbs
Normal file
@ -0,0 +1 @@
|
|||||||
|
A second hbs file!
|
@ -0,0 +1 @@
|
|||||||
|
this is a footer
|
1
test/test.d.ts
vendored
1
test/test.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
import 'typings-test';
|
|
16
test/test.js
16
test/test.js
@ -1,16 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
require("typings-test");
|
|
||||||
const smarthbs = require("../dist/index");
|
|
||||||
const path = require("path");
|
|
||||||
let testHbsDir = path.join(__dirname, 'hbs_testfiles');
|
|
||||||
let testPartialDir = path.join(testHbsDir, 'partials');
|
|
||||||
let testResultDir = path.join(__dirname, 'testresult');
|
|
||||||
describe('smarthbs', function () {
|
|
||||||
it('should create partials', function () {
|
|
||||||
smarthbs.registerPartialDir(testPartialDir);
|
|
||||||
});
|
|
||||||
it('should compile a directory', function () {
|
|
||||||
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHdCQUFxQjtBQUNyQiwwQ0FBeUM7QUFDekMsNkJBQTRCO0FBRTVCLElBQUksVUFBVSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFLGVBQWUsQ0FBQyxDQUFBO0FBQ3RELElBQUksY0FBYyxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsVUFBVSxFQUFFLFVBQVUsQ0FBQyxDQUFBO0FBQ3RELElBQUksYUFBYSxHQUFHLElBQUksQ0FBRSxJQUFJLENBQUMsU0FBUyxFQUFFLFlBQVksQ0FBQyxDQUFBO0FBQ3ZELFFBQVEsQ0FBQyxVQUFVLEVBQUU7SUFFakIsRUFBRSxDQUFDLHdCQUF3QixFQUFFO1FBQ3pCLFFBQVEsQ0FBQyxrQkFBa0IsQ0FBQyxjQUFjLENBQUMsQ0FBQTtJQUMvQyxDQUFDLENBQUMsQ0FBQTtJQUVGLEVBQUUsQ0FBQyw0QkFBNEIsRUFBRTtRQUM3QixRQUFRLENBQUMsZ0JBQWdCLENBQUMsVUFBVSxFQUFFLGFBQWEsRUFBRSxXQUFXLENBQUMsQ0FBQTtJQUNyRSxDQUFDLENBQUMsQ0FBQTtBQUVOLENBQUMsQ0FBQyxDQUFBIn0=
|
|
58
test/test.ts
58
test/test.ts
@ -1,18 +1,46 @@
|
|||||||
import 'typings-test'
|
import { expect, tap } from '@pushrocks/tapbundle';
|
||||||
import * as smarthbs from '../dist/index'
|
import * as smarthbs from '../ts/index.js';
|
||||||
import * as path from 'path'
|
|
||||||
|
|
||||||
let testHbsDir = path.join(__dirname, 'hbs_testfiles')
|
import * as smartpath from '@pushrocks/smartpath';
|
||||||
let testPartialDir = path.join(testHbsDir, 'partials')
|
import * as path from 'path';
|
||||||
let testResultDir = path .join(__dirname, 'testresult')
|
|
||||||
describe('smarthbs', function() {
|
|
||||||
|
|
||||||
it('should create partials', function(){
|
|
||||||
smarthbs.registerPartialDir(testPartialDir)
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should compile a directory', function() {
|
const dirname = smartpath.get.dirnameFromImportMetaUrl(import.meta.url);
|
||||||
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json')
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
let hbs_testfilesDir = path.join(dirname, 'hbs_testfiles');
|
||||||
|
let testPartialDir = path.join(hbs_testfilesDir, 'partials');
|
||||||
|
let testResultDir = path.join(dirname, 'testresult');
|
||||||
|
|
||||||
|
tap.test('smarthbs -> should create partials', async () => {
|
||||||
|
await smarthbs.registerPartialDir(testPartialDir);
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('smarthbs -> should compile a directory', async () => {
|
||||||
|
smarthbs.compileDirectory(hbs_testfilesDir, testResultDir, 'data.json');
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('', async () => {
|
||||||
|
let templateString = '{{{firstVar}}} {{secondVar}}';
|
||||||
|
let templateVars = await smarthbs.findVarsInHbsString(templateString);
|
||||||
|
expect(templateVars).toContain('firstVar');
|
||||||
|
expect(templateVars).toContain('secondVar');
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.test('', async () => {
|
||||||
|
let templateString =
|
||||||
|
'{{{firstVar}}} {{secondVar}} {{thirdVar}} {{fourthVar}} {{fourthVar.someKey}} {{fourthVar.otherKey.nextKey}}';
|
||||||
|
let missingVars = await smarthbs.checkVarsSatisfaction(templateString, {
|
||||||
|
firstVar: 'hi',
|
||||||
|
secondVar: 'hello',
|
||||||
|
fourthVar: {
|
||||||
|
otherKey: {
|
||||||
|
nextKey: 'wow',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
expect(missingVars).toContain('thirdVar');
|
||||||
|
expect(missingVars).toContain('fourthVar.someKey');
|
||||||
|
expect(missingVars).not.toContain('secondVar');
|
||||||
|
expect(missingVars).not.toContain('fourthVar.otherKey.nextKey');
|
||||||
|
});
|
||||||
|
|
||||||
|
tap.start();
|
||||||
|
@ -1 +1 @@
|
|||||||
<head></head>
|
<head></head>analyzed
|
1
test/testresult/index2.html
Normal file
1
test/testresult/index2.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
A second hbs file!
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* autocreated commitinfo by @pushrocks/commitinfo
|
||||||
|
*/
|
||||||
|
export const commitinfo = {
|
||||||
|
name: '@pushrocks/smarthbs',
|
||||||
|
version: '3.0.1',
|
||||||
|
description: 'handlebars with better fs support'
|
||||||
|
}
|
58
ts/index.ts
58
ts/index.ts
@ -1,50 +1,10 @@
|
|||||||
import 'typings-global'
|
import * as plugins from './smarthbs.plugins.js';
|
||||||
import * as handlebars from 'handlebars'
|
export type TTemplateStringType = 'filePath' | 'code';
|
||||||
import * as smartfile from 'smartfile'
|
|
||||||
import * as path from 'path'
|
|
||||||
export type TTemplateStringType = 'filePath' | 'code'
|
|
||||||
|
|
||||||
/**
|
export let handlebars = plugins.handlebars;
|
||||||
* registers a directory of partials to make them available within handlebars compilation
|
export * from './smarthbs.compile.js';
|
||||||
*/
|
import './smarthbs.helpers.js';
|
||||||
export let registerPartialDir = (dirPathArg: string) => {
|
export * from './smarthbs.partials.js';
|
||||||
smartfile.fs.listFileTree(dirPathArg, '**/*.hbs').then(hbsFileArrayArg => {
|
export * from './smarthbs.template.js';
|
||||||
for (let hbsFilePath of hbsFileArrayArg) {
|
export * from './smarthbs.variables.js';
|
||||||
let parsedPath = path.parse(hbsFilePath)
|
export * from './smarthbs.postprocess.js';
|
||||||
let hbsFileString = smartfile.fs.toStringSync(path.join(dirPathArg, hbsFilePath))
|
|
||||||
if (parsedPath.dir === '') {
|
|
||||||
parsedPath.name = '/' + parsedPath.name
|
|
||||||
}
|
|
||||||
let partialName = `partials${parsedPath.dir}${parsedPath.name}`
|
|
||||||
handlebars.registerPartial(partialName, hbsFileString)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* compiles a directory and outputs it
|
|
||||||
*/
|
|
||||||
export let compileDirectory = async (
|
|
||||||
originDirPathArg: string,
|
|
||||||
destinationDirPathArg: string,
|
|
||||||
dataFileNameArg: string
|
|
||||||
) => {
|
|
||||||
let hbsFilePathArray = smartfile.fs.listFilesSync(originDirPathArg, /.hbs/)
|
|
||||||
let data = smartfile.fs.toObjectSync(path.join(originDirPathArg, dataFileNameArg))
|
|
||||||
for(let hbsFilePath of hbsFilePathArray) {
|
|
||||||
let parsedPath = path.parse(hbsFilePath)
|
|
||||||
let hbsFileString = smartfile.fs.toStringSync(path.join(originDirPathArg, hbsFilePath))
|
|
||||||
let template = handlebars.compile(hbsFileString)
|
|
||||||
let output = template(data)
|
|
||||||
console.log('hi ' + output + ' hi')
|
|
||||||
smartfile.memory.toFsSync(output, path.join(destinationDirPathArg, parsedPath.name + '.html'))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get a template for a file on disk
|
|
||||||
*/
|
|
||||||
export let getTemplateForFile = async (filePathArg: string) => {
|
|
||||||
let filePathAbsolute = path.resolve(filePathArg)
|
|
||||||
return handlebars.compile(smartfile.fs.toStringSync(filePathAbsolute))
|
|
||||||
}
|
|
||||||
|
29
ts/smarthbs.compile.ts
Normal file
29
ts/smarthbs.compile.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import * as plugins from './smarthbs.plugins.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* compiles a directory and outputs it
|
||||||
|
*/
|
||||||
|
export let compileDirectory = async (
|
||||||
|
originDirPathArg: string,
|
||||||
|
destinationDirPathArg: string,
|
||||||
|
dataFileNameArg: string
|
||||||
|
) => {
|
||||||
|
let hbsFilePathArray = plugins.smartfile.fs.listFilesSync(originDirPathArg, /.hbs/);
|
||||||
|
let data = plugins.smartfile.fs.toObjectSync(
|
||||||
|
plugins.path.join(originDirPathArg, dataFileNameArg)
|
||||||
|
);
|
||||||
|
for (let hbsFilePath of hbsFilePathArray) {
|
||||||
|
let parsedPath = plugins.path.parse(hbsFilePath);
|
||||||
|
let hbsFileString = plugins.smartfile.fs.toStringSync(
|
||||||
|
plugins.path.join(originDirPathArg, hbsFilePath)
|
||||||
|
);
|
||||||
|
let template = plugins.handlebars.compile(hbsFileString);
|
||||||
|
let output = template(data);
|
||||||
|
console.log('hi ' + output + ' hi');
|
||||||
|
await plugins.smartfile.fs.ensureDir(destinationDirPathArg);
|
||||||
|
plugins.smartfile.memory.toFsSync(
|
||||||
|
output,
|
||||||
|
plugins.path.join(destinationDirPathArg, parsedPath.name + '.html')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
31
ts/smarthbs.helpers.ts
Normal file
31
ts/smarthbs.helpers.ts
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import * as plugins from './smarthbs.plugins.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper:
|
||||||
|
* Allows you to analyze a context
|
||||||
|
*/
|
||||||
|
plugins.handlebars.registerHelper('__analyze', (analyzeContext) => {
|
||||||
|
if (typeof analyzeContext === 'string') {
|
||||||
|
if (plugins.handlebars.partials[analyzeContext]) {
|
||||||
|
console.log(`The analyzed partial ${analyzeContext} looks like this`);
|
||||||
|
console.log(plugins.handlebars.partials[analyzeContext]);
|
||||||
|
} else {
|
||||||
|
console.error(`The Partial ${analyzeContext} cannot be found`);
|
||||||
|
}
|
||||||
|
return 'analyzed';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper:
|
||||||
|
* logs all registered partials to console
|
||||||
|
*/
|
||||||
|
plugins.handlebars.registerHelper('__allPartialsLog', (analyzeContext) => {
|
||||||
|
console.log(plugins.handlebars.partials);
|
||||||
|
return 'analyzed';
|
||||||
|
});
|
||||||
|
|
||||||
|
plugins.handlebars.registerHelper('__compile', (evaluationString, evaluationContext) => {
|
||||||
|
let template = plugins.handlebars.compile(evaluationString);
|
||||||
|
return template(evaluationContext);
|
||||||
|
});
|
26
ts/smarthbs.partials.ts
Normal file
26
ts/smarthbs.partials.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import * as plugins from './smarthbs.plugins.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* registers a directory of partials to make them available within handlebars compilation
|
||||||
|
*/
|
||||||
|
export let registerPartialDir = (dirPathArg: string): Promise<any> => {
|
||||||
|
let done = plugins.smartpromise.defer();
|
||||||
|
plugins.smartfile.fs.listFileTree(dirPathArg, '**/*.hbs').then((hbsFileArrayArg) => {
|
||||||
|
for (let hbsFilePath of hbsFileArrayArg) {
|
||||||
|
let parsedPath = plugins.path.parse(hbsFilePath);
|
||||||
|
let hbsFileString = plugins.smartfile.fs.toStringSync(
|
||||||
|
plugins.path.join(dirPathArg, hbsFilePath)
|
||||||
|
);
|
||||||
|
if (parsedPath.dir === '/') {
|
||||||
|
parsedPath.dir = '';
|
||||||
|
}
|
||||||
|
if (parsedPath.dir !== '') {
|
||||||
|
parsedPath.dir = parsedPath.dir + '/';
|
||||||
|
}
|
||||||
|
let partialName = `partials/${parsedPath.dir}${parsedPath.name}`;
|
||||||
|
plugins.handlebars.registerPartial(partialName, hbsFileString);
|
||||||
|
done.resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return done.promise;
|
||||||
|
};
|
8
ts/smarthbs.plugins.ts
Normal file
8
ts/smarthbs.plugins.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import handlebars from 'handlebars';
|
||||||
|
import lodashUniq from 'lodash.uniq';
|
||||||
|
import * as smartpath from '@pushrocks/smartpath';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as smartfile from '@pushrocks/smartfile';
|
||||||
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
|
|
||||||
|
export { handlebars, lodashUniq, path, smartfile, smartpromise };
|
15
ts/smarthbs.postprocess.ts
Normal file
15
ts/smarthbs.postprocess.ts
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import * as plugins from './smarthbs.plugins.js';
|
||||||
|
|
||||||
|
let safeSyntaxBeginRegex = /{-{/g;
|
||||||
|
let safeSyntaxEndRegex = /}-}/g;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* allows you to keep handlebars in place across multiple iterations
|
||||||
|
* helpful when handlebars syntax is used by more than one tool in a build chain
|
||||||
|
*/
|
||||||
|
export let postprocess = async (stringArg: string): Promise<string> => {
|
||||||
|
let processedString = stringArg;
|
||||||
|
processedString = processedString.replace(safeSyntaxBeginRegex, '{{');
|
||||||
|
processedString = processedString.replace(safeSyntaxEndRegex, '}}');
|
||||||
|
return processedString;
|
||||||
|
};
|
16
ts/smarthbs.template.ts
Normal file
16
ts/smarthbs.template.ts
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import * as plugins from './smarthbs.plugins.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a template for a file on disk
|
||||||
|
*/
|
||||||
|
export let getTemplateForFile = async (filePathArg: string) => {
|
||||||
|
let filePathAbsolute = plugins.path.resolve(filePathArg);
|
||||||
|
return plugins.handlebars.compile(plugins.smartfile.fs.toStringSync(filePathAbsolute));
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get a template for string
|
||||||
|
*/
|
||||||
|
export let getTemplateForString = async (fileStringArg: string) => {
|
||||||
|
return plugins.handlebars.compile(fileStringArg);
|
||||||
|
};
|
70
ts/smarthbs.variables.ts
Normal file
70
ts/smarthbs.variables.ts
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
// This file contains code that makes it easy to search handlebar templates for variables.
|
||||||
|
// Why? To get a clue if you are missing some.
|
||||||
|
|
||||||
|
import * as plugins from './smarthbs.plugins.js';
|
||||||
|
|
||||||
|
// the curly regex objects
|
||||||
|
let tripleCurlyRegex = /{{{\s*[\w\.]+\s*}}}/g;
|
||||||
|
let doubleCurlyRegex = /{{\s*[\w\.]+\s*}}/g;
|
||||||
|
let nameInCurlsRegex = /[\w\.]+/;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* finds all variables in a handlebars template
|
||||||
|
* @param hbsStringArg
|
||||||
|
*/
|
||||||
|
export let findVarsInHbsString = async (hbsStringArg: string) => {
|
||||||
|
let hbsString = hbsStringArg; // make sure we have a new string object that we may destroy
|
||||||
|
let varNameArray: string[] = [];
|
||||||
|
let tripleCurlyMatches = hbsString.match(tripleCurlyRegex);
|
||||||
|
if (tripleCurlyMatches) {
|
||||||
|
hbsString = hbsString.replace(tripleCurlyRegex, '[[[replaced]]]');
|
||||||
|
varNameArray = varNameArray.concat(tripleCurlyMatches);
|
||||||
|
}
|
||||||
|
let doubleCurlyMatches = hbsString.match(doubleCurlyRegex);
|
||||||
|
if (doubleCurlyMatches) {
|
||||||
|
varNameArray = varNameArray.concat(doubleCurlyMatches);
|
||||||
|
}
|
||||||
|
|
||||||
|
// make sure we are clean from curly brackets
|
||||||
|
varNameArray = varNameArray.map((x) => {
|
||||||
|
return x.match(nameInCurlsRegex)[0];
|
||||||
|
});
|
||||||
|
|
||||||
|
// make sure are uniq
|
||||||
|
varNameArray = plugins.lodashUniq(varNameArray);
|
||||||
|
return varNameArray;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checks if supplied variables satisfy an handlebars template
|
||||||
|
* @param hbsStringArg
|
||||||
|
* @param varObjectArg
|
||||||
|
* @return string array with missing variable names
|
||||||
|
*/
|
||||||
|
export let checkVarsSatisfaction = async (hbsStringArg: string, varObjectArg: any) => {
|
||||||
|
// required vars as combined deep string with . notation
|
||||||
|
let requiredVarStrings = await findVarsInHbsString(hbsStringArg);
|
||||||
|
|
||||||
|
// comparison objects
|
||||||
|
let suppliedVarsObject = varObjectArg;
|
||||||
|
let missingVarsObject: string[] = [];
|
||||||
|
|
||||||
|
// building the
|
||||||
|
for (let stringVar of requiredVarStrings) {
|
||||||
|
let splittedVars = stringVar.split('.');
|
||||||
|
let requiredPointer = suppliedVarsObject;
|
||||||
|
for (let i = 0; i < splittedVars.length; i++) {
|
||||||
|
let splitVar = splittedVars[i];
|
||||||
|
let varAvailable = requiredPointer[splitVar] !== undefined;
|
||||||
|
if (varAvailable && splittedVars.length === i + 1) {
|
||||||
|
// ok
|
||||||
|
} else if (varAvailable) {
|
||||||
|
requiredPointer = requiredPointer[splitVar];
|
||||||
|
} else {
|
||||||
|
missingVarsObject.push(stringVar);
|
||||||
|
i = splittedVars.length;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return missingVarsObject;
|
||||||
|
};
|
10
tsconfig.json
Normal file
10
tsconfig.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"useDefineForClassFields": false,
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"moduleResolution": "nodenext",
|
||||||
|
"esModuleInterop": true
|
||||||
|
}
|
||||||
|
}
|
498
yarn.lock
498
yarn.lock
@ -1,498 +0,0 @@
|
|||||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
||||||
# yarn lockfile v1
|
|
||||||
|
|
||||||
|
|
||||||
"@types/fs-extra@0.x.x":
|
|
||||||
version "0.0.37"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-0.0.37.tgz#195f11bcd9a1b97d9e412c6b66899b545471a1f7"
|
|
||||||
dependencies:
|
|
||||||
"@types/node" "*"
|
|
||||||
|
|
||||||
"@types/handlebars@^4.0.31":
|
|
||||||
version "4.0.31"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.31.tgz#a7fba66fafe42713aee88eeca8db91192efe6e72"
|
|
||||||
|
|
||||||
"@types/mocha@^2.2.31":
|
|
||||||
version "2.2.39"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.39.tgz#f68d63db8b69c38e9558b4073525cf96c4f7a829"
|
|
||||||
|
|
||||||
"@types/node@*":
|
|
||||||
version "7.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.5.tgz#96a0f0a618b7b606f1ec547403c00650210bfbb7"
|
|
||||||
|
|
||||||
"@types/vinyl@^2.0.0":
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/vinyl/-/vinyl-2.0.0.tgz#fd213bf7f4136dde21fe1895500b12c186f8c268"
|
|
||||||
dependencies:
|
|
||||||
"@types/node" "*"
|
|
||||||
|
|
||||||
align-text@^0.1.1, align-text@^0.1.3:
|
|
||||||
version "0.1.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
|
|
||||||
dependencies:
|
|
||||||
kind-of "^3.0.2"
|
|
||||||
longest "^1.0.1"
|
|
||||||
repeat-string "^1.5.2"
|
|
||||||
|
|
||||||
amdefine@>=0.0.4:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5"
|
|
||||||
|
|
||||||
argparse@^1.0.7:
|
|
||||||
version "1.0.9"
|
|
||||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
|
|
||||||
dependencies:
|
|
||||||
sprintf-js "~1.0.2"
|
|
||||||
|
|
||||||
async@^1.4.0:
|
|
||||||
version "1.5.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
|
|
||||||
|
|
||||||
async@~0.2.6:
|
|
||||||
version "0.2.10"
|
|
||||||
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
|
|
||||||
|
|
||||||
balanced-match@^0.4.1:
|
|
||||||
version "0.4.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
|
|
||||||
|
|
||||||
brace-expansion@^1.0.0:
|
|
||||||
version "1.1.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9"
|
|
||||||
dependencies:
|
|
||||||
balanced-match "^0.4.1"
|
|
||||||
concat-map "0.0.1"
|
|
||||||
|
|
||||||
buffer-shims@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51"
|
|
||||||
|
|
||||||
camelcase@^1.0.2:
|
|
||||||
version "1.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"
|
|
||||||
|
|
||||||
center-align@^0.1.1:
|
|
||||||
version "0.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad"
|
|
||||||
dependencies:
|
|
||||||
align-text "^0.1.3"
|
|
||||||
lazy-cache "^1.0.3"
|
|
||||||
|
|
||||||
cliui@^2.1.0:
|
|
||||||
version "2.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
|
|
||||||
dependencies:
|
|
||||||
center-align "^0.1.1"
|
|
||||||
right-align "^0.1.1"
|
|
||||||
wordwrap "0.0.2"
|
|
||||||
|
|
||||||
clone-buffer@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58"
|
|
||||||
|
|
||||||
clone-stats@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680"
|
|
||||||
|
|
||||||
clone@^1.0.0:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149"
|
|
||||||
|
|
||||||
cloneable-readable@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.0.0.tgz#a6290d413f217a61232f95e458ff38418cfb0117"
|
|
||||||
dependencies:
|
|
||||||
inherits "^2.0.1"
|
|
||||||
process-nextick-args "^1.0.6"
|
|
||||||
through2 "^2.0.1"
|
|
||||||
|
|
||||||
concat-map@0.0.1:
|
|
||||||
version "0.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
|
||||||
|
|
||||||
core-util-is@~1.0.0:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
|
||||||
|
|
||||||
decamelize@^1.0.0:
|
|
||||||
version "1.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
|
||||||
|
|
||||||
esprima@^3.1.1:
|
|
||||||
version "3.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633"
|
|
||||||
|
|
||||||
first-chunk-stream@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz#1bdecdb8e083c0664b91945581577a43a9f31d70"
|
|
||||||
dependencies:
|
|
||||||
readable-stream "^2.0.2"
|
|
||||||
|
|
||||||
fs-extra@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-2.0.0.tgz#337352bded4a0b714f3eb84de8cea765e9d37600"
|
|
||||||
dependencies:
|
|
||||||
graceful-fs "^4.1.2"
|
|
||||||
jsonfile "^2.1.0"
|
|
||||||
|
|
||||||
fs.realpath@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
|
||||||
|
|
||||||
glob@^7.0.0, glob@^7.1.1:
|
|
||||||
version "7.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8"
|
|
||||||
dependencies:
|
|
||||||
fs.realpath "^1.0.0"
|
|
||||||
inflight "^1.0.4"
|
|
||||||
inherits "2"
|
|
||||||
minimatch "^3.0.2"
|
|
||||||
once "^1.3.0"
|
|
||||||
path-is-absolute "^1.0.0"
|
|
||||||
|
|
||||||
graceful-fs@^4.1.2, graceful-fs@^4.1.6:
|
|
||||||
version "4.1.11"
|
|
||||||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
|
|
||||||
|
|
||||||
handlebars@^4.0.6:
|
|
||||||
version "4.0.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.6.tgz#2ce4484850537f9c97a8026d5399b935c4ed4ed7"
|
|
||||||
dependencies:
|
|
||||||
async "^1.4.0"
|
|
||||||
optimist "^0.6.1"
|
|
||||||
source-map "^0.4.4"
|
|
||||||
optionalDependencies:
|
|
||||||
uglify-js "^2.6"
|
|
||||||
|
|
||||||
home@^1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/home/-/home-1.0.1.tgz#96a423ceb49b98378ff5ef3ceae059a557f9dd35"
|
|
||||||
dependencies:
|
|
||||||
os-homedir "^1.0.1"
|
|
||||||
|
|
||||||
inflight@^1.0.4:
|
|
||||||
version "1.0.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
|
||||||
dependencies:
|
|
||||||
once "^1.3.0"
|
|
||||||
wrappy "1"
|
|
||||||
|
|
||||||
inherits@2, inherits@^2.0.1, inherits@~2.0.1:
|
|
||||||
version "2.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
|
|
||||||
|
|
||||||
interpret@^1.0.0:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c"
|
|
||||||
|
|
||||||
is-buffer@^1.0.2:
|
|
||||||
version "1.1.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b"
|
|
||||||
|
|
||||||
is-stream@^1.1.0:
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
|
|
||||||
|
|
||||||
is-utf8@^0.2.0, is-utf8@^0.2.1:
|
|
||||||
version "0.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
|
|
||||||
|
|
||||||
isarray@~1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
|
|
||||||
|
|
||||||
js-yaml@^3.7.0:
|
|
||||||
version "3.8.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.1.tgz#782ba50200be7b9e5a8537001b7804db3ad02628"
|
|
||||||
dependencies:
|
|
||||||
argparse "^1.0.7"
|
|
||||||
esprima "^3.1.1"
|
|
||||||
|
|
||||||
jsonfile@^2.1.0:
|
|
||||||
version "2.4.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8"
|
|
||||||
optionalDependencies:
|
|
||||||
graceful-fs "^4.1.6"
|
|
||||||
|
|
||||||
kind-of@^3.0.2:
|
|
||||||
version "3.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47"
|
|
||||||
dependencies:
|
|
||||||
is-buffer "^1.0.2"
|
|
||||||
|
|
||||||
lazy-cache@^1.0.3:
|
|
||||||
version "1.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"
|
|
||||||
|
|
||||||
longest@^1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
|
|
||||||
|
|
||||||
minimatch@^3.0.2:
|
|
||||||
version "3.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774"
|
|
||||||
dependencies:
|
|
||||||
brace-expansion "^1.0.0"
|
|
||||||
|
|
||||||
minimist@~0.0.1:
|
|
||||||
version "0.0.10"
|
|
||||||
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf"
|
|
||||||
|
|
||||||
once@^1.3.0:
|
|
||||||
version "1.4.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
|
||||||
dependencies:
|
|
||||||
wrappy "1"
|
|
||||||
|
|
||||||
optimist@^0.6.1:
|
|
||||||
version "0.6.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
|
|
||||||
dependencies:
|
|
||||||
minimist "~0.0.1"
|
|
||||||
wordwrap "~0.0.2"
|
|
||||||
|
|
||||||
os-homedir@^1.0.1:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
|
|
||||||
|
|
||||||
path-is-absolute@^1.0.0:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
|
||||||
|
|
||||||
path-parse@^1.0.5:
|
|
||||||
version "1.0.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"
|
|
||||||
|
|
||||||
pify@^2.3.0:
|
|
||||||
version "2.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
|
||||||
|
|
||||||
process-nextick-args@^1.0.6, process-nextick-args@~1.0.6:
|
|
||||||
version "1.0.7"
|
|
||||||
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
|
|
||||||
|
|
||||||
readable-stream@^2.0.2, readable-stream@^2.1.5:
|
|
||||||
version "2.2.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729"
|
|
||||||
dependencies:
|
|
||||||
buffer-shims "^1.0.0"
|
|
||||||
core-util-is "~1.0.0"
|
|
||||||
inherits "~2.0.1"
|
|
||||||
isarray "~1.0.0"
|
|
||||||
process-nextick-args "~1.0.6"
|
|
||||||
string_decoder "~0.10.x"
|
|
||||||
util-deprecate "~1.0.1"
|
|
||||||
|
|
||||||
rechoir@^0.6.2:
|
|
||||||
version "0.6.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
|
|
||||||
dependencies:
|
|
||||||
resolve "^1.1.6"
|
|
||||||
|
|
||||||
remove-trailing-separator@^1.0.1:
|
|
||||||
version "1.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.1.tgz#615ebb96af559552d4bf4057c8436d486ab63cc4"
|
|
||||||
|
|
||||||
repeat-string@^1.5.2:
|
|
||||||
version "1.6.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
|
|
||||||
|
|
||||||
replace-ext@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb"
|
|
||||||
|
|
||||||
require-reload@0.2.2:
|
|
||||||
version "0.2.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/require-reload/-/require-reload-0.2.2.tgz#29a7591846caf91b6e8a3cda991683f95f8d7d42"
|
|
||||||
|
|
||||||
resolve@^1.1.6:
|
|
||||||
version "1.3.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.1.tgz#5d0a1632609b6b00a22284293db1d5d973676314"
|
|
||||||
dependencies:
|
|
||||||
path-parse "^1.0.5"
|
|
||||||
|
|
||||||
right-align@^0.1.1:
|
|
||||||
version "0.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef"
|
|
||||||
dependencies:
|
|
||||||
align-text "^0.1.1"
|
|
||||||
|
|
||||||
semver@^5.3.0:
|
|
||||||
version "5.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
|
|
||||||
|
|
||||||
shelljs@^0.7.4:
|
|
||||||
version "0.7.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad"
|
|
||||||
dependencies:
|
|
||||||
glob "^7.0.0"
|
|
||||||
interpret "^1.0.0"
|
|
||||||
rechoir "^0.6.2"
|
|
||||||
|
|
||||||
smartfile@^4.1.4:
|
|
||||||
version "4.1.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/smartfile/-/smartfile-4.1.6.tgz#d71026aefef99233c56766c3c6c11afc41a19b3a"
|
|
||||||
dependencies:
|
|
||||||
"@types/fs-extra" "0.x.x"
|
|
||||||
"@types/vinyl" "^2.0.0"
|
|
||||||
fs-extra "^2.0.0"
|
|
||||||
glob "^7.1.1"
|
|
||||||
js-yaml "^3.7.0"
|
|
||||||
require-reload "0.2.2"
|
|
||||||
smartpath "^3.2.7"
|
|
||||||
smartq "^1.0.4"
|
|
||||||
smartrequest "^1.0.4"
|
|
||||||
typings-global "^1.0.14"
|
|
||||||
vinyl "^2.0.1"
|
|
||||||
vinyl-file "^3.0.0"
|
|
||||||
|
|
||||||
smartpath@^3.2.7:
|
|
||||||
version "3.2.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/smartpath/-/smartpath-3.2.8.tgz#4834bd3a8bae2295baacadba23c87a501952f940"
|
|
||||||
dependencies:
|
|
||||||
home "^1.0.1"
|
|
||||||
typings-global "^1.0.14"
|
|
||||||
|
|
||||||
smartq@^1.0.4, smartq@^1.1.0:
|
|
||||||
version "1.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/smartq/-/smartq-1.1.1.tgz#efb358705260d41ae18aef7ffd815f7b6fe17dd3"
|
|
||||||
dependencies:
|
|
||||||
typed-promisify "^0.3.0"
|
|
||||||
typings-global "^1.0.14"
|
|
||||||
|
|
||||||
smartrequest@^1.0.4:
|
|
||||||
version "1.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/smartrequest/-/smartrequest-1.0.4.tgz#86af2163ae28f1031b01c2d8ad8c429733920611"
|
|
||||||
dependencies:
|
|
||||||
smartq "^1.1.0"
|
|
||||||
typings-global "^1.0.14"
|
|
||||||
|
|
||||||
source-map@^0.4.4:
|
|
||||||
version "0.4.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b"
|
|
||||||
dependencies:
|
|
||||||
amdefine ">=0.0.4"
|
|
||||||
|
|
||||||
source-map@~0.5.1:
|
|
||||||
version "0.5.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"
|
|
||||||
|
|
||||||
sprintf-js@~1.0.2:
|
|
||||||
version "1.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
|
||||||
|
|
||||||
string_decoder@~0.10.x:
|
|
||||||
version "0.10.31"
|
|
||||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
|
|
||||||
|
|
||||||
strip-bom-buf@^1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/strip-bom-buf/-/strip-bom-buf-1.0.0.tgz#1cb45aaf57530f4caf86c7f75179d2c9a51dd572"
|
|
||||||
dependencies:
|
|
||||||
is-utf8 "^0.2.1"
|
|
||||||
|
|
||||||
strip-bom-stream@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca"
|
|
||||||
dependencies:
|
|
||||||
first-chunk-stream "^2.0.0"
|
|
||||||
strip-bom "^2.0.0"
|
|
||||||
|
|
||||||
strip-bom@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e"
|
|
||||||
dependencies:
|
|
||||||
is-utf8 "^0.2.0"
|
|
||||||
|
|
||||||
through2@^2.0.1:
|
|
||||||
version "2.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be"
|
|
||||||
dependencies:
|
|
||||||
readable-stream "^2.1.5"
|
|
||||||
xtend "~4.0.1"
|
|
||||||
|
|
||||||
typed-promisify@^0.3.0:
|
|
||||||
version "0.3.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/typed-promisify/-/typed-promisify-0.3.0.tgz#1ba0af5e444c87d8047406f18ce49092a1191853"
|
|
||||||
|
|
||||||
typings-global@*, typings-global@^1.0.14:
|
|
||||||
version "1.0.14"
|
|
||||||
resolved "https://registry.yarnpkg.com/typings-global/-/typings-global-1.0.14.tgz#ab682720a03d6b9278869fb5c30c30d7dc61d12c"
|
|
||||||
dependencies:
|
|
||||||
semver "^5.3.0"
|
|
||||||
shelljs "^0.7.4"
|
|
||||||
|
|
||||||
typings-test@^1.0.3:
|
|
||||||
version "1.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/typings-test/-/typings-test-1.0.3.tgz#fbab895eb3f0c44842e73db059f65946b971e369"
|
|
||||||
dependencies:
|
|
||||||
"@types/mocha" "^2.2.31"
|
|
||||||
typings-global "*"
|
|
||||||
|
|
||||||
uglify-js@^2.6:
|
|
||||||
version "2.7.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8"
|
|
||||||
dependencies:
|
|
||||||
async "~0.2.6"
|
|
||||||
source-map "~0.5.1"
|
|
||||||
uglify-to-browserify "~1.0.0"
|
|
||||||
yargs "~3.10.0"
|
|
||||||
|
|
||||||
uglify-to-browserify@~1.0.0:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
|
|
||||||
|
|
||||||
util-deprecate@~1.0.1:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
|
||||||
|
|
||||||
vinyl-file@^3.0.0:
|
|
||||||
version "3.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/vinyl-file/-/vinyl-file-3.0.0.tgz#b104d9e4409ffa325faadd520642d0a3b488b365"
|
|
||||||
dependencies:
|
|
||||||
graceful-fs "^4.1.2"
|
|
||||||
pify "^2.3.0"
|
|
||||||
strip-bom-buf "^1.0.0"
|
|
||||||
strip-bom-stream "^2.0.0"
|
|
||||||
vinyl "^2.0.1"
|
|
||||||
|
|
||||||
vinyl@^2.0.1:
|
|
||||||
version "2.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.0.1.tgz#1c3b4931e7ac4c1efee743f3b91a74c094407bb6"
|
|
||||||
dependencies:
|
|
||||||
clone "^1.0.0"
|
|
||||||
clone-buffer "^1.0.0"
|
|
||||||
clone-stats "^1.0.0"
|
|
||||||
cloneable-readable "^1.0.0"
|
|
||||||
is-stream "^1.1.0"
|
|
||||||
remove-trailing-separator "^1.0.1"
|
|
||||||
replace-ext "^1.0.0"
|
|
||||||
|
|
||||||
window-size@0.1.0:
|
|
||||||
version "0.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d"
|
|
||||||
|
|
||||||
wordwrap@0.0.2:
|
|
||||||
version "0.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"
|
|
||||||
|
|
||||||
wordwrap@~0.0.2:
|
|
||||||
version "0.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107"
|
|
||||||
|
|
||||||
wrappy@1:
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
|
||||||
|
|
||||||
xtend@~4.0.1:
|
|
||||||
version "4.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"
|
|
||||||
|
|
||||||
yargs@~3.10.0:
|
|
||||||
version "3.10.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"
|
|
||||||
dependencies:
|
|
||||||
camelcase "^1.0.2"
|
|
||||||
cliui "^2.1.0"
|
|
||||||
decamelize "^1.0.0"
|
|
||||||
window-size "0.1.0"
|
|
Reference in New Issue
Block a user