FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
  1. Apr 08, 2025
  2. Apr 04, 2025
  3. Apr 03, 2025
  4. Apr 02, 2025
    • Hal Blackburn's avatar
      chore: add example React app project using the theme · a9464bb0
      Hal Blackburn authored
      This mui-theme-example dir contains a simple React app, built with Vite,
      that imports the theme as a module, and uses the theme plus some
      components we export. It's both a demonstration of how to use the theme
      package, and an integration test that shows the package is working as
      expected.
      a9464bb0
    • Hal Blackburn's avatar
      chore: define a package export structure · 22eca438
      Hal Blackburn authored
      Our @ucam/mui-theme package now defines exports with a specific structure
      to define how theme users import components, and how the theme's internal
      modules are structured. Users can only import modules explicitly
      exported by package.json#exports.
      
      We have the following exports:
      
        - @ucam/mui-theme/package.json
          (In case it's useful in some way, could have additional metadata in
          here for theme users...)
        - @ucam/mui-theme
          The package root, things explicitly exported from src/index.ts
        - @ucam/mui-theme/*
          Subdirectories under src/ that contain an index.ts, these exports
          contain just the things exported by the associated index.ts file.
          These are used to import components, for example, see the current
          placeholders:
          - `import { TestButton } from "@ucam/mui-theme/placeholders/TestButton"`
        - @ucam/mui-theme/fonts
          This is a special case. It contains the asset imports for fonts used
          by our theme/Material UI. It seems sensible to allow theme users to
          import it explicitly, as it'll be imported for side-effects and
          handled by their build system.
      22eca438
    • Hal Blackburn's avatar
    • Hal Blackburn's avatar
      chore: configure packaging as NPM library · 02d4c162
      Hal Blackburn authored
      Rather than targeting web assets (js bundles, etc), the primary project
      build is an NPM package that will be a dependency of other projects that
      are building themselves as web assets. As a result, we don't use vite in
      our own build, rather we use typescript/tsc to create individual ESM
      modules with .d.ts types, .map source maps, and the source files (from
      ./src/ which are referenced from the .map files).
      
      We don't bundle our Storybook stories with the NPM package as they're
      not required to use the theme, but it's possible that downstream
      projects that have their own Storybooks might like to have our stories
      show up in their Storybook, so we could revisit this and consider
      packaging our stories, perhaps as a separate package.
      02d4c162
  5. Apr 01, 2025
  6. Mar 28, 2025
Loading