Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,70 +17,78 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "24"
cache: "npm"
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Build
run: |
npm run build
pnpm run build

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "24"
cache: "npm"
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- # Required for the package command tests to work
name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3

- name: Test
run: |
npm test
pnpm test

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6

with:
node-version: "24"
cache: "npm"
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Lint
run: |
npm run lint
pnpm run lint

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "24"
cache: "npm"
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Format
run: |
npm run format:check
pnpm run format:check
8 changes: 5 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Install pnpm
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Build code
run: |
npm run build
pnpm run build

- run: npm publish --access public
- run: pnpm publish --access public
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
FROM node:24-slim as builder
FROM node:24-slim AS builder

RUN corepack enable && corepack prepare pnpm@10.23.0 --activate

WORKDIR /app

COPY package*.json ./
COPY package.json pnpm-lock.yaml ./

RUN npm ci
RUN pnpm install --frozen-lockfile

COPY . .

RUN npm run build
RUN pnpm run build

FROM node:24-slim AS final

RUN corepack enable && corepack prepare pnpm@10.23.0 --activate

WORKDIR /app

COPY --from=builder ./app/dist ./dist

COPY package*.json ./
COPY package.json pnpm-lock.yaml ./

RUN npm ci --omit=dev
RUN pnpm install --frozen-lockfile --prod

EXPOSE 7777

ENTRYPOINT ["node", "dist/main.js"]

CMD [ "serve", "--address", "[::]:7777", "--log-format", "json", "--log-level", "info" ]
CMD [ "serve", "--address", "[::]:7777", "--log-format", "json", "--log-level", "info" ]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,42 @@ Node.js 20 or higher. Install Node.js from [here](https://nodejs.org/en/download
### Install dependencies

```bash
npm ci
pnpm install
```

### Build

```bash
npm run build
pnpm build
```

### Test

```bash
npm test
pnpm test
```

### Start a local memory based plugin server

```bash
npm run dev -- serve
pnpm dev -- serve
```

### Package as a Docker image

```bash
npm run dev -- package -m test "v1.0.0" . --dist-dir dist-dir
pnpm dev -- package -m test "v1.0.0" . --dist-dir dist-dir
```

### Formatting and Linting

```bash
# This is just to check if the code is formatted
npm run format:check
pnpm format:check

# Automatically format code
npm run format
pnpm format

# Lint
npm run lint
pnpm lint
```
Loading
Loading