@erclx/canon 4.9.2 → 4.10.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/package.json
CHANGED
|
@@ -8,7 +8,8 @@ PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
|
|
|
8
8
|
source "$PROJECT_ROOT/scripts/lib/ui.sh"
|
|
9
9
|
|
|
10
10
|
TMP_ROOT="$PROJECT_ROOT/.canon/tmp/install-check"
|
|
11
|
-
|
|
11
|
+
PACK_DIR="$TMP_ROOT/pack"
|
|
12
|
+
EXTRACT_DIR="$TMP_ROOT/extract"
|
|
12
13
|
TARGET_DIR="$TMP_ROOT/target"
|
|
13
14
|
KEEP=0
|
|
14
15
|
|
|
@@ -19,12 +20,13 @@ for arg in "$@"; do
|
|
|
19
20
|
cat <<HELP
|
|
20
21
|
Usage: scripts/core/install-check.sh [--keep]
|
|
21
22
|
|
|
22
|
-
Verifies the
|
|
23
|
-
1.
|
|
24
|
-
2.
|
|
25
|
-
3. Runs
|
|
26
|
-
4.
|
|
27
|
-
5.
|
|
23
|
+
Verifies the published install path end to end:
|
|
24
|
+
1. Packs this repo into a tarball at .canon/tmp/install-check/pack
|
|
25
|
+
2. Extracts it and asserts scripts/sandbox is absent from the tree
|
|
26
|
+
3. Runs bun install --production in the extracted tree
|
|
27
|
+
4. Runs the CLI with --help from the extracted tree to confirm it resolves
|
|
28
|
+
5. Scaffolds a fresh project in .canon/tmp/install-check/target
|
|
29
|
+
6. Runs canon init from the extracted package and asserts a scaffold landed
|
|
28
30
|
|
|
29
31
|
Flags:
|
|
30
32
|
--keep Keep the tmp tree on exit for inspection
|
|
@@ -45,21 +47,31 @@ cleanup() {
|
|
|
45
47
|
trap cleanup EXIT
|
|
46
48
|
|
|
47
49
|
rm -rf "$TMP_ROOT"
|
|
48
|
-
mkdir -p "$
|
|
50
|
+
mkdir -p "$PACK_DIR" "$EXTRACT_DIR"
|
|
49
51
|
|
|
50
52
|
open_timeline "Install verification"
|
|
51
53
|
|
|
52
|
-
log_step "
|
|
53
|
-
|
|
54
|
-
log_info "
|
|
54
|
+
log_step "Pack"
|
|
55
|
+
TARBALL_PATH="$(cd "$PROJECT_ROOT" && bun pm pack --quiet --ignore-scripts --destination "$PACK_DIR" | tail -n 1)"
|
|
56
|
+
log_info "Packed to $TARBALL_PATH"
|
|
55
57
|
|
|
56
|
-
log_step "
|
|
57
|
-
|
|
58
|
-
log_info "
|
|
58
|
+
log_step "Extract"
|
|
59
|
+
tar -xzf "$TARBALL_PATH" -C "$EXTRACT_DIR" --strip-components=1
|
|
60
|
+
log_info "Extracted to $EXTRACT_DIR"
|
|
61
|
+
|
|
62
|
+
log_step "Assert excluded path is absent"
|
|
63
|
+
if [ -e "$EXTRACT_DIR/scripts/sandbox" ]; then
|
|
64
|
+
log_error "scripts/sandbox shipped in the tarball, and the files field in package.json excludes it"
|
|
65
|
+
fi
|
|
66
|
+
log_info "Absent: scripts/sandbox"
|
|
67
|
+
|
|
68
|
+
log_step "Install dependencies (production)"
|
|
69
|
+
(cd "$EXTRACT_DIR" && bun install --production --ignore-scripts --silent 2>&1 | pipe_output) || log_error "bun install --production failed"
|
|
70
|
+
log_info "Dependencies installed without devDependencies"
|
|
59
71
|
|
|
60
72
|
log_step "Confirm CLI runs"
|
|
61
|
-
(cd "$
|
|
62
|
-
log_info "canon --help ran clean"
|
|
73
|
+
(cd "$EXTRACT_DIR" && bun run src/cli.ts --help >/dev/null) || log_error "canon --help failed"
|
|
74
|
+
log_info "canon --help ran clean from the extracted package"
|
|
63
75
|
|
|
64
76
|
log_step "Scaffold fresh project"
|
|
65
77
|
mkdir -p "$TARGET_DIR"
|
|
@@ -67,7 +79,7 @@ mkdir -p "$TARGET_DIR"
|
|
|
67
79
|
log_info "Initialized git in $TARGET_DIR"
|
|
68
80
|
|
|
69
81
|
log_step "Run canon init"
|
|
70
|
-
(cd "$TARGET_DIR" && CANON_NON_INTERACTIVE=1 bun run "$
|
|
82
|
+
(cd "$TARGET_DIR" && CANON_NON_INTERACTIVE=1 bun run "$EXTRACT_DIR/src/cli.ts" init --stack base 2>&1 | pipe_output) || log_error "canon init failed"
|
|
71
83
|
log_info "canon init completed"
|
|
72
84
|
|
|
73
85
|
log_step "Assert scaffold"
|