mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 00:52:55 +00:00
feat: rating for dishes
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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),
|
||||
);
|
||||
|
||||
@@ -115,6 +115,7 @@ async function minifyIconFont() {
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line unicorn/prefer-top-level-await
|
||||
minifyIconFont();
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "../node_modules/@openstapps/configuration/tsconfig.json",
|
||||
"extends": "@openstapps/tsconfig",
|
||||
"compilerOptions": {
|
||||
"lib": ["es2019"]
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "Node"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user