@jterrazz/typescript 1.9.3 → 1.9.5
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/swc-compile.sh +15 -2
- package/bin/swc-watch.sh +16 -3
- package/package.json +1 -1
- package/tsconfig/expo.json +6 -1
package/bin/swc-compile.sh
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
# Get the directory where the script is being called from (caller's project root)
|
|
4
|
+
# If called through bin, we need to get the directory where the command was executed
|
|
5
|
+
if [ -n "$INIT_CWD" ]; then
|
|
6
|
+
PROJECT_ROOT="$INIT_CWD"
|
|
7
|
+
else
|
|
8
|
+
PROJECT_ROOT=$(pwd)
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
# Default paths relative to project root
|
|
12
|
+
IN_PATH="$PROJECT_ROOT/src"
|
|
13
|
+
OUT_PATH="$PROJECT_ROOT/dist"
|
|
4
14
|
|
|
5
15
|
# Convert tsconfig.json to .swcrc
|
|
6
16
|
TMP_SWCRC=$(mktemp -q /tmp/.swcrc.XXXXXX)
|
|
@@ -8,6 +18,9 @@ if [ $? -ne 0 ]; then
|
|
|
8
18
|
echo "$0: Can't create temporary .swcrc file"
|
|
9
19
|
exit 1
|
|
10
20
|
fi
|
|
21
|
+
|
|
22
|
+
# Ensure we're in the project root directory for TypeScript configuration
|
|
23
|
+
cd "$PROJECT_ROOT"
|
|
11
24
|
npx tsconfig-to-swcconfig --output="$TMP_SWCRC"
|
|
12
25
|
|
|
13
26
|
# Create typescript declaration files
|
package/bin/swc-watch.sh
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
# Get the directory where the script is being called from (caller's project root)
|
|
4
|
+
# If called through bin, we need to get the directory where the command was executed
|
|
5
|
+
if [ -n "$INIT_CWD" ]; then
|
|
6
|
+
PROJECT_ROOT="$INIT_CWD"
|
|
7
|
+
else
|
|
8
|
+
PROJECT_ROOT=$(pwd)
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
# Default paths relative to project root
|
|
12
|
+
IN_PATH="$PROJECT_ROOT/src"
|
|
13
|
+
OUT_PATH="$PROJECT_ROOT/dist"
|
|
4
14
|
|
|
5
15
|
# Convert tsconfig.json to .swcrc
|
|
6
16
|
TMP_SWCRC=$(mktemp -q /tmp/.swcrc.XXXXXX)
|
|
@@ -8,11 +18,14 @@ if [ $? -ne 0 ]; then
|
|
|
8
18
|
echo "$0: Can't create temporary .swcrc file"
|
|
9
19
|
exit 1
|
|
10
20
|
fi
|
|
21
|
+
|
|
22
|
+
# Ensure we're in the project root directory for TypeScript configuration
|
|
23
|
+
cd "$PROJECT_ROOT"
|
|
11
24
|
npx tsconfig-to-swcconfig --output="$TMP_SWCRC"
|
|
12
25
|
|
|
13
26
|
# Watch for changes in the src directory, compile and run
|
|
14
27
|
npx nodemon --quiet \
|
|
15
|
-
--watch
|
|
28
|
+
--watch "$IN_PATH" \
|
|
16
29
|
--ext '*' \
|
|
17
30
|
--exec "npx swc $IN_PATH \
|
|
18
31
|
--source-maps \
|
package/package.json
CHANGED
package/tsconfig/expo.json
CHANGED