Skip to content

Commit f2f7931

Browse files
authored
feat: Add package command (#106)
1 parent 765cd05 commit f2f7931

File tree

16 files changed

+2193
-1346
lines changed

16 files changed

+2193
-1346
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist-dir
2+
node_modules
3+
npm-debug.log
4+
.env

.github/workflows/ci.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-node@v3
1717
with:
18-
node-version: '16'
18+
node-version: '20'
1919
cache: 'npm'
2020

2121
- name: Install dependencies
@@ -31,12 +31,17 @@ jobs:
3131
- uses: actions/checkout@v3
3232
- uses: actions/setup-node@v3
3333
with:
34-
node-version: '16'
34+
node-version: '20'
3535
cache: 'npm'
3636

3737
- name: Install dependencies
3838
run: npm ci
3939

40+
-
41+
# Required for the package command tests to work
42+
name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v3
44+
4045
- name: Test
4146
run: |
4247
npm test
@@ -47,7 +52,7 @@ jobs:
4752
- uses: actions/checkout@v3
4853
- uses: actions/setup-node@v3
4954
with:
50-
node-version: '16'
55+
node-version: '20'
5156
cache: 'npm'
5257

5358
- name: Install dependencies
@@ -63,7 +68,7 @@ jobs:
6368
- uses: actions/checkout@v3
6469
- uses: actions/setup-node@v3
6570
with:
66-
node-version: '16'
71+
node-version: '20'
6772
cache: 'npm'
6873

6974
- name: Install dependencies

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,6 @@ dist
132132
# Editor settings
133133
.idea
134134
.vscode
135+
136+
dist-dir
137+
.DS_Store

Dockerfile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM node:20-slim as builder
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm ci
8+
9+
COPY . .
10+
11+
RUN npm run build
12+
13+
FROM node:20-slim AS final
14+
15+
WORKDIR /app
16+
17+
COPY --from=builder ./app/dist ./dist
18+
19+
COPY package*.json ./
20+
21+
RUN npm ci --omit=dev
22+
23+
EXPOSE 7777
24+
25+
ENTRYPOINT ["node", "dist/main.js"]
26+
27+
CMD [ "serve", "--address", "[::]:7777", "--log-format", "json", "--log-level", "info" ]

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is the high-level package to use for developing CloudQuery plugins in JavaS
44

55
## Prerequisites
66

7-
Node.js 16 or higher. Install Node.js from [here](https://nodejs.org/en/download/).
7+
Node.js 20 or higher. Install Node.js from [here](https://nodejs.org/en/download/).
88

99
## Setup
1010

@@ -29,7 +29,13 @@ npm test
2929
### Start a local memory based plugin server
3030

3131
```bash
32-
npm run dev
32+
npm run dev -- serve
33+
```
34+
35+
### Package as a Docker image
36+
37+
```bash
38+
npm run dev -- package -m test "v1.0.0" . --dist-dir dist-dir
3339
```
3440

3541
### Formatting and Linting

docs/overview.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# MemDB Plugin
2+
3+
Test docs for the MemDB plugin.

0 commit comments

Comments
 (0)