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

refactor: migrate oas libraries of ours into this new monorepo #811

Merged
merged 10 commits into from
Oct 5, 2023

Conversation

erunion
Copy link
Member

@erunion erunion commented Oct 5, 2023

🧰 Changes

This migrates the following libraries into the new monorepo structure that I've started with #810:

Others that may be moved later:

  • oas-examples: Maybe but I think it's fine as-is.
  • oas-to-snippet: This needs some work to be ESM ready so it'll come over later.
  • openapi-parser: Our fork of APIDevTools/swagger-parser has diverged from upstream pretty well so I might fully detach ourselves and move that in here so all of our OpenAPI tooling is under one roof. TBD though.

@erunion erunion added enhancement New feature or request refactor Issues about tackling technical debt labels Oct 5, 2023
@erunion erunion marked this pull request as ready for review October 5, 2023 17:41
Copy link
Member

@kanadgupta kanadgupta left a comment

Choose a reason for hiding this comment

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

i have a lot of ideas for how we can consolidate a lot of the config here, but for the sake of this PR, LGTM!


[![Build](https://github.com/readmeio/oas/workflows/CI/badge.svg)](https://github.com/readmeio/oas/tree/main/packages/oas-extensions)

[![](https://raw.githubusercontent.com/readmeio/.github/main/oss-header.png)](https://readme.io)
Copy link
Member

Choose a reason for hiding this comment

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

ohhh thank you for this

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah i was sick of seeing that cloudfront.net link

Copy link
Member

Choose a reason for hiding this comment

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

I have an open design request to update this and i was literally thinking of doing this so we can just update the graphic in one fell swoop

Copy link
Member

Choose a reason for hiding this comment

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

since we're specifying files via that files array in the package.json, we might not need a lot of this but that can happen in a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

would love to make a shared tsup config at the top level (but again, can happen in a separate PR)

@@ -31,4 +31,16 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: npm ci

# With the way these libraries use each other we need to run our build step for linting in a
Copy link
Member

Choose a reason for hiding this comment

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

i think it'd be safer to configure stuff like this via lerna, that way we can run a top-level npm run build command. i think something like this? https://lerna.js.org/docs/concepts/task-pipeline-configuration#define-task-dependencies-aka-task-pipelines

Copy link
Member Author

Choose a reason for hiding this comment

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

It only seems like we're able to say "run before " but only on a global level. I don't see any way with Lerna/NX to set up something that says "run oas-normalize build before oas build`.

Copy link
Member

Choose a reason for hiding this comment

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

i might play around with turborepo at some point: https://turbo.build/repo/docs/core-concepts/monorepos/task-dependencies

Base automatically changed from refactor/monorepo to main October 5, 2023 19:25
} else if (typeof obj === 'object') {
return 'json';
} else if (typeof obj === 'string') {
if (obj.match(/\s*{/)) {

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data

This [regular expression](1) that depends on [library input](2) may run slow on strings with many repetitions of ' '.
* refactor: remove pretest scripts

that way we're not double linting

* refactor: build using lerna

* chore: oops
@erunion erunion merged commit 2554cfa into main Oct 5, 2023
@erunion erunion deleted the refactor/migrate-oas-libraries branch October 5, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor Issues about tackling technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants