@langri-sha/projen-project 0.4.1 → 0.5.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 +30 -1
- package/CHANGELOG.md +11 -2
- package/lib/index.d.ts +5 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +26 -6
- package/lib/index.js.map +1 -1
- package/package.json +4 -2
- package/readme +10 -13
- package/src/index.ts +53 -11
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,36 @@
|
|
|
2
2
|
"name": "@langri-sha/projen-project",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Mon, 06 May 2024 02:32:43 GMT",
|
|
6
|
+
"version": "0.5.0",
|
|
7
|
+
"tag": "@langri-sha/projen-project_v0.5.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "filip.dupanovic@gmail.com",
|
|
12
|
+
"package": "@langri-sha/projen-project",
|
|
13
|
+
"commit": "4ce9a634d76fb8287290e07ae33aa37e3b6151b4",
|
|
14
|
+
"comment": "feat(project): Add support for configuring code owners"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "filip.dupanovic@gmail.com",
|
|
18
|
+
"package": "@langri-sha/projen-project",
|
|
19
|
+
"commit": "4ce9a634d76fb8287290e07ae33aa37e3b6151b4",
|
|
20
|
+
"comment": "feat(projen-project): Manage Renovate configuration"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"none": [
|
|
24
|
+
{
|
|
25
|
+
"author": "filip.dupanovic@gmail.com",
|
|
26
|
+
"package": "@langri-sha/projen-project",
|
|
27
|
+
"commit": "4ce9a634d76fb8287290e07ae33aa37e3b6151b4",
|
|
28
|
+
"comment": "feat(projen-project): Update documentation"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"date": "Fri, 03 May 2024 12:54:50 GMT",
|
|
6
35
|
"version": "0.4.1",
|
|
7
36
|
"tag": "@langri-sha/projen-project_v0.4.1",
|
|
8
37
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
# Change Log - @langri-sha/projen-project
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 06 May 2024 02:32:43 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.5.0
|
|
8
|
+
|
|
9
|
+
Mon, 06 May 2024 02:32:43 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- feat(project): Add support for configuring code owners (filip.dupanovic@gmail.com)
|
|
14
|
+
- feat(projen-project): Manage Renovate configuration (filip.dupanovic@gmail.com)
|
|
15
|
+
|
|
7
16
|
## 0.4.1
|
|
8
17
|
|
|
9
|
-
Fri, 03 May 2024 12:54:
|
|
18
|
+
Fri, 03 May 2024 12:54:50 GMT
|
|
10
19
|
|
|
11
20
|
### Patches
|
|
12
21
|
|
package/lib/index.d.ts
CHANGED
|
@@ -2,12 +2,16 @@ 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
|
+
export interface ProjectOptions extends Omit<BaseProjectOptions, 'renovatebot' | 'renovatebotOptions'> {
|
|
6
8
|
beachballConfig?: BeachballConfig;
|
|
9
|
+
codeownersOptions?: CodeownersOptions;
|
|
7
10
|
/**
|
|
8
11
|
* EditorConfig options.
|
|
9
12
|
*/
|
|
10
13
|
editorConfigOptions?: EditorConfigOptions;
|
|
14
|
+
renovateOptions?: RenovateOptions;
|
|
11
15
|
lintSynthesizedOptions?: LintSynthesizedOptions;
|
|
12
16
|
withTerraform?: boolean;
|
|
13
17
|
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,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AAEhD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAA;
|
|
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,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AAEhD,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAE5E,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,aAAa,GAAG,oBAAoB,CAAC;IAItE,eAAe,CAAC,EAAE,eAAe,CAAA;IAKjC,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IAKzC,eAAe,CAAC,EAAE,eAAe,CAAA;IAKjC,sBAAsB,CAAC,EAAE,sBAAsB,CAAA;IAK/C,aAAa,CAAC,EAAE,OAAO,CAAA;IAKvB,cAAc,CAAC,EAAE,OAAO,CAAA;IAKxB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB;AAED,qBAAa,OAAQ,SAAQ,WAAW;;gBAC1B,OAAO,EAAE,cAAc;CAiIpC"}
|
package/lib/index.js
CHANGED
|
@@ -3,11 +3,13 @@ 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_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';
|
|
11
13
|
export class Project extends BaseProject {
|
|
12
14
|
constructor(options) {
|
|
13
15
|
super({
|
|
@@ -24,9 +26,11 @@ export class Project extends BaseProject {
|
|
|
24
26
|
this.tasks.removeTask('pre-compile');
|
|
25
27
|
this.tasks.removeTask('watch');
|
|
26
28
|
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureBeachball).call(this, options);
|
|
29
|
+
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureCodeowners).call(this, options);
|
|
27
30
|
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureDefaultTask).call(this);
|
|
28
31
|
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureEditorConfig).call(this, options);
|
|
29
32
|
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureLintSynthesized).call(this, options);
|
|
33
|
+
__classPrivateFieldGet(this, _Project_instances, "m", _Project_configureRenovate).call(this, options);
|
|
30
34
|
__classPrivateFieldGet(this, _Project_instances, "m", _Project_createPnpmWorkspaces).call(this, options);
|
|
31
35
|
}
|
|
32
36
|
}
|
|
@@ -55,15 +59,15 @@ _Project_instances = new WeakSet(), _Project_configureBeachball = function _Proj
|
|
|
55
59
|
]) {
|
|
56
60
|
file.addLine(line);
|
|
57
61
|
}
|
|
62
|
+
}, _Project_configureCodeowners = function _Project_configureCodeowners({ codeownersOptions }) {
|
|
63
|
+
if (!codeownersOptions) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
new Codeowners(this, codeownersOptions);
|
|
58
67
|
}, _Project_configureDefaultTask = function _Project_configureDefaultTask() {
|
|
59
68
|
this.tasks
|
|
60
69
|
.tryFind('default')
|
|
61
70
|
?.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
71
|
}, _Project_configureEditorConfig = function _Project_configureEditorConfig({ editorConfigOptions }) {
|
|
68
72
|
if (!editorConfigOptions) {
|
|
69
73
|
return;
|
|
@@ -83,6 +87,22 @@ _Project_instances = new WeakSet(), _Project_configureBeachball = function _Proj
|
|
|
83
87
|
},
|
|
84
88
|
};
|
|
85
89
|
new EditorConfig(this, deepMerge(editorConfigOptions ?? {}, defaults));
|
|
90
|
+
}, _Project_configureLintSynthesized = function _Project_configureLintSynthesized({ lintSynthesizedOptions }) {
|
|
91
|
+
new LintSynthesized(this, lintSynthesizedOptions ?? {
|
|
92
|
+
'*.{js,jsx,ts,tsx}': 'pnpm eslint --fix',
|
|
93
|
+
'*': 'pnpm prettier --write --ignore-unknown',
|
|
94
|
+
});
|
|
95
|
+
}, _Project_configureRenovate = function _Project_configureRenovate({ renovateOptions }) {
|
|
96
|
+
if (!renovateOptions) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const defaults = {
|
|
100
|
+
configMigration: true,
|
|
101
|
+
extends: ['config:recommended'],
|
|
102
|
+
labels: ['dependencies'],
|
|
103
|
+
reviewersFromCodeOwners: true,
|
|
104
|
+
};
|
|
105
|
+
new Renovate(this, deepMerge(defaults, renovateOptions));
|
|
86
106
|
}, _Project_createPnpmWorkspaces = function _Project_createPnpmWorkspaces({ workspaces }) {
|
|
87
107
|
if (!workspaces) {
|
|
88
108
|
return;
|
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,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c,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE;;;;;MAKrC,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.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -8,8 +8,10 @@
|
|
|
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",
|
|
12
|
-
"@langri-sha/projen-lint-synthesized": "0.2.
|
|
13
|
+
"@langri-sha/projen-lint-synthesized": "0.2.2",
|
|
14
|
+
"@langri-sha/projen-renovate": "0.2.0",
|
|
13
15
|
"beachball": "2.43.1",
|
|
14
16
|
"ramda": "0.29.1"
|
|
15
17
|
},
|
package/readme
CHANGED
|
@@ -3,22 +3,19 @@
|
|
|
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]
|
|
10
|
+
- configures [`@langri-sha/tsconfig`] for TypeScript monorepos
|
|
11
|
+
- configures extensive list of Git ignore patterns
|
|
12
|
+
- manages [code owners] with [`@langri-sha/projen-codeowners`]
|
|
20
13
|
|
|
21
|
-
[`@langri-sha/
|
|
14
|
+
[`@langri-sha/codeowners`]: https://www.npmjs.com/package/@langri-sha/codeowners
|
|
15
|
+
[`@langri-sha/tsconfig`]: https://www.npmjs.com/package/@langri-sha/tsconfig
|
|
16
|
+
[beachball]: https://microsoft.github.io/beachball/
|
|
17
|
+
[code owners]:
|
|
18
|
+
https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
|
|
22
19
|
[pnpm]: https://pnpm.io
|
|
23
20
|
[projen]: https://projen.dev/
|
|
24
21
|
[workspaces]: https://pnpm.io/workspaces
|
package/src/index.ts
CHANGED
|
@@ -16,22 +16,39 @@ import {
|
|
|
16
16
|
EditorConfig,
|
|
17
17
|
type EditorConfigOptions,
|
|
18
18
|
} from '@langri-sha/projen-editorconfig'
|
|
19
|
+
import {
|
|
20
|
+
Codeowners,
|
|
21
|
+
type CodeownersOptions,
|
|
22
|
+
} from '@langri-sha/projen-codeowners'
|
|
23
|
+
import { Renovate, type RenovateOptions } from '@langri-sha/projen-renovate'
|
|
19
24
|
|
|
20
|
-
export interface ProjectOptions
|
|
25
|
+
export interface ProjectOptions
|
|
26
|
+
extends Omit<BaseProjectOptions, 'renovatebot' | 'renovatebotOptions'> {
|
|
21
27
|
/*
|
|
22
28
|
* Pass in to set up Beachball.
|
|
23
29
|
*/
|
|
24
30
|
beachballConfig?: BeachballConfig
|
|
25
31
|
|
|
32
|
+
/*
|
|
33
|
+
* Pass in to set up Beachball.
|
|
34
|
+
*/
|
|
35
|
+
codeownersOptions?: CodeownersOptions
|
|
36
|
+
|
|
26
37
|
/**
|
|
27
38
|
* EditorConfig options.
|
|
28
39
|
*/
|
|
29
40
|
editorConfigOptions?: EditorConfigOptions
|
|
30
41
|
|
|
42
|
+
/*
|
|
43
|
+
* Pass in to configure Renovate.
|
|
44
|
+
*/
|
|
45
|
+
renovateOptions?: RenovateOptions
|
|
46
|
+
|
|
31
47
|
/*
|
|
32
48
|
* Options for the linting synthesized files.
|
|
33
49
|
*/
|
|
34
50
|
lintSynthesizedOptions?: LintSynthesizedOptions
|
|
51
|
+
|
|
35
52
|
/*
|
|
36
53
|
* Whether to use Terrafom.
|
|
37
54
|
*/
|
|
@@ -65,9 +82,11 @@ export class Project extends BaseProject {
|
|
|
65
82
|
this.tasks.removeTask('watch')
|
|
66
83
|
|
|
67
84
|
this.#configureBeachball(options)
|
|
85
|
+
this.#configureCodeowners(options)
|
|
68
86
|
this.#configureDefaultTask()
|
|
69
87
|
this.#configureEditorConfig(options)
|
|
70
88
|
this.#configureLintSynthesized(options)
|
|
89
|
+
this.#configureRenovate(options)
|
|
71
90
|
this.#createPnpmWorkspaces(options)
|
|
72
91
|
}
|
|
73
92
|
|
|
@@ -101,22 +120,20 @@ export class Project extends BaseProject {
|
|
|
101
120
|
}
|
|
102
121
|
}
|
|
103
122
|
|
|
123
|
+
#configureCodeowners({ codeownersOptions }: ProjectOptions) {
|
|
124
|
+
if (!codeownersOptions) {
|
|
125
|
+
return
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
new Codeowners(this, codeownersOptions)
|
|
129
|
+
}
|
|
130
|
+
|
|
104
131
|
#configureDefaultTask() {
|
|
105
132
|
this.tasks
|
|
106
133
|
.tryFind('default')
|
|
107
134
|
?.exec(`node --loader ts-node/esm .projenrc.mts`)
|
|
108
135
|
}
|
|
109
136
|
|
|
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
137
|
#configureEditorConfig({ editorConfigOptions }: ProjectOptions) {
|
|
121
138
|
if (!editorConfigOptions) {
|
|
122
139
|
return
|
|
@@ -140,6 +157,31 @@ export class Project extends BaseProject {
|
|
|
140
157
|
new EditorConfig(this, deepMerge(editorConfigOptions ?? {}, defaults))
|
|
141
158
|
}
|
|
142
159
|
|
|
160
|
+
#configureLintSynthesized({ lintSynthesizedOptions }: ProjectOptions) {
|
|
161
|
+
new LintSynthesized(
|
|
162
|
+
this,
|
|
163
|
+
lintSynthesizedOptions ?? {
|
|
164
|
+
'*.{js,jsx,ts,tsx}': 'pnpm eslint --fix',
|
|
165
|
+
'*': 'pnpm prettier --write --ignore-unknown',
|
|
166
|
+
},
|
|
167
|
+
)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
#configureRenovate({ renovateOptions }: ProjectOptions) {
|
|
171
|
+
if (!renovateOptions) {
|
|
172
|
+
return
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const defaults: RenovateOptions = {
|
|
176
|
+
configMigration: true,
|
|
177
|
+
extends: ['config:recommended'],
|
|
178
|
+
labels: ['dependencies'],
|
|
179
|
+
reviewersFromCodeOwners: true,
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
new Renovate(this, deepMerge(defaults, renovateOptions))
|
|
183
|
+
}
|
|
184
|
+
|
|
143
185
|
#createPnpmWorkspaces({ workspaces }: ProjectOptions) {
|
|
144
186
|
if (!workspaces) {
|
|
145
187
|
return
|