datamade / how-to

📚 Doing all sorts of things, the DataMade way
MIT License
80 stars 12 forks source link

Synchronize Wagtail and Django templates, address Wagtail template bugs #312

Closed hancush closed 11 months ago

hancush commented 1 year ago

Documentation request

One important fix for the Wagtail template is the commands for django-compressor. They should be:

COMPRESS_PRECOMPILERS = (
    ('module',
     'export NODE_PATH=/app/node_modules && npx browserify {infile} -t [ babelify --global --presets [ @babel/preset-env ] ] > {outfile}'),
    ('text/jsx',
     'export NODE_PATH=/app/node_modules && npx browserify {infile} -t [ babelify --global --presets [ @babel/preset-env @babel/preset-react ] ] > {outfile}'),
)

There are also references to the app module in the precommit config and package.json, IIRC, that can be templated.

I think there are also some things we can strip out of the templates that are not applicable to all apps.

Finally, I'm still concerned that the level of templating we're doing is 1. keeping us on older versions of software and 2. obscuring how the set up fits together, making it difficult to debug. I need to think more about this.

fgomez828 commented 1 year ago

I'm curious about this, too. A couple of questions (I haven't looked into them, but posing here in case they're helpful):

hancush commented 1 year ago

@fatima3558 We initialized them by hand, usually by following the installation instructions from their docs or copying from other projects. This took more time, but I think led to a deeper understanding of the contours of each tool.

I think we could do one better by removing pinned versions from the templates and including instructions for pinning – we currently do this for Python deps in the Django template, IIRC.

Can you say more about your third question?

fgomez828 commented 1 year ago

@hancush ty for the info! for my 3rd question, I was wondering if we might ever need to reference a cookiecutter setup that we used to start an older application? If so, we might want to make any cookiecutter setups we have used pinned or linked to somewhere for reference.

I don't think this is something we would ever really need, as we would most likely refer to the repo itself for any info on how it was set up, but I thought I would ask.

smcalilly commented 1 year ago

Related to #318.

Here's a WIP: https://github.com/datamade/how-to/commit/b0b7c3a10581215276be2a1e9b2a106971e1168b