@jterrazz/typescript 2.0.1 → 2.0.3
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 +12 -3
- package/package.json +9 -2
package/bin/ts-compile.sh
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
+
# Exit on error
|
|
4
|
+
set -e
|
|
5
|
+
|
|
3
6
|
# Get the directory where the script is being called from (caller's project root)
|
|
4
7
|
# If called through bin, we need to get the directory where the command was executed
|
|
5
8
|
if [ -n "$INIT_CWD" ]; then
|
|
@@ -37,19 +40,25 @@ echo "✅ TypeScript declaration files generated"
|
|
|
37
40
|
|
|
38
41
|
# Create javascript ESM files with improved source maps
|
|
39
42
|
echo "⚙️ Compiling TypeScript to ESM with source maps..."
|
|
40
|
-
|
|
43
|
+
if ! "$PROJECT_ROOT/node_modules/.bin/swc" "$IN_PATH" \
|
|
41
44
|
--source-maps \
|
|
42
45
|
--copy-files \
|
|
43
46
|
--config-file "$TMP_SWCRC" \
|
|
44
47
|
--out-dir "$OUT_PATH" \
|
|
45
48
|
--strip-leading-paths \
|
|
46
49
|
--log-watch-compilation \
|
|
47
|
-
"$@"
|
|
50
|
+
"$@"; then
|
|
51
|
+
echo "❌ SWC compilation failed"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
48
54
|
echo "✅ ESM compilation completed"
|
|
49
55
|
|
|
50
56
|
# Create javascript CJS files
|
|
51
57
|
echo "🔄 Creating CommonJS bundle..."
|
|
52
|
-
npx rollup "$OUT_PATH/index.js" --format cjs --file "$OUT_PATH/index.cjs"
|
|
58
|
+
if ! npx rollup "$OUT_PATH/index.js" --format cjs --file "$OUT_PATH/index.cjs"; then
|
|
59
|
+
echo "❌ Rollup bundling failed"
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
53
62
|
echo "✅ CommonJS bundle created"
|
|
54
63
|
|
|
55
64
|
echo "✨ Compilation process completed successfully!"
|
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.
|
|
4
|
+
"version": "2.0.3",
|
|
5
5
|
"files": [
|
|
6
6
|
"tsconfig",
|
|
7
7
|
"bin"
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@jterrazz/quality": "^1.6.1"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@swc/cli": "0.6.0",
|
|
19
|
+
"@swc/cli": "^0.6.0",
|
|
20
20
|
"@swc/core": "1.11.13",
|
|
21
21
|
"@types/node": "22.13.10",
|
|
22
22
|
"nodemon": "3.1.9",
|
|
@@ -24,6 +24,13 @@
|
|
|
24
24
|
"tsconfig-to-swcconfig": "2.8.1",
|
|
25
25
|
"typescript": "5.8.2"
|
|
26
26
|
},
|
|
27
|
+
"optionalDependencies": {
|
|
28
|
+
"@swc/core-linux-x64-gnu": "1.11.13",
|
|
29
|
+
"@swc/core-linux-x64-musl": "1.11.13",
|
|
30
|
+
"@swc/core-darwin-x64": "1.11.13",
|
|
31
|
+
"@swc/core-darwin-arm64": "1.11.13",
|
|
32
|
+
"@swc/core-win32-x64-msvc": "1.11.13"
|
|
33
|
+
},
|
|
27
34
|
"publishConfig": {
|
|
28
35
|
"registry": "https://registry.npmjs.org/"
|
|
29
36
|
}
|