Skip to content

Commit 0340ae0

Browse files
committed
feat: 🎸 修复cdn问题 danni-cool/blog-edit@f99dfd8
1 parent a1652b2 commit 0340ae0

File tree

7 files changed

+63
-63
lines changed

7 files changed

+63
-63
lines changed

2019/09/05/G2实现大数据展示模块/index.html

+21-21
Large diffs are not rendered by default.

2021/09/09/基于多页项目的微前端改造/index.html

+20-20
Large diffs are not rendered by default.

2023/10/15/A Simple Install Test Between Npm, Yarn and Pnpm/index.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
<meta property="og:site_name" content="Danni.cool - Daniel&#39;s Blog">
2424
<meta property="og:description" content="Installation size and time between package managers, and some thoughts in Github Actions">
2525
<meta property="og:locale" content="en_US">
26-
<meta property="og:image" content="http://example.com/cdn.danni.cool/file/b3413585214fbe5e53f701d88cd8bdd3.jpg">
26+
<meta property="og:image" content="https://cdn.danni.cool/file/b3413585214fbe5e53f701d88cd8bdd3.jpg">
2727
<meta property="article:published_time" content="2023-10-15T16:00:00.000Z">
2828
<meta property="article:modified_time" content="2024-05-06T14:50:00.000Z">
2929
<meta property="article:author" content="Daniel Chan">
3030
<meta property="article:tag" content="Yarn">
3131
<meta property="article:tag" content="Pnpm">
3232
<meta property="article:tag" content="Github Actions">
3333
<meta name="twitter:card" content="summary_large_image">
34-
<meta name="twitter:image" content="http://example.com/cdn.danni.cool/file/b3413585214fbe5e53f701d88cd8bdd3.jpg">
34+
<meta name="twitter:image" content="https://cdn.danni.cool/file/b3413585214fbe5e53f701d88cd8bdd3.jpg">
3535

3636

3737
<meta name="referrer" content="no-referrer-when-downgrade">
@@ -265,7 +265,7 @@
265265

266266

267267
<div id="banner" class="banner" parallax=true
268-
style="background: url('/cdn.danni.cool/file/b3413585214fbe5e53f701d88cd8bdd3.jpg') no-repeat center center; background-size: cover;">
268+
style="background: url('https://cdn.danni.cool/file/b3413585214fbe5e53f701d88cd8bdd3.jpg') no-repeat center center; background-size: cover;">
269269
<div class="full-bg-img">
270270
<div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.5)">
271271
<div class="banner-text text-center fade-in-up">
@@ -374,10 +374,10 @@ <h1 id="A-Discussion-Of-Dockerfile"><a href="#A-Discussion-Of-Dockerfile" class=
374374
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs bash">FROM node:18-alpine<br><br>WORKDIR /app<br><br>COPY package.json pnpm-lock.yaml ./<br><br>RUN npm install -g pnpm &amp;&amp; pnpm install &amp;&amp; pnpm store prune &amp;&amp; npm uninstall pnpm -g<br></code></pre></td></tr></table></figure>
375375

376376

377-
<h1 id="Pnpm-Improves-Nothing"><a href="#Pnpm-Improves-Nothing" class="headerlink" title="Pnpm Improves Nothing?"></a>Pnpm Improves Nothing?</h1><p><img src="/cdn.danni.cool/file/7b31bc2ab1890888ba0a53199fafe44b.png" srcset="/img/loading.gif" lazyload alt="Untitled.png"></p>
377+
<h1 id="Pnpm-Improves-Nothing"><a href="#Pnpm-Improves-Nothing" class="headerlink" title="Pnpm Improves Nothing?"></a>Pnpm Improves Nothing?</h1><p><img src="https://cdn.danni.cool/file/7b31bc2ab1890888ba0a53199fafe44b.png" srcset="/img/loading.gif" lazyload alt="Untitled.png"></p>
378378
<p>We know, pnpm <strong>uses symbol links point to a global space to resolve the node_modules in every project</strong>, <strong>so that each project installs modules only once in specific version, that’s one of the advantages why pnpm takes little space and install node_modules so quick.</strong></p>
379379
<p>With the high expectation of pnpm’s magic, I found the docker build speed is almost unchanged in Github Actions. 🤨</p>
380-
<p><img src="/cdn.danni.cool/file/21ce41b0678696e994551a72f63a4409.jpg" srcset="/img/loading.gif" lazyload alt="Jietu20231206-154642.jpg"></p>
380+
<p><img src="https://cdn.danni.cool/file/21ce41b0678696e994551a72f63a4409.jpg" srcset="/img/loading.gif" lazyload alt="Jietu20231206-154642.jpg"></p>
381381
<p>Why was that? In Github Runner, each building task owns a new environment. it means whether to choose npm , yarn or pnpm , they all need to reinstall again. </p>
382382
<h1 id="Github-Actions-Cache"><a href="#Github-Actions-Cache" class="headerlink" title="Github Actions Cache"></a>Github Actions Cache</h1><p>If you install node_modules in Github Actions workflow, there comes a way to cache dependencies and build outputs 👉 <a target="_blank" rel="noopener" href="https://github.com/actions/cache">https://github.com/actions/cache</a>.</p>
383383
<p>What my workflow does is to build dockerfile, upload to dockerHub, and then push a release PR. The <code>npm install</code> step is only running in docker building progress. So this cache method is helpless.</p>
@@ -430,7 +430,7 @@ <h3 id="No-cache-and-no-lock-file"><a href="#No-cache-and-no-lock-file" class="h
430430
<h3 id="No-cache-but-with-lock-file"><a href="#No-cache-but-with-lock-file" class="headerlink" title="No cache but with lock file"></a>No cache but with lock file</h3><p>like the most common build scene, the installation time is roughly similar, but the size is still minimal via yarn installed, pnpm is at the bottom</p>
431431
<h3 id="Clear-cache-and-remove-package-manage"><a href="#Clear-cache-and-remove-package-manage" class="headerlink" title="Clear cache and remove package manage"></a>Clear cache and remove package manage</h3><p><strong>yarn</strong> is ahead over others in installation size, however, the node_modules that installed via pnpm comes an error when I try to launch my project. but I found it was my fault after I carefully debug the reason. </p>
432432
<p>I was tried to import the module called “<strong>file-box”</strong> which is not declared in the package.json**.** Actually, it’s a dependency of <a target="_blank" rel="noopener" href="https://github.com/wechaty/wechaty"><strong>Wechaty</strong></a>. </p>
433-
<p><img src="/cdn.danni.cool/file/18a602bd544140a79ea214530bb70ce9.png" srcset="/img/loading.gif" lazyload alt="Untitled.png"></p>
433+
<p><img src="https://cdn.danni.cool/file/18a602bd544140a79ea214530bb70ce9.png" srcset="/img/loading.gif" lazyload alt="Untitled.png"></p>
434434
<p><strong>Pnpm helped me find an potential issues, it called “</strong><a target="_blank" rel="noopener" href="https://broadcrunch.com/technology/computing/phantom-dependencies-in-nodejs-and-how-pnpm-prevents-them/"><strong>phantom dependencies</strong></a><strong>”.</strong></p>
435435
<p>Phantom dependencies is dangerous because it will cause error or crash if “Wechaty” don’t depends “file-box” anymore. Although it runs well in local dev.</p>
436436
<h1 id="Final-Thoughts"><a href="#Final-Thoughts" class="headerlink" title="Final Thoughts"></a><strong>Final Thoughts</strong></h1><ol>

2023/10/17/Fixed the broken search in nextjs-notion-starter-kit/index.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
<meta property="og:site_name" content="Danni.cool - Daniel&#39;s Blog">
2424
<meta property="og:description" content="If your nextjs-notion-starter-kit is v2.0.0 and broken in search">
2525
<meta property="og:locale" content="en_US">
26-
<meta property="og:image" content="http://example.com/cdn.danni.cool/file/00a39c743f39d5bb828f0f7bd5e20a1e.jpg">
26+
<meta property="og:image" content="https://cdn.danni.cool/file/00a39c743f39d5bb828f0f7bd5e20a1e.jpg">
2727
<meta property="article:published_time" content="2023-10-17T02:06:00.000Z">
2828
<meta property="article:modified_time" content="2024-05-07T01:45:00.000Z">
2929
<meta property="article:author" content="Daniel Chan">
3030
<meta property="article:tag" content="Next.js">
3131
<meta property="article:tag" content="Notion">
3232
<meta name="twitter:card" content="summary_large_image">
33-
<meta name="twitter:image" content="http://example.com/cdn.danni.cool/file/00a39c743f39d5bb828f0f7bd5e20a1e.jpg">
33+
<meta name="twitter:image" content="https://cdn.danni.cool/file/00a39c743f39d5bb828f0f7bd5e20a1e.jpg">
3434

3535

3636
<meta name="referrer" content="no-referrer-when-downgrade">
@@ -264,7 +264,7 @@
264264

265265

266266
<div id="banner" class="banner" parallax=true
267-
style="background: url('/cdn.danni.cool/file/00a39c743f39d5bb828f0f7bd5e20a1e.jpg') no-repeat center center; background-size: cover;">
267+
style="background: url('https://cdn.danni.cool/file/00a39c743f39d5bb828f0f7bd5e20a1e.jpg') no-repeat center center; background-size: cover;">
268268
<div class="full-bg-img">
269269
<div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.5)">
270270
<div class="banner-text text-center fade-in-up">
@@ -370,7 +370,7 @@ <h2 id="Reason"><a href="#Reason" class="headerlink" title="Reason"></a>Reason</
370370
<blockquote>
371371
<p>💡 As the pic shows, param <strong>sort</strong> turned <code>String</code> into an <code>Object</code>.</p>
372372
</blockquote>
373-
<p><img src="/cdn.danni.cool/file/8b232e71595cf51a7fb21bfca5717fa2.png" srcset="/img/loading.gif" lazyload alt="Untitled.png"></p>
373+
<p><img src="https://cdn.danni.cool/file/8b232e71595cf51a7fb21bfca5717fa2.png" srcset="/img/loading.gif" lazyload alt="Untitled.png"></p>
374374
<p>Although the guy @Armster15 fixed this problem in the Project’s dependency <a target="_blank" rel="noopener" href="https://github.com/NotionX/react-notion-x/compare/v6.16.0...v6.16.1"><code>react-notion-x@6.16.1</code></a> , but the <a target="_blank" rel="noopener" href="https://www.npmjs.com/package/notion-client">npm version</a> is still v6.16.0 until 17&#x2F;10&#x2F;2023.</p>
375375
<h2 id="Solve"><a href="#Solve" class="headerlink" title="Solve"></a>Solve</h2><p>We can not simply update the dependency version to solve this problem, I believe the author will fixed the issue in the future. but currently we need a hotfix. The way is quite simple:</p>
376376
<p>1.find a package called <code>patch-package</code> in npm, and install it.</p>
@@ -387,10 +387,10 @@ <h3 id="Download-The-Patch-File"><a href="#Download-The-Patch-File" class="heade
387387
</blockquote>
388388
<pre><code class="hljs">[file](https://drive.google.com/file/d/17AQFkbqJVH53DGIKYGZBHGTH1w6Rgpzu/view)
389389
</code></pre>
390-
<p><img src="/cdn.danni.cool/file/f4223b235e88ff84868b2d931cdd71bc.png" srcset="/img/loading.gif" lazyload alt="Untitled.png"></p>
390+
<p><img src="https://cdn.danni.cool/file/f4223b235e88ff84868b2d931cdd71bc.png" srcset="/img/loading.gif" lazyload alt="Untitled.png"></p>
391391
<p>4.Run <code>npm i --legacy-peer-deps</code> again**,** the patches will apply to the <code>node_modules</code>.</p>
392392
<p>5.Test the your project in development, it works.</p>
393-
<p><img src="/cdn.danni.cool/file/f49eb72349e81f6e06d1a21fb02c1db5.png" srcset="/img/loading.gif" lazyload alt="Untitled.png"></p>
393+
<p><img src="https://cdn.danni.cool/file/f49eb72349e81f6e06d1a21fb02c1db5.png" srcset="/img/loading.gif" lazyload alt="Untitled.png"></p>
394394

395395

396396
</div>

about/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
<meta property="og:locale" content="en_US">
2626
<meta property="og:image" content="http://example.com/img/alipay.png">
2727
<meta property="og:image" content="http://example.com/img/wechatpay.png">
28-
<meta property="article:published_time" content="2024-05-08T16:12:09.698Z">
29-
<meta property="article:modified_time" content="2024-05-08T16:12:09.698Z">
28+
<meta property="article:published_time" content="2024-05-08T16:17:07.397Z">
29+
<meta property="article:modified_time" content="2024-05-08T16:17:07.397Z">
3030
<meta property="article:author" content="Daniel Chan">
3131
<meta property="article:tag" content="front-end">
3232
<meta property="article:tag" content="javascript">

index.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295

296296
<div class="col-12 col-md-4 m-auto index-img">
297297
<a href="/2023/10/17/Fixed%20the%20broken%20search%20in%20nextjs-notion-starter-kit/" target="_self">
298-
<img src="/cdn.danni.cool/file/00a39c743f39d5bb828f0f7bd5e20a1e.jpg" srcset="/img/loading.gif" lazyload alt="Fixed the broken search in nextjs-notion-starter-kit">
298+
<img src="https://cdn.danni.cool/file/00a39c743f39d5bb828f0f7bd5e20a1e.jpg" srcset="/img/loading.gif" lazyload alt="Fixed the broken search in nextjs-notion-starter-kit">
299299
</a>
300300
</div>
301301

@@ -364,7 +364,7 @@ <h2 class="index-header">
364364

365365
<div class="col-12 col-md-4 m-auto index-img">
366366
<a href="/2023/10/15/A%20Simple%20Install%20Test%20Between%20Npm,%20Yarn%20and%20Pnpm/" target="_self">
367-
<img src="/cdn.danni.cool/file/b3413585214fbe5e53f701d88cd8bdd3.jpg" srcset="/img/loading.gif" lazyload alt="A Simple Install Test Between Npm, Yarn and Pnpm">
367+
<img src="https://cdn.danni.cool/file/b3413585214fbe5e53f701d88cd8bdd3.jpg" srcset="/img/loading.gif" lazyload alt="A Simple Install Test Between Npm, Yarn and Pnpm">
368368
</a>
369369
</div>
370370

@@ -435,7 +435,7 @@ <h2 class="index-header">
435435

436436
<div class="col-12 col-md-4 m-auto index-img">
437437
<a href="/2021/09/09/%E5%9F%BA%E4%BA%8E%E5%A4%9A%E9%A1%B5%E9%A1%B9%E7%9B%AE%E7%9A%84%E5%BE%AE%E5%89%8D%E7%AB%AF%E6%94%B9%E9%80%A0/" target="_self">
438-
<img src="/cdn.danni.cool/file/5cd81a818b6f486682136aa0ba70b440.jpg" srcset="/img/loading.gif" lazyload alt="基于多页项目的微前端改造">
438+
<img src="https://cdn.danni.cool/file/5cd81a818b6f486682136aa0ba70b440.jpg" srcset="/img/loading.gif" lazyload alt="基于多页项目的微前端改造">
439439
</a>
440440
</div>
441441

@@ -504,7 +504,7 @@ <h2 class="index-header">
504504

505505
<div class="col-12 col-md-4 m-auto index-img">
506506
<a href="/2019/09/05/G2%E5%AE%9E%E7%8E%B0%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%B1%95%E7%A4%BA%E6%A8%A1%E5%9D%97/" target="_self">
507-
<img src="/cdn.danni.cool/file/da30d0efd7373b2f8b5e0e19d4a1981c.jpg" srcset="/img/loading.gif" lazyload alt="G2实现大数据展示模块">
507+
<img src="https://cdn.danni.cool/file/da30d0efd7373b2f8b5e0e19d4a1981c.jpg" srcset="/img/loading.gif" lazyload alt="G2实现大数据展示模块">
508508
</a>
509509
</div>
510510

0 commit comments

Comments
 (0)