vscode의 extension 배포를 위해서는 "Visual Studioi Code Extensions"라는 node 기반의 툴이 필요하다. 필요하다면 다음 명령을 통해 node 및 vsce를 설치하자.
brew install node
npm install -g vsce
vsce --help
Usage: vsce <command>
Options:
-V, --version output the version number
-h, --help display helpforcommand
Commands:
ls [options] Lists all the files that will be published
package [options] [version] Packages an extension
publish [options] [version] Publishes an extension
unpublish [options] [extensionid] Unpublishes an extension. Example extension id: microsoft.csharp.
ls-publishers List all known publishers
delete-publisher <publisher> Deletes a publisher
login <publisher> Add a publisher to the known publishers list
logout <publisher> Remove a publisher from the known publishers list
verify-pat [options] [publisher] Verify if the Personal Access Token has publish rights for the publisher.
show [options] <extensionid> Show extension metadata
search [options] <text> search extension gallery
help [command] display helpforcommand
extensionPack 부분에는 참조할 extension들의 목록을 나열하면 되는데 등록되는 내용은 해당 extension의 identifier로 각 extension 설명 페이지 우측 상단에 있는 installation / identifier의 내용을 참조한다.
categories 부분부터는 옵션이므로 생략해도 상관은 없지만 사용자를 위해 필요한 정보들이다.
packaging
이제 VSCE로 packaging을 실행한다.
itsmeyjc@itsmeyjiMacmini extensionpack % vsce package
(node:9457) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
WARNING A 'repository' field is missing from the 'package.json' manifest file.
Do you want to continue? [y/N] y
WARNING LICENSE.md, LICENSE.txt or LICENSE not found
Do you want to continue? [y/N] y
DONE Packaged: /Volumes/storage/datas/workspace/frontend-extension-pack-0.0.1.vsix (3 files, 1.88KB)
작업의 결과 XX.vsix 파일이 생성된다.
publishing
publishing 하기 전에 먼저 login 절차가 필요하다. 이때 앞서 만든 publisher id와 personal access token이 필요하다.
itsmeyjc@itsmeyjiMacmini extensionpack % vsce login quietjun
(node:9705) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
https://marketplace.visualstudio.com/manage/publishers/
Personal Access Token for publisher 'quietjun': ************************************************************************************
The Personal Access Token verification succeeded for the publisher 'quietjun'.
이제 마지막으로 publish를 처리한다.
itsmeyjc@itsmeyjiMacmini extensionpack % vsce publish
(node:10025) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
INFO Publishing 'quietjun.ssafy-frontend-extension-pack v0.0.1'...
INFO Extension URL (might take a few minutes): https://marketplace.visualstudio.com/items?itemName=quietjun.ssafy-frontend-extension-pack
INFO Hub URL: https://marketplace.visualstudio.com/manage/publishers/quietjun/extensions/ssafy-frontend-extension-pack/hub
DONE Published quietjun.ssafy-frontend-extension-pack v0.0.1.
이제 extension에서 해당 확장팩을 검색해서 설치할 수 있다. (약간의 시간이 필요할 수 있다.)
publishing 과정에서 401 오류가 발생한다면 페이지에서 'New extension' 메뉴를 통해 직접 extension을 등록할 수도 있다.