From 1299fff678a0afe31d9ad687cce9ddc17c0f03c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Tesa=C5=99?= Date: Sun, 1 Oct 2023 13:44:26 +0200 Subject: [PATCH] Use consistent naming --- README.md | 4 +++- packages/{data-pusher => pusher}/.env.example | 0 packages/{data-pusher => pusher}/.eslintignore | 0 packages/{data-pusher => pusher}/.prettierignore | 0 packages/{data-pusher => pusher}/README.md | 6 ++---- .../config/pusher.example.json | 0 .../config/secrets.example.env | 0 packages/{data-pusher => pusher}/docker/Dockerfile | 14 +++++++------- .../docker/docker-compose.yml | 6 +++--- packages/{data-pusher => pusher}/jest.config.js | 0 packages/{data-pusher => pusher}/package.json | 2 +- .../src/api-requests/data-provider.test.ts | 0 .../src/api-requests/data-provider.ts | 0 .../src/api-requests/signed-api.test.ts | 0 .../src/api-requests/signed-api.ts | 0 packages/{data-pusher => pusher}/src/constants.ts | 0 .../src/fetch-beacon-data.ts | 0 packages/{data-pusher => pusher}/src/index.ts | 0 packages/{data-pusher => pusher}/src/logger.ts | 0 .../src/sign-template-data.test.ts | 0 .../src/sign-template-data.ts | 0 packages/{data-pusher => pusher}/src/state.test.ts | 0 packages/{data-pusher => pusher}/src/state.ts | 0 .../api-specification-processing.ts | 0 .../unsafe-evaluate.test.ts | 0 .../unexported-airnode-features/unsafe-evaluate.ts | 0 .../src/unexported-airnode-features/vm-timers.ts | 0 .../src/update-signed-api.ts | 0 packages/{data-pusher => pusher}/src/utils.ts | 0 .../src/validation/config.ts | 0 .../{data-pusher => pusher}/src/validation/env.ts | 0 .../src/validation/schema.test.ts | 0 .../src/validation/schema.ts | 0 .../src/validation/utils.ts | 0 packages/{data-pusher => pusher}/test/fixtures.ts | 0 .../{data-pusher => pusher}/tsconfig.build.json | 0 packages/{data-pusher => pusher}/tsconfig.json | 0 pnpm-lock.yaml | 2 +- 38 files changed, 17 insertions(+), 17 deletions(-) rename packages/{data-pusher => pusher}/.env.example (100%) rename packages/{data-pusher => pusher}/.eslintignore (100%) rename packages/{data-pusher => pusher}/.prettierignore (100%) rename packages/{data-pusher => pusher}/README.md (98%) rename packages/{data-pusher => pusher}/config/pusher.example.json (100%) rename packages/{data-pusher => pusher}/config/secrets.example.env (100%) rename packages/{data-pusher => pusher}/docker/Dockerfile (69%) rename packages/{data-pusher => pusher}/docker/docker-compose.yml (85%) rename packages/{data-pusher => pusher}/jest.config.js (100%) rename packages/{data-pusher => pusher}/package.json (98%) rename packages/{data-pusher => pusher}/src/api-requests/data-provider.test.ts (100%) rename packages/{data-pusher => pusher}/src/api-requests/data-provider.ts (100%) rename packages/{data-pusher => pusher}/src/api-requests/signed-api.test.ts (100%) rename packages/{data-pusher => pusher}/src/api-requests/signed-api.ts (100%) rename packages/{data-pusher => pusher}/src/constants.ts (100%) rename packages/{data-pusher => pusher}/src/fetch-beacon-data.ts (100%) rename packages/{data-pusher => pusher}/src/index.ts (100%) rename packages/{data-pusher => pusher}/src/logger.ts (100%) rename packages/{data-pusher => pusher}/src/sign-template-data.test.ts (100%) rename packages/{data-pusher => pusher}/src/sign-template-data.ts (100%) rename packages/{data-pusher => pusher}/src/state.test.ts (100%) rename packages/{data-pusher => pusher}/src/state.ts (100%) rename packages/{data-pusher => pusher}/src/unexported-airnode-features/api-specification-processing.ts (100%) rename packages/{data-pusher => pusher}/src/unexported-airnode-features/unsafe-evaluate.test.ts (100%) rename packages/{data-pusher => pusher}/src/unexported-airnode-features/unsafe-evaluate.ts (100%) rename packages/{data-pusher => pusher}/src/unexported-airnode-features/vm-timers.ts (100%) rename packages/{data-pusher => pusher}/src/update-signed-api.ts (100%) rename packages/{data-pusher => pusher}/src/utils.ts (100%) rename packages/{data-pusher => pusher}/src/validation/config.ts (100%) rename packages/{data-pusher => pusher}/src/validation/env.ts (100%) rename packages/{data-pusher => pusher}/src/validation/schema.test.ts (100%) rename packages/{data-pusher => pusher}/src/validation/schema.ts (100%) rename packages/{data-pusher => pusher}/src/validation/utils.ts (100%) rename packages/{data-pusher => pusher}/test/fixtures.ts (100%) rename packages/{data-pusher => pusher}/tsconfig.build.json (100%) rename packages/{data-pusher => pusher}/tsconfig.json (100%) diff --git a/README.md b/README.md index 12cfd39b..fe788203 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ A monorepo for managing signed data. Consists of: - [api](./packages/api/README.md) - A service for storing and accessing signed data. It provides endpoints to handle signed data for a specific airnode. -- [data-pusher](./packages/data-pusher/README.md) - A service for pushing data provider signed data. +- [common](./packages/common/README.md) - An internal-only package with common types and utilities used by other + packages. +- [pusher](./packages/pusher/README.md) - A service for pushing data provider signed data. ## Getting started diff --git a/packages/data-pusher/.env.example b/packages/pusher/.env.example similarity index 100% rename from packages/data-pusher/.env.example rename to packages/pusher/.env.example diff --git a/packages/data-pusher/.eslintignore b/packages/pusher/.eslintignore similarity index 100% rename from packages/data-pusher/.eslintignore rename to packages/pusher/.eslintignore diff --git a/packages/data-pusher/.prettierignore b/packages/pusher/.prettierignore similarity index 100% rename from packages/data-pusher/.prettierignore rename to packages/pusher/.prettierignore diff --git a/packages/data-pusher/README.md b/packages/pusher/README.md similarity index 98% rename from packages/data-pusher/README.md rename to packages/pusher/README.md index 67670662..750370ad 100644 --- a/packages/data-pusher/README.md +++ b/packages/pusher/README.md @@ -1,6 +1,4 @@ - - -# data-pusher +# pusher > A service for storing and accessing signed data. @@ -350,7 +348,7 @@ pnpm run docker:stop ### Development only docker instructions -By default the `CONFIG_PATH` is points to the `data-pusher/config` directory. This means it's possible to run: +By default the `CONFIG_PATH` is points to the `pusher/config` directory. This means it's possible to run: ```bash pnpm run docker:build diff --git a/packages/data-pusher/config/pusher.example.json b/packages/pusher/config/pusher.example.json similarity index 100% rename from packages/data-pusher/config/pusher.example.json rename to packages/pusher/config/pusher.example.json diff --git a/packages/data-pusher/config/secrets.example.env b/packages/pusher/config/secrets.example.env similarity index 100% rename from packages/data-pusher/config/secrets.example.env rename to packages/pusher/config/secrets.example.env diff --git a/packages/data-pusher/docker/Dockerfile b/packages/pusher/docker/Dockerfile similarity index 69% rename from packages/data-pusher/docker/Dockerfile rename to packages/pusher/docker/Dockerfile index 0a342151..3d21df92 100644 --- a/packages/data-pusher/docker/Dockerfile +++ b/packages/pusher/docker/Dockerfile @@ -6,19 +6,19 @@ WORKDIR /usr/src/app # the monorepo into the image. COPY . . RUN npm install -g pnpm -# Installs all dependencies only for the data-pusher package. -RUN pnpm install --recursive --filter data-pusher -# Builds the data-pusher package. -RUN pnpm run --filter data-pusher build +# Installs all dependencies only for the pusher package. +RUN pnpm install --recursive --filter pusher +# Builds the pusher package. +RUN pnpm run --filter pusher build # Step 2: Run the built application. FROM node:18-alpine -WORKDIR /usr/src/app/packages/data-pusher +WORKDIR /usr/src/app/packages/pusher # Copies the built application from the builder image. -COPY --from=builder /usr/src/app/packages/data-pusher/dist ./dist +COPY --from=builder /usr/src/app/packages/pusher/dist ./dist # Copies the package.json from the builder image. -COPY --from=builder /usr/src/app/packages/data-pusher/package.json . +COPY --from=builder /usr/src/app/packages/pusher/package.json . # This Dockerfile copies the pnpm-lock.yaml file from the monorepo root to install locked dependency versions. This # guarantees consistency by utilizing identical sets of dependencies. COPY pnpm-lock.yaml . diff --git a/packages/data-pusher/docker/docker-compose.yml b/packages/pusher/docker/docker-compose.yml similarity index 85% rename from packages/data-pusher/docker/docker-compose.yml rename to packages/pusher/docker/docker-compose.yml index 9b851949..cab65461 100644 --- a/packages/data-pusher/docker/docker-compose.yml +++ b/packages/pusher/docker/docker-compose.yml @@ -1,10 +1,10 @@ version: '3.8' services: - data-pusher: + pusher: build: context: ../../../ - dockerfile: ./packages/data-pusher/docker/Dockerfile + dockerfile: ./packages/pusher/docker/Dockerfile environment: - NODE_ENV=production volumes: @@ -18,4 +18,4 @@ services: # Docker Compose doesn't allow setting default values based on the current shell's environment, so we can't access # current working directory and default to "$(pwd)/config". For this reason we default to the config folder # relative to the docker-compose.yml file. - - ${CONFIG_PATH:-../config}:/usr/src/app/packages/data-pusher/dist/config + - ${CONFIG_PATH:-../config}:/usr/src/app/packages/pusher/dist/config diff --git a/packages/data-pusher/jest.config.js b/packages/pusher/jest.config.js similarity index 100% rename from packages/data-pusher/jest.config.js rename to packages/pusher/jest.config.js diff --git a/packages/data-pusher/package.json b/packages/pusher/package.json similarity index 98% rename from packages/data-pusher/package.json rename to packages/pusher/package.json index 52983b9a..eee8772e 100644 --- a/packages/data-pusher/package.json +++ b/packages/pusher/package.json @@ -1,5 +1,5 @@ { - "name": "data-pusher", + "name": "pusher", "version": "1.0.0", "engines": { "node": "^18.14.0", diff --git a/packages/data-pusher/src/api-requests/data-provider.test.ts b/packages/pusher/src/api-requests/data-provider.test.ts similarity index 100% rename from packages/data-pusher/src/api-requests/data-provider.test.ts rename to packages/pusher/src/api-requests/data-provider.test.ts diff --git a/packages/data-pusher/src/api-requests/data-provider.ts b/packages/pusher/src/api-requests/data-provider.ts similarity index 100% rename from packages/data-pusher/src/api-requests/data-provider.ts rename to packages/pusher/src/api-requests/data-provider.ts diff --git a/packages/data-pusher/src/api-requests/signed-api.test.ts b/packages/pusher/src/api-requests/signed-api.test.ts similarity index 100% rename from packages/data-pusher/src/api-requests/signed-api.test.ts rename to packages/pusher/src/api-requests/signed-api.test.ts diff --git a/packages/data-pusher/src/api-requests/signed-api.ts b/packages/pusher/src/api-requests/signed-api.ts similarity index 100% rename from packages/data-pusher/src/api-requests/signed-api.ts rename to packages/pusher/src/api-requests/signed-api.ts diff --git a/packages/data-pusher/src/constants.ts b/packages/pusher/src/constants.ts similarity index 100% rename from packages/data-pusher/src/constants.ts rename to packages/pusher/src/constants.ts diff --git a/packages/data-pusher/src/fetch-beacon-data.ts b/packages/pusher/src/fetch-beacon-data.ts similarity index 100% rename from packages/data-pusher/src/fetch-beacon-data.ts rename to packages/pusher/src/fetch-beacon-data.ts diff --git a/packages/data-pusher/src/index.ts b/packages/pusher/src/index.ts similarity index 100% rename from packages/data-pusher/src/index.ts rename to packages/pusher/src/index.ts diff --git a/packages/data-pusher/src/logger.ts b/packages/pusher/src/logger.ts similarity index 100% rename from packages/data-pusher/src/logger.ts rename to packages/pusher/src/logger.ts diff --git a/packages/data-pusher/src/sign-template-data.test.ts b/packages/pusher/src/sign-template-data.test.ts similarity index 100% rename from packages/data-pusher/src/sign-template-data.test.ts rename to packages/pusher/src/sign-template-data.test.ts diff --git a/packages/data-pusher/src/sign-template-data.ts b/packages/pusher/src/sign-template-data.ts similarity index 100% rename from packages/data-pusher/src/sign-template-data.ts rename to packages/pusher/src/sign-template-data.ts diff --git a/packages/data-pusher/src/state.test.ts b/packages/pusher/src/state.test.ts similarity index 100% rename from packages/data-pusher/src/state.test.ts rename to packages/pusher/src/state.test.ts diff --git a/packages/data-pusher/src/state.ts b/packages/pusher/src/state.ts similarity index 100% rename from packages/data-pusher/src/state.ts rename to packages/pusher/src/state.ts diff --git a/packages/data-pusher/src/unexported-airnode-features/api-specification-processing.ts b/packages/pusher/src/unexported-airnode-features/api-specification-processing.ts similarity index 100% rename from packages/data-pusher/src/unexported-airnode-features/api-specification-processing.ts rename to packages/pusher/src/unexported-airnode-features/api-specification-processing.ts diff --git a/packages/data-pusher/src/unexported-airnode-features/unsafe-evaluate.test.ts b/packages/pusher/src/unexported-airnode-features/unsafe-evaluate.test.ts similarity index 100% rename from packages/data-pusher/src/unexported-airnode-features/unsafe-evaluate.test.ts rename to packages/pusher/src/unexported-airnode-features/unsafe-evaluate.test.ts diff --git a/packages/data-pusher/src/unexported-airnode-features/unsafe-evaluate.ts b/packages/pusher/src/unexported-airnode-features/unsafe-evaluate.ts similarity index 100% rename from packages/data-pusher/src/unexported-airnode-features/unsafe-evaluate.ts rename to packages/pusher/src/unexported-airnode-features/unsafe-evaluate.ts diff --git a/packages/data-pusher/src/unexported-airnode-features/vm-timers.ts b/packages/pusher/src/unexported-airnode-features/vm-timers.ts similarity index 100% rename from packages/data-pusher/src/unexported-airnode-features/vm-timers.ts rename to packages/pusher/src/unexported-airnode-features/vm-timers.ts diff --git a/packages/data-pusher/src/update-signed-api.ts b/packages/pusher/src/update-signed-api.ts similarity index 100% rename from packages/data-pusher/src/update-signed-api.ts rename to packages/pusher/src/update-signed-api.ts diff --git a/packages/data-pusher/src/utils.ts b/packages/pusher/src/utils.ts similarity index 100% rename from packages/data-pusher/src/utils.ts rename to packages/pusher/src/utils.ts diff --git a/packages/data-pusher/src/validation/config.ts b/packages/pusher/src/validation/config.ts similarity index 100% rename from packages/data-pusher/src/validation/config.ts rename to packages/pusher/src/validation/config.ts diff --git a/packages/data-pusher/src/validation/env.ts b/packages/pusher/src/validation/env.ts similarity index 100% rename from packages/data-pusher/src/validation/env.ts rename to packages/pusher/src/validation/env.ts diff --git a/packages/data-pusher/src/validation/schema.test.ts b/packages/pusher/src/validation/schema.test.ts similarity index 100% rename from packages/data-pusher/src/validation/schema.test.ts rename to packages/pusher/src/validation/schema.test.ts diff --git a/packages/data-pusher/src/validation/schema.ts b/packages/pusher/src/validation/schema.ts similarity index 100% rename from packages/data-pusher/src/validation/schema.ts rename to packages/pusher/src/validation/schema.ts diff --git a/packages/data-pusher/src/validation/utils.ts b/packages/pusher/src/validation/utils.ts similarity index 100% rename from packages/data-pusher/src/validation/utils.ts rename to packages/pusher/src/validation/utils.ts diff --git a/packages/data-pusher/test/fixtures.ts b/packages/pusher/test/fixtures.ts similarity index 100% rename from packages/data-pusher/test/fixtures.ts rename to packages/pusher/test/fixtures.ts diff --git a/packages/data-pusher/tsconfig.build.json b/packages/pusher/tsconfig.build.json similarity index 100% rename from packages/data-pusher/tsconfig.build.json rename to packages/pusher/tsconfig.build.json diff --git a/packages/data-pusher/tsconfig.json b/packages/pusher/tsconfig.json similarity index 100% rename from packages/data-pusher/tsconfig.json rename to packages/pusher/tsconfig.json diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 580ef32a..63402015 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -106,7 +106,7 @@ importers: specifier: ^3.22.2 version: 3.22.2 - packages/data-pusher: + packages/pusher: dependencies: '@api3/airnode-abi': specifier: ^0.12.0