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
22 changes: 22 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM denoland/deno:2.2.12

# Install tools
RUN apt-get update && \
apt-get install -y git && \
rm -rf /var/lib/apt/lists/*

# Creates a non-root user for the devcontainer
ARG USERNAME=developer
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid "$USER_GID" "$USERNAME" \
&& useradd -s /bin/bash --uid "$USER_UID" --gid "$USER_GID" -m "$USERNAME" \
&& mkdir -p /home/"$USERNAME"/.deno \
&& chown -R "$USERNAME":"$USERNAME" /home/"$USERNAME" \
&& chown -R "$USERNAME":"$USERNAME" /deno-dir

# Switch to the non-root user
USER $USERNAME

# Set the working directory
WORKDIR /home/$USERNAME/workspace
16 changes: 16 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Switcher Management Feature Dev Container",
"dockerComposeFile": [
"docker-compose.yml"
],
"service": "switcher-management-feature",
"workspaceFolder": "/workspace",
"customizations":{
"vscode": {
"extensions": ["denoland.vscode-deno"],
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
}
}
}
}
11 changes: 11 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.9'

services:

switcher-management-feature:
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspace:cached
command: sleep infinity
4 changes: 2 additions & 2 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
with:
fetch-depth: 0

- name: Setup Deno v2.2.8
- name: Setup Deno v2.2.12
uses: denoland/setup-deno@v1
with:
deno-version: v2.2.8
deno-version: v2.2.12

- name: Setup LCOV
run: sudo apt install -y lcov
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/re-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
fetch-depth: 0
ref: ${{ github.event.inputs.tag }}

- name: Setup Deno v2.2.8
- name: Setup Deno v2.2.12
uses: denoland/setup-deno@v1
with:
deno-version: v2.2.8
deno-version: v2.2.12

- name: Verify formatting
run: deno task fmt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
with:
fetch-depth: 0

- name: Setup Deno v2.2.8
- name: Setup Deno v2.2.12
uses: denoland/setup-deno@v1
with:
deno-version: v2.2.8
deno-version: v2.2.12

- name: Verify formatting
run: deno task fmt
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM denoland/deno:alpine-2.2.8
FROM denoland/deno:alpine-2.2.12

ENV APP_HOME=/home/app
WORKDIR $APP_HOME
Expand Down
34 changes: 29 additions & 5 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions src/api-docs/paths/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,3 @@ export const commonSchemaContent = (ref: string) => ({
},
},
});

export const commonArraySchemaContent = (ref: string) => ({
'application/json': {
schema: {
type: 'array',
items: {
$ref: `#/components/schemas/${ref}`,
},
},
},
});

export const commonOneOfSchemaContent = (refs: string[]) => ({
'application/json': {
schema: {
oneOf: refs.map((ref) => ({
$ref: `#/components/schemas/${ref}`,
})),
},
},
});
2 changes: 1 addition & 1 deletion src/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export { Application, Context, type Middleware, type Next, Router } from 'jsr:@o
export { Client } from 'jsr:@switcherapi/switcher-client-deno@2.1.0';
export { ValidatorFn, ValidatorMiddleware } from 'jsr:@trackerforce/validator4oak@1.2.0';
export { load } from 'jsr:@std/dotenv@0.225.3';
export { bold, cyan, green } from 'jsr:@std/fmt@1.0.6/colors';
export { bold, cyan, green } from 'jsr:@std/fmt@1.0.7/colors';
2 changes: 1 addition & 1 deletion tests/deps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export { type Middleware, testing } from 'jsr:@oak/oak@17.1.4';
export { Client, StrategiesType } from 'jsr:@switcherapi/switcher-client-deno@2.1.0';
export { superoak } from 'https://deno.land/x/superoak@4.8.1/mod.ts';
export { assert, assertEquals, assertFalse, assertObjectMatch } from 'jsr:@std/assert@1.0.12';
export { assert, assertEquals, assertFalse, assertObjectMatch } from 'jsr:@std/assert@1.0.13';

// Fixes superdeno@4.9.0 issue
// deno-lint-ignore no-explicit-any
Expand Down
13 changes: 13 additions & 0 deletions tests/routes/api-docs.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import app from '../../src/app.ts';
import { assertObjectMatch, superoak } from '../deps.ts';
import apiDocs from '../../src/api-docs/swagger-document.ts';

Deno.test({
name: 'API-Docs route - it should return ok',
async fn() {
const request = await superoak(app);
const response = await request.get('/swagger.json').expect(200);

assertObjectMatch(response.body, apiDocs);
},
});