Skip to main content

brew 坏掉了

· 2 min read

为了体验下 swiftUI,要下载最新的 XCode,下载最新的 XCode 需要更新最新的系统,更新完了以后今天发现 brew 跪了。 报错提示如下:

Error:
homebrew-core is a shallow clone.
To `brew update`, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!

不要相信它的提示,因为操作下来发现并不管用,后来搜了大概了解 brew 在本地是有两个项目文件夹,一个是 homebrew-core,一个是 homebrew-cask,这两个已经不可用,至于为啥不晓得,即便进入这俩的文件夹,进行 git fetch 和 git pull 升级到最新也无效。最后索性将这两个文件夹直接删掉,重新升级:

cd /usr/local/Homebrew/Library/Taps/homebrew
rm -rf homebrew-core homebrew-cask
brew upgrade

npm包的设计

· 2 min read

设计一个 npm 包经常要考虑要不要分包,比如早期将项目中的各个包分开:reports、interface、log、request 等,各司其职。后来由于业务互相耦合的很厉害,所以又将这些包合并成一个包,现在就将 reports、interface、request 合并成为了一个 interface 包。

在整理 laya 库的时候发现早期一直想分离一个@pawgame 的库,给纯粹的 es6 来用,不捆绑任何框架,不管是 Laya 还是 Cocos 还是 Egret 还是 React 都可以用。后来发现不太现实,因为为了兼容他们反而写了一堆冗余代码,而如果都整合在一起又导致各个项目不通用。

所以我想要不要把@pawgame 的包拆分足够细致,如果没有必要不再更新,而对于单独的项目来说写一个对应的 core 包。 大概结构如下:

welcome

· One min read

之前尝试使用 Hexo 搭建了一个 blog,https://blog.pawgame.com,断断续续写了一段时间。后来想在内容上做一些好玩的东西,比如特殊的字体效果、好玩的动画等都很困难。于是就使用 Next.js 搭建了一个,使用了好多插件,解决代码高亮,在线代码编辑,mdx 内容,读取 blog 列表,生成 site 等等。

然而突然有一天发现所有我想要的 docusaurus 都有,不仅可以支持文档模式,还可以写 blog。完全就是一个资源整合站。 于是就迁移了一些内容过来,并准备长期维护,主要放日常工作遇到的问题以及解决方法。