datamade / how-to

📚 Doing all sorts of things, the DataMade way

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Synchronize Wagtail and Django templates, address Wagtail template bugs

hancush opened this issue · comments

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.

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

  • How did DataMade bring up new apps before we used cookiecutter?
  • Is it possible to include versions of our key tools as cookiecutter template variables? e.g., Django, Wagtail, React? Those are our primary tools, so getting off on a current version of those seems to me to be high priority
  • Do we need to keep records of setups for apps using older versions of key tools?

@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?

@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.

Related to #318.

Here's a WIP: b0b7c3a