Skip to content

Commit 49420a4

Browse files
authored
Typescript migration (#102)
* 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
1 parent 4698487 commit 49420a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+866
-463
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Typescript result
2+
app
3+
14
# Dependency directories
25
node_modules/
36

CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
10+
## [3.0.0] - 2022-02-07
11+
12+
### Updated
13+
14+
- 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
15+
916
## [2.2.4] - 2022-02-05
1017

1118
### Fixed
19+
1220
- 404 error on `__webpack_hmr` URL
1321

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

207-
[unreleased]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.4...HEAD
215+
[unreleased]: https://github.com/pipedrive/graphql-schema-registry/compare/v3.0.0...HEAD
216+
[3.0.0]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.4...v3.0.0
208217
[2.2.4]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.3...v2.2.4
209218
[2.2.3]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.2...v2.2.3
210219
[2.2.2]: https://github.com/pipedrive/graphql-schema-registry/compare/v2.2.1...v2.2.2

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ COPY --from=builder-app /app/node_modules /app/node_modules
3737
HEALTHCHECK --interval=10s --timeout=5s --start-period=10s --retries=3 CMD [ "node", "container-health.js" ]
3838
EXPOSE 3000
3939

40-
CMD ["node", "schema-registry.js"]
40+
CMD ["node", "app/schema-registry.js"]

Dockerfile.CI

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ COPY --from=builder-app /app/node_modules /app/node_modules
3636
HEALTHCHECK --interval=10s --timeout=5s --start-period=10s --retries=3 CMD [ "node", "container-health.js" ]
3737
EXPOSE 3000
3838

39-
CMD ["node", "schema-registry.js"]
39+
CMD ["node", "app/schema-registry.js"]

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ With default settings, UI should be accessible at [http://localhost:6001](http:/
7171
```
7272
git clone https://github.com/pipedrive/graphql-schema-registry.git && cd graphql-schema-registry
7373
cp example.env .env && nano .env
74-
node schema-registry.js
74+
node app/schema-registry.js
7575
```
7676

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

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

163163
### DB migrations

app/controller/schema.js

-89
This file was deleted.

app/controller/service.js

-13
This file was deleted.

app/graphql/index.js

-16
This file was deleted.

app/logger.js

-1
This file was deleted.

app/router/index.js

-34
This file was deleted.
File renamed without changes.

dev.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ WORKDIR /app
77

88
EXPOSE 3000
99

10-
CMD ["node", "schema-registry.js"]
10+
CMD ["node", "app/schema-registry.js"]

docker-compose.dev.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ services:
2525
build:
2626
context: .
2727
dockerfile: dev.Dockerfile
28-
command:
29-
node_modules/nodemon/bin/nodemon.js --watch schema-registry.js --watch app
30-
--inspect=0.0.0.0:5850 schema-registry.js
28+
command: ./node_modules/.bin/ts-node-dev --respawn src/schema-registry.ts --watch src --inspect
3129
ports:
3230
- 6001:3000
3331
- 6002:5850

docker-compose.with-kafka-dev.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ services:
2525
build:
2626
context: .
2727
dockerfile: dev.Dockerfile
28-
command:
29-
node_modules/nodemon/bin/nodemon.js --watch schema-registry.js --watch app
30-
--inspect=0.0.0.0:5850 schema-registry.js
28+
command: ./node_modules/.bin/ts-node-dev --respawn src/schema-registry.ts --watch src --inspect
3129
ports:
3230
- 6001:3000
3331
- 6002:5850

0 commit comments

Comments
 (0)