fix(build): migrate filesystem access to smartfs and tighten TypeScript compatibility

This commit is contained in:
2026-04-30 10:20:07 +00:00
parent a71a53092b
commit 8c6e8d9c96
14 changed files with 7298 additions and 3761 deletions
+7 -4
View File
@@ -4,7 +4,7 @@ import * as plugins from './smarthbs.plugins.js';
* Helper:
* Allows you to analyze a context
*/
plugins.handlebars.registerHelper('__analyze', (analyzeContext) => {
plugins.handlebars.registerHelper('__analyze', (analyzeContext: unknown) => {
if (typeof analyzeContext === 'string') {
if (plugins.handlebars.partials[analyzeContext]) {
console.log(`The analyzed partial ${analyzeContext} looks like this`);
@@ -20,12 +20,15 @@ plugins.handlebars.registerHelper('__analyze', (analyzeContext) => {
* Helper:
* logs all registered partials to console
*/
plugins.handlebars.registerHelper('__allPartialsLog', (analyzeContext) => {
plugins.handlebars.registerHelper('__allPartialsLog', (_analyzeContext: unknown) => {
console.log(plugins.handlebars.partials);
return 'analyzed';
});
plugins.handlebars.registerHelper('__compile', (evaluationString, evaluationContext) => {
let template = plugins.handlebars.compile(evaluationString);
plugins.handlebars.registerHelper('__compile', (evaluationString: unknown, evaluationContext: unknown) => {
if (typeof evaluationString !== 'string') {
return '';
}
const template = plugins.handlebars.compile(evaluationString);
return template(evaluationContext);
});