CircleCI-Public / circleci-config-sdk-ts

Generate CircleCI Configuration YAML from JavaScript or TypeScript. Use Dynamic Configuration and the Config SDK together for live generative config.
https://circleci-public.github.io/circleci-config-sdk-ts/
Apache License 2.0
82 stars 29 forks source link

refactor!: separate SDK and Parser #114

Closed KyleTryon closed 2 years ago

KyleTryon commented 2 years ago

This PR removes the parsing functionality of the Config SDK and relocates the logic to a separate package named @circleci/circleci-config-parser, which will have the SDK as a dependency

Why?

  1. Remove a large amount of code that will not be used by the majority of developers attempting to generate configs for CI
  2. Removes external dependencies on AJV and related libraries used for schema checking
  3. Prepares the library for potential JSII integration

Other:

This PR contains a large number of commits and changes. The following explains the reasoning:

ghost commented 2 years ago
👇 Click on the image for a new way to code review - Make big changes easier — review code in small groups of related files - Know where to start — see the whole change at a glance - Take a code tour — explore the change with an interactive tour - Make comments and review — all fully sync’ed with github [Try it now!](https://app.codesee.io/r/reviews?pr=114&src=https%3A%2F%2Fgithub.com%2FCircleCI-Public%2Fcircleci-config-sdk-ts)

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map Legend

codecov[bot] commented 2 years ago

Codecov Report

Merging #114 (6af09e7) into main (48bff2c) will decrease coverage by 0.32%. The diff coverage is 98.41%.

@@             Coverage Diff             @@
##              main     #114      +/-   ##
===========================================
- Coverage   100.00%   99.67%   -0.33%     
===========================================
  Files          106       61      -45     
  Lines         1025      614     -411     
  Branches        87       46      -41     
===========================================
- Hits          1025      612     -413     
- Misses           0        1       +1     
- Partials         0        1       +1     
Impacted Files Coverage Δ
...b/Components/Commands/exports/Native/AddSSHKeys.ts 100.00% <ø> (ø)
...omponents/Commands/exports/Native/Cache/Restore.ts 100.00% <ø> (ø)
...b/Components/Commands/exports/Native/Cache/Save.ts 100.00% <ø> (ø)
...lib/Components/Commands/exports/Native/Checkout.ts 100.00% <ø> (ø)
...nents/Commands/exports/Native/SetupRemoteDocker.ts 100.00% <ø> (ø)
...mponents/Commands/exports/Native/StoreArtifacts.ts 100.00% <ø> (ø)
...onents/Commands/exports/Native/StoreTestResults.ts 100.00% <ø> (ø)
...onents/Commands/exports/Native/Workspace/Attach.ts 100.00% <ø> (ø)
...nents/Commands/exports/Native/Workspace/Persist.ts 100.00% <ø> (ø)
...rc/lib/Components/Executors/exports/DockerImage.ts 100.00% <ø> (ø)
... and 23 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.