@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.
- package/bin/tsc.mjs +3 -7
- package/dist/binary/index.js +1 -0
- package/dist/clean-package/index.js +34 -35
- package/dist/commitlint/index.js +5 -9
- package/dist/datamitsu-config/apps.js +81 -0
- package/dist/datamitsu-config/cmdInit.js +850 -0
- package/dist/datamitsu-config/constants.js +6 -0
- package/dist/datamitsu-config/env.js +6 -0
- package/dist/datamitsu-config/githubApps.json +1936 -0
- package/dist/datamitsu-config/ignore.js +121 -0
- package/dist/datamitsu-config/main.js +32 -0
- package/dist/datamitsu-config/project.js +31 -0
- package/dist/datamitsu-config/tools.js +332 -0
- package/dist/datamitsu-config/utils/cleanDependencies.js +25 -0
- package/dist/eslint/globs.js +71 -0
- package/dist/eslint/index.js +189 -211
- package/dist/eslint/plugins/arrayFunc.js +20 -0
- package/dist/eslint/plugins/arrow-return-style.js +4 -0
- package/dist/eslint/plugins/boundaries.js +15 -0
- package/dist/eslint/plugins/clsx.js +4 -0
- package/dist/eslint/plugins/command.js +4 -0
- package/dist/eslint/plugins/compat.js +4 -0
- package/dist/eslint/plugins/cspell.js +4 -0
- package/dist/eslint/plugins/deMorgan.js +14 -0
- package/dist/eslint/plugins/depend.js +4 -0
- package/dist/eslint/plugins/escompat.js +4 -0
- package/dist/eslint/plugins/fsecond.js +12 -0
- package/dist/eslint/plugins/html.js +12 -0
- package/dist/eslint/plugins/i18next.js +4 -0
- package/dist/eslint/plugins/import.js +27 -0
- package/dist/eslint/plugins/javascript.js +32 -0
- package/dist/eslint/plugins/jsdoc.js +4 -0
- package/dist/eslint/plugins/json-schema-validator.js +15 -0
- package/dist/eslint/plugins/json.js +24 -0
- package/dist/eslint/plugins/jsonc.js +7 -0
- package/dist/eslint/plugins/jsx-a11y.js +22 -0
- package/dist/eslint/plugins/n.js +15 -0
- package/dist/eslint/plugins/no-unsanitized.js +4 -0
- package/dist/eslint/plugins/no-use-extend-native.js +15 -0
- package/dist/eslint/plugins/oxlint.js +10 -0
- package/dist/eslint/plugins/perfectionist.js +95 -0
- package/dist/eslint/plugins/playwright.js +15 -0
- package/dist/eslint/plugins/pnpm.js +11 -0
- package/dist/eslint/plugins/prettier.js +14 -0
- package/dist/eslint/plugins/promise.js +21 -0
- package/dist/eslint/plugins/react-hooks.js +14 -0
- package/dist/eslint/plugins/react-perf.js +14 -0
- package/dist/eslint/plugins/react-prefer-function-component.js +15 -0
- package/dist/eslint/plugins/react-refresh.js +14 -0
- package/dist/eslint/plugins/react-you-might-not-need-an-effect.js +4 -0
- package/dist/eslint/plugins/react.js +49 -0
- package/dist/eslint/plugins/regexp.js +4 -0
- package/dist/eslint/plugins/security.js +20 -0
- package/dist/eslint/plugins/sonarjs.js +38 -0
- package/dist/eslint/plugins/storybook.js +15 -0
- package/dist/eslint/plugins/stylistic.js +14 -0
- package/dist/eslint/plugins/toml.js +15 -0
- package/dist/eslint/plugins/turbo.js +15 -0
- package/dist/eslint/plugins/typescript.js +34 -0
- package/dist/eslint/plugins/unicorn.js +69 -0
- package/dist/eslint/plugins/unused-imports.js +24 -0
- package/dist/eslint/plugins/vanilla-extract.js +17 -0
- package/dist/eslint/plugins/vitest.js +15 -0
- package/dist/eslint/plugins/yml.js +21 -0
- package/dist/eslint/types.js +0 -0
- package/dist/globs/globs.js +1 -0
- package/dist/knip/index.js +3 -7
- package/dist/oxlint/index.js +36 -0
- 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
|
-
|
|
11
|
-
|
|
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/dist/binary/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,40 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export {
|
|
38
|
-
|
|
39
|
-
main
|
|
34
|
+
/**
|
|
35
|
+
* CLI entry point
|
|
36
|
+
*/
|
|
37
|
+
export const main = () => {
|
|
38
|
+
cleanPackage();
|
|
40
39
|
};
|
package/dist/commitlint/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
// src/commitlint/index.ts
|
|
2
1
|
import configConventional from "@commitlint/config-conventional";
|
|
3
|
-
import "@commitlint/types";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
};
|