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

How Best to Provide Compiled Stylesheets #342

Closed
wesleyboar opened this issue Apr 22, 2024 · 2 comments
Closed

How Best to Provide Compiled Stylesheets #342

wesleyboar opened this issue Apr 22, 2024 · 2 comments
Assignees

Comments

@wesleyboar
Copy link
Member

wesleyboar commented Apr 22, 2024

Goal

Design a solution to offer compiled and minified stylesheets without committing dist/ to the repository.

Background

The repository has a /dist folder. This folder provides compilation of stylesheets using non-native CSS (that is made native via postcss) and minifies the CSS (for smaller file size).

To build and commit /dist is:

  • unintuitive software development
  • extra, easy-to-forget step
  • excess data

Expectations

  1. The NPM Package1 offers compiled files.
    Why? So clients can use non-native CSS, from releases, on software that does not compile CSS.
  2. The NPM Package1 offers minification.
    Why? So users download smaller files.
  3. The repository will not save compiled stylesheets from source that uses all native syntax.
    Why? Because a compiled, minified version of all native CSS is redundant.
  4. Client can use, before a release, compiled stylesheet from source that uses non-native syntax.
    Why? So clients can use non-native CSS, from a commit-ish (e.g. commit, branches, tag, pre-releases), on software that does not compile CSS.
  5. (Maybe) Paths to compiled files are less different from paths to source files.
    Currently src/lib/_imports/components/c-some-thing.css is compiled to dist/components/c-some-thing.css.

References

Footnotes

  1. @tacc/core-styles 2

@wesleyboar wesleyboar added this to the Core-Styles v3 milestone Apr 22, 2024
@wesleyboar wesleyboar changed the title How best to Provide Compiled Stylesheets How Best to Provide Compiled Stylesheets Apr 22, 2024
@wesleyboar
Copy link
Member Author

wesleyboar commented Apr 22, 2024

Ideas

A. Only Commit /dist During Release, and As Needed

  1. Retain existing committed files.
  2. Do not commit dist files by default (use .gitignore).
  3. Yet…
    • Do commit dist files on release.
      (Publish step runs a script that runs git add dist.)
    • Do commit dist files when client must test compiled CSS for incomplete feature.
      (Dev manually runs git add dist/components/c-some-thing.css.)

@wesleyboar
Copy link
Member Author

wesleyboar commented Oct 15, 2024

Ideas

B. Publish /dist, Commit As Needed Except on main

Solution:

  • Do not commit /dist.
  • Name source files as *.postcss.
  • Include /dist when publishing to NPM.
  • Allow commits of.css near .postcss.
  • Do not allow .css files in main branch.
    Well, epic/v3 for now.

Completed:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant