pob 15.0.2 → 15.0.3
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 +11 -0
- package/lib/generators/app/PobAppGenerator.js +11 -6
- package/lib/generators/common/format-lint/CommonLintGenerator.js +16 -3
- package/lib/generators/common/testing/CommonTestingGenerator.js +10 -8
- package/lib/generators/common/typescript/CommonTypescriptGenerator.js +3 -3
- package/lib/generators/common/typescript/templates/tsconfig.json.ejs +3 -3
- package/lib/generators/core/yarn/CoreYarnGenerator.js +1 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.0.3](https://github.com/christophehurpeau/pob/compare/pob@15.0.2...pob@15.0.3) (2023-11-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **pob:** ignore install plugin version for source package ([cf5312b](https://github.com/christophehurpeau/pob/commit/cf5312bbc94db00def686337c1e6e32822a584a7))
|
|
12
|
+
* srcDirectory for yarn plugin package ([97a0977](https://github.com/christophehurpeau/pob/commit/97a097721d6296d576bd78521b4313fcbbe28860))
|
|
13
|
+
|
|
14
|
+
Version bump for dependency: yarn-workspace-utils
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [15.0.2](https://github.com/christophehurpeau/pob/compare/pob@15.0.1...pob@15.0.2) (2023-11-05)
|
|
7
18
|
|
|
8
19
|
Note: no notable changes
|
|
@@ -128,7 +128,8 @@ export default class PobAppGenerator extends Generator {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
default() {
|
|
131
|
-
const
|
|
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 (
|
|
@@ -179,8 +180,8 @@ export default class PobAppGenerator extends Generator {
|
|
|
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 '.';
|
|
@@ -225,7 +226,7 @@ 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
232
|
this.composeWith('pob:common:format-lint', {
|
|
@@ -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
248
|
this.composeWith('pob:common:release', {
|
|
247
|
-
enable:
|
|
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,
|
|
@@ -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', {
|
|
@@ -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
|
],
|
|
@@ -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 (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pob",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.3",
|
|
4
4
|
"description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"skeleton"
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"mem-fs-editor": "10.0.3",
|
|
65
65
|
"minimist": "1.2.8",
|
|
66
66
|
"parse-author": "2.0.0",
|
|
67
|
-
"pob-dependencies": "8.9.
|
|
67
|
+
"pob-dependencies": "8.9.2",
|
|
68
68
|
"prettier": "2.8.8",
|
|
69
69
|
"semver": "7.5.4",
|
|
70
|
-
"yarn-workspace-utils": "1.2.
|
|
70
|
+
"yarn-workspace-utils": "1.2.2",
|
|
71
71
|
"yeoman-environment": "4.0.0-beta.5",
|
|
72
72
|
"yeoman-generator": "6.0.0-rc.6"
|
|
73
73
|
},
|