@shibanet0/datamitsu-config 0.0.1-alpha-23 → 0.0.1-alpha-25

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.
Files changed (70) hide show
  1. package/bin/tsc.mjs +3 -7
  2. package/datamitsu.js +29 -34
  3. package/dist/binary/index.js +1 -0
  4. package/dist/clean-package/index.js +34 -35
  5. package/dist/commitlint/index.js +5 -9
  6. package/dist/datamitsu-config/apps.js +81 -0
  7. package/dist/datamitsu-config/cmdInit.js +850 -0
  8. package/dist/datamitsu-config/constants.js +6 -0
  9. package/dist/datamitsu-config/env.js +6 -0
  10. package/dist/datamitsu-config/githubApps.json +1936 -0
  11. package/dist/datamitsu-config/ignore.js +121 -0
  12. package/dist/datamitsu-config/main.js +32 -0
  13. package/dist/datamitsu-config/project.js +31 -0
  14. package/dist/datamitsu-config/tools.js +332 -0
  15. package/dist/datamitsu-config/utils/cleanDependencies.js +25 -0
  16. package/dist/eslint/globs.js +71 -0
  17. package/dist/eslint/index.js +189 -211
  18. package/dist/eslint/plugins/arrayFunc.js +20 -0
  19. package/dist/eslint/plugins/arrow-return-style.js +4 -0
  20. package/dist/eslint/plugins/boundaries.js +15 -0
  21. package/dist/eslint/plugins/clsx.js +4 -0
  22. package/dist/eslint/plugins/command.js +4 -0
  23. package/dist/eslint/plugins/compat.js +4 -0
  24. package/dist/eslint/plugins/cspell.js +4 -0
  25. package/dist/eslint/plugins/deMorgan.js +14 -0
  26. package/dist/eslint/plugins/depend.js +4 -0
  27. package/dist/eslint/plugins/escompat.js +4 -0
  28. package/dist/eslint/plugins/fsecond.js +12 -0
  29. package/dist/eslint/plugins/html.js +12 -0
  30. package/dist/eslint/plugins/i18next.js +4 -0
  31. package/dist/eslint/plugins/import.js +27 -0
  32. package/dist/eslint/plugins/javascript.js +32 -0
  33. package/dist/eslint/plugins/jsdoc.js +4 -0
  34. package/dist/eslint/plugins/json-schema-validator.js +15 -0
  35. package/dist/eslint/plugins/json.js +24 -0
  36. package/dist/eslint/plugins/jsonc.js +7 -0
  37. package/dist/eslint/plugins/jsx-a11y.js +22 -0
  38. package/dist/eslint/plugins/n.js +15 -0
  39. package/dist/eslint/plugins/no-unsanitized.js +4 -0
  40. package/dist/eslint/plugins/no-use-extend-native.js +15 -0
  41. package/dist/eslint/plugins/oxlint.js +10 -0
  42. package/dist/eslint/plugins/perfectionist.js +95 -0
  43. package/dist/eslint/plugins/playwright.js +15 -0
  44. package/dist/eslint/plugins/pnpm.js +11 -0
  45. package/dist/eslint/plugins/prettier.js +14 -0
  46. package/dist/eslint/plugins/promise.js +21 -0
  47. package/dist/eslint/plugins/react-hooks.js +14 -0
  48. package/dist/eslint/plugins/react-perf.js +14 -0
  49. package/dist/eslint/plugins/react-prefer-function-component.js +15 -0
  50. package/dist/eslint/plugins/react-refresh.js +14 -0
  51. package/dist/eslint/plugins/react-you-might-not-need-an-effect.js +4 -0
  52. package/dist/eslint/plugins/react.js +49 -0
  53. package/dist/eslint/plugins/regexp.js +4 -0
  54. package/dist/eslint/plugins/security.js +20 -0
  55. package/dist/eslint/plugins/sonarjs.js +38 -0
  56. package/dist/eslint/plugins/storybook.js +15 -0
  57. package/dist/eslint/plugins/stylistic.js +14 -0
  58. package/dist/eslint/plugins/toml.js +15 -0
  59. package/dist/eslint/plugins/turbo.js +15 -0
  60. package/dist/eslint/plugins/typescript.js +34 -0
  61. package/dist/eslint/plugins/unicorn.js +69 -0
  62. package/dist/eslint/plugins/unused-imports.js +24 -0
  63. package/dist/eslint/plugins/vanilla-extract.js +17 -0
  64. package/dist/eslint/plugins/vitest.js +15 -0
  65. package/dist/eslint/plugins/yml.js +21 -0
  66. package/dist/eslint/types.js +0 -0
  67. package/dist/globs/globs.js +1 -0
  68. package/dist/knip/index.js +3 -7
  69. package/dist/oxlint/index.js +36 -0
  70. package/package.json +2 -2
package/bin/tsc.mjs CHANGED
@@ -6,13 +6,9 @@ import { getBinaryFilepath } from "./utils.mjs";
6
6
 
7
7
  const args = process.argv.slice(2);
8
8
 
9
- const child = spawn(
10
- getBinaryFilepath("@typescript/native-preview/package.json", "../bin/tsc"),
11
- args,
12
- {
13
- stdio: "inherit",
14
- },
15
- );
9
+ const child = spawn(getBinaryFilepath("typescript/package.json", "../bin/tsc"), args, {
10
+ stdio: "inherit",
11
+ });
16
12
 
17
13
  child.on("exit", (code) => {
18
14
  if (code !== 0) {
package/datamitsu.js CHANGED
@@ -1789,7 +1789,7 @@ var mapOfApps = {
1789
1789
 
1790
1790
  // package.json
1791
1791
  var name = "@shibanet0/datamitsu-config";
1792
- var version = "0.0.1-alpha-22";
1792
+ var version = "0.0.1-alpha-23";
1793
1793
  var dependencies = {
1794
1794
  "@antebudimir/eslint-plugin-vanilla-extract": "1.16.0",
1795
1795
  "@commander-js/extra-typings": "14.0.0",
@@ -1798,7 +1798,7 @@ var dependencies = {
1798
1798
  "@commitlint/format": "20.2.0",
1799
1799
  "@commitlint/types": "20.2.0",
1800
1800
  "@cspell/eslint-plugin": "9.4.0",
1801
- "@datamitsu/datamitsu": "0.0.1-alpha-60",
1801
+ "@datamitsu/datamitsu": "0.0.1-alpha-61",
1802
1802
  "@eslint/config-helpers": "0.5.0",
1803
1803
  "@eslint/js": "9.39.2",
1804
1804
  "@next/eslint-plugin-next": "16.1.1",
@@ -3049,19 +3049,19 @@ var toolsConfig = {
3049
3049
  operations: {
3050
3050
  fix: {
3051
3051
  args: ["--quiet", "--fix", "-c", "{cwd}/eslint.config.js", "{files}"],
3052
+ batch: true,
3052
3053
  command: "eslint",
3053
3054
  globs: eslintGlobs,
3054
- mode: "batch",
3055
3055
  priority: toolPriority.eslint,
3056
- workingDir: "project-root"
3056
+ scope: "per-project"
3057
3057
  },
3058
3058
  lint: {
3059
3059
  args: ["--quiet", "{files}"],
3060
+ batch: true,
3060
3061
  command: "eslint",
3061
3062
  globs: eslintGlobs,
3062
- mode: "batch",
3063
3063
  priority: toolPriority.eslint,
3064
- workingDir: "project-root"
3064
+ scope: "per-project"
3065
3065
  }
3066
3066
  },
3067
3067
  projectTypes: ["npm-package"]
@@ -3085,19 +3085,15 @@ var toolsConfig = {
3085
3085
  args: ["run", "--fix"],
3086
3086
  command: "golangci-lint",
3087
3087
  globs: ["**/*.go"],
3088
- mode: "whole-project",
3089
3088
  priority: toolPriority["golangci-lint"],
3090
- rootOnly: true,
3091
- workingDir: "project-root"
3089
+ scope: "per-project"
3092
3090
  },
3093
3091
  lint: {
3094
3092
  args: ["run"],
3095
3093
  command: "golangci-lint",
3096
3094
  globs: ["**/*.go"],
3097
- mode: "whole-project",
3098
3095
  priority: toolPriority["golangci-lint"],
3099
- rootOnly: true,
3100
- workingDir: "project-root"
3096
+ scope: "per-project"
3101
3097
  }
3102
3098
  },
3103
3099
  projectTypes: ["golang-package"]
@@ -3118,19 +3114,19 @@ var toolsConfig = {
3118
3114
  operations: {
3119
3115
  fix: {
3120
3116
  args: ["--fix", "{files}"],
3117
+ batch: true,
3121
3118
  command: "oxlint",
3122
3119
  globs: oxlintGlobs,
3123
- mode: "batch",
3124
3120
  priority: toolPriority.oxlint,
3125
- workingDir: "project-root"
3121
+ scope: "per-project"
3126
3122
  },
3127
3123
  lint: {
3128
3124
  args: ["{files}"],
3125
+ batch: true,
3129
3126
  command: "oxlint",
3130
3127
  globs: oxlintGlobs,
3131
- mode: "batch",
3132
3128
  priority: toolPriority.oxlint,
3133
- workingDir: "project-root"
3129
+ scope: "per-project"
3134
3130
  }
3135
3131
  },
3136
3132
  projectTypes: ["npm-package", "typescript-project"]
@@ -3158,10 +3154,11 @@ var toolsConfig = {
3158
3154
  tools.Path.join(facts().gitRoot, "prettier.config.js"),
3159
3155
  "{files}"
3160
3156
  ],
3157
+ batch: true,
3161
3158
  command: "prettier",
3162
3159
  globs: prettierGlobs,
3163
- mode: "batch",
3164
- priority: toolPriority.prettier
3160
+ priority: toolPriority.prettier,
3161
+ scope: "per-project"
3165
3162
  },
3166
3163
  lint: {
3167
3164
  args: [
@@ -3171,10 +3168,11 @@ var toolsConfig = {
3171
3168
  tools.Path.join(facts().gitRoot, "prettier.config.js"),
3172
3169
  "{files}"
3173
3170
  ],
3171
+ batch: true,
3174
3172
  command: "prettier",
3175
3173
  globs: prettierGlobs,
3176
- mode: "batch",
3177
- priority: toolPriority.prettier
3174
+ priority: toolPriority.prettier,
3175
+ scope: "per-project"
3178
3176
  }
3179
3177
  },
3180
3178
  projectTypes: ["npm-package", "typescript-project"]
@@ -3213,19 +3211,19 @@ var toolsConfig = {
3213
3211
  operations: {
3214
3212
  fix: {
3215
3213
  args: ["--quiet"],
3214
+ batch: false,
3216
3215
  command: "sort-package-json",
3217
3216
  globs: ["**/package.json"],
3218
- mode: "per-file",
3219
3217
  priority: toolPriority["sort-package-json"],
3220
- workingDir: "project-root"
3218
+ scope: "per-file"
3221
3219
  },
3222
3220
  lint: {
3223
3221
  args: ["--check", "--quiet"],
3222
+ batch: false,
3224
3223
  command: "sort-package-json",
3225
3224
  globs: ["**/package.json"],
3226
- mode: "per-file",
3227
3225
  priority: toolPriority["sort-package-json"],
3228
- workingDir: "project-root"
3226
+ scope: "per-file"
3229
3227
  }
3230
3228
  },
3231
3229
  projectTypes: ["npm-package", "typescript-project"]
@@ -3237,17 +3235,15 @@ var toolsConfig = {
3237
3235
  args: ["fix", "--config", tools.Path.join(facts().gitRoot, ".syncpackrc.json")],
3238
3236
  command: "syncpack",
3239
3237
  globs: ["**/package.json"],
3240
- mode: "whole-project",
3241
3238
  priority: toolPriority.syncpack,
3242
- rootOnly: true
3239
+ scope: "repository"
3243
3240
  },
3244
3241
  lint: {
3245
3242
  args: ["lint", "--config", tools.Path.join(facts().gitRoot, ".syncpackrc.json")],
3246
3243
  command: "syncpack",
3247
3244
  globs: ["**/package.json"],
3248
- mode: "whole-project",
3249
3245
  priority: toolPriority.syncpack,
3250
- rootOnly: true
3246
+ scope: "repository"
3251
3247
  }
3252
3248
  },
3253
3249
  projectTypes: ["npm-package", "typescript-project"]
@@ -3264,9 +3260,8 @@ var toolsConfig = {
3264
3260
  ],
3265
3261
  command: "tsc",
3266
3262
  globs: ["**/*.d.ts", "**/*.ts", "**/*.mts", "**/*.cts", "**/*.tsx"],
3267
- mode: "whole-project",
3268
3263
  priority: toolPriority.tsc,
3269
- workingDir: "project-root"
3264
+ scope: "per-project"
3270
3265
  }
3271
3266
  },
3272
3267
  projectTypes: ["typescript-project"]
@@ -3286,8 +3281,8 @@ var toolsConfig = {
3286
3281
  ],
3287
3282
  command: "typstyle",
3288
3283
  globs: ["**/*.typ"],
3289
- mode: "per-file",
3290
- priority: toolPriority.typstyle
3284
+ priority: toolPriority.typstyle,
3285
+ scope: "per-file"
3291
3286
  },
3292
3287
  lint: {
3293
3288
  args: [
@@ -3301,8 +3296,8 @@ var toolsConfig = {
3301
3296
  ],
3302
3297
  command: "typstyle",
3303
3298
  globs: ["**/*.typ"],
3304
- mode: "per-file",
3305
- priority: toolPriority.typstyle
3299
+ priority: toolPriority.typstyle,
3300
+ scope: "per-file"
3306
3301
  }
3307
3302
  }
3308
3303
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,40 +1,39 @@
1
- // src/clean-package/index.ts
2
- import { readFileSync, writeFileSync } from "fs";
3
- import { resolve } from "path";
4
- var DEFAULT_FIELDS_TO_REMOVE = [
5
- "scripts",
6
- "devDependencies",
7
- "packageManager"
1
+ import { readFileSync, writeFileSync } from "node:fs";
2
+ import { resolve } from "node:path";
3
+ const DEFAULT_FIELDS_TO_REMOVE = [
4
+ "scripts",
5
+ "devDependencies",
6
+ "packageManager",
8
7
  ];
9
- var cleanPackage = (options = {}) => {
10
- const {
11
- dryRun = false,
12
- fieldsToRemove = DEFAULT_FIELDS_TO_REMOVE,
13
- packagePath = "package.json"
14
- } = options;
15
- const absolutePath = resolve(process.cwd(), packagePath);
16
- try {
17
- const packageJson = JSON.parse(readFileSync(absolutePath, "utf8"));
18
- const cleaned = { ...packageJson };
19
- for (const field of fieldsToRemove) {
20
- delete cleaned[field];
8
+ /**
9
+ * Clean package.json by removing specified fields
10
+ * Useful for prepack/prepublishOnly hooks
11
+ */
12
+ export const cleanPackage = (options = {}) => {
13
+ const { dryRun = false, fieldsToRemove = DEFAULT_FIELDS_TO_REMOVE, packagePath = "package.json", } = options;
14
+ const absolutePath = resolve(process.cwd(), packagePath);
15
+ try {
16
+ const packageJson = JSON.parse(readFileSync(absolutePath, "utf8"));
17
+ const cleaned = { ...packageJson };
18
+ for (const field of fieldsToRemove) {
19
+ delete cleaned[field];
20
+ }
21
+ if (dryRun) {
22
+ console.log("Dry run - would remove fields:", fieldsToRemove);
23
+ console.log("Cleaned package.json:", JSON.stringify(cleaned, null, 2));
24
+ return;
25
+ }
26
+ writeFileSync(absolutePath, JSON.stringify(cleaned, null, 2) + "\n", "utf8");
27
+ console.log(`✓ Cleaned ${packagePath}, removed fields:`, fieldsToRemove);
21
28
  }
22
- if (dryRun) {
23
- console.log("Dry run - would remove fields:", fieldsToRemove);
24
- console.log("Cleaned package.json:", JSON.stringify(cleaned, null, 2));
25
- return;
29
+ catch (error) {
30
+ console.error(`Error cleaning package.json:`, error);
31
+ throw error;
26
32
  }
27
- writeFileSync(absolutePath, JSON.stringify(cleaned, null, 2) + "\n", "utf8");
28
- console.log(`\u2713 Cleaned ${packagePath}, removed fields:`, fieldsToRemove);
29
- } catch (error) {
30
- console.error(`Error cleaning package.json:`, error);
31
- throw error;
32
- }
33
33
  };
34
- var main = () => {
35
- cleanPackage();
36
- };
37
- export {
38
- cleanPackage,
39
- main
34
+ /**
35
+ * CLI entry point
36
+ */
37
+ export const main = () => {
38
+ cleanPackage();
40
39
  };
@@ -1,11 +1,7 @@
1
- // src/commitlint/index.ts
2
1
  import configConventional from "@commitlint/config-conventional";
3
- import "@commitlint/types";
4
- var config = {
5
- ...configConventional,
6
- formatter: import.meta.resolve("@commitlint/format"),
7
- parserPreset: import.meta.resolve("conventional-changelog-conventionalcommits")
8
- };
9
- export {
10
- config
2
+ import {} from "@commitlint/types";
3
+ export const config = {
4
+ ...configConventional,
5
+ formatter: import.meta.resolve("@commitlint/format"),
6
+ parserPreset: import.meta.resolve("conventional-changelog-conventionalcommits"),
11
7
  };
@@ -0,0 +1,81 @@
1
+ import { binaries as githubBinariesJSON } from "./githubApps.json";
2
+ const requiredGithubApps = new Set(["lefthook"]);
3
+ const githubApps = Object.entries(githubBinariesJSON).reduce((acc, [key, el]) => {
4
+ acc[key] = {
5
+ binary: {
6
+ binaries: el.binaries,
7
+ },
8
+ required: requiredGithubApps.has(key),
9
+ };
10
+ return acc;
11
+ }, {});
12
+ export const mapOfApps = {
13
+ ...githubApps,
14
+ commitlint: {
15
+ shell: {
16
+ args: [facts().env.DATAMITSU_APP_COMMITLINT_BINARY_FILEPATH || ""],
17
+ name: "node",
18
+ },
19
+ },
20
+ eslint: {
21
+ shell: {
22
+ args: [],
23
+ name: facts().env.DATAMITSU_APP_ESLINT_BINARY_FILEPATH || "",
24
+ },
25
+ },
26
+ "go-test": {
27
+ shell: { args: ["test", "./..."], name: "go" },
28
+ },
29
+ knip: {
30
+ shell: {
31
+ args: [],
32
+ name: facts().env.DATAMITSU_APP_KNIP_BINARY_FILEPATH || "",
33
+ },
34
+ },
35
+ mmdc: {
36
+ // https://www.npmjs.com/package/@mermaid-js/mermaid-cli
37
+ pnpm: { packageName: "@mermaid-js/mermaid-cli", version: "11.12.0" },
38
+ },
39
+ oxlint: {
40
+ shell: {
41
+ args: ["-c", tools.Path.join(facts().cwd, ".oxlintrc.json")],
42
+ name: facts().env.DATAMITSU_APP_OXLINT_BINARY_FILEPATH || "",
43
+ },
44
+ },
45
+ prettier: {
46
+ shell: {
47
+ args: [],
48
+ name: facts().env.DATAMITSU_APP_PRETTIER_BINARY_FILEPATH || "",
49
+ },
50
+ },
51
+ slidev: {
52
+ // https://www.npmjs.com/package/@slidev/cli
53
+ pnpm: { packageName: "@slidev/cli", version: "52.10.1" },
54
+ },
55
+ "sort-package-json": {
56
+ shell: {
57
+ args: [],
58
+ name: facts().env.DATAMITSU_APP_SORT_PACKAGE_JSON_BINARY_FILEPATH || "",
59
+ },
60
+ },
61
+ spectral: {
62
+ // https://www.npmjs.com/package/@stoplight/spectral-cli
63
+ pnpm: { packageName: "@stoplight/spectral-cli", version: "6.15.0" },
64
+ },
65
+ syncpack: {
66
+ shell: {
67
+ args: [],
68
+ name: facts().env.DATAMITSU_APP_SYNCPACK_BINARY_FILEPATH || "",
69
+ },
70
+ },
71
+ tsc: {
72
+ shell: {
73
+ args: [],
74
+ name: facts().env.DATAMITSU_APP_TSC_BINARY_FILEPATH || "",
75
+ },
76
+ },
77
+ yamllint: {
78
+ // https://pypi.org/project/yamllint/
79
+ uvx: { packageName: "yamllint", version: "1.37.1" },
80
+ },
81
+ };