Skip to content

Commit

Permalink
feat: add and improve functions (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
clement-berard authored Jan 10, 2025
1 parent e1fa8f5 commit 76a3e23
Show file tree
Hide file tree
Showing 12 changed files with 632 additions and 227 deletions.
473 changes: 358 additions & 115 deletions README.md

Large diffs are not rendered by default.

82 changes: 48 additions & 34 deletions build-readme.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
import * as fs from 'node:fs';
import { alphabetical, title } from 'radash';
import { getFunctionsFromCategory, list } from './src/common/list';
import { list } from './src/common/list';

const allCategories = alphabetical(Object.keys(list), (f) => f);

const allFns = new Map<string, string[]>();
const sortByKey = (obj) => {
return Object.fromEntries(Object.entries(obj).sort((a, b) => a[0].localeCompare(b[0])));
};

for (const category of allCategories) {
const functions = getFunctionsFromCategory(category).map((v) => v.label);
const allCategories = alphabetical(Object.keys(list), (f) => f);

allFns.set(
title(category),
alphabetical(functions, (f) => f),
);
const finalFeatures = [];

for (const cat of allCategories) {
const catTitle = title(cat);
const catFns = sortByKey(list[cat]);
const finalCatFns = [];
for (const [key, value] of Object.entries(catFns)) {
finalCatFns.push({
name: title(key),
// @ts-ignore
description: value?.description || '',
});
}
finalFeatures.push({
title: catTitle,
finalCatFns,
});
}

const featurePart = `
## Features
${Array.from(allFns)
.map(([key, value]) => {
const _values = value
.filter((v) => v?.trim())
.map((v) => `- \`${v}\``)
.join('\n');
return `\n### ${key}\n\n${_values}`;
${finalFeatures
.map((cat) => {
return `\n### → ${cat.title}\n\n<hr>\n\n${cat.finalCatFns.map((v) => `― \`${v.name}\` \n\n ${v.description}`).join('\n\n')}`;
})
.join('\n')}`;
.join('\n')}
`;

const README = `
# node-red-contrib-ultimate-toolkit
Expand Down Expand Up @@ -62,36 +69,43 @@ A collection of utilities to help you build your Node-RED flows.
</a>
</p>
## Overview
## Overview 🔦
This package provides a set of utilities to help you build your Node-RED flows.
✨ Simplify and optimize your Node-RED flows with this versatile package! ✨
Convert, format, and manipulate your data with ease.
Effortlessly handle date formatting, math operations, data manipulation, and more—all **in a single node.**
Essentially based on [es-toolkit](https://es-toolkit.slash.page/) and [radash](https://radash-docs.vercel.app/docs/getting-started)
When needed, the following libraries were used sparingly:
- [es-toolkit](https://es-toolkit.slash.page/)
- [radash](https://radash-docs.vercel.app/docs/getting-started)
- [tempo](https://tempo.formkit.com/)
If native Node.js are available, they are used instead of the libraries.
Whenever possible, native Node.js methods take precedence for maximum efficiency.
**One node to rule them all!**
**One node to rule them all—streamline your flows like never before!**
![paring-config.png](docs/screenshot.png)
${featurePart}
## Performance
## Performance 🚀
All used libraries are treeshaked and included in the final bundle.
**No extra dependencies are added**
[Very small distribution](https://www.npmjs.com/package/@keload/node-red-contrib-ultimate-toolkit?activeTab=code) size < 30kb.
[Very small distribution](https://www.npmjs.com/package/@keload/node-red-contrib-ultimate-toolkit?activeTab=code) **size < 40kb**.
## Features ✨
${featurePart}
## Contributing & Developer Experience
This package is built using [node-red-dxp](https://www.npmjs.com/package/@keload/node-red-dxp), offering a blazing-fast and seamless way to develop Node-RED packages.
## Contributing
Written in **TypeScript**, the codebase is cleanly structured, ensuring maintainability and effortless scalability.
This package use [node-red-dxp](https://www.npmjs.com/package/@keload/node-red-dxp) to build the package.
A crazy fast and easy way to build Node-RED package.
We’re committed to keeping this node alive and thriving, making it a joy to evolve and improve over time. Whether it's refining existing features or adding new capabilities, contributing should always be an enjoyable experience.
Please feel free to contribute to this package by creating issues or pull requests.
Feel free to join the journey—create issues, submit pull requests, or share your ideas. Let’s build something incredible together!
## License
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@formkit/tempo": "^0.1.2",
"@keload/node-red-dxp": "1.17.0",
"@keload/node-red-dxp": "1.19.0",
"@release-it/conventional-changelog": "9.0.4",
"@types/jquery": "3.5.32",
"@types/jqueryui": "1.12.23",
Expand Down
Loading

0 comments on commit 76a3e23

Please sign in to comment.