Publish SCSS file into NPM package Vue-cli 3 - build

I am authoring a Vue.js lib on NPM and one of my users is asking me to add my scss file into the build so they can modify it.
How can users modify that scss file and compile it back to my lib?
Would that be a hack like modifying a lib's source code or is that common practice?
If I externalize that scss into a static file (I suspect in public/ folder), how do I include it from my component?
Is there a documentation about it, I looked into Vue-cli, Webpack, and Google and didn't find a guide.
Currently I only export a minified css file into the build and my scss resides in my index.vue of my component.
My project architecture is:
| public/
| src/
| assets/
| components/
|- my-lib/ // Only this folder gets bundled into dist/
|- index.vue
|- app.vue // My app documentation.
In the dist/ folder I get:
mylib.css
mylib.umd.js
mylib.umd.min.js
mylib.common.js
mylib.umd.min.js
demo.html
I bundle my lib (with vue-cli 3) with:
vue-cli-service build --target lib --name mylib ./src/components/mylib/index.vue --dest ./dist

Related

Node.js lambda: how to import common layer utility lib in local development but also work in the cloud

I have a monorepo with a few functions in their own folder. I want to create a common layer with utility functions that I can require/import locally and also after deployment to the cloud. I want to add a layers/ directory to do this, with the folder structure looking something like this:
A
|- node_modules/
|- package.json
|- index.js
B
|- node_modules/
|- package.json
|- index.js
layers
|- nodejs
|- node_modules
|- package.json
|- util.js
I'm not set on the folder structure above and am OK with it changing.
Currently, I only have A and B with their own individual dependency layers (orchestrated using terraform), and they work great locally and deployed.
With the introduction of a common utility layer, the issue is that I can require/import locally but it wouldn't be the same in the cloud (/opt/nodejs/*), but if I change it up to work on the cloud, it won't work locally.
I am not using the serverless framework.

Publish html/js project to github page

I have a simple javascript projet created using npm. The source code is in a public github repository.
Here is the content of the repository
my-project
src
index.html
app.js
package.json
README.md
In my local environment I run it using lite-server by executing npm run dev.
I create gh-pages branch from my main branch, my code was automatically deployed after but when I visit the page it show the content of the README.md file.
How can I point to my index.html page instead so that my simple website is rendered ?
Do I have to absolutely move my index.html to the root directory ? Or is there other way without changing my project folder structre ?
=============== MY SOLUTION ===============
I just had to copy index.html and app.js at the root of the branch gh-pages.
You can only choose the root folder or /docs from repo settings.
https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site

Ember - Minify CSS File in public Folder

When I build my super-rentals Ember app with command ember build -prod all css files in app\styles folder are minified but css files in public\assets\css folder are not minified. So how I could minify all css file in public\assets\css folder.

How to ignore nested node modules when running mocha?

I have a project with the following setup:
Project
|- node_modules
|- server
|- client // nested create-react-app
|- node_modules
|- package.json
|-etc
|- package.json
|- etc
From project root, I'd like to run mocha recursively throughout both server and client directories (or any other directory that may be required) looking to *.test.js files, while ignoring all node_modules directories.
This article explained how to run mocha recursively while ignoring node_modules, but it only ignores the top-level node_modules. Mocha fails when it encounters ./client/node_modules.
Is it possible to modify this command to ignore all node_modules directories, not just in the project root?
"test:unit": "mocha --compilers js:babel-core/register \"./{,!(node_modules)/**}/*.test.js\""
Decided to run tests on specific directories, like so:
"test:unit": "mocha --compilers js:babel-core/register ./server/**/*.test.js \"./client/{,!(node_modules)/**}/*.test.js\""

Django Private Project Git Repo - Open Source App Repo

My team and I are currently working on a django app. We want to keep track of changes to the django project files on a private repo (so that all of the private information is not available) as well as open source the app files on github.
Currently we have two repos:
1) A repo for the project that contains:
/Main Folder
|- .git
|- /djangoproject
|- requirements.txt
|- dev-db.sqlite
|- manage.py
|- .gitignore
The git ignore is told to ignore the second repo which is the app repo and also resides in Main Folder:
2)
/Main Folder
|- /django-app-name // the name of the repo as appearing on github
|- .git
|- /djangoapp
|- models.py
|- urls.py
|- views.py
|- admin.py
|- ....
|- .gitignore
|- LICENSE
|- README.md
|- requirements.txt
This works for our purposes, but it would be really nice to somehow consolidate the two repos so that a single command would work with both. I am just getting started with git, so I don't know all of the awesome features that git contains. Is there a way to be able to track both the private and public portions of the whole django project within a single repo? What is the best way, using git, to have private project settings and an open source app?
As far as I know, the best way to do this is to have a git submodule.
Have look at how git submodules work : http://git-scm.com/book/en/Git-Tools-Submodules