From ef33a0cda07d2d1d2ecbb5ce483268364e8277bf Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Wed, 4 May 2022 17:14:05 +0300
Subject: [PATCH] npm config template.

- Move npmrc to ~/.config/. It makes sense to me and keep ~ cleaner.
- Change it to a template to have the Font Awesome auth token.
---
 .bashrc                 | 1 +
 .config/npmrc.j2        | 6 ++++++
 .npmrc                  | 4 ----
 .pre-commit-config.yaml | 2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)
 create mode 100644 .config/npmrc.j2
 delete mode 100644 .npmrc

diff --git a/.bashrc b/.bashrc
index badcc1a..1f894c2 100644
--- a/.bashrc
+++ b/.bashrc
@@ -48,6 +48,7 @@ export LESS_TERMCAP_us=$'\E[01;32m'
 export LYNX_SAVE_SPACE="$HOME/Downloads"
 export LYNX_TEMP_SPACE="$HOME/.cache/lynx"
 export NODE_PENDING_DEPRECATION='1'
+export NPM_CONFIG_USERCONFIG="$HOME/.config/npmrc"
 export PATH="$GOPATH/bin:$PATH"
 export PATH="$HOME/.cabal/bin:$PATH"
 export PATH="$HOME/.cargo/bin:$PATH"
diff --git a/.config/npmrc.j2 b/.config/npmrc.j2
new file mode 100644
index 0000000..a3a300b
--- /dev/null
+++ b/.config/npmrc.j2
@@ -0,0 +1,6 @@
+ignore-scripts=true
+init-author-name=Nimrod Adar
+init-author-email=nimrod@shore.co.il
+init-author-url=https://git.shore.co.il/explore
+@fortawesome:registry=https://npm.fontawesome.com/
+//npm.fontawesome.com/:_authToken={{ run(["ph", "show", "--field", "Password", "SchooLinks/Font Awesome auth token"])["stdout"] }}
diff --git a/.npmrc b/.npmrc
deleted file mode 100644
index 4dd7891..0000000
--- a/.npmrc
+++ /dev/null
@@ -1,4 +0,0 @@
-ignore-scripts=true
-init-author-name=Nimrod Adar
-init-author-email=nimrod@shore.co.il
-init-author-url=https://git.shore.co.il/explore
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index df8d347..ccbf4d5 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -89,7 +89,7 @@ repos:
     rev: v1.1.0
     hooks:
       - id: detect-secrets
-        exclude: rabbitmqadmin|\.config/git/config|Pipfile\.lock
+        exclude: rabbitmqadmin|\.config/git/config|Pipfile\.lock|npmrc
 
   - repo: https://git.shore.co.il/nimrod/pre-commit-hooks.git
     rev: v0.2.0
-- 
GitLab