Skip to content

Commit 0413e9d

Browse files
feat: more tweaks
1 parent c878648 commit 0413e9d

28 files changed

+624
-700
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ node_modules/
22

33
/coverage/
44
/dist/
5-
/src/typegen.d.ts
5+
/src/typegen.ts
66

77
*.log

CHANGELOG.md

+183-313
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cspell.config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ ignorePaths:
4949
- patches
5050
- pnpm-lock.yaml
5151
- project-dictionary.txt
52+
- src/typegen.ts
5253

5354
ignoreRegExpList:
5455
- /\b[a-f0-9]{6}\b/ui # ignore hex color codes

eslint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const rsEslint = jiti("./src").default;
1111

1212
export default rsEslint(
1313
{
14+
mode: "none",
1415
typescript: {
1516
tsconfig: "./tsconfig.eslint.json",
1617
},

package.json

-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
"@stylistic/eslint-plugin": "1.8.0",
6969
"@stylistic/eslint-plugin-migrate": "1.8.0",
7070
"@types/node": "20.12.8",
71-
"@types/rollup-plugin-auto-external": "2.0.5",
7271
"@typescript-eslint/eslint-plugin": "7.8.0",
7372
"@typescript-eslint/parser": "7.8.0",
7473
"@typescript-eslint/utils": "7.8.0",
@@ -112,7 +111,6 @@
112111
"prettier-plugin-packagejson": "2.5.0",
113112
"rimraf": "5.0.5",
114113
"rollup": "4.17.2",
115-
"rollup-plugin-auto-external": "2.0.0",
116114
"rollup-plugin-ts": "3.4.5",
117115
"semantic-release": "23.0.8",
118116
"toml-eslint-parser": "0.9.3",

pnpm-lock.yaml

-51
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rollup.config.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { rollupPlugin as rollupPluginDeassert } from "deassert";
22
import { type RollupOptions } from "rollup";
3-
import rollupPluginAutoExternal from "rollup-plugin-auto-external";
43
import rollupPluginTs from "rollup-plugin-ts";
54

65
import pkg from "./package.json" assert { type: "json" };
76

87
const treeshake = {
98
annotations: true,
10-
moduleSideEffects: [],
9+
moduleSideEffects: ["src/typegen.ts"],
1110
propertyReadSideEffects: false,
1211
unknownGlobalSideEffects: false,
1312
} satisfies RollupOptions["treeshake"];
@@ -34,14 +33,19 @@ export default {
3433
},
3534
],
3635

36+
external: [
37+
...Object.keys(pkg.dependencies),
38+
...Object.keys(pkg.peerDependencies),
39+
],
40+
3741
plugins: [
38-
rollupPluginAutoExternal(),
3942
rollupPluginTs({
4043
transpileOnly: true,
4144
tsconfig: "tsconfig.build.json",
4245
}),
4346
rollupPluginDeassert({
4447
include: ["**/*.{js,ts}"],
48+
exclude: ["**/*.d.ts"],
4549
}),
4650
],
4751

scripts/typegen.ts

+91-17
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,106 @@ import { combine } from "../src/utils";
3434
const configs = (await combine(
3535
comments(),
3636
formatters({}, {}),
37-
functional({}),
38-
ignores({}),
39-
imports({}),
37+
functional({
38+
functionalEnforcement: "none",
39+
ignoreNamePattern: [],
40+
stylistic: false,
41+
overrides: undefined,
42+
parserOptions: {},
43+
filesTypeAware: [],
44+
mode: "none",
45+
}),
46+
ignores({
47+
ignores: [],
48+
}),
49+
imports({
50+
stylistic: false,
51+
parserOptions: {},
52+
filesTypeAware: [],
53+
}),
4054
inEditor(),
41-
javascript({}),
42-
jsdoc({}),
43-
jsonc({}),
44-
markdown({}),
55+
javascript({
56+
overrides: undefined,
57+
functionalEnforcement: "none",
58+
ignoreNamePattern: [],
59+
}),
60+
jsdoc({
61+
stylistic: false,
62+
}),
63+
jsonc({
64+
files: [],
65+
stylistic: false,
66+
overrides: undefined,
67+
}),
68+
markdown({
69+
files: [],
70+
componentExts: [],
71+
overrides: undefined,
72+
}),
4573
node(),
4674
overrides(),
4775
promise(),
4876
regexp(),
49-
sonar({}),
77+
sonar({
78+
functionalEnforcement: "none",
79+
ignoreNamePattern: [],
80+
}),
5081
sortTsconfig(),
51-
stylistic({}),
52-
test({}),
53-
toml({}),
54-
typescript({}),
82+
stylistic({
83+
stylistic: {
84+
indent: 2,
85+
jsx: true,
86+
quotes: "double",
87+
semi: true,
88+
},
89+
overrides: undefined,
90+
typescript: false
91+
}),
92+
test({
93+
files: [],
94+
overrides: undefined,
95+
}),
96+
toml({
97+
overrides: undefined,
98+
stylistic: false,
99+
files: [],
100+
}),
101+
typescript({
102+
files: [],
103+
componentExts: [],
104+
overrides: undefined,
105+
parserOptions: {},
106+
filesTypeAware: [],
107+
unsafe: "off",
108+
functionalEnforcement: "none",
109+
ignoreNamePattern: [],
110+
}),
55111
unicorn(),
56-
unocss({}),
57-
vue({}),
58-
yaml({}),
112+
unocss({
113+
attributify: false,
114+
strict: false,
115+
overrides: undefined,
116+
}),
117+
vue({
118+
sfcBlocks: false,
119+
vueVersion: 2,
120+
i18n: false,
121+
overrides: undefined,
122+
typescript: false,
123+
stylistic: false,
124+
files: [],
125+
}),
126+
yaml({
127+
overrides: undefined,
128+
stylistic: false,
129+
files: [],
130+
}),
59131
)) as Linter.FlatConfig[];
60132

61133
const dts = await flatConfigsToRulesDTS(configs, {
62-
includeAugmentation: false,
134+
includeIgnoreComments: false,
63135
});
64136

65-
await fs.writeFile("src/typegen.d.ts", dts);
137+
const fullDts = `// @ts-nocheck\n${dts}`;
138+
139+
await fs.writeFile("src/typegen.ts", fullDts);

0 commit comments

Comments
 (0)