Skip to content
This repository was archived by the owner on Oct 4, 2022. It is now read-only.

Added typings entry in schema-blocks package.json #1141

Merged
merged 1 commit into from
Apr 2, 2021

Conversation

hansjovis
Copy link
Contributor

@hansjovis hansjovis commented Apr 1, 2021

Summary

This PR can be summarized in the following changelog entry:

  • [schema-blocks] Added typings entry to package.json to make sure that other packages can consume the typings even with a linked schema-blocks package.

Relevant technical choices:

  • The location of the typings file of the schema-blocks package (index.d.ts) changes based on whether it is unlinked/installed or linked.
    • Linked: located within dist/index.d.ts
    • Unlinked: located within the package root: index.d.ts.
  • This means that with a linked monorepo, WordPress SEO Premium cannot find the typings file.
    • It assumes that it is located in index.d.ts, but with a linked monorepo it is located within dist/index.d.ts.
  • This PR solves this by explicitly setting the path to the typings in the package.json file.
  • I also adapted the prepublishOnly hook such that the typings property is updated when the package is published.
    • Like happens for main: dist/index.js -> main: index.js right now.

Test instructions

This PR can be tested by following these steps:

Impact check

  • This PR affects the following parts of the plugin, which may require extra testing:
    *

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Quality assurance

  • I have tested this code to the best of my abilities
  • I have added unittests to verify the code works as intended

Fixes #

…can consume the typings even with a linked schema-blocks package.
@hansjovis hansjovis added tooling changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog labels Apr 1, 2021
@increddibelly increddibelly merged commit ac5de57 into develop Apr 2, 2021
@increddibelly increddibelly deleted the add-typings-parameter-to-package-json branch April 2, 2021 07:45
@increddibelly increddibelly added this to the 16.2 milestone Apr 2, 2021
@johannadevos johannadevos added changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog and removed changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog labels Apr 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog innovation tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants