@shibanet0/datamitsu-config 0.0.1-alpha-24 → 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 (69) hide show
  1. package/bin/tsc.mjs +3 -7
  2. package/dist/binary/index.js +1 -0
  3. package/dist/clean-package/index.js +34 -35
  4. package/dist/commitlint/index.js +5 -9
  5. package/dist/datamitsu-config/apps.js +81 -0
  6. package/dist/datamitsu-config/cmdInit.js +850 -0
  7. package/dist/datamitsu-config/constants.js +6 -0
  8. package/dist/datamitsu-config/env.js +6 -0
  9. package/dist/datamitsu-config/githubApps.json +1936 -0
  10. package/dist/datamitsu-config/ignore.js +121 -0
  11. package/dist/datamitsu-config/main.js +32 -0
  12. package/dist/datamitsu-config/project.js +31 -0
  13. package/dist/datamitsu-config/tools.js +332 -0
  14. package/dist/datamitsu-config/utils/cleanDependencies.js +25 -0
  15. package/dist/eslint/globs.js +71 -0
  16. package/dist/eslint/index.js +189 -211
  17. package/dist/eslint/plugins/arrayFunc.js +20 -0
  18. package/dist/eslint/plugins/arrow-return-style.js +4 -0
  19. package/dist/eslint/plugins/boundaries.js +15 -0
  20. package/dist/eslint/plugins/clsx.js +4 -0
  21. package/dist/eslint/plugins/command.js +4 -0
  22. package/dist/eslint/plugins/compat.js +4 -0
  23. package/dist/eslint/plugins/cspell.js +4 -0
  24. package/dist/eslint/plugins/deMorgan.js +14 -0
  25. package/dist/eslint/plugins/depend.js +4 -0
  26. package/dist/eslint/plugins/escompat.js +4 -0
  27. package/dist/eslint/plugins/fsecond.js +12 -0
  28. package/dist/eslint/plugins/html.js +12 -0
  29. package/dist/eslint/plugins/i18next.js +4 -0
  30. package/dist/eslint/plugins/import.js +27 -0
  31. package/dist/eslint/plugins/javascript.js +32 -0
  32. package/dist/eslint/plugins/jsdoc.js +4 -0
  33. package/dist/eslint/plugins/json-schema-validator.js +15 -0
  34. package/dist/eslint/plugins/json.js +24 -0
  35. package/dist/eslint/plugins/jsonc.js +7 -0
  36. package/dist/eslint/plugins/jsx-a11y.js +22 -0
  37. package/dist/eslint/plugins/n.js +15 -0
  38. package/dist/eslint/plugins/no-unsanitized.js +4 -0
  39. package/dist/eslint/plugins/no-use-extend-native.js +15 -0
  40. package/dist/eslint/plugins/oxlint.js +10 -0
  41. package/dist/eslint/plugins/perfectionist.js +95 -0
  42. package/dist/eslint/plugins/playwright.js +15 -0
  43. package/dist/eslint/plugins/pnpm.js +11 -0
  44. package/dist/eslint/plugins/prettier.js +14 -0
  45. package/dist/eslint/plugins/promise.js +21 -0
  46. package/dist/eslint/plugins/react-hooks.js +14 -0
  47. package/dist/eslint/plugins/react-perf.js +14 -0
  48. package/dist/eslint/plugins/react-prefer-function-component.js +15 -0
  49. package/dist/eslint/plugins/react-refresh.js +14 -0
  50. package/dist/eslint/plugins/react-you-might-not-need-an-effect.js +4 -0
  51. package/dist/eslint/plugins/react.js +49 -0
  52. package/dist/eslint/plugins/regexp.js +4 -0
  53. package/dist/eslint/plugins/security.js +20 -0
  54. package/dist/eslint/plugins/sonarjs.js +38 -0
  55. package/dist/eslint/plugins/storybook.js +15 -0
  56. package/dist/eslint/plugins/stylistic.js +14 -0
  57. package/dist/eslint/plugins/toml.js +15 -0
  58. package/dist/eslint/plugins/turbo.js +15 -0
  59. package/dist/eslint/plugins/typescript.js +34 -0
  60. package/dist/eslint/plugins/unicorn.js +69 -0
  61. package/dist/eslint/plugins/unused-imports.js +24 -0
  62. package/dist/eslint/plugins/vanilla-extract.js +17 -0
  63. package/dist/eslint/plugins/vitest.js +15 -0
  64. package/dist/eslint/plugins/yml.js +21 -0
  65. package/dist/eslint/types.js +0 -0
  66. package/dist/globs/globs.js +1 -0
  67. package/dist/knip/index.js +3 -7
  68. package/dist/oxlint/index.js +36 -0
  69. package/package.json +1 -1
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) {
@@ -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
+ };