ts-builds 2.2.2 → 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/dist/cli.js CHANGED
@@ -35,10 +35,10 @@ function loadConfig() {
35
35
  chains
36
36
  };
37
37
  }
38
- function runCommand(command$1, args, options = {}) {
38
+ function runCommand(command, args, options = {}) {
39
39
  const cwd = options.cwd ? join(targetDir, options.cwd) : targetDir;
40
40
  return new Promise((resolve) => {
41
- const child = spawn(command$1, args, {
41
+ const child = spawn(command, args, {
42
42
  cwd,
43
43
  stdio: "inherit",
44
44
  shell: true
@@ -47,7 +47,7 @@ function runCommand(command$1, args, options = {}) {
47
47
  resolve(code ?? 1);
48
48
  });
49
49
  child.on("error", (err) => {
50
- console.error(`Failed to run ${command$1}: ${err.message}`);
50
+ console.error(`Failed to run ${command}: ${err.message}`);
51
51
  resolve(1);
52
52
  });
53
53
  });
@@ -355,8 +355,8 @@ async function runTest(mode = "run") {
355
355
  async function runBuild(watch = false) {
356
356
  if (loadConfig().buildMode === "vite") {
357
357
  if (watch) return runCommand("vite", ["build", "--watch"]);
358
- const cleanCode$1 = await runCommand("rimraf", ["dist"]);
359
- if (cleanCode$1 !== 0) return cleanCode$1;
358
+ const cleanCode = await runCommand("rimraf", ["dist"]);
359
+ if (cleanCode !== 0) return cleanCode;
360
360
  return runCommand("vite", ["build"]);
361
361
  }
362
362
  if (watch) return runCommand("tsdown", ["--watch"]);
@@ -405,8 +405,8 @@ async function runChain(chainName, config, visited = /* @__PURE__ */ new Set())
405
405
  console.log(`\nšŸ“‹ Running chain: ${chainName} [${chain.join(" → ")}]`);
406
406
  for (const step of chain) {
407
407
  if (config.chains[step]) {
408
- const code$1 = await runChain(step, config, visited);
409
- if (code$1 !== 0) return code$1;
408
+ const code = await runChain(step, config, visited);
409
+ if (code !== 0) return code;
410
410
  continue;
411
411
  }
412
412
  const cmdDef = config.commands[step] ?? builtins[step];
@@ -0,0 +1,71 @@
1
+ // ESLint FP config: Base + functional programming rules from eslint-config-functype
2
+ // Includes: no-let, immutable-data, prefer-immutable-types, etc.
3
+ import path from "node:path"
4
+ import { fileURLToPath } from "node:url"
5
+
6
+ import { FlatCompat } from "@eslint/eslintrc"
7
+ import js from "@eslint/js"
8
+ import typescriptEslint from "@typescript-eslint/eslint-plugin"
9
+ import tsParser from "@typescript-eslint/parser"
10
+ import functypeConfig from "eslint-config-functype"
11
+ import functional from "eslint-plugin-functional"
12
+ import prettier from "eslint-plugin-prettier"
13
+ import simpleImportSort from "eslint-plugin-simple-import-sort"
14
+ import globals from "globals"
15
+
16
+ const __filename = fileURLToPath(import.meta.url)
17
+ const __dirname = path.dirname(__filename)
18
+ const compat = new FlatCompat({
19
+ baseDirectory: __dirname,
20
+ recommendedConfig: js.configs.recommended,
21
+ allConfig: js.configs.all,
22
+ })
23
+
24
+ export default [
25
+ {
26
+ ignores: [
27
+ "**/.gitignore",
28
+ "**/.eslintignore",
29
+ "**/node_modules",
30
+ "**/.DS_Store",
31
+ "**/dist-ssr",
32
+ "**/*.local",
33
+ "**/tsconfig.json",
34
+ ],
35
+ },
36
+ ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"),
37
+ {
38
+ plugins: {
39
+ "@typescript-eslint": typescriptEslint,
40
+ "simple-import-sort": simpleImportSort,
41
+ functional,
42
+ prettier,
43
+ },
44
+
45
+ languageOptions: {
46
+ globals: {
47
+ ...globals.browser,
48
+ ...globals.amd,
49
+ ...globals.node,
50
+ },
51
+
52
+ parser: tsParser,
53
+ ecmaVersion: 2020,
54
+ sourceType: "module",
55
+ },
56
+
57
+ settings: {
58
+ "import/resolver": {
59
+ node: {
60
+ paths: ["'src'"],
61
+ extensions: [".js", ".ts"],
62
+ },
63
+ },
64
+ },
65
+
66
+ rules: {
67
+ // Include all rules from eslint-config-functype recommended
68
+ ...functypeConfig.configs.recommended.rules,
69
+ },
70
+ },
71
+ ]
@@ -0,0 +1,81 @@
1
+ // ESLint Functype config: Base + FP rules + eslint-plugin-functype rules
2
+ // Full functype support: prefer-option, prefer-either, prefer-fold, etc.
3
+ import path from "node:path"
4
+ import { fileURLToPath } from "node:url"
5
+
6
+ import { FlatCompat } from "@eslint/eslintrc"
7
+ import js from "@eslint/js"
8
+ import typescriptEslint from "@typescript-eslint/eslint-plugin"
9
+ import tsParser from "@typescript-eslint/parser"
10
+ import functypeConfig from "eslint-config-functype"
11
+ import functional from "eslint-plugin-functional"
12
+ import functypePlugin from "eslint-plugin-functype"
13
+ import prettier from "eslint-plugin-prettier"
14
+ import simpleImportSort from "eslint-plugin-simple-import-sort"
15
+ import globals from "globals"
16
+
17
+ const __filename = fileURLToPath(import.meta.url)
18
+ const __dirname = path.dirname(__filename)
19
+ const compat = new FlatCompat({
20
+ baseDirectory: __dirname,
21
+ recommendedConfig: js.configs.recommended,
22
+ allConfig: js.configs.all,
23
+ })
24
+
25
+ export default [
26
+ {
27
+ ignores: [
28
+ "**/.gitignore",
29
+ "**/.eslintignore",
30
+ "**/node_modules",
31
+ "**/.DS_Store",
32
+ "**/dist-ssr",
33
+ "**/*.local",
34
+ "**/tsconfig.json",
35
+ ],
36
+ },
37
+ ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"),
38
+ {
39
+ plugins: {
40
+ "@typescript-eslint": typescriptEslint,
41
+ "simple-import-sort": simpleImportSort,
42
+ functional,
43
+ functype: functypePlugin,
44
+ prettier,
45
+ },
46
+
47
+ languageOptions: {
48
+ globals: {
49
+ ...globals.browser,
50
+ ...globals.amd,
51
+ ...globals.node,
52
+ },
53
+
54
+ parser: tsParser,
55
+ ecmaVersion: 2020,
56
+ sourceType: "module",
57
+ },
58
+
59
+ settings: {
60
+ "import/resolver": {
61
+ node: {
62
+ paths: ["'src'"],
63
+ extensions: [".js", ".ts"],
64
+ },
65
+ },
66
+ },
67
+
68
+ rules: {
69
+ // Include all rules from eslint-config-functype recommended
70
+ ...functypeConfig.configs.recommended.rules,
71
+ // Functype library-specific rules
72
+ "functype/prefer-option": "warn",
73
+ "functype/prefer-either": "warn",
74
+ "functype/prefer-fold": "warn",
75
+ "functype/prefer-map": "warn",
76
+ "functype/prefer-flatmap": "warn",
77
+ "functype/no-imperative-loops": "warn",
78
+ "functype/prefer-do-notation": "warn",
79
+ },
80
+ },
81
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-builds",
3
- "version": "2.2.2",
3
+ "version": "2.3.1",
4
4
  "description": "Shared TypeScript configuration files for library templates. Provides standardized ESLint, Prettier, Vitest, TypeScript, and build configs.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -30,6 +30,8 @@
30
30
  "./prettier": "./prettier-config.cjs",
31
31
  "./prettier-ignore": "./.prettierignore",
32
32
  "./eslint": "./eslint.config.base.mjs",
33
+ "./eslint-fp": "./eslint.config.fp.mjs",
34
+ "./eslint-functype": "./eslint.config.functype.mjs",
33
35
  "./vitest": "./dist/vitest.config.base.js",
34
36
  "./tsconfig": "./tsconfig.base.json",
35
37
  "./tsdown": "./dist/tsdown.config.base.js",
@@ -41,6 +43,8 @@
41
43
  "prettier-config.cjs",
42
44
  ".prettierignore",
43
45
  "eslint.config.base.mjs",
46
+ "eslint.config.fp.mjs",
47
+ "eslint.config.functype.mjs",
44
48
  "dist",
45
49
  "tsconfig.base.json",
46
50
  "package-scripts.json",
@@ -52,25 +56,28 @@
52
56
  "@eslint/eslintrc": "^3.3.3",
53
57
  "@eslint/js": "^9.39.2",
54
58
  "@types/node": "~24.10.9",
55
- "@typescript-eslint/eslint-plugin": "^8.53.1",
56
- "@typescript-eslint/parser": "^8.53.1",
57
- "@vitest/coverage-v8": "^4.0.17",
58
- "@vitest/ui": "^4.0.17",
59
+ "@typescript-eslint/eslint-plugin": "^8.54.0",
60
+ "@typescript-eslint/parser": "^8.54.0",
61
+ "@vitest/coverage-v8": "^4.0.18",
62
+ "@vitest/ui": "^4.0.18",
59
63
  "cross-env": "^10.1.0",
60
64
  "eslint": "^9.39.2",
65
+ "eslint-config-functype": "^1.3.0",
61
66
  "eslint-config-prettier": "^10.1.8",
67
+ "eslint-plugin-functype": "^1.4.0",
68
+ "eslint-plugin-functional": "^9.0.0",
62
69
  "eslint-plugin-import": "^2.32.0",
63
70
  "eslint-plugin-prettier": "^5.5.5",
64
71
  "eslint-plugin-simple-import-sort": "^12.1.1",
65
- "globals": "^17.0.0",
66
- "prettier": "^3.8.0",
72
+ "globals": "^17.2.0",
73
+ "prettier": "^3.8.1",
67
74
  "rimraf": "^6.1.2",
68
75
  "ts-node": "^10.9.2",
69
76
  "typescript": "^5.9.3",
70
- "vitest": "^4.0.17"
77
+ "vitest": "^4.0.18"
71
78
  },
72
79
  "devDependencies": {
73
- "tsdown": "^0.19.0"
80
+ "tsdown": "^0.20.1"
74
81
  },
75
82
  "peerDependencies": {
76
83
  "tsdown": "^0.x",
@@ -99,5 +106,5 @@
99
106
  "dev": "node dist/cli.js dev",
100
107
  "prepublishOnly": "pnpm validate:bootstrap"
101
108
  },
102
- "packageManager": "pnpm@10.28.1+sha512.7d7dbbca9e99447b7c3bf7a73286afaaf6be99251eb9498baefa7d406892f67b879adb3a1d7e687fc4ccc1a388c7175fbaae567a26ab44d1067b54fcb0d6a316"
109
+ "packageManager": "pnpm@10.28.2+sha512.41872f037ad22f7348e3b1debbaf7e867cfd448f2726d9cf74c08f19507c31d2c8e7a11525b983febc2df640b5438dee6023ebb1f84ed43cc2d654d2bc326264"
103
110
  }