Skip to content

Commit

Permalink
Merge branch 'main' into feat/icon-alias-deprecation-reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
Karsa committed Mar 8, 2024
2 parents b9ea801 + bc1843f commit e98b58d
Show file tree
Hide file tree
Showing 15 changed files with 169 additions and 41 deletions.
19 changes: 19 additions & 0 deletions icons/briefcase-business.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"colebemis",
"csandman",
"ericfennis",
"karsa-mistmere"
],
"tags": [
"work",
"bag",
"baggage",
"folder",
"portfolio"
],
"categories": [
"transportation"
]
}
16 changes: 16 additions & 0 deletions icons/briefcase-business.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions icons/briefcase-medical.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"colebemis",
"csandman",
"ericfennis",
"karsa-mistmere"
],
"tags": [
"doctor",
"medicine",
"first aid"
],
"categories": [
"medical",
"transportation"
]
}
18 changes: 18 additions & 0 deletions icons/briefcase-medical.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions icons/briefcase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 17 additions & 1 deletion icons/circle-ellipsis.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,29 @@
"ericfennis"
],
"tags": [
"pending",
"ellipsis",
"et cetera",
"etc",
"loader",
"loading",
"progress",
"pending",
"throbber",
"menu",
"options",
"operator",
"code",
"spread",
"rest",
"",
"..."
],
"categories": [
"layout",
"development",
"shapes"
],
"aliases": [
"circle-ellipsis"
]
}
7 changes: 5 additions & 2 deletions icons/more-vertical.json → icons/ellipsis-vertical.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
"colebemis"
],
"tags": [
"ellipsis",
"menu",
"options"
"options",
"..."
],
"categories": [
"layout"
],
"aliases": [
"more-vertical"
]
}
File renamed without changes
16 changes: 10 additions & 6 deletions icons/more-horizontal.json → icons/ellipsis.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"colebemis"
],
"tags": [
"ellipsis",
"et cetera",
"etc",
"loader",
"loading",
"progress",
"pending",
"throbber",
"menu",
"options",
"loading",
"loader",
"throber",
"etc",
"et cetera",
"operator",
"code",
"coding",
Expand All @@ -23,5 +24,8 @@
"categories": [
"layout",
"development"
],
"aliases": [
"more-horizontal"
]
}
File renamed without changes
17 changes: 0 additions & 17 deletions icons/form-input.json

This file was deleted.

39 changes: 39 additions & 0 deletions icons/rectangle-ellipsis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "../icon.schema.json",
"contributors": [
"mittalyashu",
"ericfennis"
],
"tags": [
"login",
"password",
"authenticate",
"2fa",
"field",
"fill",
"ellipsis",
"et cetera",
"etc",
"loader",
"loading",
"progress",
"pending",
"throbber",
"menu",
"options",
"operator",
"code",
"spread",
"rest",
"",
"..."
],
"categories": [
"text",
"development",
"shapes"
],
"aliases": [
"form-input"
]
}
File renamed without changes
3 changes: 2 additions & 1 deletion scripts/writeIconDetails.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ import iconNode from '../iconNodes/${iconName}.node.json'
import metaData from '../../../../icons/${iconName}.json'
import releaseData from '../releaseMetadata/${iconName}.json'
const { tags, categories, contributors } = metaData
const { tags, categories, contributors, aliases } = metaData
const iconDetails = {
name: '${iconName}',
iconNode,
contributors,
tags,
categories,
aliases,
...releaseData,
}
Expand Down
35 changes: 23 additions & 12 deletions scripts/writeVercelOutput.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
import path from 'path';
import fs from 'fs';
// eslint-disable-next-line import/no-named-as-default, import/no-named-as-default-member
import getIconMetaData from '../tools/build-icons/utils/getIconMetaData.mjs';
import { getCurrentDirPath } from './helpers.mjs';

const currentDir = process.cwd();
const scriptDir = getCurrentDirPath(import.meta.url);

const iconMetaData = await getIconMetaData(path.resolve(scriptDir, '../icons'));

const iconAliasesRedirectRoutes = Object.entries(iconMetaData)
.filter(([, { aliases }]) => aliases?.length)
.map(([iconName, { aliases }]) => {
const aliasRouteMatches = aliases.join('|');

return {
src: `/icons/(${aliasRouteMatches})`,
status: 302,
headers: {
Location: `/icons/${iconName}`,
},
};
});

const vercelRouteConfig = {
version: 3,
Expand All @@ -15,21 +35,12 @@ const vercelRouteConfig = {
src: '(?<url>/api/.*)',
dest: '/__nitro?url=$url',
},
// {
// source: '/icon/:path*',
// destination: '/icons/:path*',
// permanent: true,
// },
// {
// src: '/(.*)',
// status: 404,
// dest: '/static/404.html',
// },
...iconAliasesRedirectRoutes,
],
};

const output = JSON.stringify(vercelRouteConfig, null, 2);

const vercelOutputJosn = path.resolve(currentDir, '.vercel/output/config.json');
const vercelOutputJSON = path.resolve(currentDir, '.vercel/output/config.json');

fs.writeFileSync(vercelOutputJosn, output, 'utf-8');
fs.writeFileSync(vercelOutputJSON, output, 'utf-8');

0 comments on commit e98b58d

Please sign in to comment.