@upleveled/preflight 8.1.5 → 9.0.0

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/preflight.sh CHANGED
@@ -1,15 +1,44 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- script_dir="$(cd "$(dirname "$0")" && pwd)"
4
-
5
- # Workaround for incorrect path in pnpm shim
6
- # https://github.com/pnpm/pnpm/issues/8704#issuecomment-2439618363
7
- #
8
- # TODO: Remove and switch back to "$script_dir/../node_modules/.bin/tsx"
9
- # when the issue above is resolved
10
- tsx_shim="$script_dir/../node_modules/.bin/tsx"
11
- exec_command=$(awk '/^else$/{flag=1;next}/^fi$/{flag=0}flag' "$tsx_shim" | grep 'exec node')
12
- cli_path=$(echo "$exec_command" | sed -E 's/^[[:space:]]*exec node[[:space:]]+"[^"]+(node_modules\/tsx\/[^"]+)".*/\1/')
13
- cli_path="$(pnpm bin --global)/global/5/.pnpm/$cli_path"
14
-
15
- node "$cli_path" "$script_dir/../src/index.ts"
3
+ set -o errexit
4
+ set -o nounset
5
+ set -o pipefail
6
+
7
+ exec node --disable-warning=ExperimentalWarning --input-type=module --eval '
8
+ import { readFileSync } from "node:fs";
9
+ import { registerHooks, stripTypeScriptTypes } from "node:module";
10
+ import { dirname, resolve } from "node:path";
11
+ import { argv } from "node:process";
12
+ import { fileURLToPath, pathToFileURL } from "node:url";
13
+
14
+ const tsRegex = /^file:.*(?<!\.d)\.m?ts$/;
15
+
16
+ // Intercept .ts / .mts files (skipping .d.ts files) and
17
+ // transpile to JS, returning ES module
18
+ registerHooks({
19
+ load(url, context, nextLoad) {
20
+ if (tsRegex.test(url)) {
21
+ return {
22
+ format: "module",
23
+ source: stripTypeScriptTypes(readFileSync(fileURLToPath(url), "utf8"), {
24
+ mode: "transform",
25
+ sourceUrl: url,
26
+ }),
27
+ shortCircuit: true,
28
+ };
29
+ }
30
+
31
+ return nextLoad(url, context);
32
+ },
33
+ });
34
+
35
+ await import(
36
+ pathToFileURL(
37
+ resolve(
38
+ dirname(argv[1]),
39
+ // Path to entry point
40
+ "../src/index.ts",
41
+ ),
42
+ ).href
43
+ );
44
+ ' "$0" "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upleveled/preflight",
3
- "version": "8.1.5",
3
+ "version": "9.0.0",
4
4
  "repository": "upleveled/preflight",
5
5
  "license": "MIT",
6
6
  "author": "UpLeveled (https://github.com/upleveled)",
@@ -19,32 +19,31 @@
19
19
  "src"
20
20
  ],
21
21
  "dependencies": {
22
- "algoliasearch": "5.23.2",
22
+ "algoliasearch": "5.35.0",
23
23
  "chalk": "5.4.1",
24
- "cheerio": "1.0.0",
24
+ "cheerio": "1.1.2",
25
25
  "depcheck": "1.4.7",
26
26
  "domhandler": "5.0.3",
27
- "execa": "9.5.2",
28
- "listr2": "8.2.5",
27
+ "execa": "9.6.0",
28
+ "listr2": "9.0.1",
29
29
  "node-fetch": "3.3.2",
30
30
  "p-reduce": "3.0.0",
31
31
  "readdirp": "4.1.2",
32
- "semver": "7.7.1",
33
- "top-user-agents": "2.1.42",
34
- "tsx": "4.19.3"
32
+ "semver": "7.7.2",
33
+ "top-user-agents": "2.1.61"
35
34
  },
36
35
  "devDependencies": {
37
- "@types/node": "22.14.0",
36
+ "@types/node": "24.1.0",
38
37
  "@types/p-map": "2.0.0",
39
38
  "@types/semver": "7.7.0",
40
- "eslint": "9.23.0",
41
- "eslint-config-upleveled": "9.2.3",
39
+ "eslint": "9.32.0",
40
+ "eslint-config-upleveled": "9.2.6",
42
41
  "p-map": "7.0.3",
43
- "prettier": "3.5.3",
44
- "stylelint": "16.17.0",
45
- "typescript": "5.8.2",
46
- "typescript-eslint": "8.29.0",
47
- "vitest": "3.1.1"
42
+ "prettier": "3.6.2",
43
+ "stylelint": "16.23.0",
44
+ "typescript": "5.9.2",
45
+ "typescript-eslint": "8.38.0",
46
+ "vitest": "3.2.4"
48
47
  },
49
48
  "engines": {
50
49
  "node": ">=18"
@@ -54,7 +53,7 @@
54
53
  "docker-build-run": "pnpm docker-build && pnpm docker-run",
55
54
  "docker-run": "docker run preflight",
56
55
  "lint": "eslint . --max-warnings 0",
57
- "start": "tsx watch ./src/index.ts",
56
+ "start": "node --watch ./src/index.ts",
58
57
  "test": "vitest run",
59
58
  "test-local": "rm -rf ./__tests__/fixtures/__temp && pnpm test"
60
59
  }
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  type ListrContext,
4
4
  type ListrDefaultRenderer,
5
5
  type ListrTask,
6
- ListrTaskWrapper,
6
+ type ListrTaskWrapper,
7
7
  } from 'listr2';
8
8
  import * as allChangesCommittedToGit from './checks/allChangesCommittedToGit.ts';
9
9
  import * as eslint from './checks/eslint.ts';