Skip to content

v1 Setup#31

Merged
jackyzha0 merged 28 commits into
v1from
v1-staging
Dec 6, 2022
Merged

v1 Setup#31
jackyzha0 merged 28 commits into
v1from
v1-staging

Conversation

@jackyzha0

@jackyzha0 jackyzha0 commented Nov 23, 2022

Copy link
Copy Markdown
Contributor
  • Scaffold new project using Typescript + Fastify + Ava + Standardjs + Swagger + Prometheus
  • Setup CI to run on push/PR (lint + test)

Closes hyphacoop/distributed-press-organizing#57

@catdevnull

Copy link
Copy Markdown

Do ping me for reviewing :)

@RangerMauve RangerMauve left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress! I think the general structure is exactly what we need. 👍

Just left a few comments on some details that could be changed.

Comment thread .github/workflows/tests.yaml Outdated
Comment thread .github/workflows/tests.yaml Outdated
Comment thread v1/package.json Outdated
Comment thread v1/package.json
Comment thread v1/protocols/interfaces.ts
Comment thread v1/config/index.ts Outdated
Comment thread v1/api/index.ts Outdated
Comment thread v1/api/index.ts Outdated
Comment thread v1/api/index.ts Outdated
Comment thread v1/tsconfig.json Outdated
Co-authored-by: RangerMauve <RangerMauve@hotmail.com>
@RangerMauve

Copy link
Copy Markdown
Contributor

Jacky is figuring out the typescript issues with the promethius logger, and we'll create a new issue for it and merge what we have for the project structure so far so that Fauno and others can run the server stubs to start

@jackyzha0
jackyzha0 requested a review from RangerMauve December 2, 2022 21:23
Comment thread v1/package.json Outdated
Comment thread v1/package.json
Comment thread v1/package.json Outdated
@fauno

fauno commented Dec 5, 2022

Copy link
Copy Markdown
Collaborator

Just to note the build breaks if you're using pnpm, I think it's because you need to add this dependency explicitly

> pnpm run build

> distributed-press-api@0.1.0 build /Sutty/api.distributed.press/v1
> npm run clean && tsc


> distributed-press-api@0.1.0 clean
> rm -rf build

api/admin.ts:1:24 - error TS2307: Cannot find module '@sinclair/typebox' or its corresponding type declarations.

1 import { Static } from '@sinclair/typebox'
                         ~~~~~~~~~~~~~~~~~~~

api/publisher.ts:1:30 - error TS2307: Cannot find module '@sinclair/typebox' or its corresponding type declarations.

1 import { Type, Static } from '@sinclair/typebox'
                               ~~~~~~~~~~~~~~~~~~~

api/schemas.ts:1:22 - error TS2307: Cannot find module '@sinclair/typebox' or its corresponding type declarations.

1 import { Type } from '@sinclair/typebox'
                       ~~~~~~~~~~~~~~~~~~~

api/sites.ts:2:30 - error TS2307: Cannot find module '@sinclair/typebox' or its corresponding type declarations.

2 import { Type, Static } from '@sinclair/typebox'
                               ~~~~~~~~~~~~~~~~~~~

config/admin.ts:2:24 - error TS2307: Cannot find module '@sinclair/typebox' or its corresponding type declarations.

2 import { Static } from '@sinclair/typebox'
                         ~~~~~~~~~~~~~~~~~~~

config/publisher.ts:2:24 - error TS2307: Cannot find module '@sinclair/typebox' or its corresponding type declarations.

2 import { Static } from '@sinclair/typebox'
                         ~~~~~~~~~~~~~~~~~~~

config/sites.ts:2:24 - error TS2307: Cannot find module '@sinclair/typebox' or its corresponding type declarations.

2 import { Static } from '@sinclair/typebox'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@fastify+type-provider-typebox@2.4.0_fastify@4.10.2/node_modules/@fastify/type-provider-typebox/dist/index.d.ts:2:33 - error TS2307: Cannot find module '@sinclair/typebox' or its corresponding type declarations.

2 import { Static, TSchema } from '@sinclair/typebox';
                                  ~~~~~~~~~~~~~~~~~~~

protocols/interfaces.ts:1:24 - error TS2307: Cannot find module '@sinclair/typebox' or its corresponding type declarations.

1 import { Static } from '@sinclair/typebox'
                         ~~~~~~~~~~~~~~~~~~~


Found 9 errors in 9 files.

Errors  Files
     1  api/admin.ts:1
     1  api/publisher.ts:1
     1  api/schemas.ts:1
     1  api/sites.ts:2
     1  config/admin.ts:2
     1  config/publisher.ts:2
     1  config/sites.ts:2
     1  node_modules/.pnpm/@fastify+type-provider-typebox@2.4.0_fastify@4.10.2/node_modules/@fastify/type-provider-typebox/dist/index.d.ts:2
     1  protocols/interfaces.ts:1
 ELIFECYCLE  Command failed with exit code 2.

@fauno

fauno commented Dec 5, 2022

Copy link
Copy Markdown
Collaborator

pnpm add @sinclair/typebox fixed it

@fauno

fauno commented Dec 5, 2022

Copy link
Copy Markdown
Collaborator

openapi-generator-cli said:

        -attribute paths.'/v1/publisher/{id}'. Declared path parameter id needs to be defined as a path parameter in path or operation level
        -attribute paths.'/v1/admin/{id}'. Declared path parameter id needs to be defined as a path parameter in path or operation level

@fauno

fauno commented Dec 5, 2022

Copy link
Copy Markdown
Collaborator

openapi-generator-cli said:

        -attribute paths.'/v1/publisher/{id}'. Declared path parameter id needs to be defined as a path parameter in path or operation level
        -attribute paths.'/v1/admin/{id}'. Declared path parameter id needs to be defined as a path parameter in path or operation level

doesn't happen with swagger-codegen-cli

@RangerMauve RangerMauve left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to merge this 👍

@jackyzha0
jackyzha0 merged commit 8ad7f4b into v1 Dec 6, 2022
@jackyzha0
jackyzha0 deleted the v1-staging branch December 6, 2022 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants