@mostajs/orm-cli 0.5.9 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mostajs.sh +5 -20
- package/package.json +1 -1
package/bin/mostajs.sh
CHANGED
|
@@ -2115,29 +2115,14 @@ action_rep_add_rule() {
|
|
|
2115
2115
|
target=$(ask "Target project" "$src_default")
|
|
2116
2116
|
mode=$(ask "Mode (snapshot | cdc | bidirectional)" "cdc")
|
|
2117
2117
|
echo
|
|
2118
|
-
dim " Collections : '*' = all tables
|
|
2119
|
-
dim "
|
|
2118
|
+
dim " Collections : '*' = all tables of the master DB — resolved LIVE at"
|
|
2119
|
+
dim " each sync tick from the master's table catalogue"
|
|
2120
|
+
dim " (so new tables added later are picked up automatically)."
|
|
2121
|
+
dim " Or : explicit comma-separated list (User,Member,Payment)"
|
|
2120
2122
|
colls=$(ask "Collections" "*")
|
|
2121
2123
|
conflict=$(ask "Conflict resolution (source-wins | target-wins | timestamp)" "source-wins")
|
|
2122
|
-
|
|
2123
|
-
# Expand '*' into the full list of entity NAMES from entities.json. Keeps
|
|
2124
|
-
# the tree self-contained — no special-case needed in replicator.mjs.
|
|
2125
2124
|
if [[ "$colls" == "*" ]]; then
|
|
2126
|
-
|
|
2127
|
-
if [[ -f "$ents_json" ]]; then
|
|
2128
|
-
colls=$(node -e "try{const e=JSON.parse(require('fs').readFileSync('$ents_json','utf8'));console.log(e.map(x=>x.name).join(','))}catch{console.log('')}" 2>/dev/null)
|
|
2129
|
-
if [[ -z "$colls" ]]; then
|
|
2130
|
-
warn " entities.json empty or unreadable — keeping '*' as wildcard placeholder"
|
|
2131
|
-
colls="*"
|
|
2132
|
-
else
|
|
2133
|
-
local count; count=$(echo "$colls" | tr ',' '\n' | wc -l)
|
|
2134
|
-
ok " expanded '*' → ${count} tables from entities.json"
|
|
2135
|
-
dim " ${colls}"
|
|
2136
|
-
fi
|
|
2137
|
-
else
|
|
2138
|
-
warn " no entities.json found at $ents_json — keeping '*' as wildcard placeholder"
|
|
2139
|
-
warn " (run menu 1 'Convert' first, then re-add the rule to expand)"
|
|
2140
|
-
fi
|
|
2125
|
+
dim " → '*' stored as-is ; replicator.mjs will introspect the master DB at run-time."
|
|
2141
2126
|
fi
|
|
2142
2127
|
|
|
2143
2128
|
_tree_patch "
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mostajs/orm-cli",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"description": "Universal CLI to integrate @mostajs/orm into any project — one-shot `mostajs bootstrap` migrates a Prisma project (codemod + deps + schema convert + DDL) to 13 databases with zero code change.",
|
|
5
5
|
"author": "Dr Hamid MADANI <drmdh@msn.com>",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|