From 43d3042088393e03a13ed257a97d34110d32ba50 Mon Sep 17 00:00:00 2001 From: abekoh Date: Sat, 20 Nov 2021 22:56:10 +0900 Subject: [PATCH 1/8] add vercel.json --- vercel.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 vercel.json diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..b89a697 --- /dev/null +++ b/vercel.json @@ -0,0 +1,7 @@ +{ + "functions": { + "pages/api/ogp-images/[postid]/index.ts": { + "includeFiles": "assets/**" + } + } +} From 16be0825175078563db71651bb3052c0c49ea95f Mon Sep 17 00:00:00 2001 From: abekoh Date: Sat, 20 Nov 2021 22:56:46 +0900 Subject: [PATCH 2/8] make assets --- {fonts => assets}/NotoSansJP-Black.otf | Bin {fonts => assets}/NotoSansJP-Bold.otf | Bin {fonts => assets}/NotoSansJP-Light.otf | Bin {fonts => assets}/NotoSansJP-Medium.otf | Bin {fonts => assets}/NotoSansJP-Regular.otf | Bin {fonts => assets}/NotoSansJP-Thin.otf | Bin {fonts => assets}/OFL.txt | 0 assets/logo.png | Bin 0 -> 4653 bytes 8 files changed, 0 insertions(+), 0 deletions(-) rename {fonts => assets}/NotoSansJP-Black.otf (100%) rename {fonts => assets}/NotoSansJP-Bold.otf (100%) rename {fonts => assets}/NotoSansJP-Light.otf (100%) rename {fonts => assets}/NotoSansJP-Medium.otf (100%) rename {fonts => assets}/NotoSansJP-Regular.otf (100%) rename {fonts => assets}/NotoSansJP-Thin.otf (100%) rename {fonts => assets}/OFL.txt (100%) create mode 100644 assets/logo.png diff --git a/fonts/NotoSansJP-Black.otf b/assets/NotoSansJP-Black.otf similarity index 100% rename from fonts/NotoSansJP-Black.otf rename to assets/NotoSansJP-Black.otf diff --git a/fonts/NotoSansJP-Bold.otf b/assets/NotoSansJP-Bold.otf similarity index 100% rename from fonts/NotoSansJP-Bold.otf rename to assets/NotoSansJP-Bold.otf diff --git a/fonts/NotoSansJP-Light.otf b/assets/NotoSansJP-Light.otf similarity index 100% rename from fonts/NotoSansJP-Light.otf rename to assets/NotoSansJP-Light.otf diff --git a/fonts/NotoSansJP-Medium.otf b/assets/NotoSansJP-Medium.otf similarity index 100% rename from fonts/NotoSansJP-Medium.otf rename to assets/NotoSansJP-Medium.otf diff --git a/fonts/NotoSansJP-Regular.otf b/assets/NotoSansJP-Regular.otf similarity index 100% rename from fonts/NotoSansJP-Regular.otf rename to assets/NotoSansJP-Regular.otf diff --git a/fonts/NotoSansJP-Thin.otf b/assets/NotoSansJP-Thin.otf similarity index 100% rename from fonts/NotoSansJP-Thin.otf rename to assets/NotoSansJP-Thin.otf diff --git a/fonts/OFL.txt b/assets/OFL.txt similarity index 100% rename from fonts/OFL.txt rename to assets/OFL.txt diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ec6040b3d2cd53afd90f218c0d10d8aec6076cf6 GIT binary patch literal 4653 zcmV+|64LF7P)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-saj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x;}6|_VV00000NkvXXu0mjf@&VQ$ literal 0 HcmV?d00001 From cc49dbcbc8260bba13cc55860e643542c6ecee4c Mon Sep 17 00:00:00 2001 From: abekoh Date: Sat, 20 Nov 2021 23:03:11 +0900 Subject: [PATCH 3/8] fix path --- src/pages/api/ogp-images/[postid]/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/api/ogp-images/[postid]/index.ts b/src/pages/api/ogp-images/[postid]/index.ts index e0396c7..9c54d88 100644 --- a/src/pages/api/ogp-images/[postid]/index.ts +++ b/src/pages/api/ogp-images/[postid]/index.ts @@ -26,7 +26,7 @@ const generateOgpImage = async ( // setup const canvas = createCanvas(width, height); const ctx = canvas.getContext('2d'); - registerFont(path.resolve('./fonts/NotoSansJP-Medium.otf'), { + registerFont(path.resolve('./assents/NotoSansJP-Medium.otf'), { family: 'Noto Sans JP', }); const fontFamilyName = "'Noto Sans JP'"; @@ -51,7 +51,7 @@ const generateOgpImage = async ( ); // logo - const logoImage = await loadImage(path.resolve('./public/logo.png')); + const logoImage = await loadImage(path.resolve('./assets/logo.png')); ctx.drawImage( logoImage, width - padding - margin - 380, From 5dd321c6637b7df0aef39b83e39c1376a6e6c1e0 Mon Sep 17 00:00:00 2001 From: abekoh Date: Sat, 20 Nov 2021 23:05:18 +0900 Subject: [PATCH 4/8] fix path --- src/pages/api/ogp-images/[postid]/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/api/ogp-images/[postid]/index.ts b/src/pages/api/ogp-images/[postid]/index.ts index 9c54d88..bdd291a 100644 --- a/src/pages/api/ogp-images/[postid]/index.ts +++ b/src/pages/api/ogp-images/[postid]/index.ts @@ -26,7 +26,7 @@ const generateOgpImage = async ( // setup const canvas = createCanvas(width, height); const ctx = canvas.getContext('2d'); - registerFont(path.resolve('./assents/NotoSansJP-Medium.otf'), { + registerFont(path.join(__dirname, 'assets', 'NotoSansJP-Medium.otf'), { family: 'Noto Sans JP', }); const fontFamilyName = "'Noto Sans JP'"; @@ -51,7 +51,7 @@ const generateOgpImage = async ( ); // logo - const logoImage = await loadImage(path.resolve('./assets/logo.png')); + const logoImage = await loadImage(path.join(__dirname, 'assets', 'logo.png')); ctx.drawImage( logoImage, width - padding - margin - 380, From 177726b55e7906f242d5f05c68d6659549e0d9a3 Mon Sep 17 00:00:00 2001 From: abekoh Date: Sat, 20 Nov 2021 23:13:14 +0900 Subject: [PATCH 5/8] update next --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 316dfd9..ae2893f 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "canvas": "^2.7.0", "jsonld": "^5.2.0", "moment": "^2.29.1", - "next": "11.1.1", + "next": "12.0.4", "prismjs": "^1.23.0", "react": "17.0.1", "react-dom": "17.0.1", From b9bf7775aa74497f7864a48623af1b0027f0a114 Mon Sep 17 00:00:00 2001 From: abekoh Date: Sat, 20 Nov 2021 23:13:47 +0900 Subject: [PATCH 6/8] update lock --- yarn.lock | 212 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 134 insertions(+), 78 deletions(-) diff --git a/yarn.lock b/yarn.lock index 342abe4..1e3e8c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1150,7 +1150,14 @@ pirates "^4.0.0" source-map-support "^0.5.16" -"@babel/runtime@7.15.3", "@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": +"@babel/runtime@7.15.4": + version "7.15.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.4.tgz#fd17d16bfdf878e6dd02d19753a39fa8a8d9c84a" + integrity sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw== + dependencies: + regenerator-runtime "^0.13.4" + +"@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": version "7.15.3" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.15.3.tgz#2e1c2880ca118e5b2f9988322bd8a7656a32502b" integrity sha512-OvwMLqNXkCXSz1kSm58sEsNuhqOx/fKpnUnKnFB5v8uDda5bLNEHNgKPvhDN6IU0LDcnHQ90LlJ0Q6jnyBSIBA== @@ -1814,25 +1821,25 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" -"@napi-rs/triples@^1.0.3": +"@napi-rs/triples@1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@napi-rs/triples/-/triples-1.0.3.tgz#76d6d0c3f4d16013c61e45dfca5ff1e6c31ae53c" integrity sha512-jDJTpta+P4p1NZTFVLHJ/TLFVYVcOqv6l8xwOeBKNPMgY/zDYH/YH7SJbvrr/h1RcS9GzbPcLKGzpuK9cV56UA== -"@next/env@11.1.1": - version "11.1.1" - resolved "https://registry.yarnpkg.com/@next/env/-/env-11.1.1.tgz#d403282accbe8795aa2341f0e02c2e8bfc92bfb0" - integrity sha512-UEAzlfKofotLmj9LIgNixAfXpRck9rt/1CU9Q4ZtNDueGBJQP3HUzPHlrLChltWY2TA5MOzDQGL82H0a3+i5Ag== +"@next/env@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/env/-/env-12.0.4.tgz#effe19526fa51ab2da1a39e594b80a257b3fa1c5" + integrity sha512-QtZ6X5c6Zqa7oWs5csEmZ7xy+gLdtRKKg02SOT5l0Ziea4P5IU8mSOCyNC4fZmXewcRVjpbY+yGqAAP7hJUfOA== -"@next/polyfill-module@11.1.1": - version "11.1.1" - resolved "https://registry.yarnpkg.com/@next/polyfill-module/-/polyfill-module-11.1.1.tgz#89d5a70685a52a0fad79f05a1f97a6b15cc727aa" - integrity sha512-9FyVSnz00WGdlLsgc2w1xL1Lm/Q25y6FYIyA+1WlJvT6LA2lbR78GKiHgedzUvrAatVGAcg/Og+d0d7B4tsJOg== +"@next/polyfill-module@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/polyfill-module/-/polyfill-module-12.0.4.tgz#ef4f4fd6d773ad655db1859ca71127e0c358af50" + integrity sha512-mk9yCDNpfXINTJKFTZNgwYs7eqRFpc5D/49O/fKB59blihyKl1GY1sZ0l7a2bn5l1X/WuaZzcIfqnrwkneqeaQ== -"@next/react-dev-overlay@11.1.1": - version "11.1.1" - resolved "https://registry.yarnpkg.com/@next/react-dev-overlay/-/react-dev-overlay-11.1.1.tgz#3cd99202a85412bada8ba9c8e3f4cf7c19294b24" - integrity sha512-CXc/A0DbSk5VXYu4+zr0fHm52Zh/LhPlLyVPEctJOZL64ccxkls5xGoXvgolJCku9L0pLjJzvdfAmhNLOp5dyw== +"@next/react-dev-overlay@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/react-dev-overlay/-/react-dev-overlay-12.0.4.tgz#c97113df84986233c62eed37382aab85a0ec006e" + integrity sha512-9O0lXyzv5goFSmDwq9Hp8JE+DcObvd+bTXvmGSSvYR91AlIoVlH8/PwATx8Rf5YEuqggn/XKR1hn2kBYcbcGnA== dependencies: "@babel/code-frame" "7.12.11" anser "1.4.9" @@ -1841,42 +1848,70 @@ css.escape "1.5.1" data-uri-to-buffer "3.0.1" platform "1.3.6" - shell-quote "1.7.2" + shell-quote "1.7.3" source-map "0.8.0-beta.0" stacktrace-parser "0.1.10" - strip-ansi "6.0.0" + strip-ansi "6.0.1" -"@next/react-refresh-utils@11.1.1": - version "11.1.1" - resolved "https://registry.yarnpkg.com/@next/react-refresh-utils/-/react-refresh-utils-11.1.1.tgz#8d1a5432a53c9f987503d5ab07d3241230afb33f" - integrity sha512-j186y+lWc8BHAuysAWvlOqO9Bp7E3BLK/d/Ju3W2sP5BCH5ZLyLG/p308zSy/O0MGTag0B038ZA1dCy/msouRQ== +"@next/react-refresh-utils@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/react-refresh-utils/-/react-refresh-utils-12.0.4.tgz#20d43626498c451f71bb0bb26c3f780ad90f5fd6" + integrity sha512-kNUDmpBaJ+8Lb8CtKNynRFF9oijCjUKKru6Ont+JKhti9//5dNFFIcuo607bJSH86un06OEK0TZUt5XWVlbkjw== -"@next/swc-darwin-arm64@11.1.1": - version "11.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-11.1.1.tgz#ea9a76bcff00945df29a81bc43b3b22dd0a6cb53" - integrity sha512-KyB0aLpfQ+B2dsyGYpkM0ZwK3PV0t4C4b9yjgQc1VoTVnIjzXdDPnNOuVvmD849ZNOHfj3x8e2rlbxkj0lPm3A== +"@next/swc-android-arm64@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.0.4.tgz#e3ad69d3aadbd1d3ff0768b4f02b66c3806aa6b2" + integrity sha512-6mXumia8ZPcy7bYu9kjItfWxrE6SFaJyqQDaFy9G9WrU9x3M1R1Yok8B2X1mboM8itD0tq+t3R/ebQEkkmevUw== -"@next/swc-darwin-x64@11.1.1": - version "11.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-11.1.1.tgz#95838e9116897ae734d02fdbbfa601b6f52adaf3" - integrity sha512-B3ZXgrGx0bQplbrk2oggPjKPPsmyg8Fl0PJLMTVQ+erQ8g1m5QzyS9P6tB3SiIZa180JgENuguTHlVK5qEj4UA== +"@next/swc-darwin-arm64@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.0.4.tgz#bc083ed3ad5e6971d2f374f38a7d8f3c46a6de0a" + integrity sha512-7WMen1qhF5JmjKD9S5IEgEoaPJOXyIZj/Nsqa8ZSWxdF5oogp3uYYbKb/rvMYoKzpIbjyoLH/OCM5lm5IFM4iw== -"@next/swc-linux-x64-gnu@11.1.1": - version "11.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-11.1.1.tgz#42c4973213a880977ebdfad01474217d7d71e8c2" - integrity sha512-qvZL7gSKF+E+GZ3L1XiTnE3cOh9rk0wkqimT/q+wwcZA4E720Lu4lrT79I3HPuj6i/JPgGvmNskcnYrDeaoFaw== +"@next/swc-darwin-x64@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.0.4.tgz#84855d4c9fef3b3a094c0f2424ae2b7e6dc29caa" + integrity sha512-PVgefMWjxP6CU1HQs39+Bfpjcue6qErJfvJ/+n2zimjLzyeQAmD6LM9f1lDSttW2LjKjasoxR5qkRNLVlqzlaA== -"@next/swc-win32-x64-msvc@11.1.1": - version "11.1.1" - resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-11.1.1.tgz#1ffcbd01a0155fa8558f7aefffea1066e9bebe74" - integrity sha512-jhnCiA1De1L+kA0gmHG1AJijHoxOcrETWziDWy8fcqSrM1NlC4aJ5Mnu6k0QMcM9MnmXTA4TQZOEv3kF7vhJUQ== +"@next/swc-linux-arm-gnueabihf@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.0.4.tgz#090156c4fc88d86ebc67df35e99daa97ddb232de" + integrity sha512-8xGQu3sJiIdriKiCux3jDJ9pwivELEg7z2zfW0CqmQMbKNB7qP9lc0pq6CxshtKyXRMczNWRMtQ3Cjwep+UvNg== -"@node-rs/helper@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@node-rs/helper/-/helper-1.2.1.tgz#e079b05f21ff4329d82c4e1f71c0290e4ecdc70c" - integrity sha512-R5wEmm8nbuQU0YGGmYVjEc0OHtYsuXdpRG+Ut/3wZ9XAvQWyThN08bTh2cBJgoZxHQUPtvRfeQuxcAgLuiBISg== - dependencies: - "@napi-rs/triples" "^1.0.3" +"@next/swc-linux-arm64-gnu@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.0.4.tgz#3ddda6eb703eda411b117d1974f08e028bb987ed" + integrity sha512-HhEWcBkqGr3E7SYLtN9VnYUGamAWaLcXawHN33Em0WP7gzXrBqz0iIJNH7uEzHDS6980EqU/rrkLyhCHrYSZgQ== + +"@next/swc-linux-arm64-musl@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.0.4.tgz#a17985b811166bb3598816009e5f025539827c21" + integrity sha512-oZyQ9wjtE7OX9RlnovP7izNx2AR/RzTuYWU4Ttim8ssABsipQSxSlfRaeb+Qi6jTc6k+lrPhjRfaZ+fGv/m2Ag== + +"@next/swc-linux-x64-gnu@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.0.4.tgz#46fa9f4a4d381d41c0fc75912810e72468b0fb49" + integrity sha512-aBuf78QzL93T59Lk9kEGfHcA+9SzYIH7dGon1nqVxtAd2iqicKYNVaVcb38VKeiIBXMSUHXTdu6Ee053ZCOmSw== + +"@next/swc-linux-x64-musl@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.0.4.tgz#5e07982c84df77ddad537f3abca7d0f52504fc08" + integrity sha512-yDgqUqL4H8M3Y0hv30ZyL9UvjnK4iXmD4I6iJz+XIHSRdA/VUiyKKoL7okf9hxr0mSxBtagbZ5A3qEoW/VliUQ== + +"@next/swc-win32-arm64-msvc@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.0.4.tgz#17705a3d20b35fddd2f61c4d2e491bbf6909e71a" + integrity sha512-evDUrEYsUo+PMHsedaymfZO98VwV9wNFzuWVCyKgqg6SD1ZRpzbpqYQY7aINIuqZVdIWZElBE6EM+oxaj7PuWQ== + +"@next/swc-win32-ia32-msvc@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.0.4.tgz#a2a6d5c09a07c62d3a6b5b6dbc4443b566b8385b" + integrity sha512-Lbmz0xlo8vW4EDWyzCfy3nGfqt7skqwxaERwe+vDVTBZ56mvJ5dsdyjqK24sxu4FFkWR7SaU4eNlHwZR+A3kTg== + +"@next/swc-win32-x64-msvc@12.0.4": + version "12.0.4" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.0.4.tgz#acb9ffb17118b797d8c76dd688dd0aec5fa65cd4" + integrity sha512-f+7WNIJOno5QEelrmob+3vN5EZJb3KCkOrnvUsQ0+LCCD0dIPIhCjeHAh3BGj9msGu8ijnXvD7JxVxE5V26cnQ== "@nodelib/fs.scandir@2.1.4": version "2.1.4" @@ -3395,6 +3430,11 @@ acorn-walk@^7.1.1, acorn-walk@^7.2.0: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" + integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== + acorn@^6.4.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" @@ -3530,6 +3570,11 @@ ansi-regex@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -3740,11 +3785,6 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -ast-types@0.13.2: - version "0.13.2" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.13.2.tgz#df39b677a911a83f3a049644fb74fdded23cea48" - integrity sha512-uWMHxJxtfj/1oZClOxDEV1sQ1HCDkA4MG8Gr69KKeBjEVH0R84WlejZ0y2DcwyBlpAEMltmVYkVgqfLFb2oyiA== - ast-types@^0.14.2: version "0.14.2" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.14.2.tgz#600b882df8583e3cd4f2df5fa20fa83759d4bdfd" @@ -5950,7 +5990,7 @@ event-target-shim@^5.0.0: resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== -events@^3.0.0: +events@3.3.0, events@^3.0.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== @@ -9077,13 +9117,6 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -native-url@0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/native-url/-/native-url-0.3.4.tgz#29c943172aed86c63cee62c8c04db7f5756661f8" - integrity sha512-6iM8R99ze45ivyH8vybJ7X0yekIcPf5GgLV5K0ENCbmRcaRIDoj37BC8iLEmaaBfqqb8enuZ5p0uhY+lVAbAcA== - dependencies: - querystring "^0.2.0" - native-url@^0.2.6: version "0.2.6" resolved "https://registry.yarnpkg.com/native-url/-/native-url-0.2.6.tgz#ca1258f5ace169c716ff44eccbddb674e10399ae" @@ -9120,20 +9153,20 @@ nested-error-stacks@^2.0.0, nested-error-stacks@^2.1.0: resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz#0fbdcf3e13fe4994781280524f8b96b0cdff9c61" integrity sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug== -next@11.1.1: - version "11.1.1" - resolved "https://registry.yarnpkg.com/next/-/next-11.1.1.tgz#ca15c6d6b4b4bf8c3e859f7fc4f9657ce59bcb63" - integrity sha512-vfLJDkwAHsZUho5R1K4w49nfYhftUMWNmeNSjCtulOvnRBuEFb7ROyRZOQk7f29rMz02eLQrPZ9yiAmPsexL2g== +next@12.0.4: + version "12.0.4" + resolved "https://registry.yarnpkg.com/next/-/next-12.0.4.tgz#096578b320f0faf0bd51798decb39aaf00052efe" + integrity sha512-1pvjcSZBm5OLoGmDhp4JwKwIE798WbqUNLuyU7w6a2jUkdWaxOYtkE/ROXQTi2pXHj7+6rm68AvhxROLX2NHQg== dependencies: - "@babel/runtime" "7.15.3" + "@babel/runtime" "7.15.4" "@hapi/accept" "5.0.2" - "@next/env" "11.1.1" - "@next/polyfill-module" "11.1.1" - "@next/react-dev-overlay" "11.1.1" - "@next/react-refresh-utils" "11.1.1" - "@node-rs/helper" "1.2.1" + "@napi-rs/triples" "1.0.3" + "@next/env" "12.0.4" + "@next/polyfill-module" "12.0.4" + "@next/react-dev-overlay" "12.0.4" + "@next/react-refresh-utils" "12.0.4" + acorn "8.5.0" assert "2.0.0" - ast-types "0.13.2" browserify-zlib "0.2.0" browserslist "4.16.6" buffer "5.6.0" @@ -9146,29 +9179,28 @@ next@11.1.1: domain-browser "4.19.0" encoding "0.1.13" etag "1.8.1" + events "3.3.0" find-cache-dir "3.3.1" get-orientation "1.1.2" https-browserify "1.0.0" image-size "1.0.0" jest-worker "27.0.0-next.5" - native-url "0.3.4" node-fetch "2.6.1" node-html-parser "1.4.9" - node-libs-browser "^2.2.1" os-browserify "0.3.0" p-limit "3.1.0" path-browserify "1.0.1" - pnp-webpack-plugin "1.6.4" postcss "8.2.15" process "0.11.10" querystring-es3 "0.2.1" raw-body "2.4.1" react-is "17.0.2" react-refresh "0.8.3" + regenerator-runtime "0.13.4" stream-browserify "3.0.0" stream-http "3.1.1" string_decoder "1.3.0" - styled-jsx "4.0.0" + styled-jsx "5.0.0-beta.3" timers-browserify "2.0.12" tty-browserify "0.0.1" use-subscription "1.5.1" @@ -9176,10 +9208,17 @@ next@11.1.1: vm-browserify "1.1.2" watchpack "2.1.1" optionalDependencies: - "@next/swc-darwin-arm64" "11.1.1" - "@next/swc-darwin-x64" "11.1.1" - "@next/swc-linux-x64-gnu" "11.1.1" - "@next/swc-win32-x64-msvc" "11.1.1" + "@next/swc-android-arm64" "12.0.4" + "@next/swc-darwin-arm64" "12.0.4" + "@next/swc-darwin-x64" "12.0.4" + "@next/swc-linux-arm-gnueabihf" "12.0.4" + "@next/swc-linux-arm64-gnu" "12.0.4" + "@next/swc-linux-arm64-musl" "12.0.4" + "@next/swc-linux-x64-gnu" "12.0.4" + "@next/swc-linux-x64-musl" "12.0.4" + "@next/swc-win32-arm64-msvc" "12.0.4" + "@next/swc-win32-ia32-msvc" "12.0.4" + "@next/swc-win32-x64-msvc" "12.0.4" nice-try@^1.0.4: version "1.0.5" @@ -10690,6 +10729,11 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== +regenerator-runtime@0.13.4: + version "0.13.4" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.4.tgz#e96bf612a3362d12bb69f7e8f74ffeab25c7ac91" + integrity sha512-plpwicqEzfEyTQohIKktWigcLzmNStMGwbOUbykx51/29Z3JOGYldaaNGK7ngNXV+UcoqvIMmloZ48Sr74sd+g== + regenerator-runtime@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" @@ -11250,6 +11294,11 @@ shell-quote@1.7.2: resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== +shell-quote@1.7.3: + version "1.7.3" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.3.tgz#aa40edac170445b9a431e17bb62c0b881b9c4123" + integrity sha512-Vpfqwm4EnqGdlsBFNmHhxhElJYrdfcxPThu+ryKS5J8L/fhAwLazFZtq+S+TWZ9ANj2piSQLGj6NQg+lKPmxrw== + shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" @@ -11702,6 +11751,13 @@ strip-ansi@6.0.0, strip-ansi@^6.0.0: dependencies: ansi-regex "^5.0.0" +strip-ansi@6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -11775,10 +11831,10 @@ style-to-object@0.3.0, style-to-object@^0.3.0: dependencies: inline-style-parser "0.1.1" -styled-jsx@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-4.0.0.tgz#f7b90e7889d0a4f4635f8d1ae9ac32f3acaedc57" - integrity sha512-2USeoWMoJ/Lx5s2y1PxuvLy/cz2Yrr8cTySV3ILHU1Vmaw1bnV7suKdblLPjnyhMD+qzN7B1SWyh4UZTARn/WA== +styled-jsx@5.0.0-beta.3: + version "5.0.0-beta.3" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.0-beta.3.tgz#400d16179b5dff10d5954ab8be27a9a1b7780dd2" + integrity sha512-HtDDGSFPvmjHIqWf9n8Oo54tAoY/DTplvlyOH2+YOtD80Sp31Ap8ffSmxhgk5EkUoJ7xepdXMGT650mSffWuRA== dependencies: "@babel/plugin-syntax-jsx" "7.14.5" "@babel/types" "7.15.0" From 1dba16a0c42adc756b689a54ec8ef9df2e6fc9a5 Mon Sep 17 00:00:00 2001 From: abekoh Date: Sat, 20 Nov 2021 23:15:56 +0900 Subject: [PATCH 7/8] fix path --- src/pages/api/ogp-images/[postid]/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/api/ogp-images/[postid]/index.ts b/src/pages/api/ogp-images/[postid]/index.ts index bdd291a..be85630 100644 --- a/src/pages/api/ogp-images/[postid]/index.ts +++ b/src/pages/api/ogp-images/[postid]/index.ts @@ -26,7 +26,7 @@ const generateOgpImage = async ( // setup const canvas = createCanvas(width, height); const ctx = canvas.getContext('2d'); - registerFont(path.join(__dirname, 'assets', 'NotoSansJP-Medium.otf'), { + registerFont(path.resolve(process.cwd(), 'assets', 'NotoSansJP-Medium.otf'), { family: 'Noto Sans JP', }); const fontFamilyName = "'Noto Sans JP'"; @@ -51,7 +51,9 @@ const generateOgpImage = async ( ); // logo - const logoImage = await loadImage(path.join(__dirname, 'assets', 'logo.png')); + const logoImage = await loadImage( + path.resolve(process.cwd(), 'assets', 'logo.png'), + ); ctx.drawImage( logoImage, width - padding - margin - 380, From 19917713de32a15f995935497308b68eac208901 Mon Sep 17 00:00:00 2001 From: abekoh Date: Sat, 20 Nov 2021 23:16:21 +0900 Subject: [PATCH 8/8] add outputFileTracing --- next.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/next.config.js b/next.config.js index 4e1ec08..fdfbbe4 100644 --- a/next.config.js +++ b/next.config.js @@ -20,4 +20,5 @@ module.exports = { }, ]; }, + outputFileTracing: true, };