@langri-sha/projen-project 0.4.2 → 0.6.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/CHANGELOG.json +50 -0
- package/CHANGELOG.md +19 -1
- package/lib/index.d.ts +10 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +35 -12
- package/lib/index.js.map +1 -1
- package/package.json +4 -1
- package/readme +14 -14
- package/src/index.ts +71 -17
package/CHANGELOG.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langri-sha/projen-project",
|
|
3
3
|
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"date": "Thu, 09 May 2024 07:29:32 GMT",
|
|
6
|
+
"version": "0.6.0",
|
|
7
|
+
"tag": "@langri-sha/projen-project_v0.6.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "filip.dupanovic@gmail.com",
|
|
12
|
+
"package": "@langri-sha/projen-project",
|
|
13
|
+
"commit": "508fb179ee3454c0e43f7ea2a9ed25ca6310e27b",
|
|
14
|
+
"comment": "feat(eslint): Upgrade to v9"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "filip.dupanovic@gmail.com",
|
|
18
|
+
"package": "@langri-sha/projen-project",
|
|
19
|
+
"commit": "508fb179ee3454c0e43f7ea2a9ed25ca6310e27b",
|
|
20
|
+
"comment": "feat(project): Add support for configuring Husky"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Mon, 06 May 2024 02:33:10 GMT",
|
|
27
|
+
"version": "0.5.0",
|
|
28
|
+
"tag": "@langri-sha/projen-project_v0.5.0",
|
|
29
|
+
"comments": {
|
|
30
|
+
"minor": [
|
|
31
|
+
{
|
|
32
|
+
"author": "filip.dupanovic@gmail.com",
|
|
33
|
+
"package": "@langri-sha/projen-project",
|
|
34
|
+
"commit": "4ce9a634d76fb8287290e07ae33aa37e3b6151b4",
|
|
35
|
+
"comment": "feat(project): Add support for configuring code owners"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "filip.dupanovic@gmail.com",
|
|
39
|
+
"package": "@langri-sha/projen-project",
|
|
40
|
+
"commit": "4ce9a634d76fb8287290e07ae33aa37e3b6151b4",
|
|
41
|
+
"comment": "feat(projen-project): Manage Renovate configuration"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"none": [
|
|
45
|
+
{
|
|
46
|
+
"author": "filip.dupanovic@gmail.com",
|
|
47
|
+
"package": "@langri-sha/projen-project",
|
|
48
|
+
"commit": "4ce9a634d76fb8287290e07ae33aa37e3b6151b4",
|
|
49
|
+
"comment": "feat(projen-project): Update documentation"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
},
|
|
4
54
|
{
|
|
5
55
|
"date": "Fri, 03 May 2024 12:54:50 GMT",
|
|
6
56
|
"version": "0.4.1",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
# Change Log - @langri-sha/projen-project
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 09 May 2024 07:29:32 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.6.0
|
|
8
|
+
|
|
9
|
+
Thu, 09 May 2024 07:29:32 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- feat(eslint): Upgrade to v9 (filip.dupanovic@gmail.com)
|
|
14
|
+
- feat(project): Add support for configuring Husky (filip.dupanovic@gmail.com)
|
|
15
|
+
|
|
16
|
+
## 0.5.0
|
|
17
|
+
|
|
18
|
+
Mon, 06 May 2024 02:33:10 GMT
|
|
19
|
+
|
|
20
|
+
### Minor changes
|
|
21
|
+
|
|
22
|
+
- feat(project): Add support for configuring code owners (filip.dupanovic@gmail.com)
|
|
23
|
+
- feat(projen-project): Manage Renovate configuration (filip.dupanovic@gmail.com)
|
|
24
|
+
|
|
7
25
|
## 0.4.1
|
|
8
26
|
|
|
9
27
|
Fri, 03 May 2024 12:54:50 GMT
|
package/lib/index.d.ts
CHANGED
|
@@ -2,12 +2,21 @@ import { Project as BaseProject, type ProjectOptions as BaseProjectOptions } fro
|
|
|
2
2
|
import { type BeachballConfig } from 'beachball';
|
|
3
3
|
import { type LintSynthesizedOptions } from '@langri-sha/projen-lint-synthesized';
|
|
4
4
|
import { type EditorConfigOptions } from '@langri-sha/projen-editorconfig';
|
|
5
|
-
|
|
5
|
+
import { type CodeownersOptions } from '@langri-sha/projen-codeowners';
|
|
6
|
+
import { type RenovateOptions } from '@langri-sha/projen-renovate';
|
|
7
|
+
import { type HuskyOptions } from '@langri-sha/projen-husky';
|
|
8
|
+
export interface ProjectOptions extends Omit<BaseProjectOptions, 'renovatebot' | 'renovatebotOptions'> {
|
|
6
9
|
beachballConfig?: BeachballConfig;
|
|
10
|
+
codeownersOptions?: CodeownersOptions;
|
|
7
11
|
/**
|
|
8
12
|
* EditorConfig options.
|
|
9
13
|
*/
|
|
10
14
|
editorConfigOptions?: EditorConfigOptions;
|
|
15
|
+
/**
|
|
16
|
+
* Husky options.
|
|
17
|
+
*/
|
|
18
|
+
huskyOptions?: HuskyOptions;
|
|
19
|
+
renovateOptions?: RenovateOptions;
|
|
11
20
|
lintSynthesizedOptions?: LintSynthesizedOptions;
|
|
12
21
|
withTerraform?: boolean;
|
|
13
22
|
withTypeScript?: boolean;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,KAAK,cAAc,IAAI,kBAAkB,EAG1C,MAAM,QAAQ,CAAA;AAGf,OAAO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
CHANGED
|
@@ -3,11 +3,14 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _Project_instances, _Project_configureBeachball, _Project_configureDefaultTask, _Project_configureLintSynthesized,
|
|
6
|
+
var _Project_instances, _Project_configureBeachball, _Project_configureCodeowners, _Project_configureDefaultTask, _Project_configureEditorConfig, _Project_configureHusky, _Project_configureLintSynthesized, _Project_configureRenovate, _Project_createPnpmWorkspaces;
|
|
7
7
|
import { Project as BaseProject, TextFile, YamlFile, } from 'projen';
|
|
8
8
|
import * as R from 'ramda';
|
|
9
9
|
import { LintSynthesized, } from '@langri-sha/projen-lint-synthesized';
|
|
10
10
|
import { EditorConfig, } from '@langri-sha/projen-editorconfig';
|
|
11
|
+
import { Codeowners, } from '@langri-sha/projen-codeowners';
|
|
12
|
+
import { Renovate } from '@langri-sha/projen-renovate';
|
|
13
|
+
import { Husky } from '@langri-sha/projen-husky';
|
|
11
14
|
export class Project extends BaseProject {
|
|
12
15
|
constructor(options) {
|
|
13
16
|
super({
|
|
@@ -24,9 +27,12 @@ export class Project extends BaseProject {
|
|
|
24
27
|
this.tasks.removeTask('pre-compile');
|
|
25
28
|
this.tasks.removeTask('watch');
|
|
26
29
|
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureBeachball).call(this, options);
|
|
30
|
+
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureCodeowners).call(this, options);
|
|
27
31
|
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureDefaultTask).call(this);
|
|
28
32
|
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureEditorConfig).call(this, options);
|
|
33
|
+
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureHusky).call(this, options);
|
|
29
34
|
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureLintSynthesized).call(this, options);
|
|
35
|
+
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureRenovate).call(this, options);
|
|
30
36
|
__classPrivateFieldGet(this, _Project_instances, "m", _Project_createPnpmWorkspaces).call(this, options);
|
|
31
37
|
}
|
|
32
38
|
}
|
|
@@ -55,22 +61,21 @@ _Project_instances = new WeakSet(), _Project_configureBeachball = function _Proj
|
|
|
55
61
|
]) {
|
|
56
62
|
file.addLine(line);
|
|
57
63
|
}
|
|
64
|
+
}, _Project_configureCodeowners = function _Project_configureCodeowners({ codeownersOptions }) {
|
|
65
|
+
if (!codeownersOptions) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
new Codeowners(this, codeownersOptions);
|
|
58
69
|
}, _Project_configureDefaultTask = function _Project_configureDefaultTask() {
|
|
59
70
|
this.tasks
|
|
60
71
|
.tryFind('default')
|
|
61
72
|
?.exec(`node --loader ts-node/esm .projenrc.mts`);
|
|
62
|
-
}, _Project_configureLintSynthesized = function _Project_configureLintSynthesized({ lintSynthesizedOptions }) {
|
|
63
|
-
new LintSynthesized(this, lintSynthesizedOptions ?? {
|
|
64
|
-
'*.{js,jsx,ts,tsx}': 'pnpm eslint --fix',
|
|
65
|
-
'*': 'pnpm prettier --write --ignore-unknown',
|
|
66
|
-
});
|
|
67
73
|
}, _Project_configureEditorConfig = function _Project_configureEditorConfig({ editorConfigOptions }) {
|
|
68
74
|
if (!editorConfigOptions) {
|
|
69
75
|
return;
|
|
70
76
|
}
|
|
71
77
|
const defaults = {
|
|
72
78
|
'*': {
|
|
73
|
-
// eslint-disable-next-line unicorn/text-encoding-identifier-case
|
|
74
79
|
charset: 'utf-8',
|
|
75
80
|
end_of_line: 'lf',
|
|
76
81
|
indent_style: 'space',
|
|
@@ -83,6 +88,27 @@ _Project_instances = new WeakSet(), _Project_configureBeachball = function _Proj
|
|
|
83
88
|
},
|
|
84
89
|
};
|
|
85
90
|
new EditorConfig(this, deepMerge(editorConfigOptions ?? {}, defaults));
|
|
91
|
+
}, _Project_configureHusky = function _Project_configureHusky({ huskyOptions }) {
|
|
92
|
+
if (!huskyOptions) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
new Husky(this, huskyOptions);
|
|
96
|
+
}, _Project_configureLintSynthesized = function _Project_configureLintSynthesized({ lintSynthesizedOptions }) {
|
|
97
|
+
new LintSynthesized(this, lintSynthesizedOptions ?? {
|
|
98
|
+
'*.{js,jsx,ts,tsx}': 'pnpm eslint --fix',
|
|
99
|
+
'*': 'pnpm prettier --write --ignore-unknown',
|
|
100
|
+
});
|
|
101
|
+
}, _Project_configureRenovate = function _Project_configureRenovate({ renovateOptions }) {
|
|
102
|
+
if (!renovateOptions) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const defaults = {
|
|
106
|
+
configMigration: true,
|
|
107
|
+
extends: ['config:recommended'],
|
|
108
|
+
labels: ['dependencies'],
|
|
109
|
+
reviewersFromCodeOwners: true,
|
|
110
|
+
};
|
|
111
|
+
new Renovate(this, deepMerge(defaults, renovateOptions));
|
|
86
112
|
}, _Project_createPnpmWorkspaces = function _Project_createPnpmWorkspaces({ workspaces }) {
|
|
87
113
|
if (!workspaces) {
|
|
88
114
|
return;
|
|
@@ -95,7 +121,7 @@ _Project_instances = new WeakSet(), _Project_configureBeachball = function _Proj
|
|
|
95
121
|
},
|
|
96
122
|
});
|
|
97
123
|
};
|
|
98
|
-
const getGitIgnoreOptions = ({ withTerraform, withTypeScript, ...options }) => ({
|
|
124
|
+
const getGitIgnoreOptions = ({ huskyOptions, withTerraform, withTypeScript, ...options }) => ({
|
|
99
125
|
...options.gitIgnoreOptions,
|
|
100
126
|
ignorePatterns: [
|
|
101
127
|
...`
|
|
@@ -103,12 +129,9 @@ const getGitIgnoreOptions = ({ withTerraform, withTypeScript, ...options }) => (
|
|
|
103
129
|
!.babelrc
|
|
104
130
|
!.dockerignore
|
|
105
131
|
!.editorconfig
|
|
106
|
-
!.eslintignore
|
|
107
|
-
!.eslintrc.js
|
|
108
132
|
!.gitattributes
|
|
109
133
|
!.gitignore
|
|
110
134
|
!.gitkeep
|
|
111
|
-
!.husky
|
|
112
135
|
!.npmignore
|
|
113
136
|
!.openssl
|
|
114
137
|
!.prettierignore
|
|
@@ -119,7 +142,7 @@ const getGitIgnoreOptions = ({ withTerraform, withTypeScript, ...options }) => (
|
|
|
119
142
|
${withTypeScript ? '*.tsbuildinfo' : ''}
|
|
120
143
|
|
|
121
144
|
!.github/
|
|
122
|
-
!.husky/
|
|
145
|
+
${huskyOptions ? '!.husky/' : ''}
|
|
123
146
|
!.projen/
|
|
124
147
|
${options.workspaces?.map((workspace) => `${workspace}/lib/`).join('\n') ?? ''}
|
|
125
148
|
node_modules/
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,OAAO,IAAI,WAAW,EAEtB,QAAQ,EACR,QAAQ,GACT,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,CAAC,MAAM,OAAO,CAAA;AAG1B,OAAO,EACL,eAAe,GAEhB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,YAAY,GAEb,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,OAAO,IAAI,WAAW,EAEtB,QAAQ,EACR,QAAQ,GACT,MAAM,QAAQ,CAAA;AAEf,OAAO,KAAK,CAAC,MAAM,OAAO,CAAA;AAG1B,OAAO,EACL,eAAe,GAEhB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACL,YAAY,GAEb,MAAM,iCAAiC,CAAA;AACxC,OAAO,EACL,UAAU,GAEX,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,QAAQ,EAA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YD,aAAa,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE;;;MAG3C,cAAc,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE;;;MAGrC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;;MAE9B,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,GAAG,SAAS,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;;KAE7E;aACE,KAAK,CAAC,IAAI,CAAC;aACX,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;aAChC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;QAC1C,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,cAAc,IAAI,EAAE,CAAC;KACpD;CACF,CAAC,CAAA;AAEF,MAAM,SAAS,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@langri-sha/projen-project",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
"prepublishOnly": "rm -rf lib; tsc --project tsconfig.build.json"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
+
"@langri-sha/projen-codeowners": "0.2.0",
|
|
11
12
|
"@langri-sha/projen-editorconfig": "0.3.1",
|
|
13
|
+
"@langri-sha/projen-husky": "0.1.0",
|
|
12
14
|
"@langri-sha/projen-lint-synthesized": "0.2.2",
|
|
15
|
+
"@langri-sha/projen-renovate": "0.2.0",
|
|
13
16
|
"beachball": "2.43.1",
|
|
14
17
|
"ramda": "0.29.1"
|
|
15
18
|
},
|
package/readme
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
Collection of [projen] templates for bootstraping monorepos and workspace
|
|
4
4
|
projects.
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Features
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
- configures extensive list of Git ignore patterns
|
|
11
|
-
|
|
12
|
-
### Terraform
|
|
13
|
-
|
|
14
|
-
- adds lockfile
|
|
15
|
-
|
|
16
|
-
### TypeScript monorepo
|
|
17
|
-
|
|
18
|
-
- configures [`@langri-sha/tsconfig`]
|
|
8
|
+
- managing [Beacbhall] configuration for publishing packages
|
|
19
9
|
- configures [PNPM] [workspaces]
|
|
20
|
-
|
|
21
|
-
[`@langri-sha/
|
|
10
|
+
- configures [`@langri-sha/tsconfig`] for TypeScript monorepos
|
|
11
|
+
- managing Git hooks with [`@langri-sha/projen-husky`]
|
|
12
|
+
- configures extensive list of Git ignore patterns
|
|
13
|
+
- manages [code owners] with [`@langri-sha/projen-codeowners`]
|
|
14
|
+
|
|
15
|
+
[`@langri-sha/codeowners`]: https://www.npmjs.com/package/@langri-sha/codeowners
|
|
16
|
+
[`@langri-sha/projen-husky`]:
|
|
17
|
+
https://www.npmjs.com/package/@langri-sha/projen-husky
|
|
18
|
+
[`@langri-sha/tsconfig`]: https://www.npmjs.com/package/@langri-sha/tsconfig
|
|
19
|
+
[beachball]: https://microsoft.github.io/beachball/
|
|
20
|
+
[code owners]:
|
|
21
|
+
https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
|
|
22
22
|
[pnpm]: https://pnpm.io
|
|
23
23
|
[projen]: https://projen.dev/
|
|
24
24
|
[workspaces]: https://pnpm.io/workspaces
|
package/src/index.ts
CHANGED
|
@@ -16,22 +16,45 @@ import {
|
|
|
16
16
|
EditorConfig,
|
|
17
17
|
type EditorConfigOptions,
|
|
18
18
|
} from '@langri-sha/projen-editorconfig'
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
import {
|
|
20
|
+
Codeowners,
|
|
21
|
+
type CodeownersOptions,
|
|
22
|
+
} from '@langri-sha/projen-codeowners'
|
|
23
|
+
import { Renovate, type RenovateOptions } from '@langri-sha/projen-renovate'
|
|
24
|
+
import { Husky, type HuskyOptions } from '@langri-sha/projen-husky'
|
|
25
|
+
|
|
26
|
+
export interface ProjectOptions
|
|
27
|
+
extends Omit<BaseProjectOptions, 'renovatebot' | 'renovatebotOptions'> {
|
|
21
28
|
/*
|
|
22
29
|
* Pass in to set up Beachball.
|
|
23
30
|
*/
|
|
24
31
|
beachballConfig?: BeachballConfig
|
|
25
32
|
|
|
33
|
+
/*
|
|
34
|
+
* Pass in to set up Beachball.
|
|
35
|
+
*/
|
|
36
|
+
codeownersOptions?: CodeownersOptions
|
|
37
|
+
|
|
26
38
|
/**
|
|
27
39
|
* EditorConfig options.
|
|
28
40
|
*/
|
|
29
41
|
editorConfigOptions?: EditorConfigOptions
|
|
30
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Husky options.
|
|
45
|
+
*/
|
|
46
|
+
huskyOptions?: HuskyOptions
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
* Pass in to configure Renovate.
|
|
50
|
+
*/
|
|
51
|
+
renovateOptions?: RenovateOptions
|
|
52
|
+
|
|
31
53
|
/*
|
|
32
54
|
* Options for the linting synthesized files.
|
|
33
55
|
*/
|
|
34
56
|
lintSynthesizedOptions?: LintSynthesizedOptions
|
|
57
|
+
|
|
35
58
|
/*
|
|
36
59
|
* Whether to use Terrafom.
|
|
37
60
|
*/
|
|
@@ -65,9 +88,12 @@ export class Project extends BaseProject {
|
|
|
65
88
|
this.tasks.removeTask('watch')
|
|
66
89
|
|
|
67
90
|
this.#configureBeachball(options)
|
|
91
|
+
this.#configureCodeowners(options)
|
|
68
92
|
this.#configureDefaultTask()
|
|
69
93
|
this.#configureEditorConfig(options)
|
|
94
|
+
this.#configureHusky(options)
|
|
70
95
|
this.#configureLintSynthesized(options)
|
|
96
|
+
this.#configureRenovate(options)
|
|
71
97
|
this.#createPnpmWorkspaces(options)
|
|
72
98
|
}
|
|
73
99
|
|
|
@@ -101,22 +127,20 @@ export class Project extends BaseProject {
|
|
|
101
127
|
}
|
|
102
128
|
}
|
|
103
129
|
|
|
130
|
+
#configureCodeowners({ codeownersOptions }: ProjectOptions) {
|
|
131
|
+
if (!codeownersOptions) {
|
|
132
|
+
return
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
new Codeowners(this, codeownersOptions)
|
|
136
|
+
}
|
|
137
|
+
|
|
104
138
|
#configureDefaultTask() {
|
|
105
139
|
this.tasks
|
|
106
140
|
.tryFind('default')
|
|
107
141
|
?.exec(`node --loader ts-node/esm .projenrc.mts`)
|
|
108
142
|
}
|
|
109
143
|
|
|
110
|
-
#configureLintSynthesized({ lintSynthesizedOptions }: ProjectOptions) {
|
|
111
|
-
new LintSynthesized(
|
|
112
|
-
this,
|
|
113
|
-
lintSynthesizedOptions ?? {
|
|
114
|
-
'*.{js,jsx,ts,tsx}': 'pnpm eslint --fix',
|
|
115
|
-
'*': 'pnpm prettier --write --ignore-unknown',
|
|
116
|
-
},
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
144
|
#configureEditorConfig({ editorConfigOptions }: ProjectOptions) {
|
|
121
145
|
if (!editorConfigOptions) {
|
|
122
146
|
return
|
|
@@ -124,7 +148,6 @@ export class Project extends BaseProject {
|
|
|
124
148
|
|
|
125
149
|
const defaults: EditorConfigOptions = {
|
|
126
150
|
'*': {
|
|
127
|
-
// eslint-disable-next-line unicorn/text-encoding-identifier-case
|
|
128
151
|
charset: 'utf-8',
|
|
129
152
|
end_of_line: 'lf',
|
|
130
153
|
indent_style: 'space',
|
|
@@ -140,6 +163,39 @@ export class Project extends BaseProject {
|
|
|
140
163
|
new EditorConfig(this, deepMerge(editorConfigOptions ?? {}, defaults))
|
|
141
164
|
}
|
|
142
165
|
|
|
166
|
+
#configureHusky({ huskyOptions }: ProjectOptions) {
|
|
167
|
+
if (!huskyOptions) {
|
|
168
|
+
return
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
new Husky(this, huskyOptions)
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
#configureLintSynthesized({ lintSynthesizedOptions }: ProjectOptions) {
|
|
175
|
+
new LintSynthesized(
|
|
176
|
+
this,
|
|
177
|
+
lintSynthesizedOptions ?? {
|
|
178
|
+
'*.{js,jsx,ts,tsx}': 'pnpm eslint --fix',
|
|
179
|
+
'*': 'pnpm prettier --write --ignore-unknown',
|
|
180
|
+
},
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
#configureRenovate({ renovateOptions }: ProjectOptions) {
|
|
185
|
+
if (!renovateOptions) {
|
|
186
|
+
return
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const defaults: RenovateOptions = {
|
|
190
|
+
configMigration: true,
|
|
191
|
+
extends: ['config:recommended'],
|
|
192
|
+
labels: ['dependencies'],
|
|
193
|
+
reviewersFromCodeOwners: true,
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
new Renovate(this, deepMerge(defaults, renovateOptions))
|
|
197
|
+
}
|
|
198
|
+
|
|
143
199
|
#createPnpmWorkspaces({ workspaces }: ProjectOptions) {
|
|
144
200
|
if (!workspaces) {
|
|
145
201
|
return
|
|
@@ -156,6 +212,7 @@ export class Project extends BaseProject {
|
|
|
156
212
|
}
|
|
157
213
|
|
|
158
214
|
const getGitIgnoreOptions = ({
|
|
215
|
+
huskyOptions,
|
|
159
216
|
withTerraform,
|
|
160
217
|
withTypeScript,
|
|
161
218
|
...options
|
|
@@ -167,12 +224,9 @@ const getGitIgnoreOptions = ({
|
|
|
167
224
|
!.babelrc
|
|
168
225
|
!.dockerignore
|
|
169
226
|
!.editorconfig
|
|
170
|
-
!.eslintignore
|
|
171
|
-
!.eslintrc.js
|
|
172
227
|
!.gitattributes
|
|
173
228
|
!.gitignore
|
|
174
229
|
!.gitkeep
|
|
175
|
-
!.husky
|
|
176
230
|
!.npmignore
|
|
177
231
|
!.openssl
|
|
178
232
|
!.prettierignore
|
|
@@ -183,7 +237,7 @@ const getGitIgnoreOptions = ({
|
|
|
183
237
|
${withTypeScript ? '*.tsbuildinfo' : ''}
|
|
184
238
|
|
|
185
239
|
!.github/
|
|
186
|
-
!.husky/
|
|
240
|
+
${huskyOptions ? '!.husky/' : ''}
|
|
187
241
|
!.projen/
|
|
188
242
|
${options.workspaces?.map((workspace) => `${workspace}/lib/`).join('\n') ?? ''}
|
|
189
243
|
node_modules/
|