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: tup-274 core-styles dependencies to root #51

Merged
merged 5 commits into from
Oct 28, 2022

Conversation

wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented Sep 1, 2022

Overview

Move core-styles dependencies to root package.json.

But also tetain its dependencies as peerDependencies so any client repo can resolve the dependencies in a way that is compatible with tup-ui monorepo.

Simplify core-styles project.json.

I reduce complexity that seems unnecessary for core-styles.

Related

Changes

  • install core-styles dependencies to the root
  • list core-styles dependencies, internally, as peer dependencies*
  • chore: simplify core-styles project.json

* By not using dependencies, internal to core-styles, a set of dependencies is not exactly duplicated from root. Instead, core-styles lists dependencies that it expects are installed (whether by TACC/tup-ui or TACC/Core-CMS† or TACC/Core-Portal). This works because peerDependencies are automatically installed, if not already installed (as of NPM v7).
† TACC/Core-CMS is not using TACC/tup-ui's core-styles, but it is supposed to in the future, so this change makes its build process remain compatible with TACC/Core-CMS. I am mirroring and testing this via TACC/Core-Styles#46 and TACC/Core-CMS#552.

Testing

in TACC/tup-ui

  1. Delete (if present): /dist, /libs/core-styles/node_modules, /libs/core-styles/dist.
  2. From root, run npm ci.
  3. From root, run nx run core-styles:build --skip-nx-cache.
  4. Verify the lib builds without error.
  5. From root, run nx run tup-ui:build --skip-nx-cache.
  6. Verify the app builds without error finding a stylesheet.

✅ in TACC/Core-CMS (i.e. TACC/Core-CMS#552)

Already peer-tested via TACC/Core-CMS#552 for TACC/Core-Styles#46 (review).

  1. Clone TACC/Core-CMS.
  2. Checkout branch task/tup-274-core-styles-deps.
  3. Build styles for any CMS project e.g.
    • npm run build --project=core-cms
    • npm run build --project=frontera-cms
  4. Verify the app builds without error.12

Footnotes

  1. A CMS stylesheet build error caused by a missing dependency will halt the build.

  2. An error caused by a missing stylesheet will not halt the build (known problem). Search for Error: Failed to find .

- TUP-274: move core-styles deps to root package.json
- TUP-334: app build must depend on core-styles build
@wesleyboar wesleyboar marked this pull request as ready for review September 2, 2022 01:15
@wesleyboar wesleyboar changed the title feat(core-styles): tup-274 & tup-334 fix(core-styles): tup-274 & tup-334 appd and core styles dependencies Sep 2, 2022
@wesleyboar wesleyboar changed the title fix(core-styles): tup-274 & tup-334 appd and core styles dependencies fix: tup-274 & tup-334 appd and core styles dependencies Sep 2, 2022
@wesleyboar wesleyboar changed the title fix: tup-274 & tup-334 appd and core styles dependencies fix: tup-274 & tup-334 apps and styles dependencies Sep 2, 2022
Once tested using `--skip-nx-cache` this solution proved ineffective.
@wesleyboar wesleyboar changed the title fix: tup-274 & tup-334 apps and styles dependencies fix: tup-274 core-styles dependencies to root Sep 2, 2022
@wesleyboar wesleyboar marked this pull request as draft September 2, 2022 16:56
@wesleyboar wesleyboar marked this pull request as ready for review September 2, 2022 17:09
@wesleyboar
Copy link
Member Author

@rstijerina approved the same PR for TACC/Core-Styles standalone repo and performed the CMS test steps.

@wesleyboar wesleyboar removed the request for review from jchuahtacc October 20, 2022 16:59
@wesleyboar
Copy link
Member Author

Merging based on:

  • local testing
  • successful automated check
  • successful peer test of change on Core-CMS and Core-Styles
  • desire to have less outstanding PRs for Core Styles
  • desire to have less outstanding discrepancies between TACC/Core Styles and TACC/tup-ui:libs/core-styles

@wesleyboar wesleyboar merged commit 6192821 into main Oct 28, 2022
@wesleyboar wesleyboar deleted the task/tup-274-core-styles-deps branch October 28, 2022 20:34
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.

1 participant