diff --git a/.idea/frontmatter.iml b/.idea/frontmatter.iml index aede29d18..fb0b8a0ec 100644 --- a/.idea/frontmatter.iml +++ b/.idea/frontmatter.iml @@ -19,6 +19,7 @@ + diff --git a/packages/crypto-frontmatter/index.ts b/packages/crypto-frontmatter/index.ts index a37975920..dfcac2f01 100644 --- a/packages/crypto-frontmatter/index.ts +++ b/packages/crypto-frontmatter/index.ts @@ -9,7 +9,7 @@ export interface FrontmatterLink { export interface FrontmatterImage { type: string; - mine: string; + mime: string; size: { width: number; height: number; diff --git a/packages/crypto-frontmatter/index.unit.ts b/packages/crypto-frontmatter/index.unit.ts index a18855ef2..3c8492023 100644 --- a/packages/crypto-frontmatter/index.unit.ts +++ b/packages/crypto-frontmatter/index.unit.ts @@ -36,8 +36,8 @@ it('should getFrontmatter of eip155:1/erc20:0x00000000008943c65cAf789FFFCF953bE1 ], images: [ { - type: 'logo', - mine: 'image/png', + type: 'icon', + mime: 'image/png', size: { width: 512, height: 512, diff --git a/packages/crypto-frontmatter/turbo.json b/packages/crypto-frontmatter/turbo.json index 395acb73b..9bd277dd6 100644 --- a/packages/crypto-frontmatter/turbo.json +++ b/packages/crypto-frontmatter/turbo.json @@ -1,5 +1,5 @@ { - "$schema": "https://turborepo.org/schema.json", + "$schema": "https://turbo.build/schema.json", "extends": ["//"], "pipeline": { "build": { diff --git a/packages/turbo.json b/packages/turbo.json index bf3f3aec7..2ee0c1215 100644 --- a/packages/turbo.json +++ b/packages/turbo.json @@ -1,5 +1,5 @@ { - "$schema": "https://turborepo.org/schema.json", + "$schema": "https://turbo.build/schema.json", "extends": ["//"], "pipeline": { "build": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 78171b8eb..d6b213b40 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -800,19 +800,9 @@ packages: transitivePeerDependencies: - supports-color - /@eslint/js@8.53.0: - resolution: {integrity: sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: false - - /@eslint/js@8.54.0: - resolution: {integrity: sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /@eslint/js@8.54.0: resolution: {integrity: sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: false /@heroicons/react@2.0.18(react@18.2.0): resolution: {integrity: sha512-7TyMjRrZZMBPa+/5Y8lN0iyvUU/01PeMGX2+RE7cQWpEUIcb4QotzUObFkJDejj/HUH4qjP/eQ0gzzKs2f+6Yw==} diff --git a/turbo.json b/turbo.json index e8029f355..7b0b66ba0 100644 --- a/turbo.json +++ b/turbo.json @@ -1,5 +1,5 @@ { - "$schema": "https://turborepo.org/schema.json", + "$schema": "https://turbo.build/schema.json", "pipeline": { "clean": { "cache": false diff --git a/website/app/[caip2]/[slug]/AssetPage.tsx b/website/app/[caip2]/[slug]/AssetPage.tsx index cbc01ff47..0ba56ed5c 100644 --- a/website/app/[caip2]/[slug]/AssetPage.tsx +++ b/website/app/[caip2]/[slug]/AssetPage.tsx @@ -37,7 +37,7 @@ export async function generateMetadata(caip19: string): Promise { export async function Page(props: { caip19: string }): Promise { const frontmatter = await fetchFrontmatter(props.caip19); - const image = frontmatter.fields.images?.find((image) => image.type === 'logo'); + const image = frontmatter.fields.images?.find((image) => image.type === 'icon'); return (
diff --git a/website/turbo.json b/website/turbo.json index c52e46fd1..d94734e29 100644 --- a/website/turbo.json +++ b/website/turbo.json @@ -1,5 +1,5 @@ { - "$schema": "https://turborepo.org/schema.json", + "$schema": "https://turbo.build/schema.json", "extends": ["//"], "pipeline": { "mirror": { diff --git a/workspace/contented-config/index.mjs b/workspace/contented-config/index.mjs index 558cbc665..9d096f583 100644 --- a/workspace/contented-config/index.mjs +++ b/workspace/contented-config/index.mjs @@ -50,30 +50,47 @@ async function generateContentHash(filePath) { * @param fileId {string} * @param namespace {string} * @param filePath {string} - * @return {Promise<[{mine: string, path: string}]>} + * @return {Promise<[{mime: string, path: string}]>} */ async function computeImageField(fileId, namespace, filePath) { const reference = filePath.replace(/\/README\.md$/, ''); - const pngLogoPath = join('frontmatter', namespace, reference, 'logo.png'); - if (existsSync(pngLogoPath) === false) { - return []; - } - const size = imageSize(pngLogoPath); + async function computeAs({ type, from, ext, mime }) { + const pngLogoPath = join('frontmatter', namespace, reference, from); + if (existsSync(pngLogoPath) === false) { + return []; + } - const imagePath = (await generateContentHash(pngLogoPath)) + '.png'; - await copyFile(pngLogoPath, join(`_${namespace}`, imagePath)); + const size = imageSize(pngLogoPath); + const imagePath = (await generateContentHash(pngLogoPath)) + ext; + await copyFile(pngLogoPath, join(`_${namespace}`, imagePath)); - return [ - { - type: 'logo', - mine: 'image/png', - size: { - width: size.width, - height: size.height, + return [ + { + type: type, + mime: mime, + size: { + width: size.width, + height: size.height, + }, + path: imagePath, }, - path: imagePath, - }, + ]; + } + + return [ + ...(await computeAs({ + type: 'icon', + from: 'logo.png', + ext: '.png', + mime: 'image/png', + })), + ...(await computeAs({ + type: 'icon', + from: 'logo.svg', + ext: '.svg', + mime: 'image/svg+xml', + })), ]; } diff --git a/workspace/contented-config/turbo.json b/workspace/contented-config/turbo.json index 2f05429e5..45c3df8cb 100644 --- a/workspace/contented-config/turbo.json +++ b/workspace/contented-config/turbo.json @@ -1,5 +1,5 @@ { - "$schema": "https://turborepo.org/schema.json", + "$schema": "https://turbo.build/schema.json", "extends": ["//"], "pipeline": { "build": { diff --git a/workspace/eslint-config/index.js b/workspace/eslint-config/index.js index 9a0c0e966..f4e2ef3f8 100644 --- a/workspace/eslint-config/index.js +++ b/workspace/eslint-config/index.js @@ -1,6 +1,6 @@ module.exports = [ { - ignores: ['**/dist/*'], + ignores: ['**/*.js', '**/*.d.ts', '**/*.d.ts.map'], }, require('@eslint/js').configs.recommended, { diff --git a/workspace/sync-trustwallet-assets/turbo.json b/workspace/sync-trustwallet-assets/turbo.json index 55b4485ce..32a8af71e 100644 --- a/workspace/sync-trustwallet-assets/turbo.json +++ b/workspace/sync-trustwallet-assets/turbo.json @@ -1,5 +1,5 @@ { - "$schema": "https://turborepo.org/schema.json", + "$schema": "https://turbo.build/schema.json", "extends": ["//"], "pipeline": { "sync": {