Skip to content

Commit

Permalink
use js-yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 2, 2022
1 parent 0e847a4 commit 4988f3a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
4 changes: 2 additions & 2 deletions _scripts/sync-sponsors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
const fs = require('fs')
const path = require('path')
const axios = require('axios')
const yaml = require('yaml')
const yaml = require('js-yaml')

const configPath = path.resolve(__dirname, '../themes/vue/_config.yml')

;(async () => {
const { data } = await axios(`https://sponsors.vuejs.org/data.json`)
const yml = yaml.stringify(data)
const yml = yaml.dump(data)
const config = fs.readFileSync(configPath, 'utf-8')
const updated = config.replace(
/(# START SPONSORS)[^]*(# END SPONSORS)/,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"hexo-renderer-stylus": "^0.3.3",
"hexo-server": "^0.3.1",
"hoek": "^6.1.2",
"yaml": "^2.1.1"
"js-yaml": "^4.1.0"
}
}
19 changes: 12 additions & 7 deletions themes/vue/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ special:
description: An IDE for Vue
platinum:
- name: VueSchool
url: https://vueschool.io/?utm_source=Vuejs.org&utm_medium=Banner&utm_campaign=Sponsored%20Banner&utm_content=V1
url: >-
https://vueschool.io/?utm_source=Vuejs.org&utm_medium=Banner&utm_campaign=Sponsored%20Banner&utm_content=V1
img: vueschool.png
- name: Vehikl
url: https://vehikl.com/
Expand All @@ -22,7 +23,8 @@ platinum:
url: https://www.storyblok.com
img: storyblok.png
- name: Ionic
url: https://ionicframework.com/vue?utm_source=partner&utm_medium=referral&utm_campaign=vuesponsorship&utm_content=vuedocs
url: >-
https://ionicframework.com/vue?utm_source=partner&utm_medium=referral&utm_campaign=vuesponsorship&utm_content=vuedocs
img: ionic.png
- name: Nuxt
url: https://nuxtjs.org/
Expand All @@ -31,7 +33,8 @@ platinum:
url: https://www.refurbed.org/?utm_source=vuejs
img: refurbed.png
- name: ButterCMS
url: https://buttercms.com/vuejs-cms/?utm_source=vuejs.org&utm_medium=banner&utm_campaign=sponsorship
url: >-
https://buttercms.com/vuejs-cms/?utm_source=vuejs.org&utm_medium=banner&utm_campaign=sponsorship
img: buttercms.svg
- name: Sanofi
url: https://www.sanofi.com/
Expand All @@ -44,7 +47,8 @@ platinum_china:
url: https://www.dcloud.io/hbuilderx.html?hmsr=vue-en&hmpl=&hmcu=&hmkw=&hmci=
img: hbuilder.png
- name: Authing
url: https://www.authing.cn/welcome?utm_source=Vuejs&utm_medium=CPT&utm_campaign=EN&utm_term=page-EN
url: >-
https://www.authing.cn/welcome?utm_source=Vuejs&utm_medium=CPT&utm_campaign=EN&utm_term=page-EN
img: authing.svg
- name: 稀土掘金技术社区
url: https://juejin.cn/frontend?utm_source=vue&utm_campaign=sponsor
Expand Down Expand Up @@ -84,7 +88,7 @@ gold:
url: https://js.devexpress.com/
img: devexpress.png
- name: FASTCODING Inc
url: "https://fastcoding.jp/javascript/ "
url: 'https://fastcoding.jp/javascript/ '
img: fastcoding_inc.svg
- name: StoreKit
url: https://storekit.com
Expand Down Expand Up @@ -134,7 +138,7 @@ gold:
- name: QuickBooks Tool Hub
url: https://quickbookstoolhub.com
img: quickbooks_tool_hub.png
- name: "1394"
- name: '1394'
url: https://1394ta.org/buy-instagram-followers/
img: 1394.png?v2
- name: Snyk
Expand Down Expand Up @@ -166,7 +170,8 @@ silver:
url: https://www.interflora.fr
img: interflora_group.png
- name: Localazy
url: https://localazy.com/blog/how-to-localize-vuejs-app-with-vue-i18n-and-localazy?utm_source=vuejs&utm_medium=banner&utm_campaign=sponsorships_vuejs&utm_content=logo
url: >-
https://localazy.com/blog/how-to-localize-vuejs-app-with-vue-i18n-and-localazy?utm_source=vuejs&utm_medium=banner&utm_campaign=sponsorships_vuejs&utm_content=logo
img: localazy.png
- name: AddWeb Solution
url: http://addwebsolution.com/
Expand Down
17 changes: 12 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ argparse@^1.0.7:
dependencies:
sprintf-js "~1.0.2"

argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==

arr-diff@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
Expand Down Expand Up @@ -1859,6 +1864,13 @@ js-yaml@^3.6.1:
argparse "^1.0.7"
esprima "^4.0.0"

js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"

jsonparse@^1.2.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280"
Expand Down Expand Up @@ -3565,11 +3577,6 @@ yallist@^3.0.0, yallist@^3.0.3:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==

yaml@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.1.1.tgz#1e06fb4ca46e60d9da07e4f786ea370ed3c3cfec"
integrity sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw==

yargs@^3.32.0:
version "3.32.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995"
Expand Down

0 comments on commit 4988f3a

Please sign in to comment.