@jterrazz/typescript 2.0.6 → 2.3.1

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/ts-compile.sh CHANGED
@@ -3,6 +3,13 @@
3
3
  # Exit on error
4
4
  set -e
5
5
 
6
+ # Colors for output
7
+ RED='\033[0;31m'
8
+ GREEN='\033[0;32m'
9
+ ACCENT_BG='\033[48;5;31m' # TypeScript blue
10
+ WHITE='\033[1;37m'
11
+ NC='\033[0m' # No Color
12
+
6
13
  # Get the directory where the script is being called from (caller's project root)
7
14
  # If called through bin, we need to get the directory where the command was executed
8
15
  if [ -n "$INIT_CWD" ]; then
@@ -11,35 +18,35 @@ else
11
18
  PROJECT_ROOT=$(pwd)
12
19
  fi
13
20
 
14
- echo "🚀 Starting TypeScript compilation process..."
21
+ echo "${ACCENT_BG}${WHITE} START ${NC} Starting TypeScript compilation process...\n"
15
22
 
16
23
  # Default paths relative to project root
17
24
  IN_PATH="$PROJECT_ROOT/src"
18
25
  OUT_PATH="$PROJECT_ROOT/dist"
19
26
 
20
- echo "📂 Input directory: $IN_PATH"
21
- echo "📂 Output directory: $OUT_PATH"
27
+ echo "Input directory: $IN_PATH"
28
+ echo "Output directory: $OUT_PATH"
22
29
 
23
30
  # Convert tsconfig.json to .swcrc
24
- echo "🔄 Converting tsconfig.json to .swcrc..."
31
+ echo "\n${ACCENT_BG}${WHITE} STEP ${NC} Converting tsconfig.json to .swcrc\n"
25
32
  TMP_SWCRC=$(mktemp -q /tmp/.swcrc.XXXXXX)
26
33
  if [ $? -ne 0 ]; then
27
- echo " Error: Can't create temporary .swcrc file"
34
+ echo "${RED}✗ Error: Can't create temporary .swcrc file${NC}"
28
35
  exit 1
29
36
  fi
30
37
 
31
38
  # Ensure we're in the project root directory for TypeScript configuration
32
39
  cd "$PROJECT_ROOT"
33
40
  npx tsconfig-to-swcconfig --output="$TMP_SWCRC"
34
- echo " Successfully converted tsconfig.json to .swcrc"
41
+ echo "${GREEN}✓ Completed${NC}"
35
42
 
36
43
  # Create typescript declaration files
37
- echo "📝 Generating TypeScript declaration files..."
44
+ echo "\n${ACCENT_BG}${WHITE} STEP ${NC} Generating TypeScript declaration files\n"
38
45
  npx tsc --rootDir "$IN_PATH" --declaration --emitDeclarationOnly --outDir "$OUT_PATH"
39
- echo " TypeScript declaration files generated"
46
+ echo "${GREEN}✓ Completed${NC}"
40
47
 
41
48
  # Create javascript ESM files with improved source maps
42
- echo "⚙️ Compiling TypeScript to ESM with source maps..."
49
+ echo "\n${ACCENT_BG}${WHITE} STEP ${NC} Compiling TypeScript to ESM with source maps\n"
43
50
  if ! "$PROJECT_ROOT/node_modules/.bin/swc" "$IN_PATH" \
44
51
  --source-maps \
45
52
  --copy-files \
@@ -48,17 +55,18 @@ if ! "$PROJECT_ROOT/node_modules/.bin/swc" "$IN_PATH" \
48
55
  --strip-leading-paths \
49
56
  --log-watch-compilation \
50
57
  "$@"; then
51
- echo " SWC compilation failed"
58
+ echo "${RED}✗ SWC compilation failed${NC}"
52
59
  exit 1
53
60
  fi
54
- echo " ESM compilation completed"
61
+ echo "${GREEN}✓ Completed${NC}"
55
62
 
56
63
  # Create javascript CJS files
57
- echo "🔄 Creating CommonJS bundle..."
64
+ echo "\n${ACCENT_BG}${WHITE} STEP ${NC} Creating CommonJS bundle\n"
58
65
  if ! npx rollup "$OUT_PATH/index.js" --format cjs --file "$OUT_PATH/index.cjs" --silent; then
59
- echo " Rollup bundling failed"
66
+ echo "${RED}✗ Rollup bundling failed${NC}"
60
67
  exit 1
61
68
  fi
62
- echo " CommonJS bundle created"
69
+ echo "${GREEN}✓ Completed${NC}"
63
70
 
64
- echo " Compilation process completed successfully!"
71
+ echo "\n${ACCENT_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.0.6",
4
+ "version": "2.3.1",
5
5
  "files": [
6
6
  "tsconfig",
7
7
  "bin"
@@ -21,24 +21,24 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@swc/cli": "^0.7.3",
24
- "@swc/core": "1.11.21",
24
+ "@swc/core": "1.11.24",
25
25
  "@types/node": "22.14.1",
26
- "nodemon": "3.1.9",
27
- "rollup": "4.40.0",
26
+ "nodemon": "3.1.10",
27
+ "rollup": "4.40.1",
28
28
  "tsconfig-to-swcconfig": "2.8.1",
29
29
  "typescript": "5.8.3"
30
30
  },
31
31
  "optionalDependencies": {
32
- "@swc/core-linux-x64-gnu": "1.11.21",
33
- "@swc/core-linux-x64-musl": "1.11.21",
34
- "@swc/core-darwin-x64": "1.11.21",
35
- "@swc/core-darwin-arm64": "1.11.21",
36
- "@swc/core-win32-x64-msvc": "1.11.21",
37
- "@rollup/rollup-linux-x64-gnu": "4.40.0",
38
- "@rollup/rollup-linux-x64-musl": "4.40.0",
39
- "@rollup/rollup-darwin-x64": "4.40.0",
40
- "@rollup/rollup-darwin-arm64": "4.40.0",
41
- "@rollup/rollup-win32-x64-msvc": "4.40.0"
32
+ "@swc/core-linux-x64-gnu": "1.11.24",
33
+ "@swc/core-linux-x64-musl": "1.11.24",
34
+ "@swc/core-darwin-x64": "1.11.24",
35
+ "@swc/core-darwin-arm64": "1.11.24",
36
+ "@swc/core-win32-x64-msvc": "1.11.24",
37
+ "@rollup/rollup-linux-x64-gnu": "4.40.1",
38
+ "@rollup/rollup-linux-x64-musl": "4.40.1",
39
+ "@rollup/rollup-darwin-x64": "4.40.1",
40
+ "@rollup/rollup-darwin-arm64": "4.40.1",
41
+ "@rollup/rollup-win32-x64-msvc": "4.40.1"
42
42
  },
43
43
  "publishConfig": {
44
44
  "registry": "https://registry.npmjs.org/"
@@ -1,11 +1,11 @@
1
1
  {
2
- "display": "ESM",
2
+ "display": "Node ESM",
3
3
  "include": ["../../../../src/"],
4
4
 
5
5
  "compilerOptions": {
6
6
  "moduleResolution": "bundler",
7
7
  "module": "ESNext",
8
- "types": ["node", "jest"],
8
+ "types": ["node"],
9
9
  "strict": true,
10
10
  "experimentalDecorators": true,
11
11
  "esModuleInterop": true,