lerna-projen 0.1.62 → 0.1.64
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/.jsii
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"lerna-projen": "bin/lerna-projen"
|
|
11
11
|
},
|
|
12
12
|
"bundled": {
|
|
13
|
-
"commander": "^10.0.
|
|
13
|
+
"commander": "^10.0.1",
|
|
14
14
|
"fs-extra": "^9.1.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"projen": "^0.
|
|
17
|
+
"projen": "^0.71.15"
|
|
18
18
|
},
|
|
19
19
|
"dependencyClosure": {
|
|
20
20
|
"projen": {
|
|
@@ -781,6 +781,6 @@
|
|
|
781
781
|
"symbolId": "src/types:TaskCustomization"
|
|
782
782
|
}
|
|
783
783
|
},
|
|
784
|
-
"version": "0.1.
|
|
785
|
-
"fingerprint": "
|
|
784
|
+
"version": "0.1.64",
|
|
785
|
+
"fingerprint": "U0RE6cPoB5MzaTfDneHwfG/7m2YRXaiB9od0729Chao="
|
|
786
786
|
}
|
package/API.md
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
+
# lerna-projen
|
|
2
|
+
|
|
3
|
+
Inspired by [projen](https://github.com/projen/projen) and [lerna](https://github.com/lerna/lerna)
|
|
4
|
+
|
|
5
|
+
This is a library to use manage mono repositories using projen.
|
|
6
|
+
|
|
7
|
+
## Getting started
|
|
8
|
+
|
|
9
|
+
To create a new project, run the following command and follow the instructions:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
console
|
|
13
|
+
$ mkdir my-project
|
|
14
|
+
$ cd my-project
|
|
15
|
+
$ git init
|
|
16
|
+
$ npx projen new --from lerna-projen lerna-project
|
|
17
|
+
🤖 Synthesizing project...
|
|
18
|
+
...
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The project type can be anything to start with, then in the `projenrc` file, initiate a lerna project and add all of the sub normal projen project to the lerna project.
|
|
22
|
+
|
|
23
|
+
### Example
|
|
24
|
+
```javascript
|
|
25
|
+
const { LernaProject } = require('lerna-projen');
|
|
26
|
+
const { TypeScriptProject } = require('projen');
|
|
27
|
+
|
|
28
|
+
const parentProject = new LernaProject({
|
|
29
|
+
name: 'my-parent-project',
|
|
30
|
+
...
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const firstProject = new TypeScriptProject({
|
|
34
|
+
name: 'my-first-project',
|
|
35
|
+
parent: parentProject,
|
|
36
|
+
...
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
parentProject.addSubProject(firstProject);
|
|
40
|
+
|
|
41
|
+
parentProject.synth()
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The rest of the process is taken care of by projen. All of the scripts on the parent project are chained by running the same command from the sub project using lerna.
|
|
45
|
+
|
|
1
46
|
# API Reference <a name="API Reference" id="api-reference"></a>
|
|
2
47
|
|
|
3
48
|
|
|
@@ -1145,7 +1190,9 @@ Options for privately hosted scoped packages.
|
|
|
1145
1190
|
|
|
1146
1191
|
---
|
|
1147
1192
|
|
|
1148
|
-
#####
|
|
1193
|
+
##### ~~`scripts`~~<sup>Optional</sup> <a name="scripts" id="lerna-projen.LernaProjectOptions.property.scripts"></a>
|
|
1194
|
+
|
|
1195
|
+
- *Deprecated:* use `project.addTask()` or `package.setScript()`
|
|
1149
1196
|
|
|
1150
1197
|
```typescript
|
|
1151
1198
|
public readonly scripts: {[ key: string ]: string};
|
|
@@ -1158,6 +1205,7 @@ npm scripts to include.
|
|
|
1158
1205
|
|
|
1159
1206
|
If a script has the same name as a standard script,
|
|
1160
1207
|
the standard script will be overwritten.
|
|
1208
|
+
Also adds the script as a task.
|
|
1161
1209
|
|
|
1162
1210
|
---
|
|
1163
1211
|
|
|
@@ -3120,7 +3168,9 @@ Options for privately hosted scoped packages.
|
|
|
3120
3168
|
|
|
3121
3169
|
---
|
|
3122
3170
|
|
|
3123
|
-
#####
|
|
3171
|
+
##### ~~`scripts`~~<sup>Optional</sup> <a name="scripts" id="lerna-projen.LernaTypescriptProjectOptions.property.scripts"></a>
|
|
3172
|
+
|
|
3173
|
+
- *Deprecated:* use `project.addTask()` or `package.setScript()`
|
|
3124
3174
|
|
|
3125
3175
|
```typescript
|
|
3126
3176
|
public readonly scripts: {[ key: string ]: string};
|
|
@@ -3133,6 +3183,7 @@ npm scripts to include.
|
|
|
3133
3183
|
|
|
3134
3184
|
If a script has the same name as a standard script,
|
|
3135
3185
|
the standard script will be overwritten.
|
|
3186
|
+
Also adds the script as a task.
|
|
3136
3187
|
|
|
3137
3188
|
---
|
|
3138
3189
|
|
|
@@ -4802,7 +4853,7 @@ DEPRECATED.
|
|
|
4802
4853
|
|
|
4803
4854
|
---
|
|
4804
4855
|
|
|
4805
|
-
#####
|
|
4856
|
+
##### ~~`hasScript`~~ <a name="hasScript" id="lerna-projen.LernaProject.hasScript"></a>
|
|
4806
4857
|
|
|
4807
4858
|
```typescript
|
|
4808
4859
|
public hasScript(name: string): boolean
|
|
@@ -6164,7 +6215,7 @@ DEPRECATED.
|
|
|
6164
6215
|
|
|
6165
6216
|
---
|
|
6166
6217
|
|
|
6167
|
-
#####
|
|
6218
|
+
##### ~~`hasScript`~~ <a name="hasScript" id="lerna-projen.LernaTypescriptProject.hasScript"></a>
|
|
6168
6219
|
|
|
6169
6220
|
```typescript
|
|
6170
6221
|
public hasScript(name: string): boolean
|
package/lib/index.js
CHANGED
|
@@ -90,7 +90,7 @@ class LernaProject extends projen_1.javascript.NodeProject {
|
|
|
90
90
|
}
|
|
91
91
|
exports.LernaProject = LernaProject;
|
|
92
92
|
_a = JSII_RTTI_SYMBOL_1;
|
|
93
|
-
LernaProject[_a] = { fqn: "lerna-projen.LernaProject", version: "0.1.
|
|
93
|
+
LernaProject[_a] = { fqn: "lerna-projen.LernaProject", version: "0.1.64" };
|
|
94
94
|
/**
|
|
95
95
|
* @pjid lerna-ts-project
|
|
96
96
|
*/
|
|
@@ -135,7 +135,7 @@ class LernaTypescriptProject extends projen_1.typescript.TypeScriptProject {
|
|
|
135
135
|
}
|
|
136
136
|
exports.LernaTypescriptProject = LernaTypescriptProject;
|
|
137
137
|
_b = JSII_RTTI_SYMBOL_1;
|
|
138
|
-
LernaTypescriptProject[_b] = { fqn: "lerna-projen.LernaTypescriptProject", version: "0.1.
|
|
138
|
+
LernaTypescriptProject[_b] = { fqn: "lerna-projen.LernaTypescriptProject", version: "0.1.64" };
|
|
139
139
|
class LernaProjectFactory {
|
|
140
140
|
constructor(project) {
|
|
141
141
|
this.project = project;
|
|
@@ -730,6 +730,8 @@ The supported events are:
|
|
|
730
730
|
| `preAction`, `postAction` | before/after action handler for this command and its nested subcommands | `(thisCommand, actionCommand)` |
|
|
731
731
|
| `preSubcommand` | before parsing direct subcommand | `(thisCommand, subcommand)` |
|
|
732
732
|
|
|
733
|
+
For an overview of the life cycle events see [parsing life cycle and hooks](./docs/parsing-and-hooks.md).
|
|
734
|
+
|
|
733
735
|
## Automated help
|
|
734
736
|
|
|
735
737
|
The help information is auto-generated based on the information commander already knows about your program. The default
|
|
@@ -761,6 +763,8 @@ shell help spawn
|
|
|
761
763
|
shell spawn --help
|
|
762
764
|
```
|
|
763
765
|
|
|
766
|
+
Long descriptions are wrapped to fit the available width. (However, a description that includes a line-break followed by whitespace is assumed to be pre-formatted and not wrapped.)
|
|
767
|
+
|
|
764
768
|
### Custom help
|
|
765
769
|
|
|
766
770
|
You can add extra text to be displayed along with the built-in help.
|
|
@@ -919,7 +923,7 @@ The data properties are:
|
|
|
919
923
|
- `sortOptions`: sort the options alphabetically
|
|
920
924
|
- `showGlobalOptions`: show a section with the global options from the parent command(s)
|
|
921
925
|
|
|
922
|
-
There are methods getting the visible lists of arguments, options, and subcommands. There are methods for formatting the items in the lists, with each item having a _term_ and _description_. Take a look at `.formatHelp()` to see how they are used.
|
|
926
|
+
You can override any method on the [Help](./lib/help.js) class. There are methods getting the visible lists of arguments, options, and subcommands. There are methods for formatting the items in the lists, with each item having a _term_ and _description_. Take a look at `.formatHelp()` to see how they are used.
|
|
923
927
|
|
|
924
928
|
Example file: [configure-help.js](./examples/configure-help.js)
|
|
925
929
|
|
|
@@ -1114,6 +1118,7 @@ There is more information available about:
|
|
|
1114
1118
|
|
|
1115
1119
|
- [deprecated](./docs/deprecated.md) features still supported for backwards compatibility
|
|
1116
1120
|
- [options taking varying arguments](./docs/options-taking-varying-arguments.md)
|
|
1121
|
+
- [parsing life cycle and hooks](./docs/parsing-and-hooks.md)
|
|
1117
1122
|
|
|
1118
1123
|
## Support
|
|
1119
1124
|
|
|
@@ -99,7 +99,12 @@ class Option {
|
|
|
99
99
|
* @return {Option}
|
|
100
100
|
*/
|
|
101
101
|
implies(impliedOptionValues) {
|
|
102
|
-
|
|
102
|
+
let newImplied = impliedOptionValues;
|
|
103
|
+
if (typeof impliedOptionValues === 'string') {
|
|
104
|
+
// string is not documented, but easy mistake and we can do what user probably intended.
|
|
105
|
+
newImplied = { [impliedOptionValues]: true };
|
|
106
|
+
}
|
|
107
|
+
this.implied = Object.assign(this.implied || {}, newImplied);
|
|
103
108
|
return this;
|
|
104
109
|
}
|
|
105
110
|
|
|
@@ -89,7 +89,6 @@ export class Option {
|
|
|
89
89
|
optional: boolean; // A value is optional when the option is specified.
|
|
90
90
|
variadic: boolean;
|
|
91
91
|
mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.
|
|
92
|
-
optionFlags: string;
|
|
93
92
|
short?: string;
|
|
94
93
|
long?: string;
|
|
95
94
|
negate: boolean;
|
package/package.json
CHANGED
|
@@ -54,26 +54,30 @@
|
|
|
54
54
|
"jest-junit": "^15",
|
|
55
55
|
"jsii": "1.x",
|
|
56
56
|
"jsii-diff": "^1.80.0",
|
|
57
|
-
"jsii-docgen": "^7.1
|
|
57
|
+
"jsii-docgen": "^7.2.1",
|
|
58
58
|
"jsii-pacmak": "^1.80.0",
|
|
59
59
|
"npm-check-updates": "^16",
|
|
60
|
-
"projen": "^0.
|
|
60
|
+
"projen": "^0.71.15",
|
|
61
61
|
"standard-version": "^9",
|
|
62
62
|
"ts-jest": "^27",
|
|
63
63
|
"ts-node": "^10.9.1",
|
|
64
64
|
"typescript": "^4.9.5"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"projen": "^0.
|
|
67
|
+
"projen": "^0.71.15"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"commander": "^10.0.
|
|
70
|
+
"commander": "^10.0.1",
|
|
71
71
|
"fs-extra": "^9.1.0"
|
|
72
72
|
},
|
|
73
73
|
"bundledDependencies": [
|
|
74
74
|
"commander",
|
|
75
75
|
"fs-extra"
|
|
76
76
|
],
|
|
77
|
+
"overrides": {
|
|
78
|
+
"@types/prettier": "2.6.0",
|
|
79
|
+
"@types/babel__traverse": "7.18.2"
|
|
80
|
+
},
|
|
77
81
|
"keywords": [
|
|
78
82
|
"lerna",
|
|
79
83
|
"monorepo",
|
|
@@ -82,7 +86,7 @@
|
|
|
82
86
|
],
|
|
83
87
|
"main": "lib/index.js",
|
|
84
88
|
"license": "Apache-2.0",
|
|
85
|
-
"version": "0.1.
|
|
89
|
+
"version": "0.1.64",
|
|
86
90
|
"jest": {
|
|
87
91
|
"testMatch": [
|
|
88
92
|
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
|
|
@@ -133,9 +137,5 @@
|
|
|
133
137
|
"rootDir": "src"
|
|
134
138
|
}
|
|
135
139
|
},
|
|
136
|
-
"overrides": {
|
|
137
|
-
"@types/prettier": "2.6.0",
|
|
138
|
-
"@types/babel__traverse": "7.18.2"
|
|
139
|
-
},
|
|
140
140
|
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
|
|
141
141
|
}
|