忘れそうなのでメモ
Install
1 2 3 4 5 6 7 |
$ cd ~/data/nodejs/ $ mkdir vscode-extensions $ cd vscode-extensions $ export PATH=${PATH}:${HOME}/data/nodejs/vscode-extensions/bin $ tar xvf node-v12.14.0-linux-x64.tar.xz $ mv node-v12.14.0-linux-x64/* . $ npm install yo generator-code |
Create new extension template
1 |
$ yo code |
- enter extension name:
New Extension Name
- suggest:
new-extension-name
- select:
npm
1 2 |
$ cd new-extension-name $ code . |
Try run
- F5
- Ctrl+Shift+P
Hello World
Install vsce tool
1 |
$ npm install vsce |
Create vsix package
1 2 |
$ npm update $ vsce package |
or
1 2 |
$ npm update $ vsce package --baseContentUrl . |
See
- https://qiita.com/sfp_waterwalker/items/b2cbdbe1119ea46ab25e
- https://code.visualstudio.com/api/working-with-extensions/publishing-extension#publishing-extensions
- https://code.visualstudio.com/api/get-started/your-first-extension
- https://qiita.com/deerboy/items/f035b9044edf9a51aff7
で、GitHub へ入れてみる
GitHub and vscode
暗号鍵の作成 / Create encryption key
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
$ cd ~/.ssh $ ssh-keygen -t rsa -b 4096 -C "YOUR@EXAMPLE.COM" Generating public/private rsa key pair. Enter file in which to save the key (/home/USERNAME/.ssh/id_rsa): /home/USERNAME/.ssh/id_rsa_github Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in ./id_rsa_github. Your public key has been saved in ./id_rsa_github.pub. The key fingerprint is: SHA256:....... YOUR@EXAMPLE.COM The key's randomart image is: +---[RSA 4096]----+ | | +----[SHA256]-----+ $ chmod 600 * |
GitHub へ公開鍵を設定 / Set public key to GitHub
Login GitHub
Settings > SSH and GPG keys > New SSH key
~/.gitconfig
1 2 3 |
[user] email = YOUR@EXAMPLE.COM name = GITHUB_USERNAME |
~/.ssh/config
1 2 3 4 |
Host github github.com HostName github.com IdentityFile ~/.ssh/id_rsa_github User git |
接続試験 / Connection test
1 2 3 4 |
$ ssh git@github.com -i ~/.ssh/id_rsa_github PTY allocation request failed on channel 0 Hi GITHUB_USERNAME! You've successfully authenticated, but GitHub does not provide shell access. Connection to github.com closed. |
開発ディレクトリーへ移動して、
1 |
$ cd ~/data/nodejs/vscode-extensions/new-extension-name |
GitHub の remote 先を設定 / Set remote destination of GitHub
1 |
$ git remote add origin git@github.com:GITHUB_USERNAME/new-extension-name.git |
GitHub の remote 先を変更する場合 / Change remote destination of GitHub
1 |
$ git remote set-url origin git@github.com:GITHUB_USERNAME/new-extension-name.git |
設定ファイルの確認 / Check the configuration file
~/data/nodejs/vscode-extensions/new-extension-name/.git/config:
1 2 3 4 5 6 7 8 9 10 11 |
[core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] url = https://github.com/GITHUB_USERNAME/new-extension-name.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master |
vscode
- Source Control > Sync
- github website opens, showing the connection code
- copy connection code
- return to vscode
- click status bar github information
- paste connection code
- enter username and password
finished.