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

fix(*): fix deps and build process #434

Merged
merged 2 commits into from Nov 22, 2021
Merged

Conversation

adamdehaven
Copy link
Collaborator

@adamdehaven adamdehaven commented Nov 22, 2021

Summary

Vue Composition API

When utilizing the @vue/composition-api inside of a Kongponent package, the @vue/composition-api needs to be added as a peerDependency to the component package rather than a dependency.

Currently, installing with yarn with the peer flag yarn add {package-name} --peer is broken

You will need to manually add the peerDependencies entry inside the individual component's package.json. For example, inside ./packages/KTable/package.json this is what was added

{
  "peerDependencies": {
    "@vue/composition-api": "^1.2.4"
  }
}

The parent application must then manually add @vue/composition-api to it's package.json as a dependency if utilizing any of the components depending on the package (this is now outlined in the docs for each corresponding component, currently KTable and KCardCatalog).

This is required as the component must use the same instance of the plugin as the parent application, meaning that the plugin has to be added to the parent application's dependencies. This is further outlined in an issue on the composition api repo.

Once Vue 2.7 is released, @vue/composition-api will be directly shipped with it, so this extra step will no longer be needed.

The quote above, taken from the issue, means that we should plan to upgrade Kongponents (and any parent Kong-owned applications, such as khcp, kong-admin, etc.) to 2.7 when released, which will make utilizing the library easier on the user.

Build Process

Update the build process to copy necessary config files in a separate step, leaving them in place until yarn build:cli finishes, then remove from the individual /package/* directories, as other steps in the build process will fail if postcss.config.js files are not left in place (e.g. in KIcon package) until the completion of all package builds.

Docs

Update docs for KTable and KCardCatalog for usage with Composition API.

PR Checklist

  • Does not introduce dependencies
  • Functional: all changes do not break existing APIs and if so, bump major version.
  • Tests pass: check the output of yarn test packages/
  • Naming: the files and the method and prop variables use the same naming conventions as other Kongponents
  • Framework style: abides by the essential rules in Vue's style guide
  • Cleanliness: does not have formatting issues, unused code (e.g., console.logs), or leftover comments
  • Docs: includes a technically accurate README, uses JSDOC where appropriate

Update build process to copy necessary config files in a separate step,
leave them in place until build:cli finishes, then remove, as other steps
in the build process will fail if postcss.config.js files are not
left in place.

Update @vue/composition-api to be a peerDependency.

Add docs info on KTable and KCardCatalog for how to use with
Composition API.
@adamdehaven adamdehaven self-assigned this Nov 22, 2021
@netlify
Copy link

netlify bot commented Nov 22, 2021

✔️ Deploy Preview for kongponents ready!

🔨 Explore the source changes: 789ad95

🔍 Inspect the deploy log: https://app.netlify.com/sites/kongponents/deploys/619be08486215f00070f9d4b

😎 Browse the preview: https://deploy-preview-434--kongponents.netlify.app

Remove vue as package dependency. Should probably be
added to peerDependencies at some point.
Copy link
Collaborator

@kaiarrowood kaiarrowood left a comment

Choose a reason for hiding this comment

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

This is great!! Thanks Adam!!

@adamdehaven adamdehaven merged commit 9fdd180 into master Nov 22, 2021
@adamdehaven adamdehaven deleted the fix/composition-api-peer-dep branch November 22, 2021 19:23
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

2 participants