-
Notifications
You must be signed in to change notification settings - Fork 0
/
.projenrc.js
88 lines (73 loc) · 2.06 KB
/
.projenrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import { javascript, typescript, github } from "projen";
const project = new typescript.TypeScriptProject({
defaultReleaseBranch: "main",
name: "@cloudy-ts/eslint-plugin",
deps: [],
peerDeps: ["eslint"],
devDeps: ["eslint", "@types/eslint", "@types/estree"],
// ESM.
entrypoint: "lib/index.cjs",
entrypointTypes: "",
tsconfig: {
compilerOptions: {
lib: ["ES2022"],
target: "ES2022",
module: "ES2022",
moduleResolution: "NodeNext",
noUncheckedIndexedAccess: true,
},
},
tsconfigDev: {
include: ["test/**/*.tsx"],
},
// Lint.
prettier: true,
// Test.
jest: false,
releaseToNpm: true,
autoApproveUpgrades: true,
autoApproveOptions: {
allowedUsernames: ["skyrpex", "skyrpex-bot[bot]"],
secret: "GITHUB_TOKEN",
},
githubOptions: {
projenCredentials: github.GithubCredentials.fromApp(),
},
npmAccess: javascript.NpmAccess.PUBLIC,
minNodeVersion: "18.16.0",
workflowNodeVersion: "18.16.1",
packageManager: javascript.NodePackageManager.PNPM,
pnpmVersion: "8",
});
// Docs.
project.npmignore?.addPatterns("/docs/");
// Lint.
project.npmignore?.addPatterns("/.editorconfig");
project.npmignore?.addPatterns("/.prettier*");
// ESM.
project.addFields({
type: "module",
exports: {
".": {
require: "./lib/index.cjs",
import: `./lib/index.js`,
},
},
});
// Build.
project.addDevDeps("esbuild");
project.compileTask.reset();
project.compileTask.prependExec(
"esbuild src/index.ts --bundle --target=node18 --platform=node --format=esm --outfile=lib/index.js",
);
project.compileTask.prependExec(
"esbuild src/index.ts --bundle --target=node18 --platform=node --format=cjs --outfile=lib/index.cjs",
);
// Test.
project.npmignore?.addPatterns("/coverage/");
project.addDevDeps("vitest", "@vitest/coverage-v8");
project.testTask.exec("vitest test/rules --passWithNoTests --coverage --run");
project.testTask.exec("vitest test/test-app/index.test.ts --run");
project.watchTask.reset();
project.watchTask.exec("vitest test/rules --passWithNoTests --coverage");
project.synth();