@jterrazz/typescript 2.2.0 → 2.3.2

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.
Files changed (2) hide show
  1. package/bin/ts-compile.sh +16 -13
  2. package/package.json +1 -1
package/bin/ts-compile.sh CHANGED
@@ -6,6 +6,8 @@ set -e
6
6
  # Colors for output
7
7
  RED='\033[0;31m'
8
8
  GREEN='\033[0;32m'
9
+ BLUE_BG='\033[44m' # Basic blue background
10
+ WHITE='\033[1;37m'
9
11
  NC='\033[0m' # No Color
10
12
 
11
13
  # Get the directory where the script is being called from (caller's project root)
@@ -16,7 +18,7 @@ else
16
18
  PROJECT_ROOT=$(pwd)
17
19
  fi
18
20
 
19
- echo "Starting TypeScript compilation process..."
21
+ echo "${BLUE_BG}${WHITE} START ${NC} Starting TypeScript compilation process...\n"
20
22
 
21
23
  # Default paths relative to project root
22
24
  IN_PATH="$PROJECT_ROOT/src"
@@ -26,25 +28,25 @@ echo "Input directory: $IN_PATH"
26
28
  echo "Output directory: $OUT_PATH"
27
29
 
28
30
  # Convert tsconfig.json to .swcrc
29
- echo "Converting tsconfig.json to .swcrc..."
31
+ echo "\n${BLUE_BG}${WHITE} STEP ${NC} Converting tsconfig.json to .swcrc\n"
30
32
  TMP_SWCRC=$(mktemp -q /tmp/.swcrc.XXXXXX)
31
33
  if [ $? -ne 0 ]; then
32
- echo -e "${RED} Error: Can't create temporary .swcrc file${NC}"
34
+ echo "${RED} Error: Can't create temporary .swcrc file${NC}"
33
35
  exit 1
34
36
  fi
35
37
 
36
38
  # Ensure we're in the project root directory for TypeScript configuration
37
39
  cd "$PROJECT_ROOT"
38
40
  npx tsconfig-to-swcconfig --output="$TMP_SWCRC"
39
- echo -e "${GREEN} Converted tsconfig.json to .swcrc${NC}"
41
+ echo "${GREEN} Completed${NC}"
40
42
 
41
43
  # Create typescript declaration files
42
- echo "Generating TypeScript declaration files..."
44
+ echo "\n${BLUE_BG}${WHITE} STEP ${NC} Generating TypeScript declaration files\n"
43
45
  npx tsc --rootDir "$IN_PATH" --declaration --emitDeclarationOnly --outDir "$OUT_PATH"
44
- echo -e "${GREEN} TypeScript declaration files generated${NC}"
46
+ echo "${GREEN} Completed${NC}"
45
47
 
46
48
  # Create javascript ESM files with improved source maps
47
- echo "Compiling TypeScript to ESM with source maps..."
49
+ echo "\n${BLUE_BG}${WHITE} STEP ${NC} Compiling TypeScript to ESM with source maps\n"
48
50
  if ! "$PROJECT_ROOT/node_modules/.bin/swc" "$IN_PATH" \
49
51
  --source-maps \
50
52
  --copy-files \
@@ -53,17 +55,18 @@ if ! "$PROJECT_ROOT/node_modules/.bin/swc" "$IN_PATH" \
53
55
  --strip-leading-paths \
54
56
  --log-watch-compilation \
55
57
  "$@"; then
56
- echo -e "${RED} SWC compilation failed${NC}"
58
+ echo "${RED} SWC compilation failed${NC}"
57
59
  exit 1
58
60
  fi
59
- echo -e "${GREEN} ESM compilation completed${NC}"
61
+ echo "${GREEN} Completed${NC}"
60
62
 
61
63
  # Create javascript CJS files
62
- echo "Creating CommonJS bundle..."
64
+ echo "\n${BLUE_BG}${WHITE} STEP ${NC} Creating CommonJS bundle\n"
63
65
  if ! npx rollup "$OUT_PATH/index.js" --format cjs --file "$OUT_PATH/index.cjs" --silent; then
64
- echo -e "${RED} Rollup bundling failed${NC}"
66
+ echo "${RED} Rollup bundling failed${NC}"
65
67
  exit 1
66
68
  fi
67
- echo -e "${GREEN} CommonJS bundle created${NC}"
69
+ echo "${GREEN} Completed${NC}"
68
70
 
69
- echo -e "${GREEN} Compilation process completed successfully!${NC}"
71
+ echo "\n${BLUE_BG}${WHITE} END ${NC} Finalizing compilation process\n"
72
+ echo "${GREEN}✓ Completed${NC}"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jterrazz/typescript",
3
3
  "author": "Jean-Baptiste Terrazzoni <contact@jterrazz.com>",
4
- "version": "2.2.0",
4
+ "version": "2.3.2",
5
5
  "files": [
6
6
  "tsconfig",
7
7
  "bin"