@brightsideoy/kama 0.1.0-alpha.121 โ†’ 0.1.0-alpha.123

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/test-local.sh DELETED
@@ -1,76 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Exit immediately if any command fails
4
- set -e
5
-
6
- # Define absolute test directory path
7
- TEST_DIR="$(cd .. && pwd)/npm-test"
8
-
9
- echo "๐Ÿงน 1. Nuking old test environment to start fresh..."
10
- rm -rf "$TEST_DIR"
11
- mkdir -p "$TEST_DIR"
12
-
13
- # ๐ŸŽฏ KILL THE NPX CACHE: Forces npx to unpack the fresh tarball for the CLI
14
- echo "๐Ÿ’€ Clearing NPX cache..."
15
- rm -rf ~/.npm/_npx/
16
-
17
- # Make sure the CLI file is actually executable before packing!
18
- chmod +x bin/cli.js
19
-
20
- echo "๐Ÿ”ฅ 2. Packing KAMA locally (this will trigger build scripts)..."
21
- npm pack
22
-
23
- # Find the newly created tarball
24
- TARBALL=$(ls -1t *.tgz | head -n 1)
25
-
26
- if [ -z "$TARBALL" ]; then
27
- echo "โŒ Error: Failed to find the packed .tgz file."
28
- exit 1
29
- fi
30
-
31
- echo "โœ… Packaged successfully: $TARBALL"
32
-
33
- echo "๐Ÿšš 3. Moving tarball to test environment..."
34
- mv "$TARBALL" "$TEST_DIR/"
35
-
36
- echo "๐Ÿ“‚ 4. Entering test environment..."
37
- cd "$TEST_DIR"
38
-
39
- echo "๐Ÿš€ 5. Simulating 'npx kama init' using the local tarball..."
40
- echo "------------------------------------------------------"
41
-
42
- # Explicitly define the package source and the binary to run
43
- npx --yes --package "$TEST_DIR/$TARBALL" kama init
44
-
45
- echo "------------------------------------------------------"
46
- echo "๐Ÿ” 6. Detecting generated workspace..."
47
-
48
- # Figure out if user initialized in current folder (.) or a subfolder
49
- if [ -f "package.json" ]; then
50
- WORKSPACE_DIR="."
51
- else
52
- # Find the first created directory that contains a package.json
53
- WORKSPACE_DIR=$(find . -mindepth 2 -maxdepth 2 -name "package.json" | head -n 1 | xargs dirname)
54
- fi
55
-
56
- # Sanity check
57
- if [ ! -f "$WORKSPACE_DIR/package.json" ]; then
58
- echo "โŒ Could not find a package.json. Did the setup abort?"
59
- exit 1
60
- fi
61
-
62
- echo "โœ… Found workspace at: $WORKSPACE_DIR"
63
- cd "$WORKSPACE_DIR"
64
-
65
- # ๐ŸŽฏ FULL INSTALL + LOCAL OVERRIDE:
66
- echo "๐Ÿ“ฆ 7. Installing all project dependencies..."
67
- npm install
68
-
69
- echo "๐Ÿ”— Overriding @brightsideoy/kama with local tarball..."
70
- npm install "$TEST_DIR/$TARBALL" --save
71
-
72
- echo "๐Ÿ”ฅ 8. Booting up KAMA (CMS & Astro Site)..."
73
- echo "๐Ÿ‘‰ You should see localhost URLs below to click and test."
74
- echo " (Press Ctrl+C to stop the servers. Running this script again will wipe everything and restart.)"
75
- echo "------------------------------------------------------"
76
- npm run dev