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 - storybook #462

Conversation

wesleyboar
Copy link
Member

@wesleyboar wesleyboar commented May 16, 2024

Overview

Add Storybook to Core-Components.

Related

Changes

  • documented command to start demo
  • added ./storybook config
  • documented commands for core-components in isolation
  • documented reference for Storybook
  • added command to start demo
  • updated dependencies for core-components
  • added more targets for core-components
  • added stories for Button component
  • added tup-ui support for Storybook in core-components
  • fixed core-components workspace reference

Testing

Serve Demo

  1. rm -rf node_modules
  2. npm install --include=optional --workspace=libs/core-components
  3. npx nx serve core-components
  4. Open Storybook at URL provided.
  5. View "Button" → "Types" is available.
  6. Verify "Button" types render accurately.
serve (log)
$ rm -rf node_modules
$ npm install --include=optional --workspace=libs/core-components
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead
(################⠂⠂) ⠋ reify:type-fest: timing reifyNode:node_modules/@csstools/postcss-cascade-l(################⠂⠂) ⠇ reify:pretty-format: timing reifyNode:node_modules/@babel/template Complet(################⠂⠂) ⠋ reify:@storybook/core-events: timing reifyNode:node_modules/commander Comp(################⠂⠂) ⠼ reify:@storybook/builder-vite: timing reifyNode:node_modules/@storybook/pr(#################⠂) ⠧ reify:xmlchars: timing reifyNode:node_modules/@eslint-community/eslint-uti(#################⠂) ⠹ reify:@nodelib/fs.scandir: timing reifyNode:node_modules/@babel/plugin-tra(#################⠂) ⠦ reify:domutils: timing reifyNode:node_modules/@eslint-community/regexpp Co

added 1473 packages, and audited 1475 packages in 19s

262 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (7 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
$ npx nx serve core-components

> nx run core-components:serve

info => Starting manager..
info => Starting preview..
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
╭────────────────────────────────────────────────────╮
│                                                    │
│   Storybook 7.6.19 for react-vite started          │
│   124 ms for manager and 5.52 s for preview        │
│                                                    │
│    Local:            http://localhost:4400/        │
│    On your network:  http://192.168.1.177:4400/    │
│                                                    │
╰────────────────────────────────────────────────────╯

attention => Storybook now collects completely anonymous telemetry regarding usage.
This information is used to shape Storybook's roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://storybook.js.org/telemetry

Build & Run Demo

  1. rm -rf node_modules
  2. npm install --include=optional --workspace=libs/core-components
  3. npx nx build-storybook core-components
  4. npx serve dist/storybook/core-components
  5. Open Storybook at URL provided.
  6. View "Button" → "Types" is available.
  7. Verify "Button" types render accurately.
build & run demo (log)
$ rm -rf node_modules
$ npm install --include=optional --workspace=libs/core-components
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead

added 1473 packages, and audited 1475 packages in 19s

262 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (7 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
$ npx nx build-storybook core-components

> nx run core-components:build-storybook


>  NX  Storybook builder starting ...

info => Cleaning outputDir: /dist/storybook/core-components
info => Loading presets
info => Building manager..
info => Manager built (268 ms)
info => Building preview..
info => Copying static files: /Users/wbomar/Code/tup-ui/node_modules/@storybook/manager/static at /Users/wbomar/Code/tup-ui/dist/storybook/core-components/sb-common-assets
The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

[vite:dts] You are building a library that may not need to generate declaration files.

vite v5.0.11 building for production...

[vite:lib-inject-css] Current is not in library mode or building process, skip code injection.


./sb-common-assets/fonts.css doesn't exist at build time, it will remain unchanged to be resolved at runtime
node_modules/telejson/dist/index.mjs (1413:15) Use of eval in "node_modules/telejson/dist/index.mjs" is strongly discouraged as it poses security risks and may cause issues with minification.
node_modules/telejson/dist/index.mjs (1416:18) Use of eval in "node_modules/telejson/dist/index.mjs" is strongly discouraged as it poses security risks and may cause issues with minification.
✓ 751 modules transformed.
../../dist/storybook/core-components/iframe.html                                     12.70 kB │ gzip:   3.64 kB
../../dist/storybook/core-components/assets/BentonSans-Black-D5w7wBkr.otf            13.86 kB
../../dist/storybook/core-components/assets/BentonSans-Regular-ci4oNjIa.otf          25.26 kB
../../dist/storybook/core-components/assets/BentonSans-Bold-ZsbYR1K0.otf             46.13 kB
../../dist/storybook/core-components/assets/BentonSans-Medium-cBzDwajt.otf           46.48 kB
../../dist/storybook/core-components/assets/BentonSans-RegularItalic-ON_Wr6mS.otf    46.54 kB
../../dist/storybook/core-components/assets/BentonSans-MediumItalic-OgAvf_Nj.otf     47.03 kB
../../dist/storybook/core-components/assets/Button-PjfPTwVO.css                       1.45 kB │ gzip:   0.59 kB
../../dist/storybook/core-components/assets/preview-tn9ZKBp0.css                    179.78 kB │ gzip:  62.90 kB
../../dist/storybook/core-components/assets/preview-O4Pk3XdM.js                       0.00 kB │ gzip:   0.02 kB
../../dist/storybook/core-components/assets/WithTooltip-V3YHNWJZ-ncTRPzZJ.js          0.32 kB │ gzip:   0.23 kB
../../dist/storybook/core-components/assets/syntaxhighlighter-B5GMVT5T-q_1gXYND.js    0.33 kB │ gzip:   0.25 kB
../../dist/storybook/core-components/assets/index-6Wp4k42K.js                         0.54 kB │ gzip:   0.32 kB
../../dist/storybook/core-components/assets/preview-Hylgjsqt.js                       0.63 kB │ gzip:   0.38 kB
../../dist/storybook/core-components/assets/index-PPLHz8o0.js                         0.77 kB │ gzip:   0.47 kB
../../dist/storybook/core-components/assets/index-Ogy33U6Z.js                         0.79 kB │ gzip:   0.51 kB
../../dist/storybook/core-components/assets/preview-bEa2SesL.js                       0.86 kB │ gzip:   0.55 kB
../../dist/storybook/core-components/assets/entry-preview-Z8XQxsIe.js                 1.08 kB │ gzip:   0.64 kB
../../dist/storybook/core-components/assets/preview-FekBEZxm.js                       3.19 kB │ gzip:   1.37 kB
../../dist/storybook/core-components/assets/iframe-LVZC8__c.js                        3.88 kB │ gzip:   1.62 kB
../../dist/storybook/core-components/assets/preview-OnO0tzRj.js                       5.23 kB │ gzip:   2.41 kB
../../dist/storybook/core-components/assets/Button.stories-cUSPhfLW.js                6.49 kB │ gzip:   2.88 kB
../../dist/storybook/core-components/assets/index-G6kSzgdV.js                         7.34 kB │ gzip:   2.95 kB
../../dist/storybook/core-components/assets/preview-u8M_OEO2.js                       7.62 kB │ gzip:   1.55 kB
../../dist/storybook/core-components/assets/preview-TkXSQy1x.js                       8.11 kB │ gzip:   3.09 kB
../../dist/storybook/core-components/assets/Color-6VNJS4EI-Y7z03qWk.js               30.93 kB │ gzip:  11.71 kB
../../dist/storybook/core-components/assets/_getPrototype-YNspug2s.js                78.39 kB │ gzip:  23.54 kB
../../dist/storybook/core-components/assets/react-18-JBAUhD2T.js                    134.49 kB │ gzip:  43.43 kB
../../dist/storybook/core-components/assets/entry-preview-docs-wlvrp-Sa.js          321.82 kB │ gzip:  99.67 kB
../../dist/storybook/core-components/assets/DocsRenderer-NNNQARDV-PX_eT4IG.js       541.41 kB │ gzip: 177.55 kB
../../dist/storybook/core-components/assets/formatter-SWP5E3XI-k3mfYiw8.js          601.51 kB │ gzip: 186.19 kB

(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.

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

info => Preview built (21 s)
info => Output directory: /Users/wbomar/Code/tup-ui/dist/storybook/core-components

>  NX  Storybook builder finished ...


>  NX  Storybook files available in dist/storybook/core-components


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

 >  NX   Successfully ran target build-storybook for project core-components (24s)
$ npx serve dist/storybook/core-components

   ┌───────────────────────────────────────────┐
   │                                           │
   │   Serving!                                │
   │                                           │
   │   - Local:    http://localhost:3000       │
   │   - Network:  http://192.168.1.177:3000   │
   │                                           │
   │   Copied local address to clipboard!      │
   │                                           │
   └───────────────────────────────────────────┘

 HTTP  5/16/2024 12:07:27 PM ::1 GET /
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 16 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-common-assets/fonts.css
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 3 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-addons/essentials-viewport-3/manager-bundle.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-manager/runtime.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-addons/essentials-controls-0/manager-bundle.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-addons/essentials-actions-1/manager-bundle.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-addons/essentials-backgrounds-2/manager-bundle.js
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 3 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 4 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-addons/essentials-toolbars-4/manager-bundle.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-addons/essentials-measure-5/manager-bundle.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-addons/essentials-outline-6/manager-bundle.js
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 5 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 6 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 5 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 7 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 13 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 8 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-common-assets/nunito-sans-regular.woff2
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-common-assets/nunito-sans-bold.woff2
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-preview/runtime.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-manager/chunk-ZEU7PDD3.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-manager/chunk-OF4FUD6W.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-manager/chunk-LVLAH4SI.js
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 2 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 5 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 4 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-manager/chunk-CXYKRFSY.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-manager/chunk-4IYAVH3S.js
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 5 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 3 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 8 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 9 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 7 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /index.json
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 1 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-manager/WithTooltip-V3YHNWJZ-TRLNWEGW.js
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 2 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /iframe
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 1 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-common-assets/fonts.css
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/iframe-LVZC8__c.js
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 0 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 1 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-common-assets/nunito-sans-regular.woff2
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-common-assets/nunito-sans-italic.woff2
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 2 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-common-assets/nunito-sans-bold.woff2
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 0 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /sb-common-assets/nunito-sans-bold-italic.woff2
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 3 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 3 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/entry-preview-Z8XQxsIe.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/index-G6kSzgdV.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/react-18-JBAUhD2T.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/entry-preview-docs-wlvrp-Sa.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/_getPrototype-YNspug2s.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/index-Ogy33U6Z.js
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 4 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 2 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 2 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 2 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/preview-tn9ZKBp0.css
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/index-PPLHz8o0.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/preview-u8M_OEO2.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/preview-OnO0tzRj.js
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 8 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 10 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/preview-FekBEZxm.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/preview-O4Pk3XdM.js
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 8 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 6 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 5 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 9 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 3 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 3 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/preview-Hylgjsqt.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/preview-TkXSQy1x.js
 HTTP  5/16/2024 12:07:27 PM ::1 GET /assets/preview-bEa2SesL.js
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 5 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 1 ms
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 2 ms
 HTTP  5/16/2024 12:07:27 PM ::1 GET /index.json
 HTTP  5/16/2024 12:07:27 PM ::1 Returned 304 in 1 ms
 HTTP  5/16/2024 12:07:29 PM ::1 GET /assets/Button-PjfPTwVO.css
 HTTP  5/16/2024 12:07:29 PM ::1 GET /assets/Button.stories-cUSPhfLW.js
 HTTP  5/16/2024 12:07:29 PM ::1 Returned 304 in 7 ms
 HTTP  5/16/2024 12:07:29 PM ::1 Returned 304 in 9 ms

Build Lib

  1. rm -rf node_modules
  2. npm install --include=optional --workspace=libs/core-components
  3. npx nx build core-components
  4. Verify build completes without error.
build lib (log)
$ rm -rf node_modules
$ npm install --include=optional --workspace=libs/core-components
$ npm install --include=optional --workspace=libs/core-components
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead

added 1473 packages, and audited 1475 packages in 19s

262 packages are looking for funding
  run `npm fund` for details

8 vulnerabilities (7 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
$ npx nx build core-components

> nx run core-components:build:production  [local cache]

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 7.06s
[vite:dts] Declaration files built in 3828ms.


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

 >  NX   Successfully ran target build for project core-components (637ms)
 
   Nx read the output from the cache instead of running the command for 1 out of 1 tasks.

UI

serve demo (live code) run demo (from static build)
serve demo run demo
Demo.Interaction.mov

Issues

Important

Adds optional dependencies that are installed by default (details: 5fced48).

Note

The django-pattern-library (now v1.2) (pre v1.2 research) might be useful for demo-ing Core-Styles via Core-CMS. It has no use in Core-Components.

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 and others added 13 commits May 9, 2024 18:19
Because the distinction between them is not accurate.

Both have components that import other components.
This causes more work when renaming a library.
These references are outside of this lib, so yeah, reference lib name.
* feat: tup-700 storybook

STEPS
1. `npm add -D @nx/storybook@17.2.8`
2. `npx nx@17.2.8 g @nx/storybook:configuration core-components --uiFramework="@storybook/react-vite" --bundler="vite"`
3. "Do you want to set up Storybook interaction tests? (Y/n) ›  false"

CONCERNS
1. Generator installed `@swc-node/register` and `@swc/core`.
2. `@vitejs/plugin-react-swc` is already isntalled.
3. [Storybook 7 does not work with @vitejs/plugin-react-swc](storybookjs/storybook#22381)
4. I worry I cannot move to Storybook 8 via NX, because it requires NX v18.

* deps: tup-700 uninstall `@swc-…`

- Vite already uses `@vitejs/plugin-react-swc` (notice the SWC).
- Storybook seems to work fine without these.
- I read that in v8, Storybook will stop isntalling backup compilers.

* feat: tup-700 Button stories, working Controls

* fix: tup-700 ignore stories during build

* fix: nx serve/build/test core-components

* feat: tup-700 button story

* style: npx nx format:write

* docs(tup-ui): tup-700 README "Contributing"

* fix: tup-700 npm ci core-components workspace ★

Running npm ci at this point:
- DOES reinstall deps
- does NOT create libs/core-components/node_modules
- does NOT create libs/core-components/package-lock.json

* npx nx format:write

* docs: do not reference lib names

This causes more work when renaming a library.

* docs: do reference (other) lib names

These references are outside of this lib, so yeah, reference lib name.

* docs(README): add `make start` step

* feat: make storybook optional

* feat: make storybook optional (not peer)

* docs(README): fix serve/start command

* fix: make storybook optional (not peer)

* chore: (redundantly) include optional dependences

Optional dependencies are installed by default.

We can not disable "install optional by default", cuz NX will fail:
nrwl/nx#20617

We can not configure NPM to omit optional deps only per workspace, cuz:
npm/cli#6099

* fix: limit install overhead for core-components

For core-components, tell dev to only install for core-components.

* fix: add missing dependencies for core-components

All this change was required to run `npx nx serve core-components`.

* fix: add missing `build-storybook` npm command

* fix: a TypeScript lint error

Error occurred as red squiggly udnerline in code editor when importing a component from within a component.

* fix: do not pass size to `<Button type="link">`

* feat: load global css via typescript not html
@wesleyboar wesleyboar changed the base branch from main to feat/TUP-700-core-components-node-pkg--wrappers May 16, 2024 18:02
@wesleyboar wesleyboar changed the title feat: TUP-700 @tacc/core-components feat: TUP-700 @tacc/core-components - storybook May 16, 2024
Base automatically changed from feat/TUP-700-core-components-node-pkg--wrappers to epic/TUP-700-core-components-node-pkg May 16, 2024 18:26
…0-core-components-node-pkg--wrappers--storybook
@wesleyboar wesleyboar marked this pull request as ready for review May 16, 2024 18:29
@wesleyboar wesleyboar merged commit a641527 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--storybook branch May 16, 2024 18:29
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