Skip to content

Commit 1ee5db4

Browse files
committed
Merge branch 'pr/xontab/457' into main
2 parents 0b789f6 + c0e0770 commit 1ee5db4

File tree

4 files changed

+59
-3
lines changed

4 files changed

+59
-3
lines changed

.dockerignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules/
2+
out/
3+
npm-debug.log
4+
!src/test/**/node_modules
5+
package-lock.json
6+
Dockerfile
7+
.gitignore
8+
LICENSE
9+
README.md
10+
ThirdPartyNotices.txt

.npmignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ yarn.lock
99
.travis.yml
1010
.vscode/
1111
out/**/*.d.ts
12-
!out/api.d.ts
12+
!out/api.d.ts
13+
.dockerignore
14+
Dockerfile

Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:12-alpine
2+
WORKDIR /opt/vsce
3+
COPY package.json .
4+
COPY yarn.lock .
5+
RUN yarn
6+
COPY . .
7+
RUN yarn compile
8+
VOLUME /workspace
9+
WORKDIR /workspace
10+
ENTRYPOINT ["/opt/vsce/out/vsce"]

README.md

+36-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,45 @@
88

99
- [Node.js](https://nodejs.org/en/) at least `10.x.x`
1010

11+
Or simply [Docker](#via-docker).
12+
1113
## Usage
1214

13-
`vsce` is meant to be mainly used as a command line tool. It can also be used a library since it exposes a small [API](https://github.com/microsoft/vscode-vsce/blob/master/src/api.ts).
15+
Install vsce globally:
16+
17+
```sh
18+
npm install -g vsce
19+
```
20+
21+
Verify the installation:
22+
23+
```sh
24+
vsce --version
25+
```
26+
27+
`vsce` is meant to be mainly used as a command line tool. It can also be used a library since it exposes a small [API](https://github.com/microsoft/vscode-vsce/blob/master/src/api.ts). When using vsce as a library be sure to sanitize any user input used in API calls, as a security measurement.
28+
29+
## Usage via Docker
30+
31+
You can also build a container for running vsce:
1432

15-
> **Warning:** When using vsce as a library be sure to sanitize any user input used in API calls, as a security measure.
33+
```sh
34+
git clone https://github.com/microsoft/vscode-vsce
35+
cd vscode-vsce
36+
docker build -t vsce .
37+
```
38+
39+
Validate the container:
40+
41+
```sh
42+
docker run -it vsce --version
43+
```
44+
45+
Publish your local extension:
46+
47+
```sh
48+
docker run -it -v $(pwd):/workspace vsce publish
49+
```
1650

1751
## Development
1852

0 commit comments

Comments
 (0)