forked from yamadashy/tech-blog-rss-feed
-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Maximum call stack size exceeded の修正の取り込み #2
Open
yamadashy
wants to merge
131
commits into
jser:main
Choose a base branch
from
yamadashy-sandbox:feature/merge-yamadashy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 129 commits
Commits
Show all changes
131 commits
Select commit
Hold shift + click to select a range
dd0f090
chore: fix typo
azu 5280979
add: 新規フィード追加
azu 7fc51d0
build(deps): bump ejs from 3.1.9 to 3.1.10
dependabot[bot] d8d7732
add: 新規フィード追加
azu 16bc150
Merge pull request #99 from azu/fix-typo
yamadashy f7d538b
Merge pull request #100 from azu/2024-04-30-add-feeds
yamadashy b7e7a20
Merge pull request #101 from yamadashy/dependabot/npm_and_yarn/ejs-3.…
yamadashy cf66eb3
update: フィード追加、社名変更
yamadashy 0a03978
chore(deps): update minor and patch dependencies
renovate[bot] 9cd3f08
chore(deps): update dependency renovate to v37.340.8
renovate[bot] 78c9eeb
chore(deps): update dependency renovate to v37.340.9
renovate[bot] 47382b3
chore(deps): update dependency renovate to v37.341.0
renovate[bot] e916019
chore(deps): update dependency renovate to v37.342.0
renovate[bot] 901bd45
Merge pull request #106 from yamadashy/renovate/minor-and-patch-depen…
yamadashy d62e4f5
feat: ESLint, yarn のアプデ
yamadashy defbd38
update: いくつかのnodeパッケージのメジャーバージョンアップデート
yamadashy e5310a7
Merge pull request #108 from yamadashy/feature/package-upgrade-major
yamadashy 38d25f9
update: renovate でmajorもPRを作成するように。automerge: false
yamadashy e330083
Merge pull request #109 from yamadashy/feature/renovate-major
yamadashy 8ecc907
chore(deps): update peaceiris/actions-gh-pages action to v4
renovate[bot] 24facd7
Merge pull request #110 from yamadashy/renovate/major-major-dependencies
yamadashy 6c84566
Revert "Merge pull request #110 from yamadashy/renovate/major-major-d…
yamadashy ba101ac
Revert "Merge pull request #109 from yamadashy/feature/renovate-major"
yamadashy f909f5e
Revert "Merge pull request #108 from yamadashy/feature/package-upgrad…
yamadashy 27b3c4a
chore(deps): update dependency renovate to v37.342.1
renovate[bot] c6fa6ae
feat: テストしやすいように改修 + テスト追加
yamadashy 99d459a
Merge pull request #111 from yamadashy/feature/feed-image-test
yamadashy 6d14f0a
chore(deps): update minor and patch dependencies
renovate[bot] fe8191f
chore(deps): update dependency renovate to v37.354.6
renovate[bot] c9203fc
Reapply "Merge pull request #108 from yamadashy/feature/package-upgra…
yamadashy 9791f54
Reapply "Merge pull request #109 from yamadashy/feature/renovate-major"
yamadashy 3b295f7
Reapply "Merge pull request #110 from yamadashy/renovate/major-major-…
yamadashy 7824476
fix: lint-fix実行
yamadashy 882faa8
update: google-apiアプデ
yamadashy 81a9237
fix: open-graph-scraperのアプデに伴うデグレを修正
yamadashy 6e0f264
Merge pull request #112 from yamadashy/feature/package-update
yamadashy 1aad2a6
chore(deps): update minor and patch dependencies
renovate[bot] 2d5ac55
feat: 画像の事前キャッシュ
yamadashy 168df26
fix: lint-fix
yamadashy 6c8dc06
Merge pull request #116 from yamadashy/feature/precache-image
yamadashy c94a0dd
chore(deps): update dependency renovate to v37.355.0
renovate[bot] 8b9c910
update: renovateのアプデが多すぎるので自動アプデから除外
yamadashy 2615b64
chore: renovateのPRにはdependenciesラベルをつける
yamadashy 86e12b6
add: 新規フィード追加 (GO Inc.)
anda3 bda8d29
Merge pull request #120 from anda3/new-blog-feed-goinc
yamadashy dd1b4d1
add: 新規フィード追加 PLAY,inc.
yellowsman 165e098
chore(deps): update minor and patch dependencies
renovate[bot] f6062c8
chore(deps): update minor and patch dependencies to v9.3.0
renovate[bot] f8e8249
Merge pull request #122 from yellowsman/new-blog-feed-play-developers…
yamadashy aaf5f65
chore(deps): update dependency fast-xml-parser to v4.4.0
renovate[bot] 65ac563
Merge pull request #125 from yamadashy/renovate/minor-and-patch-depen…
yamadashy 513ed75
chore(deps): update minor and patch dependencies
renovate[bot] 9458e72
chore(deps): update minor and patch dependencies
renovate[bot] d3d36fe
build(deps): bump pug from 3.0.2 to 3.0.3
dependabot[bot] b85b203
chore(deps): update dependency node to v20.14.0
renovate[bot] 115c135
Merge pull request #129 from yamadashy/dependabot/npm_and_yarn/pug-3.0.3
yamadashy 5223c2d
chore(deps): update dependency prettier to v3.3.0
renovate[bot] a8a8045
chore: renovateのPRにはrenovateラベルをつける
yamadashy bad5240
chore(deps): update dependency googleapis to v140
renovate[bot] 8a41df4
chore(deps): update minor and patch dependencies
renovate[bot] 52814dd
add: 新規フィード追加 (Suntory Wellness Limited.)
MasatoAoki14 1c7b022
chore(deps): update minor and patch dependencies
renovate[bot] 796af76
build(deps): bump braces from 3.0.2 to 3.0.3
dependabot[bot] 1455876
chore(deps): update yarn to v4.3.0
renovate[bot] 0458db0
Merge pull request #133 from MasatoAoki14/new-blog-feed-suntory-welln…
yamadashy 43c983d
Merge pull request #132 from yamadashy/renovate/major-major-dependencies
yamadashy 9bb1bd5
Merge pull request #136 from yamadashy/dependabot/npm_and_yarn/braces…
yamadashy 1d00225
build(deps): bump ws from 8.15.1 to 8.17.1
dependabot[bot] a432066
Merge pull request #137 from yamadashy/dependabot/npm_and_yarn/ws-8.17.1
yamadashy a980a4e
chore(deps): update minor and patch dependencies
renovate[bot] de705c9
Merge pull request #138 from yamadashy/renovate/minor-and-patch-depen…
yamadashy 4c7b08f
chore: repopack用のignoreと設定
yamadashy 2f8c1eb
update: feed更新
yamadashy 0a5af48
chore(deps): update minor and patch dependencies
renovate[bot] f75ff09
fix: ogs types
yamadashy 7bc4d61
Merge pull request #139 from yamadashy/renovate/minor-and-patch-depen…
yamadashy 18a9052
chore(deps): update dependency vitest to v2
renovate[bot] 384cbbd
Merge pull request #141 from yamadashy/renovate/major-major-dependencies
yamadashy c0f1431
chore: lintにtypeチェックもまとめる
yamadashy 5805d92
chroe: カバレッジ取れるように
yamadashy cca4b6d
Merge pull request #142 from yamadashy/feature/coverage
yamadashy a42cf40
feat: ファビコン表示
yamadashy 5fe6ae8
feat: icoの変換に対応
yamadashy 57e8de9
refactor: 使っていないimportの削除
yamadashy e7fd50a
Merge pull request #143 from yamadashy/feature/feed-favicon
yamadashy 4483c7f
chore(feed): フィード追加
yamadashy 40e5748
feat(feed): symbolによるフラグ管理をやめる
yamadashy ac5ab5b
feat(feed): フィードのURLをチェックする
yamadashy 1ce1fcf
chore(feed): フィード調整
yamadashy 0546f60
chore: Add funding
yamadashy 6423609
chore(deps): update minor and patch dependencies
renovate[bot] 4381a0e
chore(deps): update dependency @types/eslint to v9
renovate[bot] be1aea5
chore(deps): update minor and patch dependencies to v9.8.0
renovate[bot] 5e18e04
chore(deps): update dependency fast-xml-parser to v4.4.1
renovate[bot] 00ab585
Merge pull request #145 from yamadashy/renovate/major-major-dependencies
yamadashy 2d8bc35
chore(deps): update dependency @types/node to v20.14.13
renovate[bot] e29f71b
chore(ci): renovateの対象からnodeをはずす
yamadashy 7922909
update: フィード調整
yamadashy b369b13
chore(deps): update minor and patch dependencies
renovate[bot] 4e84e10
Merge pull request #150 from yamadashy/renovate/minor-and-patch-depen…
yamadashy 8d16f8c
chore(deps): update major dependencies to v8
renovate[bot] a18d35c
fix: eslint error
yamadashy 75dd5f6
Merge pull request #151 from yamadashy/renovate/major-major-dependencies
yamadashy 27989b1
build(deps): bump fast-xml-parser from 4.2.5 to 4.4.1
dependabot[bot] 6594bf1
fix: lock
yamadashy 05360c7
Merge pull request #149 from yamadashy/dependabot/npm_and_yarn/fast-x…
yamadashy 3b2a3be
update: フィード追加
yamadashy 21a9fd1
chore(11ty): configをtsにする
yamadashy 1585aaa
Merge pull request #152 from yamadashy/chore/config-ts
yamadashy e13c151
chore(deps): update dependency axios to v1.7.4 [security]
renovate[bot] 447d045
chore(deps): update dependency googleapis to v142
renovate[bot] 2f4cc63
Merge pull request #155 from yamadashy/renovate/major-major-dependencies
yamadashy dbb3caa
chore(deps): update minor and patch dependencies
renovate[bot] ce81e8b
Merge pull request #154 from yamadashy/renovate/minor-and-patch-depen…
yamadashy c9b4a33
chore(deps): update minor and patch dependencies
renovate[bot] 5412ba6
build(deps): bump micromatch from 4.0.5 to 4.0.8
dependabot[bot] f20dca8
chore(deps): update minor and patch dependencies to v9.9.1
renovate[bot] c7bb54f
Merge pull request #158 from yamadashy/dependabot/npm_and_yarn/microm…
yamadashy f24c561
fix(feed): 一部のフィードでMaximum call stack size exceededが発生する
yamadashy 1d4399a
Merge pull request #161 from yamadashy/fix/empty-og-image
yamadashy 9e01c80
Merge remote-tracking branch 'yamadashy/main' into feature/merge-yama…
yamadashy fa7c90c
feat(11ty): data画像ならそのまま表示
yamadashy b45ddac
Merge branch 'feature/11ty'
yamadashy afc95c1
Merge remote-tracking branch 'yamadashy/main' into feature/merge-yama…
yamadashy bee9831
feat(feed): フィード生成コマンドのエラーハンドリング
yamadashy e2371f2
Merge pull request #163 from yamadashy/feature/error-handling
yamadashy 319dff6
chore(deps): update yarn to v4.4.1
renovate[bot] b24705c
Merge pull request #162 from yamadashy/renovate/minor-and-patch-depen…
yamadashy b2ed48a
Merge remote-tracking branch 'yamadashy/main' into feature/merge-yama…
yamadashy 2d53e71
chore: repopackはいらない
yamadashy d6b8db8
Merge remote-tracking branch 'yamadashy/main' into feature/merge-yama…
yamadashy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: yamadashy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,3 +302,4 @@ public/ | |
storage/ | ||
src/site/feeds/ | ||
src/site/blog-feeds/ | ||
repopack-output.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
20.12.2 | ||
20.16.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
nodejs 20.12.2 | ||
nodejs 20.16.0 |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
compressionLevel: mixed | ||
|
||
enableGlobalCache: false | ||
|
||
nodeLinker: node-modules | ||
|
||
yarnPath: .yarn/releases/yarn-3.8.1.cjs | ||
yarnPath: .yarn/releases/yarn-4.4.1.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
import htmlmin from 'html-minifier-terser'; | ||
import EleventyImage from '@11ty/eleventy-img'; | ||
import EleventyFetch from "@11ty/eleventy-fetch"; | ||
import path from 'path'; | ||
import ts from 'typescript'; | ||
import { imageCacheOptions } from './src/common/eleventy-cache-option'; | ||
import CleanCSS from "clean-css"; | ||
import sharpIco, {ImageData} from "sharp-ico"; | ||
import url from 'url'; | ||
import Eleventy from '@11ty/eleventy'; | ||
|
||
const ELEVENTY_FETCH_CONCURRENCY = 50; | ||
|
||
EleventyImage.concurrency = ELEVENTY_FETCH_CONCURRENCY; | ||
|
||
const minifyHtmlTransform = (content: string, outputPath: string) => { | ||
if(outputPath && outputPath.endsWith('.html')) { | ||
return htmlmin.minify(content, { | ||
// オプション参考: https://github.com/terser/html-minifier-terser#options-quick-reference | ||
useShortDoctype: true, | ||
removeComments: true, | ||
collapseWhitespace: true, | ||
minifyCSS: true, | ||
minifyJS: true, | ||
maxLineLength: 1000 | ||
}); | ||
} | ||
|
||
return content; | ||
} | ||
|
||
const imageThumbnailShortcode = async (src: string, alt: string, pathPrefix: string = '') => { | ||
// 取れなければ代替画像 | ||
const alternativeImageTag = `<img src='${pathPrefix}images/alternate-feed-image.png' alt='${alt}' loading='lazy' width='256' height='256'>`; | ||
|
||
if (!src) { | ||
return alternativeImageTag; | ||
} | ||
|
||
let metadata: EleventyImage.Metadata; | ||
|
||
try { | ||
metadata = await EleventyImage(src, { | ||
widths: [150, 450], | ||
formats: ["webp", "jpeg"], | ||
outputDir: 'public/images/feed-thumbnails', | ||
urlPath: `${pathPrefix}images/feed-thumbnails/`, | ||
cacheOptions: imageCacheOptions, | ||
sharpWebpOptions: { | ||
quality: 50, | ||
}, | ||
sharpJpegOptions: { | ||
quality: 70, | ||
} | ||
}); | ||
} catch { | ||
// エラーが起きたら代替画像にする | ||
console.log('[image-thumbnail-short-code] error', src); | ||
return alternativeImageTag; | ||
} | ||
|
||
return EleventyImage.generateHTML(metadata, { | ||
alt, | ||
sizes: '100vw', | ||
loading: 'lazy', | ||
decoding: 'async', | ||
}); | ||
} | ||
|
||
const imageIconShortcode = async (src: string, alt: string, pathPrefix: string = '') => { | ||
// 取れなければ画像なし | ||
const alternativeImageTag = ``; | ||
|
||
if (!src) { | ||
return alternativeImageTag; | ||
} | ||
|
||
if (src.startsWith('data:')) { | ||
return `<img src='${src}' alt='${alt}' loading='lazy' width='16' height='16'>`; | ||
} | ||
|
||
const parsedUrl = url.parse(src); | ||
const fileName = path.basename(parsedUrl.pathname || ''); | ||
const fileExtension = path.extname(fileName).toLowerCase(); | ||
let imageSrc: EleventyImage.ImageSource = src; | ||
let metadata: EleventyImage.Metadata; | ||
|
||
if (fileExtension === '.ico') { | ||
try { | ||
const icoBuffer = await EleventyFetch(src, { | ||
type: 'buffer', | ||
duration: imageCacheOptions.duration, | ||
concurrency: ELEVENTY_FETCH_CONCURRENCY, | ||
}); | ||
const sharpIcoImages = await sharpIco.sharpsFromIco(icoBuffer, {}, true) as ImageData[]; | ||
const sharpIcoImage = sharpIcoImages.sort((a, b) => b.width - a.width)[0]; | ||
if (sharpIcoImage.image) { | ||
imageSrc = await sharpIcoImage.image.png().toBuffer(); | ||
} | ||
} catch (error) { | ||
console.error('[image-icon-short-code] Error processing ICO:', src, error); | ||
return alternativeImageTag; | ||
} | ||
} | ||
|
||
try { | ||
metadata = await EleventyImage(imageSrc, { | ||
widths: [16], | ||
formats: ["png"], | ||
outputDir: 'public/images/feed-icons', | ||
urlPath: `${pathPrefix}images/feed-icons/`, | ||
cacheOptions: imageCacheOptions, | ||
sharpPngOptions: { | ||
quality: 50, | ||
} | ||
}); | ||
} catch (error) { | ||
// エラーが起きたら画像なし | ||
console.log('[image-icon-short-code] Error processing image', src, error); | ||
return `` | ||
} | ||
|
||
return EleventyImage.generateHTML(metadata, { | ||
alt, | ||
loading: 'lazy', | ||
decoding: 'async', | ||
}); | ||
} | ||
|
||
const relativeUrlFilter = (url: string) => { | ||
const relativeUrl = path.relative(url, '/'); | ||
return relativeUrl === '' ? './' : `${relativeUrl}/`; | ||
} | ||
|
||
const minifyCssFilter = (css: string) => { | ||
return new CleanCSS({}).minify(css).styles; | ||
} | ||
|
||
const supportTypeScriptTemplate = (eleventyConfig: Eleventy.UserConfig) => { | ||
eleventyConfig.addTemplateFormats('ts'); | ||
eleventyConfig.addExtension('ts', { | ||
outputFileExtension: 'js', | ||
compile: async (inputContent: string) => { | ||
return async () => { | ||
const result = ts.transpileModule(inputContent, { compilerOptions: { module: ts.ModuleKind.CommonJS }}); | ||
return result.outputText; | ||
} | ||
} | ||
}); | ||
} | ||
|
||
module.exports = function (eleventyConfig: Eleventy.UserConfig) { | ||
// static assets | ||
eleventyConfig.addPassthroughCopy('src/site/images'); | ||
eleventyConfig.addPassthroughCopy('src/site/feeds'); | ||
|
||
// images | ||
eleventyConfig.addNunjucksAsyncShortcode('imageThumbnail', imageThumbnailShortcode); | ||
eleventyConfig.addNunjucksAsyncShortcode('imageIcon', imageIconShortcode); | ||
|
||
// minify html | ||
eleventyConfig.addTransform('minify html', minifyHtmlTransform); | ||
|
||
// relative path | ||
eleventyConfig.addFilter("relativeUrl", relativeUrlFilter); | ||
|
||
// minify css | ||
eleventyConfig.addFilter("minifyCss", minifyCssFilter); | ||
|
||
// TypeScript | ||
supportTypeScriptTemplate(eleventyConfig); | ||
|
||
// TODO: _data も TypeScript 対応したい | ||
// @see https://github.com/11ty/eleventy/discussions/1835 | ||
|
||
return { | ||
htmlTemplateEngine: 'njk', | ||
|
||
dir: { | ||
input: 'src/site', | ||
output: 'public' | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tsに移行してます。