From 4988f3af887bd6962ca98f8eee4c1a0cdeda0bc4 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 2 Jun 2022 11:46:40 +0800 Subject: [PATCH] use js-yaml --- _scripts/sync-sponsors.js | 4 ++-- package.json | 2 +- themes/vue/_config.yml | 19 ++++++++++++------- yarn.lock | 17 ++++++++++++----- 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/_scripts/sync-sponsors.js b/_scripts/sync-sponsors.js index 4482670e58..60c726da62 100644 --- a/_scripts/sync-sponsors.js +++ b/_scripts/sync-sponsors.js @@ -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)/, diff --git a/package.json b/package.json index b4bfe13208..6ed23f8991 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/themes/vue/_config.yml b/themes/vue/_config.yml index efb6f4c652..f1232411bb 100644 --- a/themes/vue/_config.yml +++ b/themes/vue/_config.yml @@ -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/ @@ -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/ @@ -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/ @@ -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 @@ -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 @@ -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 @@ -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/ diff --git a/yarn.lock b/yarn.lock index 63b2b2990a..9adb62228a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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" @@ -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"