-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'bp/main'
- Loading branch information
Showing
7 changed files
with
138 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,21 @@ | ||
|
||
# OTEL_EXPORTER_OTLP_ENDPOINT="http://127.0.0.1:4317" | ||
|
||
# POSTGRES_HOST="127.0.0.1" | ||
# POSTGRES_PORT=5432 | ||
# POSTGRES_DB=postgres | ||
# POSTGRES_DB=db_ci_test | ||
# POSTGRES_USER=postgres | ||
# POSTGRES_PASSWORD=postgres | ||
|
||
# PGMQ_HOST="127.0.0.1" | ||
# PGMQ_PORT=5432 | ||
# PGMQ_DB=db_ci_test | ||
# PGMQ_USER=postgres | ||
# PGMQ_PASSWORD=postgres | ||
|
||
# PARADEDB_HOST="127.0.0.1" | ||
# PARADEDB_PORT=5432 | ||
# PARADEDB_DB=db_ci_test | ||
# PARADEDB_USER=postgres | ||
# PARADEDB_PASSWORD=postgres | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#!/bin/bash | ||
# --------------------------- | ||
# Add sub-package from packages/mw-demo | ||
# | ||
# --------------------------- | ||
|
||
cwd=`pwd` | ||
PKGS="$cwd/packages" | ||
tplDir="$PKGS/mw-demo" | ||
tplName="@mwcp/demo" | ||
|
||
pkgName="$1" | ||
|
||
if [ -z "$pkgName" ]; then | ||
echo -e "Missing package name!" | ||
echo -e "Command examples: " | ||
echo -e " - 'npm run add:mwcp bar' without scope @mwcp" | ||
echo -e "\n" | ||
exit 1 | ||
fi | ||
|
||
pkgScope="@mwcp" | ||
pkgScopeWoAt="mwcp" | ||
pkgFullName="${pkgScope}/${pkgName}" | ||
|
||
if [ -z "$pkgName" ]; then | ||
echo -e "pkgName empty!" | ||
echo -e "Input: \"$pkgFullName\"" | ||
echo -e "\n" | ||
exit 1 | ||
fi | ||
pkgFullDir="${pkgScopeWoAt}-${pkgName}" | ||
|
||
echo -e "-------------------------------------------" | ||
echo -e " Initialize package from tpl $tplName" | ||
echo -e " Name: $pkgFullName " | ||
echo -e " Folder: $pkgFullDir " | ||
echo -e "-------------------------------------------" | ||
|
||
|
||
# pkgPath="${PKGS}/${pkgName}" | ||
pkgPath="${PKGS}/${pkgFullDir}" | ||
|
||
if [ -d "$pkgPath" ]; then | ||
echo -e "pkg path EXITS!" | ||
echo -e "path: \"$pkgPath\"" | ||
echo -e "\n" | ||
exit 1 | ||
fi | ||
|
||
mkdir -p "$pkgPath" "$pkgPath/src" | ||
|
||
fReadme="README.md" | ||
f1="package.json" | ||
f2="tsconfig.json" | ||
f4=".editorconfig" | ||
f8="LICENSE" | ||
|
||
|
||
f03="bootstrap.js" | ||
|
||
echo -e "Copying files to folder: $pkgPath/ ..." | ||
cp "$tplDir/$f1" "$pkgPath/" | ||
cp "$tplDir/$f2" "$pkgPath/" | ||
cp "$tplDir/$f4" "$pkgPath/" | ||
|
||
cp "$tplDir/$f03" "$pkgPath/" | ||
echo "" >> "$pkgPath/$fReadme" | ||
|
||
cp -a "$tplDir/src" "$pkgPath/" | ||
|
||
pkgJson="$pkgPath/package.json" | ||
echo -e "Updating file: $pkgJson" | ||
|
||
sed -i "s#$tplName#${pkgFullName}#g" "$pkgJson" | ||
sed -i "s#\(private.\+\)true#\1false#g" "$pkgJson" | ||
repo=$(git remote get-url origin) | ||
if [ -n "$repo" ]; then | ||
sed -i "s#\(git+https://\)#${repo}#" "$pkgJson" | ||
fi | ||
|
||
testDir="$pkgPath/test" | ||
mkdir -p "$testDir" | ||
cp -a "$tplDir/test/" "$pkgPath/" | ||
rm -rf "$testDir/fixtures/base-app/logs" | ||
|
||
echo -e "Git add files..." | ||
git add -f -- "$pkgPath" | ||
|
||
git commit -nm "chore: initialize package $pkgFullName" | ||
echo -e "Git add success\n" | ||
|
||
|
||
rm -rf .nx | ||
npm i --disturl=https://npmmirror.com/dist/ | ||
npm run build "$pkgFullName" | ||
|
||
echo -e "\nInitialization success. You should git add files under src/ manually!" | ||
|
||
echo -e "Packages list:" | ||
lerna list | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters