fix(core): update
This commit is contained in:
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: '2.0.9',
|
||||
description: 'handlebars with better fs support'
|
||||
}
|
14
ts/index.ts
14
ts/index.ts
@ -1,10 +1,10 @@
|
||||
import * as plugins from './smarthbs.plugins';
|
||||
import * as plugins from './smarthbs.plugins.js';
|
||||
export type TTemplateStringType = 'filePath' | 'code';
|
||||
|
||||
export let handlebars = plugins.handlebars;
|
||||
export * from './smarthbs.compile';
|
||||
import './smarthbs.helpers';
|
||||
export * from './smarthbs.partials';
|
||||
export * from './smarthbs.template';
|
||||
export * from './smarthbs.variables';
|
||||
export * from './smarthbs.postprocess';
|
||||
export * from './smarthbs.compile.js';
|
||||
import './smarthbs.helpers.js';
|
||||
export * from './smarthbs.partials.js';
|
||||
export * from './smarthbs.template.js';
|
||||
export * from './smarthbs.variables.js';
|
||||
export * from './smarthbs.postprocess.js';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './smarthbs.plugins';
|
||||
import * as plugins from './smarthbs.plugins.js';
|
||||
|
||||
/**
|
||||
* compiles a directory and outputs it
|
||||
|
@ -1,10 +1,10 @@
|
||||
import * as plugins from './smarthbs.plugins';
|
||||
import * as plugins from './smarthbs.plugins.js';
|
||||
|
||||
/**
|
||||
* Helper:
|
||||
* Allows you to analyze a context
|
||||
*/
|
||||
plugins.handlebars.registerHelper('__analyze', analyzeContext => {
|
||||
plugins.handlebars.registerHelper('__analyze', (analyzeContext) => {
|
||||
if (typeof analyzeContext === 'string') {
|
||||
if (plugins.handlebars.partials[analyzeContext]) {
|
||||
console.log(`The analyzed partial ${analyzeContext} looks like this`);
|
||||
@ -20,7 +20,7 @@ plugins.handlebars.registerHelper('__analyze', analyzeContext => {
|
||||
* Helper:
|
||||
* logs all registered partials to console
|
||||
*/
|
||||
plugins.handlebars.registerHelper('__allPartialsLog', analyzeContext => {
|
||||
plugins.handlebars.registerHelper('__allPartialsLog', (analyzeContext) => {
|
||||
console.log(plugins.handlebars.partials);
|
||||
return 'analyzed';
|
||||
});
|
||||
|
@ -1,11 +1,11 @@
|
||||
import * as plugins from './smarthbs.plugins';
|
||||
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 => {
|
||||
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(
|
||||
|
@ -1,5 +1,6 @@
|
||||
import * as handlebars from 'handlebars';
|
||||
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';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './smarthbs.plugins';
|
||||
import * as plugins from './smarthbs.plugins.js';
|
||||
|
||||
let safeSyntaxBeginRegex = /{-{/g;
|
||||
let safeSyntaxEndRegex = /}-}/g;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from './smarthbs.plugins';
|
||||
import * as plugins from './smarthbs.plugins.js';
|
||||
|
||||
/**
|
||||
* get a template for a file on disk
|
||||
|
@ -1,7 +1,7 @@
|
||||
// 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';
|
||||
import * as plugins from './smarthbs.plugins.js';
|
||||
|
||||
// the curly regex objects
|
||||
let tripleCurlyRegex = /{{{\s*[\w\.]+\s*}}}/g;
|
||||
@ -26,7 +26,7 @@ export let findVarsInHbsString = async (hbsStringArg: string) => {
|
||||
}
|
||||
|
||||
// make sure we are clean from curly brackets
|
||||
varNameArray = varNameArray.map(x => {
|
||||
varNameArray = varNameArray.map((x) => {
|
||||
return x.match(nameInCurlsRegex)[0];
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user