Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
a71a53092b | |||
095b4f25fb | |||
41ac3235b8 | |||
d98323eb82 | |||
1ba2fcbf65 | |||
2bcabea719 | |||
51a1ce74c7 | |||
9598d9ca3a | |||
8f1254b4de | |||
735708d950 | |||
0ab254e4ed | |||
185b7a38d5 | |||
7ab6922eed | |||
31bf5f7486 |
128
.gitlab-ci.yml
128
.gitlab-ci.yml
@ -1,128 +0,0 @@
|
||||
# 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
|
50
changelog.md
Normal file
50
changelog.md
Normal file
@ -0,0 +1,50 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-01-25 - 3.0.4 - fix(metadata)
|
||||
Removed CI configuration file .gitlab-ci.yml and updated project metadata
|
||||
|
||||
- Deleted the .gitlab-ci.yml file to potentially switch or update CI/CD configurations.
|
||||
- Updated the `description` and `keywords` in package.json and npmextra.json for better project documentation and SEO.
|
||||
|
||||
## 2024-04-01 to 2024-05-29 - 3.0.3 - maintenance
|
||||
Maintenance updates and minor configuration changes.
|
||||
|
||||
- Updated the project description.
|
||||
- Updated TypeScript configuration (`tsconfig`).
|
||||
- Modified `npmextra.json` file for `githost`.
|
||||
|
||||
## 2023-06-25 to 2023-07-10 - 3.0.3 - organization
|
||||
Organizational changes and fixes in core components.
|
||||
|
||||
- Transitioned to a new organization scheme.
|
||||
|
||||
## 2023-03-06 to 2023-06-25 - 3.0.1 to 3.0.2 - fixes
|
||||
Core updates and critical fixes.
|
||||
|
||||
- Updated core components with fixes.
|
||||
|
||||
## 2022-07-24 - 2.0.9 - breaking change
|
||||
Significant shifts in module support.
|
||||
|
||||
- **BREAKING CHANGE**: Switched to ECMAScript Module (ESM) format.
|
||||
|
||||
## 2018-08-27 - 1.0.16 - breaking change
|
||||
Major updates in project scope.
|
||||
|
||||
- **BREAKING CHANGE**: Updated project scope to `@pushrocks`.
|
||||
|
||||
## 2017-05-26 - 1.0.15 - functionality
|
||||
Enhancements in processing capabilities.
|
||||
|
||||
- Added post-processing functionality.
|
||||
|
||||
## 2017-05-12 - 1.0.13 - documentation improvements
|
||||
Enhanced documentation.
|
||||
|
||||
- Added new documentation materials.
|
||||
|
||||
## 2017-05-01 - 1.0.8 - variable handling
|
||||
Improvements in variable utilization.
|
||||
|
||||
- Introduced extended variable checking capabilities.
|
||||
|
@ -6,12 +6,29 @@
|
||||
"gitzone": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "gitlab.com",
|
||||
"gitscope": "pushrocks",
|
||||
"githost": "code.foss.global",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "smarthbs",
|
||||
"description": "handlebars with better fs support",
|
||||
"npmPackagename": "@pushrocks/smarthbs",
|
||||
"license": "MIT"
|
||||
"description": "Enhances Handlebars with advanced filesystem support, template compilation, and efficient management of partials and variables.",
|
||||
"npmPackagename": "@push.rocks/smarthbs",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"handlebars",
|
||||
"template engine",
|
||||
"file system",
|
||||
"partials",
|
||||
"template compilation",
|
||||
"smarthbs",
|
||||
"smartfile integration",
|
||||
"template variables analysis",
|
||||
"dynamic content",
|
||||
"code generation",
|
||||
"typescript",
|
||||
"project management"
|
||||
]
|
||||
}
|
||||
},
|
||||
"tsdoc": {
|
||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||
}
|
||||
}
|
14180
package-lock.json
generated
14180
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
39
package.json
39
package.json
@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@pushrocks/smarthbs",
|
||||
"version": "3.0.0",
|
||||
"name": "@push.rocks/smarthbs",
|
||||
"version": "3.0.4",
|
||||
"private": false,
|
||||
"description": "handlebars with better fs support",
|
||||
"description": "Enhances Handlebars with advanced filesystem support, template compilation, and efficient management of partials and variables.",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"type": "module",
|
||||
@ -12,31 +12,40 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@gitlab.com/pkunz/smarthbs.git"
|
||||
"url": "https://code.foss.global/push.rocks/smarthbs.git"
|
||||
},
|
||||
"keywords": [
|
||||
"handlebars"
|
||||
"handlebars",
|
||||
"template engine",
|
||||
"file system",
|
||||
"partials",
|
||||
"template compilation",
|
||||
"smarthbs",
|
||||
"smartfile integration",
|
||||
"template variables analysis",
|
||||
"dynamic content",
|
||||
"code generation",
|
||||
"typescript",
|
||||
"project management"
|
||||
],
|
||||
"author": "Lossless GmbH",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://gitlab.com/pkunz/smarthbs/issues"
|
||||
},
|
||||
"homepage": "https://gitlab.com/pkunz/smarthbs#README",
|
||||
"homepage": "https://code.foss.global/push.rocks/smarthbs",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartfile": "^10.0.2",
|
||||
"@pushrocks/smartfile": "^10.0.17",
|
||||
"@pushrocks/smartpath": "^5.0.5",
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
"@types/lodash.uniq": "^4.5.7",
|
||||
"handlebars": "^4.7.7",
|
||||
"lodash.uniq": "^4.5.0"
|
||||
"@pushrocks/smartpromise": "^4.0.2",
|
||||
"handlebars": "^4.7.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.63",
|
||||
"@gitzone/tsrun": "^1.2.37",
|
||||
"@gitzone/tsbuild": "^2.1.66",
|
||||
"@gitzone/tsrun": "^1.2.42",
|
||||
"@gitzone/tstest": "^1.0.72",
|
||||
"@pushrocks/tapbundle": "^5.0.4",
|
||||
"@types/node": "^18.0.6"
|
||||
"@pushrocks/tapbundle": "^5.0.8",
|
||||
"@types/node": "^20.3.1"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
|
4457
pnpm-lock.yaml
generated
Normal file
4457
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
1
readme.hints.md
Normal file
1
readme.hints.md
Normal file
@ -0,0 +1 @@
|
||||
|
208
readme.md
208
readme.md
@ -1,52 +1,188 @@
|
||||
# @pushrocks/smarthbs
|
||||
handlebars with better fs support
|
||||
# @push.rocks/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/)
|
||||
A library that enhances handlebars with better file system support, templates compilation, and partials registration.
|
||||
|
||||
## Status for master
|
||||
## Install
|
||||
|
||||
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)
|
||||
To install `@push.rocks/smarthbs`, run the following command in your terminal:
|
||||
|
||||
```bash
|
||||
npm install @push.rocks/smarthbs --save
|
||||
```
|
||||
|
||||
This will add `@push.rocks/smarthbs` as a dependency to your project, allowing you to leverage its enhanced Handlebars templating capabilities.
|
||||
|
||||
## 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.
|
||||
The `@push.rocks/smarthbs` library extends Handlebars functionality by introducing better file system interaction, template compilation, and an easier way to manage partials. The following sections walk you through the various features and how you can utilize them for creating dynamic and organized templates.
|
||||
|
||||
```javascript
|
||||
import * as smarthbs from 'smarthbs';
|
||||
### Getting Started
|
||||
|
||||
// read all .hbs files in a directory and any child directories and use relative path as partial string identifier
|
||||
smarthbs.registerPartialDir(testPartialDir);
|
||||
First, import the `@push.rocks/smarthbs` module using ECMAScript Module (ESM) syntax in a TypeScript file:
|
||||
|
||||
// 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');
|
||||
```typescript
|
||||
import * as smarthbs from '@push.rocks/smarthbs';
|
||||
```
|
||||
|
||||
### Managing Partials
|
||||
|
||||
## Contribution
|
||||
Handlebars' partials allow for embedding templates within other templates, making it simple to manage reusable pieces of template code. With `@push.rocks/smarthbs`, you can efficiently register an entire directory of partials.
|
||||
|
||||
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). :)
|
||||
#### Registering a Directory of Partials
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
To register all `.hbs` files in a directory, including those in subdirectories, as partials:
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||
```typescript
|
||||
await smarthbs.registerPartialDir('./path/to/partials');
|
||||
```
|
||||
|
||||
[](https://maintainedby.lossless.com)
|
||||
Each `.hbs` file in the specified directory becomes available as a partial. Partials are identified by their paths relative to the specified directory.
|
||||
|
||||
### Compiling Templates
|
||||
|
||||
Compiling directories of Handlebars templates is seamless with `@push.rocks/smarthbs`. This feature reads templates from a source directory, compiles them using a specified data context, and writes the rendered output to a destination directory.
|
||||
|
||||
#### Compile a Directory
|
||||
|
||||
```typescript
|
||||
await smarthbs.compileDirectory('./source/templates', './destination/html', 'data.json');
|
||||
```
|
||||
|
||||
Here, every `.hbs` file in `./source/templates` is compiled with data from `data.json`. The rendered outputs are saved as `.html` files in `./destination/html`.
|
||||
|
||||
### Working with Variables
|
||||
|
||||
When handling complex templates, you might want to analyze which variables are used, verify their satisfaction, and ensure data completeness.
|
||||
|
||||
#### Finding Variables in Templates
|
||||
|
||||
To extract all variables used within a Handlebars template string:
|
||||
|
||||
```typescript
|
||||
const templateVariables = await smarthbs.findVarsInHbsString("Your template {{example}} here.");
|
||||
console.log(templateVariables); // Outputs an array of variable names: ['example']
|
||||
```
|
||||
|
||||
#### Ensuring Variables Satisfaction
|
||||
|
||||
To check if a given data object satisfies all required variables in a template:
|
||||
|
||||
```typescript
|
||||
const missingVars = await smarthbs.checkVarsSatisfaction("Your template {{example}} here.", { anotherVar: "some value" });
|
||||
if(missingVars.length) {
|
||||
console.error('Missing variables:', missingVars);
|
||||
}
|
||||
```
|
||||
|
||||
This function ensures the provided data object contains all variables used in the template. Otherwise, it returns an array with the names of the missing variables.
|
||||
|
||||
### Rendering Templates
|
||||
|
||||
You can use `@push.rocks/smarthbs` to compile Handlebars templates directly from strings or files:
|
||||
|
||||
#### From a String
|
||||
|
||||
```typescript
|
||||
const stringTemplate = await smarthbs.getTemplateForString("Hello, {{name}}!");
|
||||
const renderedString = stringTemplate({ name: "World" });
|
||||
console.log(renderedString); // "Hello, World!"
|
||||
```
|
||||
|
||||
#### From a File
|
||||
|
||||
```typescript
|
||||
const fileTemplate = await smarthbs.getTemplateForFile('./path/to/template.hbs');
|
||||
const renderedFileString = fileTemplate({ key: "value" });
|
||||
console.log(renderedFileString); // Outputs the processed template with provided data
|
||||
```
|
||||
|
||||
### Ensuring Safe Syntax
|
||||
|
||||
If your Handlebars templates go through multiple processing stages, you might need to protect and restore the syntax:
|
||||
|
||||
```typescript
|
||||
const processedString = await smarthbs.postprocess("This is {-{safe}-} syntax.");
|
||||
console.log(processedString); // Restores to "This is {{safe}} syntax."
|
||||
```
|
||||
|
||||
This approach allows you to keep placeholders intact during various stages, converting `{-{ ... }-}` syntax back to `{{ ... }}`.
|
||||
|
||||
### Advanced Features and Helpers
|
||||
|
||||
#### Custom Helpers
|
||||
|
||||
Extend Handlebars with custom helpers to introduce new functionalities or debug existing templates. For instance:
|
||||
|
||||
- **Analyze Helper**: Displays partials and their details.
|
||||
- **Log Registered Partials**: Logs all registered partials, aiding in debugging.
|
||||
- **Runtime Compilation**: Compile templates dynamically using the `__compile` helper.
|
||||
|
||||
### Example: Building an HTML Page
|
||||
|
||||
Suppose you are building a simple HTML page. First, define a partial for the header and a general layout:
|
||||
|
||||
Create a new header partial:
|
||||
|
||||
```hbs
|
||||
<!-- ./partials/header.hbs -->
|
||||
<header>
|
||||
<h1>{{title}}</h1>
|
||||
</header>
|
||||
```
|
||||
|
||||
Define a base layout that includes the header and a body:
|
||||
|
||||
```hbs
|
||||
<!-- ./layouts/main.hbs -->
|
||||
{{> header title=pageTitle}}
|
||||
<section>
|
||||
<h2>{{subtitle}}</h2>
|
||||
<p>{{content}}</p>
|
||||
</section>
|
||||
```
|
||||
|
||||
In your script, register partials and compile the layout:
|
||||
|
||||
```typescript
|
||||
import * as smarthbs from '@push.rocks/smarthbs';
|
||||
|
||||
// Register partials
|
||||
await smarthbs.registerPartialDir('./partials');
|
||||
|
||||
// Prepare data for compilation
|
||||
const data = {
|
||||
pageTitle: "My Awesome Page",
|
||||
subtitle: "Welcome to the world of dynamic templates!",
|
||||
content: "Handlebars makes creating reusable templates easy."
|
||||
};
|
||||
|
||||
// Compile and render the layout
|
||||
const mainTemplate = await smarthbs.getTemplateForFile('./layouts/main.hbs');
|
||||
const renderedHtml = mainTemplate(data);
|
||||
|
||||
console.log(renderedHtml);
|
||||
// Outputs the full HTML replacing variables in the layout with data
|
||||
```
|
||||
|
||||
### Conclusion
|
||||
|
||||
The `@push.rocks/smarthbs` library enhances the already powerful Handlebars templating engine with capabilities that are crucial for modern development workflows, especially those involving complex template management and dynamic content generation. Whether managing large-scale projects with numerous reusable components or simply wanting a better way to handle templates and partials, this tool provides a robust solution to enhance your projects and improve productivity.
|
||||
|
||||
## License and Legal Information
|
||||
|
||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
||||
|
||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||
|
||||
### Trademarks
|
||||
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
|
||||
|
||||
### Company Information
|
||||
|
||||
Task Venture Capital GmbH
|
||||
Registered at District court Bremen HRB 35230 HB, Germany
|
||||
|
||||
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
||||
|
||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
||||
|
@ -6,8 +6,8 @@ import * as path from 'path';
|
||||
|
||||
const dirname = smartpath.get.dirnameFromImportMetaUrl(import.meta.url);
|
||||
|
||||
let testHbsDir = path.join(dirname, 'hbs_testfiles');
|
||||
let testPartialDir = path.join(testHbsDir, 'partials');
|
||||
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 () => {
|
||||
@ -15,7 +15,7 @@ tap.test('smarthbs -> should create partials', async () => {
|
||||
});
|
||||
|
||||
tap.test('smarthbs -> should compile a directory', async () => {
|
||||
smarthbs.compileDirectory(testHbsDir, testResultDir, 'data.json');
|
||||
smarthbs.compileDirectory(hbs_testfilesDir, testResultDir, 'data.json');
|
||||
});
|
||||
|
||||
tap.test('', async () => {
|
||||
|
@ -1,8 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@pushrocks/smarthbs',
|
||||
version: '3.0.0',
|
||||
description: 'handlebars with better fs support'
|
||||
name: '@push.rocks/smarthbs',
|
||||
version: '3.0.4',
|
||||
description: 'Enhances Handlebars with advanced filesystem support, template compilation, and efficient management of partials and variables.'
|
||||
}
|
||||
|
@ -1,8 +1,15 @@
|
||||
import handlebars from 'handlebars';
|
||||
import lodashUniq from 'lodash.uniq';
|
||||
import * as smartpath from '@pushrocks/smartpath';
|
||||
// node native
|
||||
import * as path from 'path';
|
||||
|
||||
export { path };
|
||||
|
||||
import * as smartpath from '@pushrocks/smartpath';
|
||||
import * as smartfile from '@pushrocks/smartfile';
|
||||
import * as smartpromise from '@pushrocks/smartpromise';
|
||||
|
||||
export { handlebars, lodashUniq, path, smartfile, smartpromise };
|
||||
export { smartpath, smartfile, smartpromise };
|
||||
|
||||
// third party
|
||||
import handlebars from 'handlebars';
|
||||
|
||||
export { handlebars };
|
||||
|
@ -31,7 +31,10 @@ export let findVarsInHbsString = async (hbsStringArg: string) => {
|
||||
});
|
||||
|
||||
// make sure are uniq
|
||||
varNameArray = plugins.lodashUniq(varNameArray);
|
||||
function uniqueArray(input: string[]): string[] {
|
||||
return Array.from(new Set(input));
|
||||
}
|
||||
varNameArray = uniqueArray(varNameArray);
|
||||
return varNameArray;
|
||||
};
|
||||
|
||||
|
@ -3,8 +3,12 @@
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "nodenext",
|
||||
"esModuleInterop": true
|
||||
}
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
|
Reference in New Issue
Block a user