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

v1 Setup #31

Merged
merged 28 commits into from
Dec 6, 2022
Merged

v1 Setup #31

merged 28 commits into from
Dec 6, 2022

Conversation

jackyzha0
Copy link
Contributor

@jackyzha0 jackyzha0 commented Nov 23, 2022

  • 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

Do ping me for reviewing :)

Copy link
Contributor

@RangerMauve RangerMauve left a comment

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.

.github/workflows/tests.yaml Outdated Show resolved Hide resolved
.github/workflows/tests.yaml Outdated Show resolved Hide resolved
v1/package.json Outdated Show resolved Hide resolved
v1/package.json Show resolved Hide resolved
v1/protocols/interfaces.ts Show resolved Hide resolved
v1/config/index.ts Outdated Show resolved Hide resolved
v1/api/index.ts Outdated Show resolved Hide resolved
v1/api/index.ts Outdated Show resolved Hide resolved
v1/api/index.ts Outdated Show resolved Hide resolved
v1/tsconfig.json Outdated Show resolved Hide resolved
Co-authored-by: RangerMauve <RangerMauve@hotmail.com>
@RangerMauve
Copy link
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

v1/package.json Outdated Show resolved Hide resolved
v1/package.json Show resolved Hide resolved
v1/package.json Outdated Show resolved Hide resolved
@fauno
Copy link
Collaborator

fauno commented Dec 5, 2022

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
Copy link
Collaborator

fauno commented Dec 5, 2022

pnpm add @sinclair/typebox fixed it

@fauno
Copy link
Collaborator

fauno commented Dec 5, 2022

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
Copy link
Collaborator

fauno commented Dec 5, 2022

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

Copy link
Contributor

@RangerMauve RangerMauve left a comment

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.

None yet

4 participants