How to config babel-plugin-react-css-modules with nextjs 10 (with scss)? - babel-plugin-react-css-modules

Is there a straightforward guide or step-by-step solution to config babel-plugin-react-css-modules with the create-next-app (v10+)?

Related

aws-cdk: Any good guides or suggestions for folder structure for web applications?

context: I mostly do rails development along with webpacker. Webpacker puts a package.json at the root of the project.
I was wondering what suggestions people might have for adding aws-cdk into a basic rails application (or any type of web application framework) to make a nice deployment pipeline?
This I've thought about for directory structure:
Adding a .infrastructure folder to the root of the project. This is where all my cdk code would reside. What I don't like about this is during the deploy pipeline I would need to cd into that directoy and run yarn install. Also wouldn't like how I'd have to prefix all my paths with ../ if I need to reference resources outside of the directory (e.g. Dockerfile)
Moving cdk.json to the root of my project. This would solve the path prefix problem but I'd still need todo something along these lines cd .infrastructure && yarn install && cd .. && cdk deploy
Use something like lerna or yarn workspaces? Not sure how much I'd need to configure to webpacker to with those tools.
I tend to over think things way too much...
Am I over complicating this or is a "fullstack engineer" really hard work sometimes? 😅
If you are interested in combining your Infrastructure as Code with your application's deployment strategy you should look into cdk-pipelines. This way, you would just run cdk deploy and all of the build commands would be seperate from the deployment and run as part of the CI/CD build project. I work in .NET but this is how I've structured the folders:
my-repo
my-cool-project
src
MyApi
MyWebApp
cdk
cdk.json
...
Dockerfiles live in 'MyApi', and 'MyWebApp'.

Docker: How to get BrowserSync running on a CraftCMS container?

I'm new to Docker. I'm trying to use it to develop CraftCMS. I found https://hub.docker.com/r/blackpepper/craftcms which works well, but I'd really like to add BrowserSync to it (so I need NodeJS in the container as well?).
I really have no idea where to begin. I've been creating Dockerfiles and docker-compose.yml files and just throwing random stuff at it... for instance in my Dockerfile I put:
FROM blackpepper/craftcms
FROM node
RUN npm install -g browser-sync
RUN npx browser-sync start --files=templates/index.twig,web/assets/style.css --proxy=http://localhost:8080
# the proxy url is where I can actually view the craftcms site in my browser
I'd really appreciate any guidance, especially if you have experience doing something like this.
After having struggled myself for years with setting up Node.js workflows including Browsersync and Gulp (or other node modules), I created an alternative that is muuch simpler to use and maintain.
I just depend on 3 binaries: inotifywait, xdotool and sassc.
If you want to know more, I have created a video showcasing the functionality.
You can check it here: https://youtu.be/tMW-xQZ6c1U
Hope that helps.

setting up swagger 3 or OpenAPI in a gradle springboot api

Swagger 3 ? or Open API ..? 3? not sure what they're calling it. There doesn't seem to be a good or easy setup.
I'm looking to add it to my java project
I don't mind manually filling out the config for my controllers and in fact do not want it dynamically config'd
and I don't want a lot of extra fluff with it.
Their github hosts a number of different files and I'm not sure what I do and don't need.
The setup at:
https://github.com/swagger-api/swagger-ui/blob/master/docs/development/setting-up.md
I've run through the setup commands and started locally which returns 2 js files, 1 css, and the swagger.json.
Does anyone know if there's a gradle or maven import / line that I can just plop into my build and get the code I need?
Has anyone setup swagger 3 with just the bare minimum to host the ui page with their controller on a java/springboot app?
any help welcome.
git clone https://github.com/swagger-api/swagger-ui.git
cd swagger-ui
npm install
npm run dev

Where is GitLab installed on Ubuntu 14.04?

GitLab was installed by following instructions at https://about.gitlab.com/downloads/ on Ubuntu Server 14.04 but I can't find the install directory. It's commonly said to be in /home/git/ or /home/gitlab/ but neither exist.
I need to find the install directory so I can setup SMTP (RE https://gist.github.com/petermanser/6117494) and migrate existing repositories into GitLab.
Does anyone know where GitLab would be installed on Ubuntu Server 14.04 if not /home/git/ or /home/gitlab/?
Config files are in etc/gitlab
Data is stored in /var/opt/gitlab
Thanks to Bjorn for finding the locations and Pavel S for providing cat /etc/passwd | grep git for finding the home directory of a given user!
To find a user's home directory do
$ cd ~git
you will be in that users directory.
:D
There is a Directory structure section in the official README.md file of Omnibus-GitLab repo:
Omnibus-gitlab uses four different directories.
/opt/gitlab holds application code for GitLab and its dependencies.
/var/opt/gitlab holds application data and configuration files that
gitlab-ctl reconfigure writes to.
/var/log/gitlab contains all log data generated by components of
omnibus-gitlab.
/etc/gitlab holds configuration files for omnibus-gitlab. These are
the only files that you should ever have to edit manually.
But, if you install the GitLab alone from source (rarely, but useful for unsupported systems like *BSD). Then the GitLab installation location will be different, and it is described in this official doc.

Has anyone succeeded in using celery with pylons

I have a pylons based webapp and i'd love to use celery + rabbitmq for some time taking tasks. I've taken a look at the celery-pylons project but I haven't succeeded in using it.
My main problem with celery is: where do i put the celeryconfig.py file or is there any other way to specify the celery options eg. BROKER_HOST and the like, from within a pylons app (In the same way one can put the options in the django settings.py file when using django-celery).
Basically, i investigated 2 options: using celery as a standalone project and using celery-pylons, both without much success.. :(
Thanks in advance for your help.
I am doing this currently, although I've not updated celery in some time. I'm still on 2.0.0 I think.
What I did was to create a celery_app directory within my pylons application. (so in same directory as data, controllers, etc.)
In that directory are my celeryconfig.py, tasks.py, and pylons_tasks.py.
pylons_tasks.py is just a file that initializes the pylons application so I can load Pylons models and such into the celery tasks.py file. So it does the pylons init and then imports tasks.py.
The celeryconfig is then set to use myapp.celery_app.pylons_tasks as the CELERY_IMPORTS value.
CELERY_IMPORTS = ("myapp.celery_app.pylons_tasks", )
Hope that helps some.
The tightest integration with pylons is to build a custom loader into paste commands. This is what celery-pylons does. Check out my fork of celery-pylons https://bitbucket.org/dougtabuchi/celery-pylons/src which should work with the latest celery and pylons 1.0.
To get the celeryd side working you need to add the correct options in your ini file and then call paster celeryd development.ini
For the webapp side you just need to import celerypylons in environment.py Then you will be able to import and use your tasks from anywhere in your project.
A good pylons project to look at that uses celery is https://rhodecode.org/rhodecode/files/tip/

Resources