Code Monkey home page Code Monkey logo

Comments (19)

benjaoming avatar benjaoming commented on June 26, 2024 1

I think the layout that they suggest looks good:

your-project/
├── scss
│   └── custom.scss
└── bootstrap/
    ├── js
    └── scss

from django-wiki.

oscarmcm avatar oscarmcm commented on June 26, 2024 1

Hey, sure I can take care it, and I think it's a good idea to move that outside of the scrips section. I'll be attending PyTexas this week so I'll try to get some time to work on it first.

from django-wiki.

benjaoming avatar benjaoming commented on June 26, 2024 1

@oscarmcm that's indeed the dependency that I mentioned in the question ;) I'm not good at assessing whether to have a plugin instead of writing 1 hook... dependencies have a price in maintenance, risk of abandonment and supply chain security.. but then on the other hand, developing and maintaining a hook probably has disadvantages too :)

from django-wiki.

oscarmcm avatar oscarmcm commented on June 26, 2024

Now, there's no real need to use a bunch of SCSS files, or are we going to continue supporting this?

https://getbootstrap.com/docs/4.6/getting-started/theming/

from django-wiki.

benjaoming avatar benjaoming commented on June 26, 2024

I would think that we still need to have the source Bootstrap files that we are building with? But we can split our own custom overrides from those so that everything from Bootstrap is kept separately and can easily be updated.

from django-wiki.

oscarmcm avatar oscarmcm commented on June 26, 2024

I would think that we still need to have the source Bootstrap files

Yes, we still need the imports like this:

// Custom.scss
// Option A: Include all of Bootstrap

// Include any default variable overrides here (though functions won't be available)

@import "../node_modules/bootstrap/scss/bootstrap";

// Then add additional custom code here

But I think that this will no longer be required to have all of this unless you still want to continue using the current structure.

from django-wiki.

benjaoming avatar benjaoming commented on June 26, 2024

I don't think we should have any Node stack in the project for this reason. That'd have to happen because of something more important.

I have so far benefited from having the Bootstrap source files in the repo because I often read the code.

from django-wiki.

benjaoming avatar benjaoming commented on June 26, 2024

But I think that this will no longer be required to have all of this unless you still want to continue using the current structure.

I want to continue having the Bootstrap source files but separate them from the files that contain overrides/additions.

I'd want to avoid any Node installation of Bootstrap for as long as possible, but certainly consider it if there were other things from Node 👍

from django-wiki.

benjaoming avatar benjaoming commented on June 26, 2024

I want to also remove the CSS artifacts from the repo. I find that hatch has so-called "hooks" to ensure that something happens during the build process. We can use those hooks to build the SCSS.

I know that we currently have the assets command that we can run, but I'd like somehow that the build and release process doesn't come with a risk of un-synced assets by baking the assets building into the wheel/sdist building.

  1. By writing our own hatch hook: https://hatch.pypa.io/1.9/plugins/build-hook/reference/
  2. By using a plugin for hatch: https://github.com/rmorshea/hatch-build-scripts

Do you have any experience with this @oscarmcm ? ❤️

from django-wiki.

benjaoming avatar benjaoming commented on June 26, 2024

That sounds fantastic! Thanks ❤️ I'll reorganize the SCSS either before or after this change, but I think we can keep them separate since it's just a matter of updating the sassc command with the new paths.

from django-wiki.

oscarmcm avatar oscarmcm commented on June 26, 2024

does the reorganize stuff means to use the new BS5 layout? or just to be more streamlined with the hooks change?

from django-wiki.

benjaoming avatar benjaoming commented on June 26, 2024

I want to begin by relocating the CSS and SCSS files in a separate change, but then I feel like the road is paved to start the BS5 upgrade 👍

from django-wiki.

oscarmcm avatar oscarmcm commented on June 26, 2024

@benjaoming maybe we don't need a new hook for this, maybe its just add a new dependency and ofc the proper configurations.

https://github.com/rmorshea/hatch-build-scripts

wdyt?

from django-wiki.

oscarmcm avatar oscarmcm commented on June 26, 2024

oh sorry about not catching it right, gonna check what's the most easy solution for this without going crazy.

from django-wiki.

benjaoming avatar benjaoming commented on June 26, 2024

yes, agreed, it seems like it's immediately going to be easy to spend a disproportional amount of time on a solution for a little problem... it was very "intuitive" with a Makefile, yet here there seems to be an immediate uphill struggle.

from django-wiki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.