๐Ÿ”” ๋ฒ„์ „-๋กœ์ผ“ ๐Ÿš€

10417 ๋‹จ์–ด versionworkderwebnpm

๐Ÿ”” ๋ฒ„์ „-๋กœ์ผ“ ๐Ÿš€



์˜์–ด | ็ฎ€ไฝ“ไธญๆ–‡

์‚ฌ์ดํŠธ์˜ ์ƒˆ ๋ฒ„์ „์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์„ ๋•Œ ์‚ฌ์šฉ์ž์—๊ฒŒ ์•Œ๋ฆฌ๊ณ  ํŽ˜์ด์ง€๋ฅผ ์ƒˆ๋กœ ๊ณ ์น˜๋ผ๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
์•ฑ ๋ฐฐํฌ๋ฅผ ์™„๋ฃŒํ•˜๋ฉด Lark ๊ทธ๋ฃน ์ฑ„ํŒ…์— ๋ฐฐํฌ ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋ƒ…๋‹ˆ๋‹ค.

์— ๋Œ€ํ•œ



version-rocket์€ ์›๊ฒฉ ์„œ๋ฒ„์˜ ๋ฒ„์ „ ํŒŒ์ผ์— ๋Œ€ํ•ด ์‚ฌ์šฉ์ž์˜ ํ˜„์žฌ ๋ธŒ๋ผ์šฐ์ €์— ์žˆ๋Š” ๋ฒ„์ „์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

์ƒˆ ๋ฒ„์ „์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒฝ์šฐ ์ƒˆ ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ ํ”„๋กฌํ”„ํŠธ๊ฐ€ ํ‘œ์‹œ๋˜๊ณ  ์‚ฌ์šฉ์ž์—๊ฒŒ ํŽ˜์ด์ง€๋ฅผ ์ƒˆ๋กœ ๊ณ ์น  ์ˆ˜ ์žˆ๋Š” ์ž‘์—… ๋ฒ„ํŠผ์ด ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค. ๋˜๋Š” version-rocket์ด ์‚ฌ์šฉ์ž ์ง€์ • ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ง€์›ํ•˜๋Š” ์ฝœ๋ฐฑ ํ•จ์ˆ˜๋ฅผ ์ˆ˜์‹ ํ•˜์—ฌ ์•Œ๋ ค์ค„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์šฐ๋ฆฌ๋Š” ํด๋ง ๋ฃจํ”„๋ฅผ ์ˆ˜ํ–‰ํ•˜๊ธฐ ์œ„ํ•ด javascript ๊ธฐ๋ฐ˜์˜ Web Worker API๋ฅผ ์‚ฌ์šฉํ•˜๋ฉฐ ๋ธŒ๋ผ์šฐ์ € ๋ Œ๋”๋ง ํ”„๋กœ์„ธ์Šค์— ์˜ํ–ฅ์„ ๋ฏธ์น˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

ํŠน์ง•


  • ๋ชจ๋“  ์ตœ์‹  ๋ธŒ๋ผ์šฐ์ €์™€ ํ˜ธํ™˜๋จ
  • ๋ฒ„์ „ ํ”„๋กฌํ”„ํŠธ ์ธํ„ฐํŽ˜์ด์Šค๋Š” ์‚ฌ์šฉ์ž ์ •์˜๋ฅผ ์ง€์›ํ•˜๋ฉฐ ๋ฐฐํฌ ๋ฉ”์‹œ์ง€ ์นด๋“œ์˜ ๋‚ด์šฉ์„ ์‚ฌ์šฉ์ž ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ฒ„์ „ ์‹ค์‹œ๊ฐ„ ๋ชจ๋‹ˆํ„ฐ๋ง
  • ์„ฑ๊ณต์ ์ธ ๋ฐฐํฌ ํ›„ ๋ฐฐํฌ ๋ฉ”์‹œ์ง€๋ฅผ Lark ๊ทธ๋ฃน ์ฑ„ํŒ…์— ๋™๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค.
  • Npm package support

  • ์Šคํฌ๋ฆฐ์ƒท


  • ์ฒซ ๋ฒˆ์งธ ๊ทธ๋ฆผ์€ ์‚ฌ์šฉ์ž์—๊ฒŒ ํŽ˜์ด์ง€๋ฅผ ์ƒˆ๋กœ ๊ณ ์น˜๋ผ๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
  • ๋‘ ๋ฒˆ์งธ ์‚ฌ์ง„์€ ํ”„๋กœ์ ํŠธ๊ฐ€ ์„ฑ๊ณต์ ์œผ๋กœ ๋ฐฐํฌ๋œ ํ›„ ํŒ€ ๊ตฌ์„ฑ์›์—๊ฒŒ ์•Œ๋ฆฌ๊ธฐ ์œ„ํ•ด ๊ทธ๋ฃน ์ฑ„ํŒ…์— ๋ฐฐํฌ ๋ฉ”์‹œ์ง€๊ฐ€ ์ „์†ก๋˜๋Š” ๊ฒƒ์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.
  • ์„ธ ๋ฒˆ์งธ ์‚ฌ์ง„ @๋‘ ๋ฒˆ์งธ ์‚ฌ์ง„
  • ์„ ๊ธฐ์ค€์œผ๋กœ ์„ ํƒ์  ์„ค์ •์ด ์žˆ๋Š” ๋ชจ๋“  ์‚ฌ์ง„





    ์šฉ๋ฒ•



    ์„ค์น˜




    npm install version-rocket -S
    


    ์‹œ์ž‘ํ•˜๋‹ค




    
    // 1. Import version-rocket, and invoke pollingCompareVersion method
    import { pollingCompareVersion } from 'version-rocket'
    import { version } from '../package.json'
    
    /**
     * @param 1: current version
     * @param 2: remote server version.json file path
     * @param 3: time interval of rotation monitoring (in ms), default 5000ms
     * @param 4: custom version tip ui callback(optional)
     */
    pollingCompareVersion(version, `${location.origin}/version.json`, 30000, (data) => {
        console.log(data)
    })
    
    



    
    /**
     * 2.
     * generate-version-file shortcut command to create the version.json file.
     * The parameter is the directory where you want to create version.json.
     * If you don't pass the parameter, it will be created in the dist directory by default.
    */ 
    
    {
      "name": "test",
      "description": "test",
      "private": true,
      "version": "0.0.1",
      "scripts": {
        ...
        "generate:version": "generate-version-file dist public"
        ...
      },
      ...
    }
    
    


    ๋ผํฌ ๋กœ๋ด‡์ด ์œ„์น˜ํ•œ ๋‹จ์ฒด ์ฑ„ํŒ…๋ฐฉ์— ๋ฐฐํฌ ์„ฑ๊ณต ๋ฉ”์‹œ์ง€๋ฅผ ํ‘ธ์‹œํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด ๊ณ„์† ์ง„ํ–‰ํ•ด์ฃผ์„ธ์š”.




    
    /**
     * 3.
     * You need to create a send-lark-config.json file first, it store the field for setting the copy for the message card. 
     * Then, you can just execute the send-lark-message shortcut command. By default, the send-lark-config.json file in the current path is selected.
     * If you want to customize the file path and file name, you can set the MESSAGE_PATH parameter to pass it in.
    */
    
    {
      "name": "test",
      "description": "test",
      "private": true,
      "version": "0.0.1",
      "scripts": {
        ...
        "send-lark-message:test": "MESSAGE_PATH=./lark-message-config.json send-lark-message"
        ...
      },
      ...
    }
    
    
    // send-lark-config.json example
    {
        // card title
        "title": "TEST FE Deployed Successfully",
        // deploy project name
        "projectName": "TEST",
        // deploy branch name
        "branch": "Staging",
        // project url
        "accessUrl": "https://test.com",
        // remind group chat members: true/false
        "isNotifyAll": true,
        // lark robot webhook url
        "larkWebHook": "https://open.larksuite.com/open-apis/bot/v2/hook/xxxxxxxxxxxx",
        // deploy type
        "deployTools": "Jenkins",
        // the deploy time zone that you want to display, default "Asia/Shanghai"
        "expectConvertToTimezone": "America/New_York"
    }
    
    


    ๋งํฌ


  • Timezone List
  • ์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ