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

feat: TUP-700 @tacc/core-components - wrappers #461

Conversation

wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented May 16, 2024

Overview

Merge libs/core-wrappers to libs/core-components.

Related

Changes

  • renames some core-wrappers components
  • moves core-wrappers components to core-components
  • adds core-wrappers component dependencies to core-components peerDep…s

Testing & UI

Run tup-ui

  1. npm ci
  2. Follow Local Dev Setup but with --skip-nx-cache appended to each nx command.
  3. Login to portal.
  4. Verify some libs/core-wrappers still work, like Formik.

Build core-compoennts

  1. npm ci
  2. npx nx build core-components --skip-nx-cache
  3. Verify build completes without error.
Log
$ npx nx build core-components --skip-nx-cache

> nx run core-components:build:production

vite v5.0.11 building for production...
✓ 473 modules transformed.
dist/assets/Section.css                                                  0.03 kB │ gzip:   0.05 kB
dist/assets/FormikCheck.css                                              0.05 kB │ gzip:   0.06 kB
dist/assets/FormikFieldWrapper.css                                       0.11 kB │ gzip:   0.12 kB
dist/assets/Button.css                                                   0.15 kB │ gzip:   0.13 kB
dist/assets/FormField.css                                                0.16 kB │ gzip:   0.13 kB
dist/assets/SectionTableWrapper.css                                      0.25 kB │ gzip:   0.16 kB
dist/assets/Collapse.css                                                 0.29 kB │ gzip:   0.19 kB
dist/assets/SectionHeader.css                                            0.45 kB │ gzip:   0.26 kB
dist/assets/ShowMore.css                                                 0.50 kB │ gzip:   0.27 kB
dist/assets/DescriptionList.css                                          1.23 kB │ gzip:   0.47 kB
dist/assets/LoadingSpinner.css                                           1.26 kB │ gzip:   0.50 kB
dist/assets/SectionContent.css                                           1.30 kB │ gzip:   0.39 kB
dist/assets/Paginator.css                                                1.40 kB │ gzip:   0.56 kB
dist/assets/InfiniteScrollTable.css                                      1.52 kB │ gzip:   0.59 kB
dist/assets/HistoryBadge.css                                             1.83 kB │ gzip:   0.55 kB
dist/assets/Checkbox.css                                                 1.92 kB │ gzip:   0.57 kB
dist/assets/TextCopyField.css                                            1.98 kB │ gzip:   0.54 kB
dist/assets/Pill.css                                                     2.28 kB │ gzip:   0.69 kB
dist/assets/Sidebar.css                                                  2.34 kB │ gzip:   0.73 kB
dist/assets/FileDropzone.css                                             2.52 kB │ gzip:   0.89 kB
dist/assets/DropdownSelector.css                                         3.15 kB │ gzip:   1.06 kB
dist/assets/Message.css                                                  4.81 kB │ gzip:   1.06 kB
dist/lib/Icon/index.js                                                   0.05 kB │ gzip:   0.07 kB
dist/lib/Pill/index.js                                                   0.05 kB │ gzip:   0.07 kB
dist/lib/Button/index.js                                                 0.06 kB │ gzip:   0.07 kB
dist/lib/Message/index.js                                                0.06 kB │ gzip:   0.07 kB
dist/lib/Checkbox/index.js                                               0.06 kB │ gzip:   0.08 kB
dist/lib/Collapse/index.js                                               0.06 kB │ gzip:   0.08 kB
dist/lib/ShowMore/index.js                                               0.06 kB │ gzip:   0.08 kB
dist/lib/Paginator/index.js                                              0.06 kB │ gzip:   0.08 kB
dist/lib/QueryWrapper/index.js                                           0.06 kB │ gzip:   0.08 kB
dist/lib/InlineMessage/index.js                                          0.06 kB │ gzip:   0.08 kB
dist/lib/SubmitWrapper/index.js                                          0.06 kB │ gzip:   0.08 kB
dist/lib/TextCopyField/index.js                                          0.06 kB │ gzip:   0.08 kB
dist/lib/LoadingSpinner/index.js                                         0.06 kB │ gzip:   0.08 kB
dist/lib/SectionMessage/index.js                                         0.06 kB │ gzip:   0.08 kB
dist/lib/DescriptionList/index.js                                        0.07 kB │ gzip:   0.08 kB
dist/lib/DropdownSelector/index.js                                       0.07 kB │ gzip:   0.08 kB
dist/lib/InfiniteScrollTable/index.js                                    0.07 kB │ gzip:   0.09 kB
dist/lib/Section/index.js                                                0.07 kB │ gzip:   0.08 kB
dist/lib/Form/index.js                                                   0.08 kB │ gzip:   0.08 kB
dist/lib/HistoryBadge/index.js                                           0.08 kB │ gzip:   0.09 kB
dist/lib/SectionHeader/index.js                                          0.08 kB │ gzip:   0.09 kB
dist/lib/Sidebar/index.js                                                0.08 kB │ gzip:   0.09 kB
dist/lib/SectionTableWrapper/index.js                                    0.08 kB │ gzip:   0.09 kB
dist/FormikCheck.module-igm12N2y.mjs                                     0.11 kB │ gzip:   0.11 kB
dist/TextCopyField.module-ZJqs59Aw.mjs                                   0.15 kB │ gzip:   0.14 kB
dist/Collapse.module-BeECu8Wx.mjs                                        0.18 kB │ gzip:   0.14 kB
dist/lib/Navbar/index.js                                                 0.18 kB │ gzip:   0.13 kB
dist/lib/Sidebar/Sidebar.js                                              0.19 kB │ gzip:   0.15 kB
dist/lib/SectionContent/index.js                                         0.20 kB │ gzip:   0.15 kB
dist/lib/Wizard/index.js                                                 0.21 kB │ gzip:   0.15 kB
dist/lib/InlineMessage/InlineMessage.js                                  0.34 kB │ gzip:   0.23 kB
dist/lib/FormikFieldWrapper/fields/index.js                              0.39 kB │ gzip:   0.16 kB
dist/lib/Icon/Icon.js                                                    0.39 kB │ gzip:   0.27 kB
dist/lib/FormikFieldWrapper/fields/FormikInput.js                        0.47 kB │ gzip:   0.29 kB
dist/lib/FormikFieldWrapper/fields/FormikTextarea.js                     0.47 kB │ gzip:   0.29 kB
dist/lib/FormikFieldWrapper/fields/FormikSelect.js                       0.50 kB │ gzip:   0.30 kB
dist/lib/FormikFieldWrapper/index.js                                     0.51 kB │ gzip:   0.18 kB
dist/lib/HistoryBadge/HistoryBadge.js                                    0.58 kB │ gzip:   0.38 kB
dist/lib/SectionMessage/SectionMessage.js                                0.62 kB │ gzip:   0.33 kB
dist/lib/FormikFieldWrapper/fields/FormikFileInput/FormikFileInput.js    0.88 kB │ gzip:   0.44 kB
dist/lib/FormikFieldWrapper/FormikFieldWrapper.js                        0.89 kB │ gzip:   0.43 kB
dist/lib/Pill/Pill.js                                                    0.94 kB │ gzip:   0.49 kB
dist/lib/FormikFieldWrapper/fields/FormikCheck.js                        0.97 kB │ gzip:   0.46 kB
dist/lib/DropdownSelector/DropdownSelector.js                            1.01 kB │ gzip:   0.59 kB
dist/utils/withBuilder.js                                                1.08 kB │ gzip:   0.46 kB
dist/lib/Wizard/Wizard.js                                                1.12 kB │ gzip:   0.45 kB
dist/lib/TextCopyField/TextCopyField.js                                  1.20 kB │ gzip:   0.62 kB
dist/lib/Checkbox/Checkbox.js                                            1.23 kB │ gzip:   0.62 kB
dist/lib/SectionHeader/SectionHeader.js                                  1.41 kB │ gzip:   0.67 kB
dist/lib/QueryWrapper/QueryWrapper.js                                    1.42 kB │ gzip:   0.55 kB
dist/lib/SubmitWrapper/SubmitWrapper.js                                  1.68 kB │ gzip:   0.69 kB
dist/Badge-aUGNYyMn.mjs                                                  1.92 kB │ gzip:   0.93 kB
dist/lib/Button/Button.js                                                1.99 kB │ gzip:   0.81 kB
dist/lib/SectionContent/SectionContent.js                                2.09 kB │ gzip:   0.93 kB
dist/lib/LoadingSpinner/LoadingSpinner.js                                2.47 kB │ gzip:   1.12 kB
dist/lib/Paginator/Paginator.js                                          2.57 kB │ gzip:   0.97 kB
dist/index.js                                                            2.91 kB │ gzip:   0.76 kB
dist/lib/Navbar/Navbar.js                                                2.92 kB │ gzip:   0.94 kB
dist/lib/Section/Section.js                                              3.35 kB │ gzip:   1.23 kB
dist/lib/SectionTableWrapper/SectionTableWrapper.js                      3.37 kB │ gzip:   1.33 kB
dist/utils-vK_fRnDN.mjs                                                  3.43 kB │ gzip:   1.51 kB
dist/lib/DescriptionList/DescriptionList.js                              3.50 kB │ gzip:   1.57 kB
dist/Input-vSmlH5h1.mjs                                                  5.49 kB │ gzip:   2.11 kB
dist/Label-xDwva92P.mjs                                                  5.86 kB │ gzip:   1.69 kB
dist/lib/Message/Message.js                                              7.56 kB │ gzip:   2.87 kB
dist/index-IYXU-vNF.mjs                                                  7.78 kB │ gzip:   1.92 kB
dist/lib/Collapse/Collapse.js                                            8.94 kB │ gzip:   2.94 kB
dist/lib/ShowMore/ShowMore.js                                           11.48 kB │ gzip:   4.02 kB
dist/Transition-JDApmdwt.mjs                                            12.16 kB │ gzip:   3.76 kB
dist/index-3VEJf-_Z.mjs                                                 15.85 kB │ gzip:   4.36 kB
dist/FileDropzone.module-hNGezKRg.mjs                                   16.65 kB │ gzip:   4.85 kB
dist/lib/Form/FormField.js                                              17.69 kB │ gzip:   5.16 kB
dist/Sidebar-TqYMB1En.mjs                                               29.58 kB │ gzip:   8.33 kB
dist/lib/FormikFieldWrapper/fields/FormikFileInput/FileDropzone.js      39.57 kB │ gzip:  11.08 kB
dist/formik.esm-gl4tKxa4.mjs                                            55.15 kB │ gzip:  15.17 kB
dist/lib/FormikFieldWrapper/fields/formikPatch.js                      121.78 kB │ gzip:  31.05 kB
dist/lib/InfiniteScrollTable/InfiniteScrollTable.js                    186.26 kB │ gzip:  40.96 kB
dist/index-eb5u1H1X.mjs                                                668.74 kB │ gzip: 155.83 kB

[vite:dts] Start generate declaration files...
✓ built in 13.57s
[vite:dts] Declaration files built in 5434ms.


 ———————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Successfully ran target build for project core-components (17s)

Serve ui-patterns

  1. npm ci
  2. npx nx serve ui-patterns --skip-nx-cache
  3. Verify build completes without error.

UI

tup-ui ui-patterns (top)* ui-patterns (end)*
tup-ui ui-patterns (top) ui-patterns (end)

* ui-patterns (full)

wesleyboar and others added 30 commits February 22, 2024 16:03
1. import & use `dts`
    - Fixes build error:
      > error TS2307: Cannot find module './….module.css' or its corresponding type declarations.
      > … import styles from './….module.css';

2. `"composite": true`
    - Fixes Typescript lint error:
      > Referenced project '/…/tup-ui/libs/core-components/tsconfig.lib.json' must have setting "composite": true.

3. `"declaration": true,`
    - Seemingly caused by `"composite": true`.
    - Fixes Vite build error:
    > \> nx run core-components:build:production
    > error TS6304: Composite projects may not disable declaration emit.
"So the consuming application is aware that it must have React installed to use this package."
— https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma#dependencies
"To prevent the CSS files from being accidentally removed by the consumer's tree-shaking efforts…"
—https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma#side-effects
Move the changes from thsoe commits to be in core-components package.json, not root package.json.

- style: tup-700 peerDependencies

    "So the consuming application is aware that it must have React installed to use this package."
    — https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma#dependencies

- feat: tup-700 add CSS as sideEffects

    "To prevent the CSS files from being accidentally removed by the consumer's tree-shaking efforts…"
    — https://dev.to/receter/how-to-create-a-react-component-library-using-vites-library-mode-4lma#side-effects

- feat: tup-700 ensure build before publish
Resolve all commented code in `vite.config.ts`.

- `outDir` DELETED cuz `rollupOptions` > `output` exists
- `reportCompressedSize` RESTORED cuz why not & it was already there
- `commonjsOptions` & `transformMixedEsModules` DELETED cuz…
    - no `require` i.e. common js modules
- `lib`'s `name` and `fileName` DELETED cuz…
    - `rollupOptions` > `output` > `assetFileNames` exists
    - `rollupOptions` > `output` > `entryFileNames` exists
…CC/tup-ui into feat/TUP-700-core-components-node-pkg
Only 1 root package-lock.json in an Nx project such as tup-ui.

Having this may have been cause of errors when starting CMS.
@wesleyboar wesleyboar changed the title Feat/tup 700 core components node pkg wrappers Feat/tup 700 core components - wrappers May 16, 2024
@wesleyboar wesleyboar changed the title Feat/tup 700 core components - wrappers feat: TUP-700 core components - wrappers May 16, 2024
@wesleyboar wesleyboar changed the title feat: TUP-700 core components - wrappers feat: TUP-700 @tacc/core-components - wrappers May 16, 2024
Base automatically changed from feat/TUP-700-core-components-node-pkg to epic/TUP-700-core-components-node-pkg May 16, 2024 18:01
@wesleyboar wesleyboar merged commit 9e6af47 into epic/TUP-700-core-components-node-pkg May 16, 2024
1 check passed
@wesleyboar wesleyboar deleted the feat/TUP-700-core-components-node-pkg--wrappers branch May 16, 2024 18:26
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