Compare commits

..

5 Commits

Author SHA1 Message Date
3c68eae55d v4.0.21
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2026-03-24 16:49:58 +00:00
d0f485ee85 fix(smartconfig): correct smartconfig package key and add npmjs registry for public releases 2026-03-24 16:49:58 +00:00
1c008bfcc1 4.0.20
Some checks failed
Default (tags) / security (push) Failing after 0s
Default (tags) / test (push) Failing after 0s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2026-03-24 16:48:20 +00:00
80b53ef2fe feat(config): add .smartconfig.json for project configuration and legal information 2026-03-24 16:48:13 +00:00
9fb0933dbc feat(ScafTemplate): add renderToMemory() method for in-memory template rendering
Adds a new public method that renders all template files in memory without writing to disk or running scripts. Returns new SmartFile instances without mutating the original templateSmartfileArray. This enables use cases like format commands that need to compare rendered templates with existing files.
2026-03-24 16:42:10 +00:00
5 changed files with 65 additions and 13 deletions

View File

@@ -1,12 +1,5 @@
{
"npmts": {
"coverageTreshold": 30
},
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"gitzone": {
"@git.zone/cli": {
"projectType": "npm",
"module": {
"githost": "code.foss.global",
@@ -25,9 +18,17 @@
"yaml",
"cli tool"
]
},
"release": {
"registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
}
},
"tsdoc": {
"@git.zone/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"
}
}
},
"@ship.zone/szci": {}
}

View File

@@ -1,5 +1,12 @@
# Changelog
## 2026-03-24 - 4.0.21 - fix(smartconfig)
correct smartconfig package key and add npmjs registry for public releases
- Rename the CLI configuration key from git.zone/cli to @git.zone/cli.
- Add https://registry.npmjs.org to the release registries alongside the existing Verdaccio registry.
- Register @ship.zone/szci in the project smart configuration.
## 2025-08-17 - 4.0.19 - fix(readme)
Update README with comprehensive quick start, usage examples, API reference and advanced guides

View File

@@ -1,6 +1,6 @@
{
"name": "@push.rocks/smartscaf",
"version": "4.0.19",
"version": "4.0.21",
"private": false,
"description": "A project aimed at quickly scaffolding projects with support for TypeScript, smart file handling, and template rendering.",
"main": "dist_ts/index.js",

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartscaf',
version: '4.0.19',
version: '4.0.21',
description: 'A project aimed at quickly scaffolding projects with support for TypeScript, smart file handling, and template rendering.'
}

View File

@@ -134,6 +134,50 @@ export class ScafTemplate {
}
}
/**
* Renders all template files in memory without writing to disk or running scripts.
* Returns new SmartFile instances — does not mutate the original templateSmartfileArray.
*/
public async renderToMemory(): Promise<plugins.smartfile.SmartFile[]> {
const renderedFiles: plugins.smartfile.SmartFile[] = [];
for (const smartfile of this.templateSmartfileArray) {
if (smartfile.path === '.smartscaf.yml') {
continue;
}
// Render handlebars template
const template = await plugins.smarthbs.getTemplateForString(
smartfile.contents.toString(),
);
const renderedTemplateString = template(this.suppliedVariables);
// Handle frontmatter
const smartfmInstance = new plugins.smartfm.Smartfm({
fmType: 'yaml',
});
const parsedTemplate = smartfmInstance.parse(renderedTemplateString) as any;
// Determine final path (frontmatter fileName rename)
let finalPath = smartfile.path;
if (parsedTemplate.data.fileName) {
const oldFileName = plugins.path.parse(finalPath).base;
finalPath = finalPath.replace(new RegExp(oldFileName + '$'), parsedTemplate.data.fileName);
}
// Postprocess: convert {-{ back to {{
const finalContent = await plugins.smarthbs.postprocess(parsedTemplate.content);
renderedFiles.push(new plugins.smartfile.SmartFile({
path: finalPath,
contentBuffer: Buffer.from(finalContent),
base: smartfile.base,
}));
}
return renderedFiles;
}
/**
* writes a file to disk
* @param destinationDirArg