geet-geet 0.1.0 → 0.3.0

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/README.md CHANGED
@@ -9,7 +9,7 @@ Only Git's *view* of the filesystem changes.
9
9
 
10
10
  ## Why?
11
11
  > “I built something useful, and I think that **SOME but not all of my code is re-usable**.
12
- I want to publish some of my code for other's to use (or to re-use myself)...
12
+ I want to publish some of my code for others to use (or to re-use myself)...
13
13
  but **I don't want to spend weeks refactoring** to split apart the reusable code from the implementation-specific code.
14
14
  In fact, it may not even be possible to move around all my files without breaking things.
15
15
  Plus, supporting this template is my **secondary task** which I want to do in tandem with my **primary development**, using my main repository's working directory and publishing some pieces to the template repo.”
@@ -25,6 +25,9 @@ Only Git's *view* of the filesystem changes.
25
25
  - submodules don't support interleaving files and folders of template code with custom app code
26
26
  - I want to simultaneously develop many apps with a similar architecture
27
27
 
28
+ ## Why Not?
29
+ > If you can super cleanly separate your template from your app or make your sourcecode fully modular, you don't need geet, use a normal repo or maybe submodules.
30
+
28
31
  ---
29
32
  ## PreReqs
30
33
  1. `git` - for pretty much everything
package/bin/geet.sh CHANGED
@@ -15,7 +15,22 @@ shift || true
15
15
  case "$cmd" in
16
16
  help|-h|--help)
17
17
  source "$GEET_LIB/help.sh"
18
- help
18
+ help "${GEET_ARGS[@]:1}"
19
+ ;;
20
+
21
+ version|-v|--version)
22
+ source "$GEET_LIB/version.sh"
23
+ version
24
+ ;;
25
+
26
+ why)
27
+ source "$GEET_LIB/why.sh"
28
+ why
29
+ ;;
30
+
31
+ whynot)
32
+ source "$GEET_LIB/why.sh"
33
+ whynot
19
34
  ;;
20
35
 
21
36
  sync)
package/lib/help.sh CHANGED
@@ -7,47 +7,68 @@ help() {
7
7
 
8
8
  # digest-and-locate.sh provides: GEET_ALIAS, TEMPLATE_NAME, die, log
9
9
 
10
+ if [[ "${1:-}" == "--all" ]]; then
10
11
  cat <<EOF
11
- $GEET_ALIAS — Git-based template layering system
12
-
13
- Usage: $GEET_ALIAS <command> [args...]
12
+ $GEET_ALIAS — Git-based template layering system (see https://github.com/modularizer/geet)
14
13
 
15
14
  TEMPLATE MANAGEMENT:
16
- template <name> [desc] Create a new template layer from current app
17
- init Initialize a freshly-cloned template repo as your app
18
- install <repo> Clone a template repo and initialize it (clone + init)
19
- clone <repo> Clone a git repository (standard git clone)
15
+ template <name> [desc] [--public|--private|--internal] Create a new template layer from current app
16
+ init Initialize a freshly-cloned template repo as your app
17
+ install <repo> <dir> [--public|--private|--internal] Clone a template repo and initialize it
20
18
 
21
19
  FILE MANAGEMENT:
22
- tree [list|tracked|all] Show what files the template includes
23
- split <dest> [mode] Export template files to external folder
24
- sync Compile .geetinclude whitelist into .geetexclude
25
- detach "Detach" a file, folder, or glob to always use "keep-ours" to resolve merge conflicts, essentially allowing you to overwrite a file's template
26
- retach undo a detach command
27
- detached list files that have been detached
20
+ tree [list|tracked|all] Show what files the template includes
21
+ split <dest> [mode] Export template files to external folder
22
+ sync Compile .geetinclude whitelist into .geetexclude
23
+ include <path> Manage included files
24
+ ignored|included|excluded <path> Check if a path is ignored/included/excluded
25
+
26
+ DETACHMENT (CONFLICT RESOLUTION):
27
+ detach|hard-detach <path> Detach a file to always use "keep-ours" on merge conflicts
28
+ soft-detach|soft_detach|slide <path> Soft detach (lighter alternative)
29
+ detached List hard-detached files
30
+ soft-detached|soft_detached|slid List soft-detached files
31
+ retach <path> Undo a detach command
28
32
 
29
33
  OPERATIONS:
30
- session run [opts] -- cmd Run command in isolated template snapshot
31
- publish [opts] Publish template to GitHub (auto-detects repo name)
32
- gh <subcommand> [...] GitHub CLI integration (pr, issue, etc.)
33
- doctor Run health checks on your geet setup
34
+ session <subcommand> Run commands in isolated template snapshot
35
+ publish|pub [opts] Publish template to GitHub
36
+ gh <subcommand> GitHub CLI integration (pr, issue, etc.)
37
+ doctor Run health checks on your geet setup
38
+ prework See what we know
39
+ precommit|pc Run pre-commit hook
40
+
41
+ UTILITIES:
42
+ version|--version|-v Show geet version
43
+ why Reasons to use geet
44
+ whynot Reasons not to use geet
45
+ bug|feature|issue|whoops|suggest Open an issue on GitHub
46
+ remove|rm Remove template tracking (requires confirmation)
47
+ destroy Remove template tracking (no confirmation)
34
48
 
35
49
  GIT ACCESS:
36
- git <command> [...] Direct git access to template repo
37
- <git-command> [...] Any git command (auto-forwarded to template repo)
50
+ git <command> [...] Direct git access to template repo
51
+ <git-command> [...] Any git command (auto-forwarded to template repo)
38
52
 
39
- Get help on any command:
40
- $GEET_ALIAS <command> --help
53
+ Current layer: ${TEMPLATE_NAME:-none}
54
+ EOF
55
+ else
56
+ cat <<EOF
57
+ $GEET_ALIAS — Git-based template layering system (see https://github.com/modularizer/geet)
41
58
 
42
- Examples:
43
- $GEET_ALIAS template my-stack "A modern web stack"
44
- $GEET_ALIAS install https://github.com/user/template-repo
45
- $GEET_ALIAS tree list
46
- $GEET_ALIAS publish --public
47
- $GEET_ALIAS status
48
- $GEET_ALIAS commit -m "Update template"
59
+ USAGE:
60
+ template <name> [desc] [--public|--private|--internal] Create a new template layer from current app
61
+ install <repo> <dir> [--public|--private|--internal] Do a git clone of a repo and convert it into a repo of your own
62
+ tree [list|tracked|all] Show what files the template includes
63
+ split <dest> [mode] Export template files to external folder
64
+ prework See what we know
65
+ why / whynot Reasons to (or not to) use geet
66
+ version / --version Show geet version
67
+ help --all Show all available commands
68
+ <git-command> [...] Any git command (auto-forwarded to template repo)
49
69
 
50
70
  Current layer: ${TEMPLATE_NAME:-none}
51
71
  EOF
72
+ fi
52
73
 
53
74
  } # end of help()
package/lib/version.sh ADDED
@@ -0,0 +1,14 @@
1
+ # version.sh — display geet version
2
+ # Usage:
3
+ # source version.sh
4
+ # version
5
+
6
+ version() {
7
+ local pkg_json="$GEET_LIB/../package.json"
8
+ if [[ -f "$pkg_json" ]]; then
9
+ local ver=$(grep '"version"' "$pkg_json" | head -1 | sed 's/.*"version": *"\([^"]*\)".*/\1/')
10
+ echo "geet version $ver"
11
+ else
12
+ echo "geet version unknown (package.json not found)"
13
+ fi
14
+ }
package/lib/why.sh ADDED
@@ -0,0 +1,37 @@
1
+ # why.sh — explain when to use (or not use) geet
2
+ # Usage:
3
+ # source why.sh
4
+ # why
5
+ # whynot
6
+
7
+ why() {
8
+ printf '%b' "$(cat <<'EOF'
9
+ Use geet if this resonates with you...
10
+ \033[3m
11
+ "I built something useful, and I think that SOME but not all of my code is re-usable.
12
+ I want to publish some of my code for others to use (or to re-use myself)...
13
+ but I don't want to spend weeks refactoring to split apart the reusable code from the implementation-specific code.
14
+ In fact, it may not even be possible to move around all my files without breaking things.
15
+ Plus, supporting this template is my secondary task which I want to do in tandem with my primary development,
16
+ using my main repository's working directory and publishing some pieces to the template repo."
17
+
18
+ \033[0m
19
+
20
+ EOF
21
+ )"
22
+
23
+ }
24
+
25
+ whynot() {
26
+ printf '%b' "$(cat <<'EOF'
27
+ As much as I love this package, it is not for every use case...
28
+ \033[3m
29
+ You probably do not need geet if you can super cleanly separate your template from your app or make your source code fully modular.
30
+ If you can use a package distribution like pypi or npm that is probably best. If git submodules work for you, that is good too.
31
+ If those solutions are not working for you, then check back here.
32
+
33
+ \033[0m
34
+
35
+ EOF
36
+ )"
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geet-geet",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "bin": {
6
6
  "geet": "bin/geet.sh",