Skip to content

Commit

Permalink
Typescript migration (#102)
Browse files Browse the repository at this point in the history
* change build command

* move all js files to new folder & rename extension

* add ignore to destination folder

* fix critical TS errors

* fix unit test runner

* fix functional tests

* fix frontend build

* fix asset serving, move schema-registry.js file to src

* format

* fix graphql endpoint

* fix trx param passing, caused func test failures

* add /schema/diff func test

* bump version

* format
  • Loading branch information
tot-ra authored Feb 7, 2022
1 parent 4698487 commit 49420a4
Show file tree
Hide file tree
Showing 62 changed files with 866 additions and 463 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Typescript result
app

# Dependency directories
node_modules/

Expand Down
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.0.0] - 2022-02-07

### Updated

- full rewrite / migration to typescript. Using major version, because of potential incompatibilities that may arise if native installation is used, for example `schema-registry.js` file that was moved from project root into `app` folder

## [2.2.4] - 2022-02-05

### Fixed

- 404 error on `__webpack_hmr` URL

## [2.2.3] - 2022-02-04
Expand Down Expand Up @@ -204,7 +212,8 @@ DELETE /schema/:schemaId
- Frontend app
- Examples of gateway + 2 federated services

[unreleased]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.4...HEAD
[unreleased]: https://github.com/pipedrive/graphql-schema-registry/compare/v3.0.0...HEAD
[3.0.0]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.4...v3.0.0
[2.2.4]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.3...v2.2.4
[2.2.3]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.2...v2.2.3
[2.2.2]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.1...v2.2.2
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ COPY --from=builder-app /app/node_modules /app/node_modules
HEALTHCHECK --interval=10s --timeout=5s --start-period=10s --retries=3 CMD [ "node", "container-health.js" ]
EXPOSE 3000

CMD ["node", "schema-registry.js"]
CMD ["node", "app/schema-registry.js"]
2 changes: 1 addition & 1 deletion Dockerfile.CI
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ COPY --from=builder-app /app/node_modules /app/node_modules
HEALTHCHECK --interval=10s --timeout=5s --start-period=10s --retries=3 CMD [ "node", "container-health.js" ]
EXPOSE 3000

CMD ["node", "schema-registry.js"]
CMD ["node", "app/schema-registry.js"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ With default settings, UI should be accessible at [http://localhost:6001](http:/
```
git clone https://github.com/pipedrive/graphql-schema-registry.git && cd graphql-schema-registry
cp example.env .env && nano .env
node schema-registry.js
node app/schema-registry.js
```

### Docker image
Expand Down Expand Up @@ -157,7 +157,7 @@ To have fast iteration of working on UI changes, you can avoid running node serv

```
docker-compose -f docker-compose.light.yml up
DB_HOST=localhost DB_PORT=6000 REDIS_HOST=localhost REDIS_PORT=6004 PORT=6001 node schema-registry.js
npm run develop
```

### DB migrations
Expand Down
89 changes: 0 additions & 89 deletions app/controller/schema.js

This file was deleted.

13 changes: 0 additions & 13 deletions app/controller/service.js

This file was deleted.

16 changes: 0 additions & 16 deletions app/graphql/index.js

This file was deleted.

1 change: 0 additions & 1 deletion app/logger.js

This file was deleted.

34 changes: 0 additions & 34 deletions app/router/index.js

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ WORKDIR /app

EXPOSE 3000

CMD ["node", "schema-registry.js"]
CMD ["node", "app/schema-registry.js"]
4 changes: 1 addition & 3 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ services:
build:
context: .
dockerfile: dev.Dockerfile
command:
node_modules/nodemon/bin/nodemon.js --watch schema-registry.js --watch app
--inspect=0.0.0.0:5850 schema-registry.js
command: ./node_modules/.bin/ts-node-dev --respawn src/schema-registry.ts --watch src --inspect
ports:
- 6001:3000
- 6002:5850
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.with-kafka-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ services:
build:
context: .
dockerfile: dev.Dockerfile
command:
node_modules/nodemon/bin/nodemon.js --watch schema-registry.js --watch app
--inspect=0.0.0.0:5850 schema-registry.js
command: ./node_modules/.bin/ts-node-dev --respawn src/schema-registry.ts --watch src --inspect
ports:
- 6001:3000
- 6002:5850
Expand Down
Loading

0 comments on commit 49420a4

Please sign in to comment.