hexo-theme-shokax 0.4.6-beta1 → 0.4.6-beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/toolbox/lib.mjs +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-shokax",
3
- "version": "0.4.6-beta1",
3
+ "version": "0.4.6-beta2",
4
4
  "description": "a hexo theme based on shoka",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/theme-shoka-x/hexo-theme-shokaX",
package/toolbox/lib.mjs CHANGED
@@ -31,7 +31,10 @@ export async function hoistDeps() {
31
31
  pm = "npm install"
32
32
  }
33
33
  try {
34
- const deps = JSON.parse(await fs.readFile(path.join(hexoRoot, 'package.json').trim(), 'utf-8')).dependencies
34
+ // TODO 使用本地 package.json 解析
35
+ const res = await (await fetch('https://registry.npmmirror.com/hexo-theme-shokax')).json()
36
+ const latestV = res['dist-tags'].latest
37
+ const deps = res.versions[latestV].dependencies
35
38
  const depsList = Object.keys(deps).map(d => `${d}@${deps[d]}`)
36
39
  await execShell(`${pm} ${depsList.join(' ')}`.trim())
37
40
  } catch (e) {