Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e11d0920bb | |||
| eec36e2e45 | |||
| 8e692b994e | |||
| 0ba0a9abbb | |||
| 2828b2eaf0 | |||
| 4d0c97f948 | |||
| 9b31263a32 | |||
| 967b103e01 |
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"@git.zone/cli": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "code.foss.global",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "smartfm",
|
||||
"shortDescription": "frontmatter parser utilities",
|
||||
"description": "A Node.js module for handling and processing frontmatter in markdown and text files, leveraging the gray-matter library for parsing and stringifying YAML or JSON formatted frontmatter.",
|
||||
"npmPackagename": "@push.rocks/smartfm",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"frontmatter",
|
||||
"markdown",
|
||||
"text files",
|
||||
"YAML",
|
||||
"JSON",
|
||||
"stringify",
|
||||
"parse",
|
||||
"commented sections",
|
||||
"static site generator",
|
||||
"CMS",
|
||||
"content metadata",
|
||||
"metadata management",
|
||||
"gray-matter"
|
||||
]
|
||||
},
|
||||
"release": {
|
||||
"registries": [
|
||||
"https://verdaccio.lossless.digital",
|
||||
"https://registry.npmjs.org"
|
||||
],
|
||||
"accessLevel": "public"
|
||||
}
|
||||
},
|
||||
"@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": {
|
||||
"npmGlobalTools": [],
|
||||
"npmRegistryUrl": "registry.npmjs.org"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,31 @@
|
||||
# Changelog
|
||||
|
||||
## 2026-05-01 - 2.2.3 - fix(build)
|
||||
modernize project configuration and test setup for current toolchain compatibility
|
||||
|
||||
- migrate npmextra metadata to scoped tool configuration and add .smartconfig.json
|
||||
- update build, test, and formatting scripts alongside TypeScript compiler settings
|
||||
- refresh development dependencies and gray-matter patch version
|
||||
- rename the test entrypoint to test.node.ts and align imports with the new tstest tapbundle path
|
||||
- add explicit return and parameter types to Smartfm methods to satisfy stricter TypeScript settings
|
||||
|
||||
## 2025-01-24 - 2.2.2 - fix(package)
|
||||
Fix export path in package.json
|
||||
|
||||
- Corrected the export path from './dist/index.js' to './dist_ts/index.js' in package.json
|
||||
|
||||
## 2025-01-24 - 2.2.1 - fix(documentation)
|
||||
Remove unnecessary markdown syntax from the README.
|
||||
|
||||
- Fixed minor formatting issue in the README file by removing extraneous markdown syntax.
|
||||
|
||||
## 2025-01-24 - 2.2.0 - feat(core)
|
||||
Initial release of smartfm module for handling frontmatter
|
||||
|
||||
- Added Smartfm class to handle YAML and JSON frontmatter
|
||||
- Implemented methods for parsing and stringifying frontmatter
|
||||
- Included support for parseFromComments to handle commented out frontmatter
|
||||
|
||||
## 2025-01-24 - 2.1.2 - fix(documentation)
|
||||
Updated readme.md to add comprehensive examples and advanced use cases.
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2026 Task Venture Capital GmbH <hello@task.vc>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+15
-7
@@ -1,14 +1,11 @@
|
||||
{
|
||||
"npmci": {
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"gitzone": {
|
||||
"@git.zone/cli": {
|
||||
"projectType": "npm",
|
||||
"module": {
|
||||
"githost": "code.foss.global",
|
||||
"gitscope": "push.rocks",
|
||||
"gitrepo": "smartfm",
|
||||
"shortDescription": "frontmatter parser utilities",
|
||||
"description": "A Node.js module for handling and processing frontmatter in markdown and text files, leveraging the gray-matter library for parsing and stringifying YAML or JSON formatted frontmatter.",
|
||||
"npmPackagename": "@push.rocks/smartfm",
|
||||
"license": "MIT",
|
||||
@@ -27,9 +24,20 @@
|
||||
"metadata management",
|
||||
"gray-matter"
|
||||
]
|
||||
},
|
||||
"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": {
|
||||
"npmGlobalTools": [],
|
||||
"npmRegistryUrl": "registry.npmjs.org"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
-11
@@ -1,15 +1,16 @@
|
||||
{
|
||||
"name": "@push.rocks/smartfm",
|
||||
"version": "2.1.2",
|
||||
"version": "2.2.3",
|
||||
"private": false,
|
||||
"description": "A Node.js module for handling and processing frontmatter in markdown and text files, leveraging the gray-matter library for parsing and stringifying YAML or JSON formatted frontmatter.",
|
||||
"exports": {
|
||||
".": "./dist/index.js"
|
||||
".": "./dist_ts/index.js"
|
||||
},
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "(tstest test/)",
|
||||
"build": "tsbuild tsfolders --allowimplicitany",
|
||||
"test": "tstest test/",
|
||||
"format": "gitzone format",
|
||||
"build": "tsbuild tsfolders",
|
||||
"buildDocs": "tsdoc"
|
||||
},
|
||||
"repository": {
|
||||
@@ -31,21 +32,20 @@
|
||||
"metadata management",
|
||||
"gray-matter"
|
||||
],
|
||||
"author": "Lossless GmbH",
|
||||
"author": "Task Venture Capital GmbH <hello@task.vc>",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://code.foss.global/push.rocks/smartfm/issues"
|
||||
},
|
||||
"homepage": "https://code.foss.global/push.rocks/smartfm#readme",
|
||||
"dependencies": {
|
||||
"gray-matter": "^4.0.2"
|
||||
"gray-matter": "^4.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@git.zone/tsbuild": "^2.1.17",
|
||||
"@git.zone/tsrun": "^1.2.8",
|
||||
"@git.zone/tstest": "^1.0.24",
|
||||
"@push.rocks/tapbundle": "^5.5.6",
|
||||
"@types/node": "^12.7.4"
|
||||
"@git.zone/tsbuild": "^4.4.0",
|
||||
"@git.zone/tsrun": "^2.0.3",
|
||||
"@git.zone/tstest": "^3.6.3",
|
||||
"@types/node": "^25.6.0"
|
||||
},
|
||||
"files": [
|
||||
"ts/**/*",
|
||||
@@ -56,6 +56,8 @@
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"cli.js",
|
||||
".smartconfig.json",
|
||||
"license",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
]
|
||||
|
||||
Generated
+3884
-5657
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,3 @@
|
||||
```markdown
|
||||
# @push.rocks/smartfm
|
||||
|
||||
The `@push.rocks/smartfm` module handles frontmatter data in markdown and other text files. The module allows easy parsing, stringification, and extraction of frontmatter data, using YAML or JSON format. It leverages the `gray-matter` library for advanced functionality with a simple API.
|
||||
@@ -188,7 +187,6 @@ By combining `@push.rocks/smartfm` with a markdown parsing library like `marked`
|
||||
With these examples, you can see how `@push.rocks/smartfm` fits into various workflows involving frontmatter and text processing. The module's simplicity and effectiveness make it a suitable choice for projects that require clean handling of document metadata.
|
||||
|
||||
Feel free to explore and extend these examples based on your particular use case. Whether you are building a simple script, a web application, or an extensive content management system, `@push.rocks/smartfm` provides a robust foundation for frontmatter operations. Happy coding!
|
||||
```
|
||||
|
||||
## License and Legal Information
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { tap, expect } from '@push.rocks/tapbundle';
|
||||
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
||||
|
||||
import * as smartfm from '../ts/index.js';
|
||||
|
||||
@@ -42,4 +42,4 @@ really
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
export default tap.start();
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartfm',
|
||||
version: '2.1.2',
|
||||
version: '2.2.3',
|
||||
description: 'A Node.js module for handling and processing frontmatter in markdown and text files, leveraging the gray-matter library for parsing and stringifying YAML or JSON formatted frontmatter.'
|
||||
}
|
||||
|
||||
+4
-4
@@ -19,22 +19,22 @@ export class Smartfm {
|
||||
/**
|
||||
* add frontmatter to a string
|
||||
*/
|
||||
stringify(bodyString: string, frontmatterData: any) {
|
||||
stringify(bodyString: string, frontmatterData: Record<string, unknown>): string {
|
||||
return grayMatter.stringify(bodyString, frontmatterData);
|
||||
}
|
||||
|
||||
/**
|
||||
* parse a string that has frontmatter attached, YAML notation
|
||||
*/
|
||||
parse(stringToParse: string) {
|
||||
parse(stringToParse: string): grayMatter.GrayMatterFile<string> {
|
||||
return grayMatter(stringToParse);
|
||||
}
|
||||
|
||||
/**
|
||||
* parse from comments
|
||||
*/
|
||||
parseFromComments(commentStart: string, stringToParse: string) {
|
||||
const diffFunc = (diffMe, diffBy) => diffMe.split(diffBy).join('');
|
||||
parseFromComments(commentStart: string, stringToParse: string): grayMatter.GrayMatterFile<string> {
|
||||
const diffFunc = (diffMe: string, diffBy: string): string => diffMe.split(diffBy).join('');
|
||||
let lines = stringToParse.split('\n');
|
||||
lines = lines.map((line) => {
|
||||
return diffFunc(line, commentStart);
|
||||
|
||||
+4
-6
@@ -6,12 +6,10 @@
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"noImplicitAny": true,
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {}
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
"exclude": ["dist_*/**/*.d.ts"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user