Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies #1135

Merged
merged 43 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d5a2ac0
Multi arch builds
daanh432 Sep 6, 2023
dbdff7e
chore: fix npm deprecation warnings
hugojosefson Oct 14, 2023
b690731
chore: npm audit fix
hugojosefson Oct 14, 2023
20f007d
chore: remove unused watch
hugojosefson Oct 14, 2023
cf189c2
chore: remove unused @types/adm-zip
hugojosefson Oct 15, 2023
c469357
chore: minor upgrade typescript
hugojosefson Oct 14, 2023
527e311
chore: minor upgrade tsnode
hugojosefson Oct 14, 2023
9354c85
chore: major upgrade tsnode
hugojosefson Oct 14, 2023
2063f39
chore: patch upgrade ts-essentials
hugojosefson Oct 14, 2023
ccaa770
chore: minor upgrade sinon+chai
hugojosefson Oct 14, 2023
3b0944b
chore: major upgrade sinon
hugojosefson Oct 14, 2023
abe1319
chore: major upgrade ts-essentials
hugojosefson Oct 14, 2023
48836ca
chore: minor upgrade pkg
hugojosefson Oct 14, 2023
2afd5b8
chore: minor upgrade nyc
hugojosefson Oct 14, 2023
11b6b94
chore: patch upgrade husky
hugojosefson Oct 14, 2023
a0bf740
chore: patch upgrade cucumber
hugojosefson Oct 14, 2023
5e52fda
chore: patch upgrade coveralls
hugojosefson Oct 14, 2023
46382b1
chore: patch upgrade async
hugojosefson Oct 14, 2023
823b6ed
chore: patch upgrade ws
hugojosefson Oct 15, 2023
224160e
chore: minor upgrade uws
hugojosefson Oct 15, 2023
12ec332
chore: patch upgrade uuid
hugojosefson Oct 15, 2023
fd2224e
chore: patch upgrade source-map-support
hugojosefson Oct 15, 2023
0333f24
chore: minor upgrade pino
hugojosefson Oct 15, 2023
cf1e523
chore: major upgrade pino
hugojosefson Oct 15, 2023
e0b9242
chore: major upgrade pino
hugojosefson Oct 15, 2023
ea86f2e
chore: minor upgrade needle
hugojosefson Oct 15, 2023
c2448d6
chore: major upgrade needle
hugojosefson Oct 15, 2023
23ff67e
chore: minor upgrade mqtt-connection
hugojosefson Oct 15, 2023
6dfa6c9
chore: patch upgrade js-yaml
hugojosefson Oct 15, 2023
28dbefe
chore: major upgrade js-yaml
hugojosefson Oct 15, 2023
13ccbe9
chore: minor upgrade http-status
hugojosefson Oct 15, 2023
19f1288
chore: minor upgrade glob
hugojosefson Oct 15, 2023
f68aacb
chore: major upgrade glob
hugojosefson Oct 15, 2023
be9a81e
chore: patch upgrade content-type
hugojosefson Oct 15, 2023
7a0b13f
chore: patch upgrade commander
hugojosefson Oct 15, 2023
aac5d27
chore: major upgrade commander
hugojosefson Oct 15, 2023
010f30e
chore: patch upgrade chalk
hugojosefson Oct 15, 2023
5639b88
chore: minor upgrade body-parser
hugojosefson Oct 15, 2023
a4d53ad
chore: major upgrade better-ajv-errors
hugojosefson Oct 15, 2023
dfb9ce3
fix: make unit tests work under node@20 too
hugojosefson Oct 14, 2023
1c37abf
test: clarify
hugojosefson Oct 20, 2023
e75008e
test: fatal log includes any metadata.error given
hugojosefson Oct 20, 2023
5169bf3
chore: npm audit fix
hugojosefson Oct 20, 2023
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
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**/.git/
**/.github/
**/node_modules/

**/Dockerfile
**/Dockerfile.*

**/.env.*.local
**/.env.local
58 changes: 55 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,60 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
node-version: '18.x'
- run: DOCKER_PASSWORD=${{ secrets.DOCKERHUB_TOKEN }} DOCKER_USERNAME=${{ secrets.DOCKERHUB_USERNAME }} bash scripts/docker.sh
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: deepstreamio/deepstream.io
flavor: |
latest=true
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

docker-alpine:
runs-on: ubuntu-latest
steps:
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: deepstreamio/deepstream.io
flavor: |
latest=true
suffix=-alpine,onlatest=true
tags: |
type=semver,pattern={{version}}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.alpine
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM node:10

FROM node:18 as builder
WORKDIR /app
# RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
# RUN unzip awscliv2.zip
# RUN ./aws/install

COPY package*.json ./

RUN npm install --production \
RUN npm ci
RUN npm install --omit=dev \
@deepstream/cache-redis \
# @deepstream/cache-memcached \
# @deepstream/cache-hazelcast \
Expand All @@ -18,11 +19,17 @@ RUN npm install --production \
@deepstream/logger-winston \
@deepstream/plugin-aws

COPY . ./
COPY . .

RUN npm run tsc

FROM node:18
WORKDIR /usr/local/deepstream
COPY --from=builder /app/node_modules/ ./node_modules
COPY --from=builder /app/dist/ .

EXPOSE 6020
EXPOSE 8080
EXPOSE 9229

CMD ["node", "./bin/deepstream.js", "start", "--inspect=0.0.0.0:9229"]

37 changes: 37 additions & 0 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM node:18-alpine as builder
WORKDIR /app
# RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
# RUN unzip awscliv2.zip
# RUN ./aws/install

COPY package*.json ./

RUN npm ci
RUN npm install --omit=dev \
@deepstream/cache-redis \
# @deepstream/cache-memcached \
# @deepstream/cache-hazelcast \
@deepstream/clusternode-redis \
@deepstream/storage-mongodb \
@deepstream/storage-rethinkdb \
@deepstream/storage-elasticsearch \
@deepstream/storage-postgres \
@deepstream/logger-winston \
@deepstream/plugin-aws

RUN npm uninstall --save uWebSockets.js

COPY . .

RUN npm run tsc

FROM node:18-alpine
WORKDIR /usr/local/deepstream
COPY --from=builder /app/node_modules/ ./node_modules
COPY --from=builder /app/dist/ .

EXPOSE 6020
EXPOSE 8080
EXPOSE 9229

CMD ["node", "./bin/deepstream.js", "start", "--inspect=0.0.0.0:9229"]
10 changes: 2 additions & 8 deletions bin/deepstream-cluster.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import * as commander from 'commander'
import { Command } from 'commander'
import * as cluster from 'cluster'
const numCPUs = require('os').cpus().length
import { EVENT } from '@deepstream/types'

// work-around for:
// TS4023: Exported variable 'command' has or is using name 'local.Command'
// from external module "node_modules/commander/typings/index" but cannot be named.
// tslint:disable-next-line: no-empty-interface
export interface Command extends commander.Command { }

export const verticalCluster = (program: Command) => {
program
.command('cluster')
Expand Down Expand Up @@ -80,4 +74,4 @@ function action () {
process.exit(1)
}
}
}
}
8 changes: 1 addition & 7 deletions bin/deepstream-daemon.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
// @ts-ignore
import * as dsDaemon from '../src/service/daemon'
import * as commander from 'commander'

// work-around for:
// TS4023: Exported variable 'command' has or is using name 'local.Command'
// from external module "node_modules/commander/typings/index" but cannot be named.
// tslint:disable-next-line: no-empty-interface
export interface Command extends commander.Command { }
import { Command } from 'commander'

export const daemon = (program: Command) => {
program
Expand Down
8 changes: 1 addition & 7 deletions bin/deepstream-hash.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import * as jsYamlLoader from '../src/config/js-yaml-loader'
import * as commander from 'commander'
import { Command } from 'commander'
import { createHash } from '../src/utils/utils'

// work-around for:
// TS4023: Exported variable 'command' has or is using name 'local.Command'
// from external module "node_modules/commander/typings/index" but cannot be named.
// tslint:disable-next-line: no-empty-interface
export interface Command extends commander.Command { }

export const hash = (program: Command) => {
program
.command('hash [password]')
Expand Down
8 changes: 1 addition & 7 deletions bin/deepstream-info.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import * as jsYamlLoader from '../src/config/js-yaml-loader'
import * as commander from 'commander'
import { Command } from 'commander'
import { getDSInfo } from '../src/config/ds-info'

// work-around for:
// TS4023: Exported variable 'command' has or is using name 'local.Command'
// from external module "node_modules/commander/typings/index" but cannot be named.
// tslint:disable-next-line: no-empty-interface
export interface Command extends commander.Command { }

export const info = (program: Command) => {
program
.command('info')
Expand Down
8 changes: 1 addition & 7 deletions bin/deepstream-nginx.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
// @ts-ignore
import * as dsService from '../src/service/service'
import * as commander from 'commander'
import { Command } from 'commander'
import { writeFileSync } from 'fs'
import * as jsYamlLoader from '../src/config/js-yaml-loader'
import * as fileUtil from '../src/config/file-utils'

// work-around for:
// TS4023: Exported variable 'command' has or is using name 'local.Command'
// from external module "node_modules/commander/typings/index" but cannot be named.
// tslint:disable-next-line: no-empty-interface
export interface Command extends commander.Command { }

export const nginx = (program: Command) => {
program
.command('nginx')
Expand Down
8 changes: 1 addition & 7 deletions bin/deepstream-service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
// @ts-ignore
import * as dsService from '../src/service/service'
import * as commander from 'commander'

// work-around for:
// TS4023: Exported variable 'command' has or is using name 'local.Command'
// from external module "node_modules/commander/typings/index" but cannot be named.
// tslint:disable-next-line: no-empty-interface
export interface Command extends commander.Command { }
import { Command } from 'commander'

export const service = (program: Command) => {
program
Expand Down
12 changes: 3 additions & 9 deletions bin/deepstream-start.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import * as commander from 'commander'
import { Command } from 'commander'
import { EVENT } from '@deepstream/types'

// work-around for:
// TS4023: Exported variable 'command' has or is using name 'local.Command'
// from external module "node_modules/commander/typings/index" but cannot be named.
// tslint:disable-next-line: no-empty-interface
export interface Command extends commander.Command { }

export const start = (program: Command) => {
program
.command('start')
.command('start', { isDefault: true })
.description('start a deepstream server')

.option('-c, --config [file]', 'configuration file, parent directory will be used as prefix for other config files')
Expand Down Expand Up @@ -51,7 +45,7 @@ function action () {
ds.stop()
})
} catch (err) {
console.error(err.toString())
console.error(err?.toString())
process.exit(1)
}
}
Expand Down
4 changes: 0 additions & 4 deletions bin/deepstream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ verticalCluster(program)
nginx(program)

program.parse(process.argv)

if (program.rawArgs.length <= 2) {
program.emit('command:start')
}
Loading