@jterrazz/typescript 6.0.2 → 6.0.4

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.
@@ -19,14 +19,24 @@ done
19
19
  SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
20
20
  PACKAGE_ROOT="$SCRIPT_DIR/../.."
21
21
 
22
- # Find bin directory
23
- if [ -x "$PACKAGE_ROOT/../../.bin/oxlint" ]; then
24
- BIN_DIR="$PACKAGE_ROOT/../../.bin"
25
- elif [ -x "$PACKAGE_ROOT/node_modules/.bin/oxlint" ]; then
26
- BIN_DIR="$PACKAGE_ROOT/node_modules/.bin"
27
- else
28
- BIN_DIR="$(npm bin 2>/dev/null)"
29
- fi
22
+ # Find binaries one by one - npm may hoist some tools to the consumer's
23
+ # node_modules/.bin and nest others under this package, so a single shared
24
+ # bin directory cannot be assumed
25
+ find_binary() {
26
+ local name="$1"
27
+ if [ -x "$PACKAGE_ROOT/node_modules/.bin/$name" ]; then
28
+ echo "$PACKAGE_ROOT/node_modules/.bin/$name"
29
+ elif [ -x "$PACKAGE_ROOT/../../.bin/$name" ]; then
30
+ echo "$PACKAGE_ROOT/../../.bin/$name"
31
+ else
32
+ echo "$name" # Fallback to PATH
33
+ fi
34
+ }
35
+
36
+ TSGO=$(find_binary tsgo)
37
+ OXLINT=$(find_binary oxlint)
38
+ OXFMT=$(find_binary oxfmt)
39
+ KNIP=$(find_binary knip)
30
40
 
31
41
  # Parse command and args
32
42
  COMMAND=""
@@ -71,20 +81,20 @@ run_checks() {
71
81
  printf "${CYAN_BG}${BRIGHT_WHITE} START ${NC} ${LABEL}\n"
72
82
 
73
83
  # Run all tools in parallel
74
- "$BIN_DIR/tsgo" --noEmit > "$tmp_dir/type.log" 2>&1 &
84
+ "$TSGO" --noEmit > "$tmp_dir/type.log" 2>&1 &
75
85
  local type_pid=$!
76
86
 
77
87
  if [ "$FIX_MODE" = true ]; then
78
- "$BIN_DIR/oxlint" --fix "${LINT_ARGS[@]}" > "$tmp_dir/lint.log" 2>&1 &
88
+ "$OXLINT" --fix "${LINT_ARGS[@]}" > "$tmp_dir/lint.log" 2>&1 &
79
89
  else
80
- "$BIN_DIR/oxlint" "${LINT_ARGS[@]}" > "$tmp_dir/lint.log" 2>&1 &
90
+ "$OXLINT" "${LINT_ARGS[@]}" > "$tmp_dir/lint.log" 2>&1 &
81
91
  fi
82
92
  local lint_pid=$!
83
93
 
84
94
  if [ "$FIX_MODE" = true ]; then
85
- "$BIN_DIR/oxfmt" > "$tmp_dir/format.log" 2>&1 &
95
+ "$OXFMT" > "$tmp_dir/format.log" 2>&1 &
86
96
  else
87
- "$BIN_DIR/oxfmt" --check > "$tmp_dir/format.log" 2>&1 &
97
+ "$OXFMT" --check > "$tmp_dir/format.log" 2>&1 &
88
98
  fi
89
99
  local format_pid=$!
90
100
 
@@ -98,8 +108,8 @@ run_checks() {
98
108
  [ -f "knip.json" ] && knip_project="knip.json"
99
109
  [ -f "knip.jsonc" ] && knip_project="knip.jsonc"
100
110
 
101
- node "$PACKAGE_ROOT/bin/merge-knip-config.js" "$knip_base" $knip_project > "$tmp_dir/knip-merged.json"
102
- "$BIN_DIR/knip" --no-progress --no-config-hints --config "$tmp_dir/knip-merged.json" > "$tmp_dir/knip.log" 2>&1 &
111
+ node "$PACKAGE_ROOT/lib/merge-knip-config.js" "$knip_base" $knip_project > "$tmp_dir/knip-merged.json"
112
+ "$KNIP" --no-progress --no-config-hints --config "$tmp_dir/knip-merged.json" > "$tmp_dir/knip.log" 2>&1 &
103
113
  knip_pid=$!
104
114
  fi
105
115
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jterrazz/typescript",
3
- "version": "6.0.2",
3
+ "version": "6.0.4",
4
4
  "author": "Jean-Baptiste Terrazzoni <contact@jterrazz.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,13 +11,18 @@
11
11
  },
12
12
  "files": [
13
13
  "bin",
14
+ "lib",
14
15
  "presets",
15
16
  "src"
16
17
  ],
17
18
  "type": "module",
18
19
  "main": "src/index.js",
20
+ "types": "src/index.d.ts",
19
21
  "exports": {
20
- ".": "./src/index.js",
22
+ ".": {
23
+ "types": "./src/index.d.ts",
24
+ "default": "./src/index.js"
25
+ },
21
26
  "./tsconfig/*": "./presets/tsconfig/*.json",
22
27
  "./tsconfig/*.json": "./presets/tsconfig/*.json",
23
28
  "./tsdown/*": "./presets/tsdown/*.js",
@@ -47,7 +52,7 @@
47
52
  "typedoc-plugin-markdown": "^4.11.0"
48
53
  },
49
54
  "devDependencies": {
50
- "@jterrazz/test": "^5.3.2",
55
+ "@jterrazz/test": "^8.0.0",
51
56
  "@types/node": "^25.5.0",
52
57
  "vitest": "^4.1.2"
53
58
  }
package/src/index.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ type ConfigObject = Record<string, unknown>;
2
+
3
+ declare const oxfmtConfig: ConfigObject;
4
+
5
+ declare const oxlintPresets: {
6
+ expo: ConfigObject;
7
+ hexagonal: ConfigObject;
8
+ next: ConfigObject;
9
+ node: ConfigObject;
10
+ };
11
+
12
+ declare const defaultExport: {
13
+ oxfmt: typeof oxfmtConfig;
14
+ oxlint: typeof oxlintPresets;
15
+ };
16
+
17
+ export { oxfmtConfig as oxfmt, oxlintPresets as oxlint };
18
+ export default defaultExport;
File without changes