pob 15.0.2 → 15.1.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.md +24 -0
- package/lib/generators/app/PobAppGenerator.js +26 -21
- package/lib/generators/common/format-lint/CommonLintGenerator.js +16 -3
- package/lib/generators/common/testing/CommonTestingGenerator.js +13 -11
- package/lib/generators/common/typescript/CommonTypescriptGenerator.js +3 -3
- package/lib/generators/common/typescript/templates/tsconfig.json.ejs +3 -3
- package/lib/generators/core/git/CoreGitGenerator.js +2 -2
- package/lib/generators/core/yarn/CoreYarnGenerator.js +2 -7
- package/lib/generators/lib/PobLibGenerator.js +15 -15
- package/lib/generators/monorepo/PobMonorepoGenerator.js +12 -12
- package/lib/generators/pob/PobBaseGenerator.js +12 -12
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [15.1.0](https://github.com/christophehurpeau/pob/compare/pob@15.0.3...pob@15.1.0) (2023-11-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** update dependency @types/inquirer to v9.0.7 ([#1839](https://github.com/christophehurpeau/pob/issues/1839)) ([0f2bfb3](https://github.com/christophehurpeau/pob/commit/0f2bfb3b020287c49aa6a0ee37254a11ed3089cd))
|
|
12
|
+
* **deps:** update yeoman group ([#1810](https://github.com/christophehurpeau/pob/issues/1810)) ([cd69295](https://github.com/christophehurpeau/pob/commit/cd692950f15e4f64c8e392f282f6981c797773eb))
|
|
13
|
+
* **pob:** add missing async/await with composeWith ([4b679d5](https://github.com/christophehurpeau/pob/commit/4b679d521430af32fcd6bf8f0fe5dce53c1e68e6))
|
|
14
|
+
|
|
15
|
+
Version bump for dependency: yarn-workspace-utils
|
|
16
|
+
Version bump for dependency: root
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## [15.0.3](https://github.com/christophehurpeau/pob/compare/pob@15.0.2...pob@15.0.3) (2023-11-05)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* **pob:** ignore install plugin version for source package ([cf5312b](https://github.com/christophehurpeau/pob/commit/cf5312bbc94db00def686337c1e6e32822a584a7))
|
|
25
|
+
* srcDirectory for yarn plugin package ([97a0977](https://github.com/christophehurpeau/pob/commit/97a097721d6296d576bd78521b4313fcbbe28860))
|
|
26
|
+
|
|
27
|
+
Version bump for dependency: yarn-workspace-utils
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [15.0.2](https://github.com/christophehurpeau/pob/compare/pob@15.0.1...pob@15.0.2) (2023-11-05)
|
|
7
31
|
|
|
8
32
|
Note: no notable changes
|
|
@@ -127,8 +127,9 @@ export default class PobAppGenerator extends Generator {
|
|
|
127
127
|
this.config.save();
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
default() {
|
|
131
|
-
const
|
|
130
|
+
async default() {
|
|
131
|
+
const srcDirectory =
|
|
132
|
+
this.appConfig.type === 'yarn-plugin' ? 'sources' : 'src';
|
|
132
133
|
const isAppLibrary = this.appConfig.type === 'node-library';
|
|
133
134
|
|
|
134
135
|
if (
|
|
@@ -136,7 +137,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
136
137
|
this.appConfig.type === 'node-library' ||
|
|
137
138
|
this.appConfig.type === 'alp-node'
|
|
138
139
|
) {
|
|
139
|
-
this.composeWith('pob:common:babel', {
|
|
140
|
+
await this.composeWith('pob:common:babel', {
|
|
140
141
|
updateOnly: this.options.updateOnly,
|
|
141
142
|
onlyLatestLTS: true,
|
|
142
143
|
isApp: true,
|
|
@@ -152,7 +153,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
152
153
|
const pkg = this.fs.readJSON(this.destinationPath('package.json'));
|
|
153
154
|
|
|
154
155
|
if (!inMonorepo || inMonorepo.root) {
|
|
155
|
-
this.composeWith('pob:common:husky', {});
|
|
156
|
+
await this.composeWith('pob:common:husky', {});
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
const babelEnvs = (pkg.pob && pkg.pob.babelEnvs) || [];
|
|
@@ -174,13 +175,13 @@ export default class PobAppGenerator extends Generator {
|
|
|
174
175
|
pkg,
|
|
175
176
|
).filter(Boolean);
|
|
176
177
|
|
|
177
|
-
this.composeWith('pob:common:typescript', {
|
|
178
|
+
await this.composeWith('pob:common:typescript', {
|
|
178
179
|
enable: babel,
|
|
179
180
|
isApp: true,
|
|
180
181
|
isAppLibrary,
|
|
181
182
|
// nextjs now supports src
|
|
182
|
-
rootDir: this.appConfig.type === 'expo' ? '.' :
|
|
183
|
-
|
|
183
|
+
rootDir: this.appConfig.type === 'expo' ? '.' : srcDirectory,
|
|
184
|
+
srcDirectory,
|
|
184
185
|
builddefs: false,
|
|
185
186
|
dom: browser,
|
|
186
187
|
jsx,
|
|
@@ -196,7 +197,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
196
197
|
this.appConfig.type === 'alp-node' ||
|
|
197
198
|
this.appConfig.type === 'next.js'
|
|
198
199
|
) {
|
|
199
|
-
return
|
|
200
|
+
return `./${srcDirectory}`;
|
|
200
201
|
}
|
|
201
202
|
if (this.appConfig.type === 'remix') {
|
|
202
203
|
return '.';
|
|
@@ -205,13 +206,13 @@ export default class PobAppGenerator extends Generator {
|
|
|
205
206
|
})(),
|
|
206
207
|
});
|
|
207
208
|
|
|
208
|
-
this.composeWith('pob:common:remove-old-dependencies');
|
|
209
|
+
await this.composeWith('pob:common:remove-old-dependencies');
|
|
209
210
|
|
|
210
211
|
const enableReleasePlease =
|
|
211
212
|
!inMonorepo && this.appConfig.testing && this.appConfig.ci;
|
|
212
213
|
|
|
213
214
|
if (this.appConfig.type !== 'remix') {
|
|
214
|
-
this.composeWith('pob:common:testing', {
|
|
215
|
+
await this.composeWith('pob:common:testing', {
|
|
215
216
|
enable: this.appConfig.testing,
|
|
216
217
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
217
218
|
enableReleasePlease,
|
|
@@ -225,10 +226,10 @@ export default class PobAppGenerator extends Generator {
|
|
|
225
226
|
isApp: true,
|
|
226
227
|
splitCIJobs: false,
|
|
227
228
|
onlyLatestLTS: true,
|
|
228
|
-
|
|
229
|
+
srcDirectory,
|
|
229
230
|
});
|
|
230
231
|
|
|
231
|
-
this.composeWith('pob:common:format-lint', {
|
|
232
|
+
await this.composeWith('pob:common:format-lint', {
|
|
232
233
|
isApp: true,
|
|
233
234
|
documentation: false,
|
|
234
235
|
testing: this.appConfig.testing,
|
|
@@ -240,11 +241,15 @@ export default class PobAppGenerator extends Generator {
|
|
|
240
241
|
packageManager: this.options.packageManager,
|
|
241
242
|
yarnNodeLinker: this.options.yarnNodeLinker,
|
|
242
243
|
rootIgnorePaths: ignorePaths.join('\n'),
|
|
244
|
+
srcDirectory,
|
|
243
245
|
buildDirectory: this.appConfig.type === 'expo' ? '.expo' : 'build',
|
|
244
246
|
});
|
|
245
247
|
|
|
246
|
-
this.composeWith('pob:common:release', {
|
|
247
|
-
enable:
|
|
248
|
+
await this.composeWith('pob:common:release', {
|
|
249
|
+
enable:
|
|
250
|
+
!inMonorepo &&
|
|
251
|
+
this.appConfig.testing &&
|
|
252
|
+
pkg.name !== 'yarn-plugin-conventional-version',
|
|
248
253
|
enablePublish: false,
|
|
249
254
|
withBabel: babel,
|
|
250
255
|
isMonorepo: false,
|
|
@@ -255,7 +260,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
255
260
|
});
|
|
256
261
|
}
|
|
257
262
|
|
|
258
|
-
this.composeWith('pob:core:vscode', {
|
|
263
|
+
await this.composeWith('pob:core:vscode', {
|
|
259
264
|
root: !inMonorepo,
|
|
260
265
|
monorepo: false,
|
|
261
266
|
packageManager: this.options.packageManager,
|
|
@@ -269,7 +274,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
269
274
|
ignorePaths.push('/.env*', '!/.env.example');
|
|
270
275
|
}
|
|
271
276
|
|
|
272
|
-
this.composeWith('pob:core:gitignore', {
|
|
277
|
+
await this.composeWith('pob:core:gitignore', {
|
|
273
278
|
root: !inMonorepo || inMonorepo.root,
|
|
274
279
|
documentation: false,
|
|
275
280
|
testing: this.appConfig.testing,
|
|
@@ -278,16 +283,16 @@ export default class PobAppGenerator extends Generator {
|
|
|
278
283
|
buildInGit: false,
|
|
279
284
|
});
|
|
280
285
|
|
|
281
|
-
this.composeWith('pob:core:npm', { enable: false });
|
|
286
|
+
await this.composeWith('pob:core:npm', { enable: false });
|
|
282
287
|
|
|
283
288
|
switch (this.appConfig.type) {
|
|
284
289
|
case 'next.js':
|
|
285
|
-
this.composeWith('pob:app:nextjs', {
|
|
290
|
+
await this.composeWith('pob:app:nextjs', {
|
|
286
291
|
export: this.appConfig.export,
|
|
287
292
|
});
|
|
288
293
|
break;
|
|
289
294
|
case 'remix':
|
|
290
|
-
this.composeWith('pob:app:remix', {});
|
|
295
|
+
await this.composeWith('pob:app:remix', {});
|
|
291
296
|
break;
|
|
292
297
|
}
|
|
293
298
|
|
|
@@ -300,7 +305,7 @@ export default class PobAppGenerator extends Generator {
|
|
|
300
305
|
}
|
|
301
306
|
}
|
|
302
307
|
|
|
303
|
-
writing() {
|
|
308
|
+
async writing() {
|
|
304
309
|
// Re-read the content at this point because a composed generator might modify it.
|
|
305
310
|
const pkg = this.fs.readJSON(this.destinationPath('package.json'));
|
|
306
311
|
|
|
@@ -314,6 +319,6 @@ export default class PobAppGenerator extends Generator {
|
|
|
314
319
|
|
|
315
320
|
this.fs.writeJSON(this.destinationPath('package.json'), pkg);
|
|
316
321
|
|
|
317
|
-
this.composeWith('pob:core:sort-package');
|
|
322
|
+
await this.composeWith('pob:core:sort-package');
|
|
318
323
|
}
|
|
319
324
|
}
|
|
@@ -100,6 +100,12 @@ export default class CommonLintGenerator extends Generator {
|
|
|
100
100
|
desc: 'Defines what linker should be used for installing Node packages (useful to enable the node-modules plugin), one of: pnp, node-modules.',
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
+
this.option('srcDirectory', {
|
|
104
|
+
type: String,
|
|
105
|
+
default: 'src',
|
|
106
|
+
desc: 'customize src directory. Default to src',
|
|
107
|
+
});
|
|
108
|
+
|
|
103
109
|
this.option('buildDirectory', {
|
|
104
110
|
type: String,
|
|
105
111
|
required: false,
|
|
@@ -415,7 +421,11 @@ export default class CommonLintGenerator extends Generator {
|
|
|
415
421
|
|
|
416
422
|
const srcEslintrcPath = this.options.rootAsSrc
|
|
417
423
|
? this.destinationPath('.eslintrc.json')
|
|
418
|
-
: this.destinationPath(
|
|
424
|
+
: this.destinationPath(
|
|
425
|
+
`${
|
|
426
|
+
useBabel ? `${this.options.srcDirectory}/` : 'lib/'
|
|
427
|
+
}.eslintrc.json`,
|
|
428
|
+
);
|
|
419
429
|
|
|
420
430
|
const useTypescript = useBabel;
|
|
421
431
|
const getRootIgnorePatterns = () => {
|
|
@@ -515,7 +525,10 @@ export default class CommonLintGenerator extends Generator {
|
|
|
515
525
|
'import/resolver': this.options.enableSrcResolver
|
|
516
526
|
? {
|
|
517
527
|
node: {
|
|
518
|
-
moduleDirectory: [
|
|
528
|
+
moduleDirectory: [
|
|
529
|
+
'node_modules',
|
|
530
|
+
this.options.srcDirectory,
|
|
531
|
+
],
|
|
519
532
|
},
|
|
520
533
|
}
|
|
521
534
|
: false,
|
|
@@ -532,7 +545,7 @@ export default class CommonLintGenerator extends Generator {
|
|
|
532
545
|
|
|
533
546
|
// see monorepo/lerna/index.js
|
|
534
547
|
if (!(inMonorepo && inMonorepo.root) && !this.options.monorepo) {
|
|
535
|
-
const srcDirectory = useBabel ?
|
|
548
|
+
const srcDirectory = useBabel ? this.options.srcDirectory : 'lib';
|
|
536
549
|
const lintRootJsFiles = (useBabel && useNode) || !inMonorepo;
|
|
537
550
|
|
|
538
551
|
const lintPaths = [srcDirectory, 'bin', 'scripts', 'migrations'].filter(
|
|
@@ -95,10 +95,10 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
95
95
|
desc: 'only latest lts',
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
this.option('
|
|
98
|
+
this.option('srcDirectory', {
|
|
99
99
|
type: String,
|
|
100
100
|
default: 'src',
|
|
101
|
-
desc: 'customize
|
|
101
|
+
desc: 'customize srcDirectory, default to "src"',
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
this.option('disableYarnGitCache', {
|
|
@@ -109,9 +109,9 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
default() {
|
|
112
|
+
async default() {
|
|
113
113
|
if (!inMonorepo || inMonorepo.root) {
|
|
114
|
-
this.composeWith('pob:core:ci', {
|
|
114
|
+
await this.composeWith('pob:core:ci', {
|
|
115
115
|
enable: this.options.ci,
|
|
116
116
|
enableReleasePlease: this.options.enableReleasePlease,
|
|
117
117
|
enableYarnVersion: this.options.enableYarnVersion,
|
|
@@ -127,7 +127,7 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
127
127
|
onlyLatestLTS: this.options.onlyLatestLTS,
|
|
128
128
|
});
|
|
129
129
|
} else {
|
|
130
|
-
this.composeWith('pob:core:ci', {
|
|
130
|
+
await this.composeWith('pob:core:ci', {
|
|
131
131
|
enable: false,
|
|
132
132
|
});
|
|
133
133
|
}
|
|
@@ -247,15 +247,15 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
247
247
|
const jestConfig = this.fs.readJSON(jestConfigPath, pkg.jest ?? {});
|
|
248
248
|
delete pkg.jest;
|
|
249
249
|
|
|
250
|
-
const
|
|
250
|
+
const srcDirectory = this.options.srcDirectory;
|
|
251
251
|
Object.assign(jestConfig, {
|
|
252
252
|
cacheDirectory: './node_modules/.cache/jest',
|
|
253
253
|
testEnvironment: 'node',
|
|
254
254
|
testMatch: [
|
|
255
|
-
`<rootDir>/${workspacesPattern}/*/@(${
|
|
255
|
+
`<rootDir>/${workspacesPattern}/*/@(${srcDirectory}|lib)/**/__tests__/**/*.${
|
|
256
256
|
transpileWithBabel ? '(ts|js|cjs|mjs)' : '(js|cjs|mjs)'
|
|
257
257
|
}${hasReact ? '?(x)' : ''}`,
|
|
258
|
-
`<rootDir>/${workspacesPattern}/*/@(${
|
|
258
|
+
`<rootDir>/${workspacesPattern}/*/@(${srcDirectory}|lib)/**/*.test.${
|
|
259
259
|
transpileWithBabel ? '(ts|js|cjs|mjs)' : '(js|cjs|mjs)'
|
|
260
260
|
}${hasReact ? '?(x)' : ''}`,
|
|
261
261
|
],
|
|
@@ -308,7 +308,9 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
308
308
|
});
|
|
309
309
|
|
|
310
310
|
if (this.options.runner === 'jest') {
|
|
311
|
-
const srcDirectory = transpileWithBabel
|
|
311
|
+
const srcDirectory = transpileWithBabel
|
|
312
|
+
? this.options.srcDirectory
|
|
313
|
+
: 'lib';
|
|
312
314
|
|
|
313
315
|
const jestConfig = this.fs.readJSON(jestConfigPath, pkg.jest ?? {});
|
|
314
316
|
delete pkg.jest;
|
|
@@ -400,10 +402,10 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
400
402
|
this.destinationPath('babel.config.cjs'),
|
|
401
403
|
{
|
|
402
404
|
only: !this.options.monorepo
|
|
403
|
-
? `'${this.options.
|
|
405
|
+
? `'${this.options.srcDirectory}'`
|
|
404
406
|
: pkg.workspaces
|
|
405
407
|
.flatMap((workspace) => [
|
|
406
|
-
`'${workspace}/${this.options.
|
|
408
|
+
`'${workspace}/${this.options.srcDirectory}'`,
|
|
407
409
|
`'${workspace}/lib'`,
|
|
408
410
|
])
|
|
409
411
|
.join(', '),
|
|
@@ -32,10 +32,10 @@ export default class CommonTypescriptGenerator extends Generator {
|
|
|
32
32
|
desc: 'customize rootDir',
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
this.option('
|
|
35
|
+
this.option('srcDirectory', {
|
|
36
36
|
type: String,
|
|
37
37
|
default: 'src',
|
|
38
|
-
desc: 'customize
|
|
38
|
+
desc: 'customize srcDirectory, if different than rootDir',
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
this.option('jsx', {
|
|
@@ -205,7 +205,7 @@ export default class CommonTypescriptGenerator extends Generator {
|
|
|
205
205
|
monorepoPackageSrcPaths,
|
|
206
206
|
monorepoPackageReferences,
|
|
207
207
|
rootDir: this.options.rootDir,
|
|
208
|
-
|
|
208
|
+
srcDirectory: this.options.srcDirectory || this.options.rootDir,
|
|
209
209
|
jsx,
|
|
210
210
|
jsxPreserve: this.options.jsxPreserve,
|
|
211
211
|
composite,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"include": [
|
|
3
|
-
"<%=
|
|
4
|
-
"<%=
|
|
3
|
+
"<%= srcDirectory %>/**/*.ts"<% if (jsx) { -%>,
|
|
4
|
+
"<%= srcDirectory %>/**/*.tsx"<% } %><% if (srcDirectory !== rootDir) { -%>,
|
|
5
5
|
"<%= rootDir %>/*.ts"<% } %>
|
|
6
6
|
],
|
|
7
|
-
<% if(
|
|
7
|
+
<% if(srcDirectory === '.' || forceExcludeNodeModules) { -%>
|
|
8
8
|
"exclude": [
|
|
9
9
|
"node_modules"
|
|
10
10
|
],
|
|
@@ -99,9 +99,9 @@ export default class CoreGitGenerator extends Generator {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
default() {
|
|
102
|
+
async default() {
|
|
103
103
|
if (this.gitHost === 'github') {
|
|
104
|
-
this.composeWith('pob:core:git:github', {
|
|
104
|
+
await this.composeWith('pob:core:git:github', {
|
|
105
105
|
shouldCreate: !this.originUrl,
|
|
106
106
|
gitHostAccount: this.gitHostAccount,
|
|
107
107
|
repoName: this.repoName,
|
|
@@ -114,7 +114,7 @@ export default class CoreYarnGenerator extends Generator {
|
|
|
114
114
|
removePluginIfInstalled(postinstallDevPluginName);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
if (pkg.
|
|
117
|
+
if (pkg.name !== 'yarn-plugin-conventional-version') {
|
|
118
118
|
installPluginIfNotInstalled(
|
|
119
119
|
versionPluginName,
|
|
120
120
|
'https://raw.githubusercontent.com/christophehurpeau/yarn-plugin-conventional-version/main/bundles/%40yarnpkg/plugin-conventional-version.cjs',
|
|
@@ -126,11 +126,6 @@ export default class CoreYarnGenerator extends Generator {
|
|
|
126
126
|
return !content.includes('Lifecycle script: preversion');
|
|
127
127
|
},
|
|
128
128
|
);
|
|
129
|
-
} else {
|
|
130
|
-
installPluginIfNotInstalled(
|
|
131
|
-
versionPluginName,
|
|
132
|
-
'https://raw.githubusercontent.com/christophehurpeau/yarn-plugin-conventional-version/main/bundles/%40yarnpkg/plugin-conventional-version.cjs',
|
|
133
|
-
);
|
|
134
129
|
}
|
|
135
130
|
|
|
136
131
|
if (
|
|
@@ -161,7 +156,7 @@ export default class CoreYarnGenerator extends Generator {
|
|
|
161
156
|
};
|
|
162
157
|
}
|
|
163
158
|
config.defaultSemverRangePrefix = this.options.type === 'app' ? '' : '^';
|
|
164
|
-
config.enableMessageNames
|
|
159
|
+
delete config.enableMessageNames; // was a config for yarn < 4
|
|
165
160
|
config.nodeLinker = this.options.yarnNodeLinker;
|
|
166
161
|
|
|
167
162
|
if (config.yarnPath) {
|
|
@@ -230,7 +230,7 @@ export default class PobLibGenerator extends Generator {
|
|
|
230
230
|
|
|
231
231
|
this.fs.writeJSON(this.destinationPath('package.json'), pkg);
|
|
232
232
|
|
|
233
|
-
this.composeWith('pob:common:babel', {
|
|
233
|
+
await this.composeWith('pob:common:babel', {
|
|
234
234
|
updateOnly: this.options.updateOnly,
|
|
235
235
|
testing: !!this.pobjson.testing,
|
|
236
236
|
documentation: !!this.pobjson.documentation,
|
|
@@ -239,7 +239,7 @@ export default class PobLibGenerator extends Generator {
|
|
|
239
239
|
});
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
default() {
|
|
242
|
+
async default() {
|
|
243
243
|
const pkg = this.fs.readJSON(this.destinationPath('package.json'));
|
|
244
244
|
const babelEnvs = pkg.pob.babelEnvs || [];
|
|
245
245
|
|
|
@@ -248,7 +248,7 @@ export default class PobLibGenerator extends Generator {
|
|
|
248
248
|
const browser =
|
|
249
249
|
withBabel && babelEnvs.some((env) => env.target === 'browser');
|
|
250
250
|
|
|
251
|
-
this.composeWith('pob:common:typescript', {
|
|
251
|
+
await this.composeWith('pob:common:typescript', {
|
|
252
252
|
enable: withBabel,
|
|
253
253
|
isApp: false,
|
|
254
254
|
dom: browser,
|
|
@@ -263,14 +263,14 @@ export default class PobLibGenerator extends Generator {
|
|
|
263
263
|
fs.mkdirSync(this.destinationPath('lib'), { recursive: true });
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
this.composeWith('pob:common:husky', {});
|
|
266
|
+
await this.composeWith('pob:common:husky', {});
|
|
267
267
|
|
|
268
|
-
this.composeWith('pob:common:remove-old-dependencies');
|
|
268
|
+
await this.composeWith('pob:common:remove-old-dependencies');
|
|
269
269
|
|
|
270
270
|
const enableReleasePlease =
|
|
271
271
|
!inMonorepo && this.pobjson.testing && this.pobjson.testing.ci;
|
|
272
272
|
|
|
273
|
-
this.composeWith('pob:common:testing', {
|
|
273
|
+
await this.composeWith('pob:common:testing', {
|
|
274
274
|
enable: this.pobjson.testing,
|
|
275
275
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
276
276
|
enableReleasePlease,
|
|
@@ -289,7 +289,7 @@ export default class PobLibGenerator extends Generator {
|
|
|
289
289
|
});
|
|
290
290
|
|
|
291
291
|
// must be after testing
|
|
292
|
-
this.composeWith('pob:common:format-lint', {
|
|
292
|
+
await this.composeWith('pob:common:format-lint', {
|
|
293
293
|
documentation:
|
|
294
294
|
!!this.pobjson.documentation ||
|
|
295
295
|
!!(this.pobjson.testing && this.pobjson.testing.codecov),
|
|
@@ -299,20 +299,20 @@ export default class PobLibGenerator extends Generator {
|
|
|
299
299
|
ignorePaths: withBabel ? '/dist' : '',
|
|
300
300
|
});
|
|
301
301
|
|
|
302
|
-
this.composeWith('pob:lib:doc', {
|
|
302
|
+
await this.composeWith('pob:lib:doc', {
|
|
303
303
|
enabled: this.pobjson.documentation,
|
|
304
304
|
testing: this.pobjson.testing,
|
|
305
305
|
});
|
|
306
306
|
|
|
307
307
|
// must be after doc, testing
|
|
308
|
-
this.composeWith('pob:lib:readme', {
|
|
308
|
+
await this.composeWith('pob:lib:readme', {
|
|
309
309
|
documentation: !!this.pobjson.documentation,
|
|
310
310
|
testing: !!this.pobjson.testing,
|
|
311
311
|
ci: this.pobjson.testing && this.pobjson.testing.ci,
|
|
312
312
|
codecov: this.pobjson.testing && this.pobjson.testing.codecov,
|
|
313
313
|
});
|
|
314
314
|
|
|
315
|
-
this.composeWith('pob:common:release', {
|
|
315
|
+
await this.composeWith('pob:common:release', {
|
|
316
316
|
enable: !inMonorepo && this.pobjson.testing,
|
|
317
317
|
enablePublish: true,
|
|
318
318
|
withBabel: babelEnvs.length > 0,
|
|
@@ -323,7 +323,7 @@ export default class PobLibGenerator extends Generator {
|
|
|
323
323
|
updateOnly: this.options.updateOnly,
|
|
324
324
|
});
|
|
325
325
|
|
|
326
|
-
this.composeWith('pob:core:vscode', {
|
|
326
|
+
await this.composeWith('pob:core:vscode', {
|
|
327
327
|
root: !inMonorepo,
|
|
328
328
|
monorepo: false,
|
|
329
329
|
packageManager: this.options.packageManager,
|
|
@@ -333,7 +333,7 @@ export default class PobLibGenerator extends Generator {
|
|
|
333
333
|
});
|
|
334
334
|
|
|
335
335
|
// must be after doc, testing
|
|
336
|
-
this.composeWith('pob:core:gitignore', {
|
|
336
|
+
await this.composeWith('pob:core:gitignore', {
|
|
337
337
|
root: !inMonorepo,
|
|
338
338
|
withBabel: babelEnvs.length > 0,
|
|
339
339
|
typescript: babelEnvs.length > 0,
|
|
@@ -341,14 +341,14 @@ export default class PobLibGenerator extends Generator {
|
|
|
341
341
|
testing: !!this.pobjson.testing,
|
|
342
342
|
});
|
|
343
343
|
|
|
344
|
-
this.composeWith('pob:core:npm', {
|
|
344
|
+
await this.composeWith('pob:core:npm', {
|
|
345
345
|
enable: !pkg.private,
|
|
346
346
|
srcDirectory: withBabel ? 'src' : 'lib',
|
|
347
347
|
distDirectory: withBabel ? 'dist' : '',
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
-
writing() {
|
|
351
|
+
async writing() {
|
|
352
352
|
// Re-read the content at this point because a composed generator might modify it.
|
|
353
353
|
const pkg = this.fs.readJSON(this.destinationPath('package.json'));
|
|
354
354
|
|
|
@@ -412,6 +412,6 @@ export default class PobLibGenerator extends Generator {
|
|
|
412
412
|
this.config.set('lib', pobjson);
|
|
413
413
|
this.config.save();
|
|
414
414
|
|
|
415
|
-
this.composeWith('pob:core:sort-package');
|
|
415
|
+
await this.composeWith('pob:core:sort-package');
|
|
416
416
|
}
|
|
417
417
|
}
|
|
@@ -201,7 +201,7 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
201
201
|
this.config.delete('pob-config');
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
default() {
|
|
204
|
+
async default() {
|
|
205
205
|
const pkg = this.fs.readJSON(this.destinationPath('package.json'), {});
|
|
206
206
|
|
|
207
207
|
const packageNames = this.packageNames;
|
|
@@ -216,13 +216,13 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
216
216
|
throw new Error('packages should not be empty');
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
this.composeWith('pob:common:husky', {});
|
|
219
|
+
await this.composeWith('pob:common:husky', {});
|
|
220
220
|
|
|
221
221
|
const isYarnVersionEnabled = this.pobLernaConfig.ci;
|
|
222
222
|
|
|
223
223
|
const splitCIJobs = this.packageNames.length > 8;
|
|
224
224
|
|
|
225
|
-
this.composeWith('pob:common:testing', {
|
|
225
|
+
await this.composeWith('pob:common:testing', {
|
|
226
226
|
monorepo: true,
|
|
227
227
|
enable: this.pobLernaConfig.testing,
|
|
228
228
|
disableYarnGitCache: this.options.disableYarnGitCache,
|
|
@@ -240,7 +240,7 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
240
240
|
splitCIJobs,
|
|
241
241
|
});
|
|
242
242
|
|
|
243
|
-
this.composeWith('pob:common:format-lint', {
|
|
243
|
+
await this.composeWith('pob:common:format-lint', {
|
|
244
244
|
monorepo: true,
|
|
245
245
|
documentation: this.pobLernaConfig.documentation,
|
|
246
246
|
typescript: this.pobLernaConfig.typescript,
|
|
@@ -257,7 +257,7 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
257
257
|
rootIgnorePaths: [],
|
|
258
258
|
});
|
|
259
259
|
|
|
260
|
-
this.composeWith('pob:lib:doc', {
|
|
260
|
+
await this.composeWith('pob:lib:doc', {
|
|
261
261
|
enabled: this.pobLernaConfig.documentation,
|
|
262
262
|
testing: this.pobLernaConfig.testing,
|
|
263
263
|
packageNames: JSON.stringify(packageNames),
|
|
@@ -265,7 +265,7 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
265
265
|
packageManager: this.options.packageManager,
|
|
266
266
|
});
|
|
267
267
|
|
|
268
|
-
this.composeWith('pob:core:vscode', {
|
|
268
|
+
await this.composeWith('pob:core:vscode', {
|
|
269
269
|
root: true,
|
|
270
270
|
monorepo: true,
|
|
271
271
|
packageManager: this.options.packageManager,
|
|
@@ -277,16 +277,16 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
277
277
|
});
|
|
278
278
|
|
|
279
279
|
// Always add a gitignore, because npm publish uses it.
|
|
280
|
-
this.composeWith('pob:core:gitignore', {
|
|
280
|
+
await this.composeWith('pob:core:gitignore', {
|
|
281
281
|
root: true,
|
|
282
282
|
typescript: this.pobLernaConfig.typescript,
|
|
283
283
|
documentation: this.pobLernaConfig.documentation,
|
|
284
284
|
testing: this.pobLernaConfig.testing,
|
|
285
285
|
});
|
|
286
286
|
|
|
287
|
-
this.composeWith('pob:common:remove-old-dependencies');
|
|
287
|
+
await this.composeWith('pob:common:remove-old-dependencies');
|
|
288
288
|
|
|
289
|
-
this.composeWith('pob:common:release', {
|
|
289
|
+
await this.composeWith('pob:common:release', {
|
|
290
290
|
enable: true,
|
|
291
291
|
enablePublish: !this.options.isAppProject,
|
|
292
292
|
withBabel: this.pobLernaConfig.typescript,
|
|
@@ -297,7 +297,7 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
297
297
|
updateOnly: this.options.updateOnly,
|
|
298
298
|
});
|
|
299
299
|
|
|
300
|
-
this.composeWith('pob:monorepo:typescript', {
|
|
300
|
+
await this.composeWith('pob:monorepo:typescript', {
|
|
301
301
|
enable: this.pobLernaConfig.typescript,
|
|
302
302
|
isAppProject: this.options.isAppProject,
|
|
303
303
|
packageNames: JSON.stringify(packageNames),
|
|
@@ -313,7 +313,7 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
writing() {
|
|
316
|
+
async writing() {
|
|
317
317
|
if (!this.options.isAppProject) {
|
|
318
318
|
const pkg = this.fs.readJSON(this.destinationPath('package.json'), {});
|
|
319
319
|
|
|
@@ -352,7 +352,7 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
352
352
|
this.fs.writeJSON(this.destinationPath('package.json'), pkg);
|
|
353
353
|
}
|
|
354
354
|
|
|
355
|
-
this.composeWith('pob:core:sort-package');
|
|
355
|
+
await this.composeWith('pob:core:sort-package');
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
end() {
|
|
@@ -113,15 +113,15 @@ export default class PobBaseGenerator extends Generator {
|
|
|
113
113
|
this.config.set('project', this.projectConfig);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
default() {
|
|
117
|
-
this.composeWith('pob:core:yarn', {
|
|
116
|
+
async default() {
|
|
117
|
+
await this.composeWith('pob:core:yarn', {
|
|
118
118
|
type: this.projectConfig.type,
|
|
119
119
|
enable: this.isRoot && this.projectConfig.packageManager === 'yarn',
|
|
120
120
|
yarnNodeLinker: this.projectConfig.yarnNodeLinker,
|
|
121
121
|
disableYarnGitCache: this.projectConfig.disableYarnGitCache,
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
-
this.composeWith('pob:core:package', {
|
|
124
|
+
await this.composeWith('pob:core:package', {
|
|
125
125
|
updateOnly: this.options.updateOnly,
|
|
126
126
|
private: this.isMonorepo,
|
|
127
127
|
isMonorepo: this.isMonorepo,
|
|
@@ -130,13 +130,13 @@ export default class PobBaseGenerator extends Generator {
|
|
|
130
130
|
});
|
|
131
131
|
|
|
132
132
|
if (this.isMonorepo) {
|
|
133
|
-
this.composeWith('pob:monorepo:workspaces', {
|
|
133
|
+
await this.composeWith('pob:monorepo:workspaces', {
|
|
134
134
|
force: this.options.force,
|
|
135
135
|
isAppProject: this.projectConfig.type === 'app',
|
|
136
136
|
packageManager: this.projectConfig.packageManager,
|
|
137
137
|
disableYarnGitCache: this.projectConfig.disableYarnGitCache,
|
|
138
138
|
});
|
|
139
|
-
this.composeWith('pob:monorepo:lerna', {
|
|
139
|
+
await this.composeWith('pob:monorepo:lerna', {
|
|
140
140
|
force: this.options.force,
|
|
141
141
|
isAppProject: this.projectConfig.type === 'app',
|
|
142
142
|
packageManager: this.projectConfig.packageManager,
|
|
@@ -147,13 +147,13 @@ export default class PobBaseGenerator extends Generator {
|
|
|
147
147
|
this.fs.delete('Makefile');
|
|
148
148
|
this.fs.delete(this.destinationPath('.commitrc.js'));
|
|
149
149
|
|
|
150
|
-
this.composeWith('pob:core:editorconfig');
|
|
150
|
+
await this.composeWith('pob:core:editorconfig');
|
|
151
151
|
|
|
152
|
-
this.composeWith('pob:core:clean', {
|
|
152
|
+
await this.composeWith('pob:core:clean', {
|
|
153
153
|
root: this.isRoot,
|
|
154
154
|
});
|
|
155
155
|
|
|
156
|
-
this.composeWith('pob:core:renovate', {
|
|
156
|
+
await this.composeWith('pob:core:renovate', {
|
|
157
157
|
updateOnly: this.options.updateOnly,
|
|
158
158
|
app: this.projectConfig.type === 'app',
|
|
159
159
|
});
|
|
@@ -167,7 +167,7 @@ export default class PobBaseGenerator extends Generator {
|
|
|
167
167
|
if (!this.hasAncestor) {
|
|
168
168
|
const splitCIJobs =
|
|
169
169
|
inMonorepo && inMonorepo.pobMonorepoConfig?.packageNames.length > 8;
|
|
170
|
-
this.composeWith('pob:core:git', {
|
|
170
|
+
await this.composeWith('pob:core:git', {
|
|
171
171
|
onlyLatestLTS,
|
|
172
172
|
splitCIJobs,
|
|
173
173
|
});
|
|
@@ -192,7 +192,7 @@ export default class PobBaseGenerator extends Generator {
|
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
if (this.isMonorepo) {
|
|
195
|
-
this.composeWith(
|
|
195
|
+
await this.composeWith(
|
|
196
196
|
// pob:monorepo <= for searching PobMonorepoGenerator.js
|
|
197
197
|
fileURLToPath(
|
|
198
198
|
new URL('../monorepo/PobMonorepoGenerator.js', import.meta.url),
|
|
@@ -209,7 +209,7 @@ export default class PobBaseGenerator extends Generator {
|
|
|
209
209
|
} else {
|
|
210
210
|
switch (this.projectConfig.type) {
|
|
211
211
|
case 'lib':
|
|
212
|
-
this.composeWith('pob:lib', {
|
|
212
|
+
await this.composeWith('pob:lib', {
|
|
213
213
|
monorepo: this.isMonorepo,
|
|
214
214
|
isRoot: this.isRoot,
|
|
215
215
|
disableYarnGitCache: this.projectConfig.disableYarnGitCache,
|
|
@@ -220,7 +220,7 @@ export default class PobBaseGenerator extends Generator {
|
|
|
220
220
|
});
|
|
221
221
|
break;
|
|
222
222
|
case 'app':
|
|
223
|
-
this.composeWith('pob:app', {
|
|
223
|
+
await this.composeWith('pob:app', {
|
|
224
224
|
monorepo: this.isMonorepo,
|
|
225
225
|
isRoot: this.isRoot,
|
|
226
226
|
disableYarnGitCache: this.projectConfig.disableYarnGitCache,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pob",
|
|
3
|
-
"version": "15.0
|
|
3
|
+
"version": "15.1.0",
|
|
4
4
|
"description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"skeleton"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@pob/sort-eslint-config": "5.1.0",
|
|
47
47
|
"@pob/sort-object": "6.1.0",
|
|
48
48
|
"@pob/sort-pkg": "6.1.0",
|
|
49
|
-
"@types/inquirer": "9.0.
|
|
49
|
+
"@types/inquirer": "9.0.7",
|
|
50
50
|
"@yarnpkg/cli": "4.0.1",
|
|
51
51
|
"@yarnpkg/core": "4.0.1",
|
|
52
52
|
"@yarnpkg/fslib": "3.0.1",
|
|
@@ -60,18 +60,18 @@
|
|
|
60
60
|
"json5": "^2.2.2",
|
|
61
61
|
"lodash.camelcase": "^4.3.0",
|
|
62
62
|
"lodash.kebabcase": "^4.1.1",
|
|
63
|
-
"mem-fs": "
|
|
64
|
-
"mem-fs-editor": "
|
|
63
|
+
"mem-fs": "4.0.0",
|
|
64
|
+
"mem-fs-editor": "11.0.0",
|
|
65
65
|
"minimist": "1.2.8",
|
|
66
66
|
"parse-author": "2.0.0",
|
|
67
|
-
"pob-dependencies": "8.9.
|
|
67
|
+
"pob-dependencies": "8.9.3",
|
|
68
68
|
"prettier": "2.8.8",
|
|
69
69
|
"semver": "7.5.4",
|
|
70
|
-
"yarn-workspace-utils": "1.2.
|
|
71
|
-
"yeoman-environment": "4.0.0
|
|
72
|
-
"yeoman-generator": "
|
|
70
|
+
"yarn-workspace-utils": "1.2.3",
|
|
71
|
+
"yeoman-environment": "4.0.0",
|
|
72
|
+
"yeoman-generator": "7.1.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@pob/root": "8.
|
|
75
|
+
"@pob/root": "8.7.0"
|
|
76
76
|
}
|
|
77
77
|
}
|