feat: rating for dishes

This commit is contained in:
2023-07-18 14:24:15 +02:00
parent 2fe8275f2f
commit c9240f289e
21 changed files with 534 additions and 31 deletions

View File

@@ -27,6 +27,7 @@ const modifiedFont = fontkit.openSync(config.outputPath);
let success = true;
// eslint-disable-next-line unicorn/prefer-top-level-await
checkAll().then(() => {
console.log();
if (success) {

View File

@@ -12,21 +12,16 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import glob from 'glob';
import {glob} from 'glob';
import {readFileSync} from 'fs';
import {matchPropertyContent, matchTagProperties} from '../src/app/util/ion-icon/icon-match';
const globPromise = (pattern: string) =>
new Promise<string[]>((resolve, reject) =>
glob(pattern, (error, files) => (error ? reject(error) : resolve(files))),
);
/**
*
*/
export async function getUsedIconsHtml(glob = 'src/**/*.html'): Promise<Record<string, string[]>> {
export async function getUsedIconsHtml(pattern = 'src/**/*.html'): Promise<Record<string, string[]>> {
return Object.fromEntries(
(await globPromise(glob))
(await glob(pattern))
.map(file => [
file,
(readFileSync(file, 'utf8')
@@ -43,9 +38,9 @@ export async function getUsedIconsHtml(glob = 'src/**/*.html'): Promise<Record<s
/**
*
*/
export async function getUsedIconsTS(glob = 'src/**/*.ts'): Promise<Record<string, string[]>> {
export async function getUsedIconsTS(pattern = 'src/**/*.ts'): Promise<Record<string, string[]>> {
return Object.fromEntries(
(await globPromise(glob))
(await glob(pattern))
.map(file => [file, readFileSync(file, 'utf8').match(/(?<=Icon`)[\w-]+(?=`)/g) || []])
.filter(([, values]) => values.length > 0),
);

View File

@@ -115,6 +115,7 @@ async function minifyIconFont() {
);
}
// eslint-disable-next-line unicorn/prefer-top-level-await
minifyIconFont();
/**

View File

@@ -1,6 +1,7 @@
{
"extends": "../node_modules/@openstapps/configuration/tsconfig.json",
"extends": "@openstapps/tsconfig",
"compilerOptions": {
"lib": ["es2019"]
"module": "CommonJS",
"moduleResolution": "Node"
}
}