@adamhl8/configs 0.25.0 → 0.27.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/dist/configs/cliff.base.toml +10 -5
- package/dist/configs/commitlint.base.js +5 -1
- package/dist/configs/commitlint.base.js.map +1 -1
- package/dist/configs/knip.base.d.ts +2 -4
- package/dist/configs/knip.base.d.ts.map +1 -1
- package/dist/configs/knip.base.js +5 -18
- package/dist/configs/knip.base.js.map +1 -1
- package/dist/configs/oxlint.base.d.ts +6 -6
- package/dist/configs/oxlint.base.d.ts.map +1 -1
- package/dist/configs/oxlint.base.js +19 -19
- package/dist/configs/oxlint.base.js.map +1 -1
- package/dist/configs/release-it.base.d.ts +4 -4
- package/dist/configs/release-it.base.js +4 -4
- package/dist/configs/release-it.base.js.map +1 -1
- package/dist/configs/tsdown.base.d.ts +21 -21
- package/dist/configs/tsdown.base.js +17 -17
- package/dist/configs/tsdown.base.js.map +1 -1
- package/dist/utils.d.ts +11 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +7 -4
- package/dist/utils.js.map +1 -1
- package/package.json +3 -4
- package/dist/adamhl8-knip/index +0 -14
- package/dist/adamhl8-knip/knip-preprocessor.js +0 -24
|
@@ -36,12 +36,13 @@ body = """
|
|
|
36
36
|
[git]
|
|
37
37
|
commit_parsers = [
|
|
38
38
|
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
|
|
39
|
-
{ message = "^
|
|
39
|
+
{ message = "^improve", group = "<!-- 1 -->✨ Improvements" },
|
|
40
40
|
{ message = "^perf", group = "<!-- 2 -->⚡ Performance" },
|
|
41
|
-
{ message = "^
|
|
42
|
-
{ message = "^
|
|
43
|
-
{ message = "^
|
|
44
|
-
{ message = "^
|
|
41
|
+
{ message = "^fix", group = "<!-- 3 -->🐛 Bug Fixes" },
|
|
42
|
+
{ message = "^refactor", group = "<!-- 4 -->🚜 Refactor" },
|
|
43
|
+
{ message = "^chore|^ci", group = "<!-- 5 -->⚙️ Miscellaneous Tasks" },
|
|
44
|
+
{ message = "^docs", group = "<!-- 6 -->📚 Documentation" },
|
|
45
|
+
{ message = "^revert", group = "<!-- 7 -->◀️ Revert" },
|
|
45
46
|
{ message = "^release", skip = true },
|
|
46
47
|
]
|
|
47
48
|
|
|
@@ -49,3 +50,7 @@ commit_preprocessors = [{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }]
|
|
|
49
50
|
|
|
50
51
|
filter_commits = true
|
|
51
52
|
sort_commits = "newest"
|
|
53
|
+
|
|
54
|
+
[bump]
|
|
55
|
+
no_increment_regex = "^chore|^ci|^docs"
|
|
56
|
+
custom_minor_increment_regex = "^improve"
|
|
@@ -8,7 +8,11 @@ const EXCLUDED_TYPES = /* @__PURE__ */ new Set([
|
|
|
8
8
|
"style",
|
|
9
9
|
"build"
|
|
10
10
|
]);
|
|
11
|
-
const commitTypes = [
|
|
11
|
+
const commitTypes = [
|
|
12
|
+
...conventionalTypes.filter((type) => !EXCLUDED_TYPES.has(type)),
|
|
13
|
+
"improve",
|
|
14
|
+
"release"
|
|
15
|
+
];
|
|
12
16
|
const commitlintConfig = createMergeConfigFn({
|
|
13
17
|
extends: ["@commitlint/config-conventional"],
|
|
14
18
|
rules: { "type-enum": [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commitlint.base.js","names":[],"sources":["../../src/configs/commitlint.base.ts"],"sourcesContent":["import conventional from \"@commitlint/config-conventional\"\nimport { RuleConfigSeverity } from \"@commitlint/types\"\nimport type { UserConfig } from \"@commitlint/types\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\nconst [_severity, _condition, conventionalTypes] = conventional.rules[\"type-enum\"]\n\nconst EXCLUDED_TYPES = new Set([\"test\", \"style\", \"build\"])\nconst filteredTypes = conventionalTypes.filter((type) => !EXCLUDED_TYPES.has(type))\nconst commitTypes = [...filteredTypes, \"release\"]\n\nconst baseConfig = {\n extends: [\"@commitlint/config-conventional\"],\n rules: {\n \"type-enum\": [RuleConfigSeverity.Error, \"always\", commitTypes],\n },\n} as const satisfies UserConfig\n\nexport const commitlintConfig = createMergeConfigFn<UserConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;;;AAMA,MAAM,CAAC,WAAW,YAAY,qBAAqB,aAAa,MAAM;AAEtE,MAAM,iCAAiB,IAAI,IAAI;CAAC;CAAQ;CAAS;AAAO,CAAC;AAEzD,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"commitlint.base.js","names":[],"sources":["../../src/configs/commitlint.base.ts"],"sourcesContent":["import conventional from \"@commitlint/config-conventional\"\nimport { RuleConfigSeverity } from \"@commitlint/types\"\nimport type { UserConfig } from \"@commitlint/types\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\nconst [_severity, _condition, conventionalTypes] = conventional.rules[\"type-enum\"]\n\nconst EXCLUDED_TYPES = new Set([\"test\", \"style\", \"build\"])\nconst filteredTypes = conventionalTypes.filter((type) => !EXCLUDED_TYPES.has(type))\nconst commitTypes = [...filteredTypes, \"improve\", \"release\"]\n\nconst baseConfig = {\n extends: [\"@commitlint/config-conventional\"],\n rules: {\n \"type-enum\": [RuleConfigSeverity.Error, \"always\", commitTypes],\n },\n} as const satisfies UserConfig\n\nexport const commitlintConfig = createMergeConfigFn<UserConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;;;AAMA,MAAM,CAAC,WAAW,YAAY,qBAAqB,aAAa,MAAM;AAEtE,MAAM,iCAAiB,IAAI,IAAI;CAAC;CAAQ;CAAS;AAAO,CAAC;AAEzD,MAAM,cAAc;CAAC,GADC,kBAAkB,QAAQ,SAAS,CAAC,eAAe,IAAI,IAAI,CAC7C;CAAG;CAAW;AAAS;AAS3D,MAAa,mBAAmB,oBAAmD;CANjF,SAAS,CAAC,iCAAiC;CAC3C,OAAO,EACL,aAAa;EAAC,mBAAmB;EAAO;EAAU;CAAW,EAC/D;AAGiF,CAAU"}
|
|
@@ -3,11 +3,9 @@ import { KnipConfig } from "knip";
|
|
|
3
3
|
|
|
4
4
|
//#region src/configs/knip.base.d.ts
|
|
5
5
|
declare const knipConfig: OptionalMergeConfigFn<KnipConfig, {
|
|
6
|
-
readonly project: ["
|
|
7
|
-
readonly entry: ["./src/index.ts", "**/*.test.ts", "./tsdown.config.ts"];
|
|
6
|
+
readonly project: ["**/*"];
|
|
8
7
|
readonly ignoreBinaries: ["lefthook", "gh"];
|
|
9
|
-
readonly ignoreDependencies:
|
|
10
|
-
readonly tsdown: false;
|
|
8
|
+
readonly ignoreDependencies: ["@adamhl8/eslint-plugin-clean-modules"];
|
|
11
9
|
}>;
|
|
12
10
|
//#endregion
|
|
13
11
|
export { knipConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.base.d.ts","names":[],"sources":["../../src/configs/knip.base.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"knip.base.d.ts","names":[],"sources":["../../src/configs/knip.base.ts"],"mappings":";;;;cAmBa,UAAA,EAAU,qBAAA,CAAA,UAAA;EAAA"}
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
import { createMergeConfigFn } from "../utils.js";
|
|
2
2
|
//#region src/configs/knip.base.ts
|
|
3
|
-
const
|
|
4
|
-
"./src/index.ts",
|
|
5
|
-
"**/*.test.ts",
|
|
6
|
-
"./tsdown.config.ts"
|
|
7
|
-
];
|
|
8
|
-
/**
|
|
9
|
-
* Consuming projects show these transitive dependencies as unlisted. e.g. knip resolves
|
|
10
|
-
* `@adamhl8/eslint-plugin-clean-modules` via the oxlint config, but we don't need to install it directly in the
|
|
11
|
-
* consuming project.
|
|
12
|
-
*/
|
|
13
|
-
const UNLISTED_DEPENDENCIES = ["@adamhl8/eslint-plugin-clean-modules"];
|
|
14
|
-
const IGNORE_DEPENDENCIES = [...["@commitlint/cli"], ...UNLISTED_DEPENDENCIES];
|
|
3
|
+
const IGNORE_BINARIES = ["lefthook", "gh"];
|
|
15
4
|
const knipConfig = createMergeConfigFn({
|
|
16
|
-
project: ["
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ignoreDependencies: IGNORE_DEPENDENCIES,
|
|
20
|
-
tsdown: false
|
|
5
|
+
project: ["**/*"],
|
|
6
|
+
ignoreBinaries: IGNORE_BINARIES,
|
|
7
|
+
ignoreDependencies: ["@adamhl8/eslint-plugin-clean-modules"]
|
|
21
8
|
});
|
|
22
9
|
//#endregion
|
|
23
|
-
export {
|
|
10
|
+
export { IGNORE_BINARIES, knipConfig };
|
|
24
11
|
|
|
25
12
|
//# sourceMappingURL=knip.base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knip.base.js","names":[],"sources":["../../src/configs/knip.base.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\
|
|
1
|
+
{"version":3,"file":"knip.base.js","names":[],"sources":["../../src/configs/knip.base.ts"],"sourcesContent":["import type { KnipConfig } from \"knip\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\nexport const IGNORE_BINARIES = [\"lefthook\", \"gh\"] as const satisfies string[]\n\n/**\n * Consuming projects show these transitive dependencies as unlisted. e.g. knip resolves\n * `@adamhl8/eslint-plugin-clean-modules` via the oxlint config, but we don't need to install it directly in the\n * consuming project.\n */\nconst UNLISTED_DEPENDENCIES = [\"@adamhl8/eslint-plugin-clean-modules\"] as const satisfies string[]\n\nconst baseConfig = {\n project: [\"**/*\"],\n ignoreBinaries: IGNORE_BINARIES,\n ignoreDependencies: UNLISTED_DEPENDENCIES,\n} as const satisfies KnipConfig\n\nexport const knipConfig = createMergeConfigFn<KnipConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;AAIA,MAAa,kBAAkB,CAAC,YAAY,IAAI;AAehD,MAAa,aAAa,oBAAmD;CAL3E,SAAS,CAAC,MAAM;CAChB,gBAAgB;CAChB,oBAAoB,CALS,sCAKW;AAGmC,CAAU"}
|
|
@@ -3,6 +3,11 @@ import { OxlintConfig } from "oxlint";
|
|
|
3
3
|
|
|
4
4
|
//#region src/configs/oxlint.base.d.ts
|
|
5
5
|
declare const oxlintConfig: OptionalMergeConfigFn<OxlintConfig, {
|
|
6
|
+
readonly options: {
|
|
7
|
+
readonly reportUnusedDisableDirectives: "error";
|
|
8
|
+
readonly typeAware: true;
|
|
9
|
+
readonly typeCheck: true;
|
|
10
|
+
};
|
|
6
11
|
readonly categories: {
|
|
7
12
|
readonly correctness: "error";
|
|
8
13
|
readonly nursery: "error";
|
|
@@ -12,19 +17,14 @@ declare const oxlintConfig: OptionalMergeConfigFn<OxlintConfig, {
|
|
|
12
17
|
readonly style: "error";
|
|
13
18
|
readonly suspicious: "error";
|
|
14
19
|
};
|
|
20
|
+
readonly plugins: ["eslint", "react", "unicorn", "typescript", "oxc", "import", "jsdoc", "vitest", "jsx-a11y", "react-perf", "promise", "node"];
|
|
15
21
|
readonly jsPlugins: [string];
|
|
16
|
-
readonly options: {
|
|
17
|
-
readonly reportUnusedDisableDirectives: "error";
|
|
18
|
-
readonly typeAware: true;
|
|
19
|
-
readonly typeCheck: true;
|
|
20
|
-
};
|
|
21
22
|
readonly overrides: [{
|
|
22
23
|
readonly files: [".release-it.ts", "commitlint.config.ts", "knip.ts", "oxfmt.config.ts", "oxlint.config.ts", "prisma.config.ts", "tsdown.config.ts", "vitest.config.ts"];
|
|
23
24
|
readonly rules: {
|
|
24
25
|
readonly "import/no-default-export": "off";
|
|
25
26
|
};
|
|
26
27
|
}];
|
|
27
|
-
readonly plugins: ["eslint", "react", "unicorn", "typescript", "oxc", "import", "jsdoc", "vitest", "jsx-a11y", "react-perf", "promise", "node"];
|
|
28
28
|
readonly rules: {
|
|
29
29
|
readonly "clean-modules/require-direct-exports": "error";
|
|
30
30
|
readonly "clean-modules/require-import-extensions": "error";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.base.d.ts","names":[],"sources":["../../src/configs/oxlint.base.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"oxlint.base.d.ts","names":[],"sources":["../../src/configs/oxlint.base.ts"],"mappings":";;;;cA6Ha,YAAA,EAAY,qBAAA,CAAA,YAAA;EAAA"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { createMergeConfigFn } from "../utils.js";
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
const oxlintConfig = createMergeConfigFn({
|
|
4
|
+
options: {
|
|
5
|
+
reportUnusedDisableDirectives: "error",
|
|
6
|
+
typeAware: true,
|
|
7
|
+
typeCheck: true
|
|
8
|
+
},
|
|
4
9
|
categories: {
|
|
5
10
|
correctness: "error",
|
|
6
11
|
nursery: "error",
|
|
@@ -10,25 +15,6 @@ const oxlintConfig = createMergeConfigFn({
|
|
|
10
15
|
style: "error",
|
|
11
16
|
suspicious: "error"
|
|
12
17
|
},
|
|
13
|
-
jsPlugins: [fileURLToPath(import.meta.resolve("@adamhl8/eslint-plugin-clean-modules"))],
|
|
14
|
-
options: {
|
|
15
|
-
reportUnusedDisableDirectives: "error",
|
|
16
|
-
typeAware: true,
|
|
17
|
-
typeCheck: true
|
|
18
|
-
},
|
|
19
|
-
overrides: [{
|
|
20
|
-
files: [
|
|
21
|
-
".release-it.ts",
|
|
22
|
-
"commitlint.config.ts",
|
|
23
|
-
"knip.ts",
|
|
24
|
-
"oxfmt.config.ts",
|
|
25
|
-
"oxlint.config.ts",
|
|
26
|
-
"prisma.config.ts",
|
|
27
|
-
"tsdown.config.ts",
|
|
28
|
-
"vitest.config.ts"
|
|
29
|
-
],
|
|
30
|
-
rules: { "import/no-default-export": "off" }
|
|
31
|
-
}],
|
|
32
18
|
plugins: [
|
|
33
19
|
"eslint",
|
|
34
20
|
"react",
|
|
@@ -43,6 +29,20 @@ const oxlintConfig = createMergeConfigFn({
|
|
|
43
29
|
"promise",
|
|
44
30
|
"node"
|
|
45
31
|
],
|
|
32
|
+
jsPlugins: [fileURLToPath(import.meta.resolve("@adamhl8/eslint-plugin-clean-modules"))],
|
|
33
|
+
overrides: [{
|
|
34
|
+
files: [
|
|
35
|
+
".release-it.ts",
|
|
36
|
+
"commitlint.config.ts",
|
|
37
|
+
"knip.ts",
|
|
38
|
+
"oxfmt.config.ts",
|
|
39
|
+
"oxlint.config.ts",
|
|
40
|
+
"prisma.config.ts",
|
|
41
|
+
"tsdown.config.ts",
|
|
42
|
+
"vitest.config.ts"
|
|
43
|
+
],
|
|
44
|
+
rules: { "import/no-default-export": "off" }
|
|
45
|
+
}],
|
|
46
46
|
rules: {
|
|
47
47
|
"clean-modules/require-direct-exports": "error",
|
|
48
48
|
"clean-modules/require-import-extensions": "error",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oxlint.base.js","names":[],"sources":["../../src/configs/oxlint.base.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\"\n\nimport type { OxlintConfig } from \"oxlint\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\nconst baseConfig = {\n categories: {\n correctness: \"error\",\n nursery: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n restriction: \"error\",\n style: \"error\",\n suspicious: \"error\",\n },\n // Resolve to an absolute path so consumers load it from this package's own deps.\n jsPlugins: [fileURLToPath(import.meta.resolve(\"@adamhl8/eslint-plugin-clean-modules\"))],\n
|
|
1
|
+
{"version":3,"file":"oxlint.base.js","names":[],"sources":["../../src/configs/oxlint.base.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\"\n\nimport type { OxlintConfig } from \"oxlint\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\nconst baseConfig = {\n options: {\n reportUnusedDisableDirectives: \"error\",\n typeAware: true,\n typeCheck: true,\n },\n\n categories: {\n correctness: \"error\",\n nursery: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n restriction: \"error\",\n style: \"error\",\n suspicious: \"error\",\n },\n\n plugins: [\n \"eslint\",\n \"react\",\n \"unicorn\",\n \"typescript\",\n \"oxc\",\n \"import\",\n \"jsdoc\",\n \"vitest\",\n \"jsx-a11y\",\n \"react-perf\",\n \"promise\",\n \"node\",\n ],\n\n // Resolve to an absolute path so consumers load it from this package's own deps.\n jsPlugins: [fileURLToPath(import.meta.resolve(\"@adamhl8/eslint-plugin-clean-modules\"))],\n\n overrides: [\n {\n files: [\n \".release-it.ts\",\n \"commitlint.config.ts\",\n \"knip.ts\",\n \"oxfmt.config.ts\",\n \"oxlint.config.ts\",\n \"prisma.config.ts\",\n \"tsdown.config.ts\",\n \"vitest.config.ts\",\n ],\n rules: {\n \"import/no-default-export\": \"off\",\n },\n },\n ],\n\n rules: {\n \"clean-modules/require-direct-exports\": \"error\",\n \"clean-modules/require-import-extensions\": \"error\",\n \"clean-modules/require-subpath-imports\": \"error\",\n\n curly: [\"error\", \"multi-or-nest\"],\n \"func-style\": [\"error\", \"expression\"],\n \"require-unicode-regexp\": [\"error\", { requireFlag: \"v\" }],\n \"unicorn/no-useless-undefined\": [\"error\", { checkArguments: false }],\n\n \"capitalized-comments\": \"off\",\n \"id-length\": \"off\",\n \"import/exports-last\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/max-dependencies\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"init-declarations\": \"off\",\n \"jsdoc/require-param\": \"off\",\n \"jsdoc/require-returns\": \"off\",\n \"max-classes-per-file\": \"off\",\n \"max-lines\": \"off\",\n \"max-lines-per-function\": \"off\",\n \"max-statements\": \"off\",\n \"no-console\": \"off\",\n \"no-continue\": \"off\",\n \"no-duplicate-imports\": \"off\",\n \"no-inline-comments\": \"off\",\n \"no-magic-numbers\": \"off\",\n \"no-plusplus\": \"off\",\n \"no-ternary\": \"off\",\n \"no-undef\": \"off\",\n \"no-undefined\": \"off\",\n \"no-useless-return\": \"off\",\n \"no-void\": \"off\",\n \"node/callback-return\": \"off\",\n \"node/no-sync\": \"off\",\n \"oxc/no-async-await\": \"off\",\n \"oxc/no-optional-chaining\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"require-await\": \"off\",\n \"sort-imports\": \"off\",\n \"sort-keys\": \"off\",\n \"typescript/consistent-return\": \"off\",\n \"typescript/explicit-function-return-type\": \"off\",\n \"typescript/explicit-module-boundary-types\": \"off\",\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"typescript/strict-boolean-expressions\": \"off\",\n \"unicorn/no-array-callback-reference\": \"off\",\n \"unicorn/no-array-method-this-argument\": \"off\",\n \"unicorn/no-process-exit\": \"off\",\n \"unicorn/number-literal-case\": \"off\",\n \"unicorn/switch-case-braces\": \"off\",\n \"vitest/no-hooks\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/require-hook\": \"off\", // reenable when false positives are fixed?\n \"vitest/require-test-timeout\": \"off\",\n },\n} as const satisfies OxlintConfig\n\nexport const oxlintConfig = createMergeConfigFn<OxlintConfig, typeof baseConfig>(baseConfig)\n"],"mappings":";;AA6HA,MAAa,eAAe,oBAAqD;CAtH/E,SAAS;EACP,+BAA+B;EAC/B,WAAW;EACX,WAAW;CACb;CAEA,YAAY;EACV,aAAa;EACb,SAAS;EACT,UAAU;EACV,MAAM;EACN,aAAa;EACb,OAAO;EACP,YAAY;CACd;CAEA,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAGA,WAAW,CAAC,cAAc,OAAO,KAAK,QAAQ,sCAAsC,CAAC,CAAC;CAEtF,WAAW,CACT;EACE,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA,OAAO,EACL,4BAA4B,MAC9B;CACF,CACF;CAEA,OAAO;EACL,wCAAwC;EACxC,2CAA2C;EAC3C,yCAAyC;EAEzC,OAAO,CAAC,SAAS,eAAe;EAChC,cAAc,CAAC,SAAS,YAAY;EACpC,0BAA0B,CAAC,SAAS,EAAE,aAAa,IAAI,CAAC;EACxD,gCAAgC,CAAC,SAAS,EAAE,gBAAgB,MAAM,CAAC;EAEnE,wBAAwB;EACxB,aAAa;EACb,uBAAuB;EACvB,wBAAwB;EACxB,2BAA2B;EAC3B,0BAA0B;EAC1B,4BAA4B;EAC5B,gCAAgC;EAChC,qBAAqB;EACrB,uBAAuB;EACvB,yBAAyB;EACzB,wBAAwB;EACxB,aAAa;EACb,0BAA0B;EAC1B,kBAAkB;EAClB,cAAc;EACd,eAAe;EACf,wBAAwB;EACxB,sBAAsB;EACtB,oBAAoB;EACpB,eAAe;EACf,cAAc;EACd,YAAY;EACZ,gBAAgB;EAChB,qBAAqB;EACrB,WAAW;EACX,wBAAwB;EACxB,gBAAgB;EAChB,sBAAsB;EACtB,4BAA4B;EAC5B,iCAAiC;EACjC,iBAAiB;EACjB,gBAAgB;EAChB,aAAa;EACb,gCAAgC;EAChC,4CAA4C;EAC5C,6CAA6C;EAC7C,8CAA8C;EAC9C,yCAAyC;EACzC,uCAAuC;EACvC,yCAAyC;EACzC,2BAA2B;EAC3B,+BAA+B;EAC/B,8BAA8B;EAC9B,mBAAmB;EACnB,sCAAsC;EACtC,yCAAyC;EACzC,mCAAmC;EACnC,iCAAiC;EACjC,6BAA6B;EAC7B,8BAA8B;EAC9B,uBAAuB;EACvB,+BAA+B;CACjC;AAG+E,CAAU"}
|
|
@@ -3,16 +3,16 @@ import { Config } from "release-it";
|
|
|
3
3
|
|
|
4
4
|
//#region src/configs/release-it.base.d.ts
|
|
5
5
|
declare const releaseItConfig: OptionalMergeConfigFn<Config, {
|
|
6
|
+
readonly hooks: {
|
|
7
|
+
readonly "before:init": "nub run bundle";
|
|
8
|
+
readonly "after:bump": ["adamhl8-cliff --tag ${version} -o", "nubx oxfmt CHANGELOG.md"];
|
|
9
|
+
};
|
|
6
10
|
readonly git: {
|
|
7
11
|
readonly commitMessage: "release: ${version}";
|
|
8
12
|
readonly tagName: "${version}";
|
|
9
13
|
readonly tagAnnotation: "release ${version}";
|
|
10
14
|
readonly addUntrackedFiles: true;
|
|
11
15
|
};
|
|
12
|
-
readonly hooks: {
|
|
13
|
-
readonly "before:init": "nub run bundle";
|
|
14
|
-
readonly "after:bump": ["adamhl8-cliff --tag ${version} -o", "nubx oxfmt CHANGELOG.md"];
|
|
15
|
-
};
|
|
16
16
|
readonly github: {
|
|
17
17
|
readonly release: true;
|
|
18
18
|
readonly releaseName: "${version}";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createMergeConfigFn } from "../utils.js";
|
|
2
2
|
const releaseItConfig = createMergeConfigFn({
|
|
3
|
+
hooks: {
|
|
4
|
+
"before:init": "nub run bundle",
|
|
5
|
+
"after:bump": ["adamhl8-cliff --tag ${version} -o", "nubx oxfmt CHANGELOG.md"]
|
|
6
|
+
},
|
|
3
7
|
git: {
|
|
4
8
|
commitMessage: "release: ${version}",
|
|
5
9
|
tagName: "${version}",
|
|
6
10
|
tagAnnotation: "release ${version}",
|
|
7
11
|
addUntrackedFiles: true
|
|
8
12
|
},
|
|
9
|
-
hooks: {
|
|
10
|
-
"before:init": "nub run bundle",
|
|
11
|
-
"after:bump": ["adamhl8-cliff --tag ${version} -o", "nubx oxfmt CHANGELOG.md"]
|
|
12
|
-
},
|
|
13
13
|
github: {
|
|
14
14
|
release: true,
|
|
15
15
|
releaseName: "${version}",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-it.base.js","names":[],"sources":["../../src/configs/release-it.base.ts"],"sourcesContent":["// oxlint-disable no-template-curly-in-string\nimport type { Config } from \"release-it\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\nconst baseConfig = {\n
|
|
1
|
+
{"version":3,"file":"release-it.base.js","names":[],"sources":["../../src/configs/release-it.base.ts"],"sourcesContent":["// oxlint-disable no-template-curly-in-string\nimport type { Config } from \"release-it\"\n\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\nconst baseConfig = {\n hooks: {\n \"before:init\": \"nub run bundle\",\n \"after:bump\": [\"adamhl8-cliff --tag ${version} -o\", \"nubx oxfmt CHANGELOG.md\"],\n },\n git: {\n commitMessage: \"release: ${version}\",\n tagName: \"${version}\",\n tagAnnotation: \"release ${version}\",\n addUntrackedFiles: true,\n },\n github: {\n release: true,\n releaseName: \"${version}\",\n releaseNotes: \"adamhl8-cliff --unreleased --tag ${version}\",\n },\n npm: {\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion - release-it doesn't support nub directly yet\n publishPackageManager: \"nub\" as \"bun\",\n publishPath: \"\",\n publishArgs: [\"--no-git-checks\"],\n },\n} as const satisfies Config\n\nexport const releaseItConfig = createMergeConfigFn<Config, typeof baseConfig>(baseConfig)\n"],"mappings":";AA6BA,MAAa,kBAAkB,oBAA+C;CAvB5E,OAAO;EACL,eAAe;EACf,cAAc,CAAC,qCAAqC,yBAAyB;CAC/E;CACA,KAAK;EACH,eAAe;EACf,SAAS;EACT,eAAe;EACf,mBAAmB;CACrB;CACA,QAAQ;EACN,SAAS;EACT,aAAa;EACb,cAAc;CAChB;CACA,KAAK;EAEH,uBAAuB;EACvB,aAAa;EACb,aAAa,CAAC,iBAAiB;CACjC;AAG4E,CAAU"}
|
|
@@ -5,43 +5,43 @@ import { UserConfig } from "tsdown";
|
|
|
5
5
|
//#region src/configs/tsdown.base.d.ts
|
|
6
6
|
type StrictUserConfig = SetRequired<UserConfig, "platform">;
|
|
7
7
|
declare const baseConfig: {
|
|
8
|
-
readonly
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
readonly entry: ["./src/index.ts"];
|
|
9
|
+
readonly platform: "neutral";
|
|
10
|
+
readonly target: false;
|
|
11
|
+
readonly unbundle: true;
|
|
12
|
+
readonly sourcemap: true;
|
|
13
|
+
readonly minify: "dce-only";
|
|
14
|
+
readonly fixedExtension: false;
|
|
15
|
+
readonly hash: false;
|
|
12
16
|
readonly dts: {
|
|
13
17
|
readonly newContext: true;
|
|
14
18
|
readonly resolver: "tsc";
|
|
15
19
|
readonly sourcemap: true;
|
|
16
20
|
};
|
|
17
|
-
readonly
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
readonly minify: "dce-only";
|
|
22
|
-
readonly platform: "neutral";
|
|
21
|
+
readonly attw: {
|
|
22
|
+
readonly level: "error";
|
|
23
|
+
readonly profile: "esm-only";
|
|
24
|
+
};
|
|
23
25
|
readonly publint: true;
|
|
24
|
-
readonly
|
|
25
|
-
readonly target: false;
|
|
26
|
-
readonly unbundle: true;
|
|
26
|
+
readonly failOnWarn: true;
|
|
27
27
|
};
|
|
28
28
|
declare const tsdownConfig: MergeConfigFn<StrictUserConfig, typeof baseConfig>;
|
|
29
29
|
declare const tsdownBinConfig: OptionalMergeConfigFn<UserConfig, {
|
|
30
|
-
readonly attw: false;
|
|
31
|
-
readonly dts: false;
|
|
32
30
|
readonly entry: [];
|
|
31
|
+
readonly platform: "node";
|
|
32
|
+
readonly unbundle: false;
|
|
33
|
+
readonly sourcemap: false;
|
|
33
34
|
readonly outExtensions: () => {
|
|
34
35
|
readonly js: "";
|
|
35
36
|
};
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
37
|
+
readonly dts: false;
|
|
38
|
+
readonly attw: false;
|
|
39
|
+
readonly target: false;
|
|
40
|
+
readonly minify: "dce-only";
|
|
40
41
|
readonly fixedExtension: false;
|
|
41
42
|
readonly hash: false;
|
|
42
|
-
readonly minify: "dce-only";
|
|
43
43
|
readonly publint: true;
|
|
44
|
-
readonly
|
|
44
|
+
readonly failOnWarn: true;
|
|
45
45
|
}>;
|
|
46
46
|
//#endregion
|
|
47
47
|
export { tsdownBinConfig, tsdownConfig };
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { createMergeConfigFn } from "../utils.js";
|
|
2
2
|
//#region src/configs/tsdown.base.ts
|
|
3
3
|
const baseConfig = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
entry: ["./src/index.ts"],
|
|
5
|
+
platform: "neutral",
|
|
6
|
+
target: false,
|
|
7
|
+
unbundle: true,
|
|
8
|
+
sourcemap: true,
|
|
9
|
+
minify: "dce-only",
|
|
10
|
+
fixedExtension: false,
|
|
11
|
+
hash: false,
|
|
8
12
|
dts: {
|
|
9
13
|
newContext: true,
|
|
10
14
|
resolver: "tsc",
|
|
11
15
|
sourcemap: true
|
|
12
16
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
minify: "dce-only",
|
|
18
|
-
platform: "neutral",
|
|
17
|
+
attw: {
|
|
18
|
+
level: "error",
|
|
19
|
+
profile: "esm-only"
|
|
20
|
+
},
|
|
19
21
|
publint: true,
|
|
20
|
-
|
|
21
|
-
target: false,
|
|
22
|
-
unbundle: true
|
|
22
|
+
failOnWarn: true
|
|
23
23
|
};
|
|
24
24
|
const binConfig = {
|
|
25
25
|
...baseConfig,
|
|
26
|
-
attw: false,
|
|
27
|
-
dts: false,
|
|
28
26
|
entry: [],
|
|
29
|
-
outExtensions: () => ({ js: "" }),
|
|
30
27
|
platform: "node",
|
|
28
|
+
unbundle: false,
|
|
31
29
|
sourcemap: false,
|
|
32
|
-
|
|
30
|
+
outExtensions: () => ({ js: "" }),
|
|
31
|
+
dts: false,
|
|
32
|
+
attw: false
|
|
33
33
|
};
|
|
34
34
|
const tsdownConfig = createMergeConfigFn(baseConfig);
|
|
35
35
|
const tsdownBinConfig = createMergeConfigFn(binConfig);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdown.base.js","names":[],"sources":["../../src/configs/tsdown.base.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport type { MergeConfigFn } from \"#/utils.ts\"\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\n// Force projects to specify platform\ntype StrictUserConfig = SetRequired<UserConfig, \"platform\">\n\nconst baseConfig = {\n
|
|
1
|
+
{"version":3,"file":"tsdown.base.js","names":[],"sources":["../../src/configs/tsdown.base.ts"],"sourcesContent":["import type { UserConfig } from \"tsdown\"\nimport type { SetRequired } from \"type-fest\"\n\nimport type { MergeConfigFn } from \"#/utils.ts\"\nimport { createMergeConfigFn } from \"#/utils.ts\"\n\n// Force projects to specify platform\ntype StrictUserConfig = SetRequired<UserConfig, \"platform\">\n\nconst baseConfig = {\n entry: [\"./src/index.ts\"],\n platform: \"neutral\",\n target: false,\n unbundle: true,\n sourcemap: true,\n minify: \"dce-only\",\n fixedExtension: false,\n hash: false,\n dts: {\n newContext: true,\n resolver: \"tsc\",\n sourcemap: true,\n },\n attw: {\n level: \"error\",\n profile: \"esm-only\",\n },\n publint: true,\n failOnWarn: true,\n} as const satisfies StrictUserConfig\n\nconst binConfig = {\n ...baseConfig,\n entry: [],\n platform: \"node\",\n unbundle: false,\n sourcemap: false,\n outExtensions: () => ({ js: \"\" }) as const,\n dts: false,\n attw: false,\n} as const satisfies UserConfig\n\n// Annotated as the non-optional MergeConfigFn so projects must pass a config (platform is required)\nexport const tsdownConfig: MergeConfigFn<StrictUserConfig, typeof baseConfig> = createMergeConfigFn<\n StrictUserConfig,\n typeof baseConfig\n>(baseConfig)\nexport const tsdownBinConfig = createMergeConfigFn<UserConfig, typeof binConfig>(binConfig)\n"],"mappings":";;AASA,MAAM,aAAa;CACjB,OAAO,CAAC,gBAAgB;CACxB,UAAU;CACV,QAAQ;CACR,UAAU;CACV,WAAW;CACX,QAAQ;CACR,gBAAgB;CAChB,MAAM;CACN,KAAK;EACH,YAAY;EACZ,UAAU;EACV,WAAW;CACb;CACA,MAAM;EACJ,OAAO;EACP,SAAS;CACX;CACA,SAAS;CACT,YAAY;AACd;AAEA,MAAM,YAAY;CAChB,GAAG;CACH,OAAO,CAAC;CACR,UAAU;CACV,UAAU;CACV,WAAW;CACX,sBAAsB,EAAE,IAAI,GAAG;CAC/B,KAAK;CACL,MAAM;AACR;AAGA,MAAa,eAAmE,oBAG9E,UAAU;AACZ,MAAa,kBAAkB,oBAAkD,SAAS"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -4,12 +4,22 @@ import { MergeDeep, ReadonlyDeep, SimplifyDeep, WritableDeep } from "type-fest";
|
|
|
4
4
|
/**
|
|
5
5
|
* The merge config function, where the `UserConfig` passed in is merged with `BaseConfig`.
|
|
6
6
|
*
|
|
7
|
+
* Each `arrays` mode gets its own overload so the return type's `arrayMergeMode` matches the runtime behavior. The
|
|
8
|
+
* `"replace"` overload comes first so it wins overload resolution when `{ arrays: "replace" }` is passed.
|
|
9
|
+
*
|
|
7
10
|
* The `const` type parameter keeps literal types without requiring `as const` at the call site. The constraint is
|
|
8
11
|
* `ReadonlyDeep` so readonly arrays/objects (e.g. from `as const`) are accepted, and the result is `WritableDeep` so it
|
|
9
12
|
* stays assignable to the tools' own (mutable) config types.
|
|
10
13
|
*/
|
|
11
14
|
interface MergeConfigFn<UserConfig, BaseConfig> {
|
|
12
|
-
<const UserConfigToMerge extends ReadonlyDeep<UserConfig>>(userConfig: UserConfigToMerge
|
|
15
|
+
<const UserConfigToMerge extends ReadonlyDeep<UserConfig>>(userConfig: UserConfigToMerge, options: {
|
|
16
|
+
arrays: "replace";
|
|
17
|
+
}): MergeDeep<SimplifyDeep<WritableDeep<BaseConfig>>, SimplifyDeep<WritableDeep<UserConfigToMerge>>, {
|
|
18
|
+
arrayMergeMode: "replace";
|
|
19
|
+
}>;
|
|
20
|
+
<const UserConfigToMerge extends ReadonlyDeep<UserConfig>>(userConfig: UserConfigToMerge, options?: {
|
|
21
|
+
arrays?: "merge";
|
|
22
|
+
}): MergeDeep<SimplifyDeep<WritableDeep<BaseConfig>>, SimplifyDeep<WritableDeep<UserConfigToMerge>>, {
|
|
13
23
|
arrayMergeMode: "spread";
|
|
14
24
|
}>;
|
|
15
25
|
}
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[],"sources":["../src/utils.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../src/utils.ts"],"mappings":";;;;AA6BA;;;;;;;;;UAAiB,aAAA;EAAA,iCACkB,YAAA,CAAa,UAAA,GAC5C,UAAA,EAAY,iBAAA,EACZ,OAAA;IAAW,MAAA;EAAA,IACV,SAAA,CACD,YAAA,CAAa,YAAA,CAAa,UAAA,IAC1B,YAAA,CAAa,YAAA,CAAa,iBAAA;IACxB,cAAA;EAAA;EAAA,iCAE6B,YAAA,CAAa,UAAA,GAC5C,UAAA,EAAY,iBAAA,EACZ,OAAA;IAAY,MAAA;EAAA,IACX,SAAA,CACD,YAAA,CAAa,YAAA,CAAa,UAAA,IAC1B,YAAA,CAAa,YAAA,CAAa,iBAAA;IACxB,cAAA;EAAA;AAAA;;;;;;;;UAYW,qBAAA,iCAAsD,aAAA,CAAc,UAAA,EAAY,UAAA;EAAA,IAC3F,YAAA,CAAa,YAAA,CAAa,UAAA;AAAA"}
|
package/dist/utils.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { cloneDeep, mergeWith } from "es-toolkit";
|
|
2
2
|
//#region src/utils.ts
|
|
3
|
-
/** A wrapper around es-toolkit's `mergeWith` with a custom merge function that concatenates arrays. */
|
|
4
|
-
const merge = (target, source) => mergeWith(target, source, (objValue, srcValue) =>
|
|
3
|
+
/** A wrapper around es-toolkit's `mergeWith` with a custom merge function that concatenates or replaces arrays. */
|
|
4
|
+
const merge = (target, source, arrays) => mergeWith(target, source, (objValue, srcValue) => {
|
|
5
|
+
if (!Array.isArray(objValue)) return;
|
|
6
|
+
return arrays === "merge" ? objValue.concat(srcValue) : srcValue;
|
|
7
|
+
});
|
|
5
8
|
/**
|
|
6
9
|
* Creates a config merge function with proper type overloads for merging with a base config.
|
|
7
10
|
*
|
|
@@ -11,9 +14,9 @@ const merge = (target, source) => mergeWith(target, source, (objValue, srcValue)
|
|
|
11
14
|
* limit on large configs like tsdown's.
|
|
12
15
|
*/
|
|
13
16
|
const createMergeConfigFn = (baseConfig) => {
|
|
14
|
-
const mergeConfigFn = (userConfig) => {
|
|
17
|
+
const mergeConfigFn = (userConfig, options) => {
|
|
15
18
|
if (userConfig === void 0) return cloneDeep(baseConfig);
|
|
16
|
-
return merge(cloneDeep(baseConfig), cloneDeep(userConfig));
|
|
19
|
+
return merge(cloneDeep(baseConfig), cloneDeep(userConfig), options?.arrays ?? "merge");
|
|
17
20
|
};
|
|
18
21
|
return mergeConfigFn;
|
|
19
22
|
};
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import { cloneDeep, mergeWith } from \"es-toolkit\"\nimport type { MergeDeep, ReadonlyDeep, WritableDeep, SimplifyDeep } from \"type-fest\"\n\ntype AnyObj = object\n\n/** A wrapper around es-toolkit's `mergeWith` with a custom merge function that concatenates arrays. */\nconst merge = <T extends AnyObj, S extends AnyObj>(target: T, source: S): T & S =>\n mergeWith(target, source, (objValue: unknown, srcValue: unknown)
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import { cloneDeep, mergeWith } from \"es-toolkit\"\nimport type { MergeDeep, ReadonlyDeep, WritableDeep, SimplifyDeep } from \"type-fest\"\n\ntype AnyObj = object\n\n/**\n * How arrays in the user config are combined with arrays in the base config. - `\"merge\"` (default): the user array is\n * appended to the base array - `\"replace\"`: the user array is used as-is\n */\ntype ArrayMergeMode = \"merge\" | \"replace\"\n\n/** A wrapper around es-toolkit's `mergeWith` with a custom merge function that concatenates or replaces arrays. */\nconst merge = <T extends AnyObj, S extends AnyObj>(target: T, source: S, arrays: ArrayMergeMode): T & S =>\n mergeWith(target, source, (objValue: unknown, srcValue: unknown) => {\n if (!Array.isArray(objValue)) return\n // oxlint-disable-next-line unicorn/prefer-spread\n return arrays === \"merge\" ? objValue.concat(srcValue) : srcValue\n })\n\n/**\n * The merge config function, where the `UserConfig` passed in is merged with `BaseConfig`.\n *\n * Each `arrays` mode gets its own overload so the return type's `arrayMergeMode` matches the runtime behavior. The\n * `\"replace\"` overload comes first so it wins overload resolution when `{ arrays: \"replace\" }` is passed.\n *\n * The `const` type parameter keeps literal types without requiring `as const` at the call site. The constraint is\n * `ReadonlyDeep` so readonly arrays/objects (e.g. from `as const`) are accepted, and the result is `WritableDeep` so it\n * stays assignable to the tools' own (mutable) config types.\n */\nexport interface MergeConfigFn<UserConfig, BaseConfig> {\n <const UserConfigToMerge extends ReadonlyDeep<UserConfig>>(\n userConfig: UserConfigToMerge,\n options: { arrays: \"replace\" },\n ): MergeDeep<\n SimplifyDeep<WritableDeep<BaseConfig>>,\n SimplifyDeep<WritableDeep<UserConfigToMerge>>,\n { arrayMergeMode: \"replace\" }\n >\n <const UserConfigToMerge extends ReadonlyDeep<UserConfig>>(\n userConfig: UserConfigToMerge,\n options?: { arrays?: \"merge\" },\n ): MergeDeep<\n SimplifyDeep<WritableDeep<BaseConfig>>,\n SimplifyDeep<WritableDeep<UserConfigToMerge>>,\n { arrayMergeMode: \"spread\" }\n >\n // Instead of returning `BaseConfig & UserConfig` (from `merge`), return a more friendly type using `MergeDeep`\n}\n\n/**\n * The optional merge config function, where the `userConfig` argument is optional. - if `UserConfig` is not provided,\n * the return type is `BaseConfig` - if `UserConfig` is provided, the return type is the merged type of `BaseConfig` and\n * `UserConfig`.\n *\n * Note that this extends `MergeConfigFn`, so this type has both function signatures on it.\n */\nexport interface OptionalMergeConfigFn<UserConfig, BaseConfig> extends MergeConfigFn<UserConfig, BaseConfig> {\n (): SimplifyDeep<WritableDeep<BaseConfig>>\n}\n\n/**\n * Creates a config merge function with proper type overloads for merging with a base config.\n *\n * `UserConfig` is not inferrable, so both type arguments must be passed explicitly. Returning the exact\n * `OptionalMergeConfigFn` instantiation (instead of relating a looser type to an annotation at the export site) keeps\n * tsc from eagerly evaluating the deep-mapped types over the full config type, which blows the instantiation depth\n * limit on large configs like tsdown's.\n */\nexport const createMergeConfigFn = <UserConfig extends AnyObj, BaseConfig extends ReadonlyDeep<UserConfig>>(\n baseConfig: BaseConfig,\n): OptionalMergeConfigFn<UserConfig, BaseConfig> => {\n // We don't care about the specific type of userConfig here because we assert mergeConfigFn as the correct type below\n const mergeConfigFn = (userConfig?: AnyObj, options?: { arrays?: ArrayMergeMode }) => {\n // Return a clone so consumers can't mutate the shared base config\n // oxlint-disable-next-line unicorn/prefer-structured-clone - structuredClone does not properly clone functions\n if (userConfig === undefined) return cloneDeep(baseConfig)\n // Clone both target and source so we never mutate the original objects\n // oxlint-disable-next-line unicorn/prefer-structured-clone - structuredClone does not properly clone functions\n return merge(cloneDeep(baseConfig), cloneDeep(userConfig), options?.arrays ?? \"merge\")\n }\n\n // oxlint-disable-next-line typescript/no-unsafe-type-assertion\n return mergeConfigFn as OptionalMergeConfigFn<UserConfig, BaseConfig>\n}\n"],"mappings":";;;AAYA,MAAM,SAA6C,QAAW,QAAW,WACvE,UAAU,QAAQ,SAAS,UAAmB,aAAsB;CAClE,IAAI,CAAC,MAAM,QAAQ,QAAQ,GAAG;CAE9B,OAAO,WAAW,UAAU,SAAS,OAAO,QAAQ,IAAI;AAC1D,CAAC;;;;;;;;;AAmDH,MAAa,uBACX,eACkD;CAElD,MAAM,iBAAiB,YAAqB,YAA0C;EAGpF,IAAI,eAAe,KAAA,GAAW,OAAO,UAAU,UAAU;EAGzD,OAAO,MAAM,UAAU,UAAU,GAAG,UAAU,UAAU,GAAG,SAAS,UAAU,OAAO;CACvF;CAGA,OAAO;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adamhl8/configs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"homepage": "https://github.com/adamhl8/configs",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/adamhl8/configs/issues"
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"url": "git+https://github.com/adamhl8/configs.git"
|
|
17
17
|
},
|
|
18
18
|
"bin": {
|
|
19
|
-
"adamhl8-cliff": "./dist/adamhl8-cliff/index"
|
|
20
|
-
"adamhl8-knip": "./dist/adamhl8-knip/index"
|
|
19
|
+
"adamhl8-cliff": "./dist/adamhl8-cliff/index"
|
|
21
20
|
},
|
|
22
21
|
"files": [
|
|
23
22
|
"./dist/"
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
"access": "public"
|
|
42
41
|
},
|
|
43
42
|
"scripts": {
|
|
44
|
-
"lint": "markdown-toc -i --bullets '-' --maxdepth 3 ./README.md && oxfmt && oxlint --fix --fix-suggestions --fix-dangerously &&
|
|
43
|
+
"lint": "markdown-toc -i --bullets '-' --maxdepth 3 ./README.md && oxfmt && oxlint --fix --fix-suggestions --fix-dangerously && knip",
|
|
45
44
|
"bump-deps": "nub update -L && rm -f lock.yaml && nub i --no-frozen-lockfile && oxfmt lock.yaml",
|
|
46
45
|
"bundle": "nub run lint && tsdown",
|
|
47
46
|
"release": "gh workflow run release.yml",
|
package/dist/adamhl8-knip/index
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env nub
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import process from "node:process";
|
|
6
|
-
//#region src/adamhl8-knip/index.ts
|
|
7
|
-
const KNIP_PREPROCESSOR_PATH = path.resolve(import.meta.dirname, "./knip-preprocessor");
|
|
8
|
-
process.exitCode = spawnSync("knip", [
|
|
9
|
-
"--preprocessor",
|
|
10
|
-
`${KNIP_PREPROCESSOR_PATH}${existsSync(`${KNIP_PREPROCESSOR_PATH}.ts`) ? ".ts" : ".js"}`,
|
|
11
|
-
...process.argv.slice(2)
|
|
12
|
-
], { stdio: "inherit" }).status;
|
|
13
|
-
//#endregion
|
|
14
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import "es-toolkit";
|
|
2
|
-
//#endregion
|
|
3
|
-
//#region src/configs/knip.base.ts
|
|
4
|
-
const DEFAULT_ENTRIES = [
|
|
5
|
-
"./src/index.ts",
|
|
6
|
-
"**/*.test.ts",
|
|
7
|
-
"./tsdown.config.ts"
|
|
8
|
-
];
|
|
9
|
-
/**
|
|
10
|
-
* Consuming projects show these transitive dependencies as unlisted. e.g. knip resolves
|
|
11
|
-
* `@adamhl8/eslint-plugin-clean-modules` via the oxlint config, but we don't need to install it directly in the
|
|
12
|
-
* consuming project.
|
|
13
|
-
*/
|
|
14
|
-
const UNLISTED_DEPENDENCIES = ["@adamhl8/eslint-plugin-clean-modules"];
|
|
15
|
-
const IGNORE_DEPENDENCIES = [...["@commitlint/cli"], ...UNLISTED_DEPENDENCIES];
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/adamhl8-knip/knip-preprocessor.ts
|
|
18
|
-
const preprocess = (options) => {
|
|
19
|
-
options.configurationHints = options.configurationHints.filter((hint) => !(DEFAULT_ENTRIES.some((entry) => typeof hint.identifier === "string" && hint.identifier.includes(entry)) && (hint.type === "entry-empty" || hint.type === "entry-redundant")));
|
|
20
|
-
options.configurationHints = options.configurationHints.filter((hint) => !(IGNORE_DEPENDENCIES.some((dep) => typeof hint.identifier === "string" && hint.identifier.includes(dep)) && hint.type === "ignoreDependencies"));
|
|
21
|
-
return options;
|
|
22
|
-
};
|
|
23
|
-
//#endregion
|
|
24
|
-
export { preprocess as default };
|