pob 9.9.1 → 9.12.1
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 +55 -0
- package/lib/generators/common/babel/CommonBabelGenerator.js +11 -2
- package/lib/generators/common/format-lint/CommonLintGenerator.js +2 -1
- package/lib/generators/common/release/templates/release-please.yml.ejs +1 -1
- package/lib/generators/common/testing/CommonTestingGenerator.js +4 -3
- package/lib/generators/common/testing/templates/babel.config.cjs.ejs +10 -1
- package/lib/generators/core/package/CorePackageGenerator.js +3 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,61 @@
|
|
|
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
|
+
## [9.12.1](https://github.com/christophehurpeau/pob/compare/pob@9.12.0...pob@9.12.1) (2022-01-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* set globalEslint default to true ([8d7d3d5](https://github.com/christophehurpeau/pob/commit/8d7d3d5917b340b901b565a23356b21939059cb8))
|
|
12
|
+
* use cjs for default main for jest which doesnt supports exports yet ([f97c897](https://github.com/christophehurpeau/pob/commit/f97c8972b35032078f4603d788b4a3e637d61637))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [9.12.0](https://github.com/christophehurpeau/pob/compare/pob@9.11.0...pob@9.12.0) (2022-01-01)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **pob:** update release-please version ([8091222](https://github.com/christophehurpeau/pob/commit/80912226fedb9eb5e25936f2c9f4a719bf9605e9))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# [9.11.0](https://github.com/christophehurpeau/pob/compare/pob@9.10.0...pob@9.11.0) (2022-01-01)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Bug Fixes
|
|
33
|
+
|
|
34
|
+
* **pob:** legacy pkg.main cjs ([04dc5e2](https://github.com/christophehurpeau/pob/commit/04dc5e22e77b7383660b3bc62516d884670cf25a))
|
|
35
|
+
* force package type module when lerna and root is module ([c8e89a8](https://github.com/christophehurpeau/pob/commit/c8e89a8d04936ea7035d86a646437ba74e54146b))
|
|
36
|
+
* **deps:** update dependency @yarnpkg/parsers to v2.5.0-rc.7 ([#1148](https://github.com/christophehurpeau/pob/issues/1148)) ([8da56d4](https://github.com/christophehurpeau/pob/commit/8da56d4c1576908570c16da89caebad87a50c473))
|
|
37
|
+
* **pob:** monorepo react testing detection ([3f95cbf](https://github.com/christophehurpeau/pob/commit/3f95cbf667f624301aab82a88080c526507fe662))
|
|
38
|
+
* **pob:** test babel config with react ([726b954](https://github.com/christophehurpeau/pob/commit/726b95400eeef042bb22cafd1f4cdec23e0008df))
|
|
39
|
+
* package main when only esm is used ([b02684f](https://github.com/christophehurpeau/pob/commit/b02684f03a7bdf5875ac4919aa69df6b4993532f))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* **deps:** update dependency eslint to v8.6.0 ([#1152](https://github.com/christophehurpeau/pob/issues/1152)) ([004bf4f](https://github.com/christophehurpeau/pob/commit/004bf4f78e200606813498ee4f211ed06fec659f))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# [9.10.0](https://github.com/christophehurpeau/pob/compare/pob@9.9.1...pob@9.10.0) (2021-12-26)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
### Features
|
|
54
|
+
|
|
55
|
+
* **deps:** update dependency mem-fs-editor to v9.4.0 ([#992](https://github.com/christophehurpeau/pob/issues/992)) ([692888b](https://github.com/christophehurpeau/pob/commit/692888bfb3546028f6cf86c58bd8cf2efecfbf71))
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
6
61
|
## [9.9.1](https://github.com/christophehurpeau/pob/compare/pob@9.9.0...pob@9.9.1) (2021-12-19)
|
|
7
62
|
|
|
8
63
|
|
|
@@ -468,7 +468,11 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
468
468
|
if (!pkg.main) {
|
|
469
469
|
pkg.exports = './lib/index.js';
|
|
470
470
|
}
|
|
471
|
-
pkg.
|
|
471
|
+
if (pkg.type === 'module' && this.fs.exists('./lib/index.cjs')) {
|
|
472
|
+
pkg.main = './lib/index.cjs';
|
|
473
|
+
} else {
|
|
474
|
+
pkg.main = './lib/index.js';
|
|
475
|
+
}
|
|
472
476
|
if (!this.options.isApp) {
|
|
473
477
|
if (this.fs.exists('./lib/index.ts')) {
|
|
474
478
|
pkg.types = './lib/index.ts';
|
|
@@ -609,7 +613,12 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
609
613
|
// eslint: https://github.com/benmosher/eslint-plugin-import/issues/2132
|
|
610
614
|
// jest: https://github.com/facebook/jest/issues/9771
|
|
611
615
|
if (!pkg.main && exportName === '.') {
|
|
612
|
-
pkg.main =
|
|
616
|
+
pkg.main =
|
|
617
|
+
pkg.type === 'module'
|
|
618
|
+
? exportTarget.import
|
|
619
|
+
: exportTarget.default ||
|
|
620
|
+
exportTarget.require ||
|
|
621
|
+
exportTarget.import;
|
|
613
622
|
}
|
|
614
623
|
} else if (target === 'browser') {
|
|
615
624
|
if (formats.includes('es')) {
|
|
@@ -179,7 +179,8 @@ export default class CommonLintGenerator extends Generator {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
const yoConfigPobMonorepo = inLerna && inLerna.pobMonorepoConfig;
|
|
182
|
-
const globalEslint =
|
|
182
|
+
const globalEslint =
|
|
183
|
+
yoConfigPobMonorepo && yoConfigPobMonorepo.eslint !== false;
|
|
183
184
|
const globalTesting = yoConfigPobMonorepo && yoConfigPobMonorepo.testing;
|
|
184
185
|
const composite = yoConfigPobMonorepo && yoConfigPobMonorepo.typescript;
|
|
185
186
|
const { rootPackageManager, rootYarnNodeLinker } = inLerna || {};
|
|
@@ -86,6 +86,7 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
86
86
|
const transpileWithBabel = this.options.monorepo
|
|
87
87
|
? yoConfigPobMonorepo.typescript
|
|
88
88
|
: pkg.pob && pkg.pob.babelEnvs && pkg.pob.babelEnvs.length > 0;
|
|
89
|
+
let hasReact = transpileWithBabel && packageUtils.hasReact(pkg);
|
|
89
90
|
|
|
90
91
|
if (!this.options.enable) {
|
|
91
92
|
packageUtils.removeDevDependencies(pkg, ['jest', '@types/jest']);
|
|
@@ -149,7 +150,9 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
149
150
|
workspacesWithoutStar.length === 1
|
|
150
151
|
? workspacesWithoutStar[0]
|
|
151
152
|
: `(${workspacesWithoutStar.join('|')})`;
|
|
152
|
-
|
|
153
|
+
hasReact = yoConfigPobMonorepo.packageNames.some((pkgName) =>
|
|
154
|
+
pkgName.startsWith('react-'),
|
|
155
|
+
);
|
|
153
156
|
|
|
154
157
|
if (!pkg.jest) pkg.jest = {};
|
|
155
158
|
Object.assign(pkg.jest, {
|
|
@@ -204,7 +207,6 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
204
207
|
].join(' ; '),
|
|
205
208
|
});
|
|
206
209
|
|
|
207
|
-
const hasReact = transpileWithBabel && packageUtils.hasReact(pkg);
|
|
208
210
|
const srcDirectory = transpileWithBabel ? 'src' : 'lib';
|
|
209
211
|
|
|
210
212
|
if (!pkg.jest) pkg.jest = {};
|
|
@@ -262,7 +264,6 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
262
264
|
transpileWithBabel &&
|
|
263
265
|
((this.options.monorepo && globalTesting) || !globalTesting)
|
|
264
266
|
) {
|
|
265
|
-
const hasReact = transpileWithBabel && packageUtils.hasReact(pkg);
|
|
266
267
|
// cjs for jest compat
|
|
267
268
|
copyAndFormatTpl(
|
|
268
269
|
this.fs,
|
|
@@ -7,6 +7,15 @@ module.exports = function babelConfig(api) {
|
|
|
7
7
|
|
|
8
8
|
return {
|
|
9
9
|
only: [<%- only %>],
|
|
10
|
-
presets: [
|
|
10
|
+
presets: [
|
|
11
|
+
[require.resolve('pob-babel/preset.cjs')<% if (!jestExperimentalESM) { %>, { modules: 'commonjs' }<% } %>]
|
|
12
|
+
<% if (hasReact) { %>, [
|
|
13
|
+
'@babel/preset-react',
|
|
14
|
+
{
|
|
15
|
+
development: false,
|
|
16
|
+
useBuiltIns: true,
|
|
17
|
+
},
|
|
18
|
+
]<% } %>
|
|
19
|
+
],
|
|
11
20
|
};
|
|
12
21
|
};
|
|
@@ -139,6 +139,9 @@ export default class CorePackageGenerator extends Generator {
|
|
|
139
139
|
);
|
|
140
140
|
|
|
141
141
|
if (!pkg.type) pkg.type = props.type;
|
|
142
|
+
if (inLerna && !inLerna.root && inLerna.rootMonorepoPkg.type === 'module') {
|
|
143
|
+
pkg.type = 'module';
|
|
144
|
+
}
|
|
142
145
|
|
|
143
146
|
pkg.description = this.options.updateOnly
|
|
144
147
|
? pkg.description
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pob",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.12.1",
|
|
4
4
|
"description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"skeleton"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@pob/sort-eslint-config": "^3.0.1",
|
|
48
48
|
"@pob/sort-object": "^4.0.1",
|
|
49
49
|
"@pob/sort-pkg": "^4.0.1",
|
|
50
|
-
"@yarnpkg/parsers": "2.5.0-rc.
|
|
51
|
-
"eslint": "8.
|
|
50
|
+
"@yarnpkg/parsers": "2.5.0-rc.7",
|
|
51
|
+
"eslint": "8.6.0",
|
|
52
52
|
"findup-sync": "^5.0.0",
|
|
53
53
|
"git-remote-url": "^1.0.1",
|
|
54
54
|
"github-username": "^6.0.0",
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"lodash.camelcase": "^4.3.0",
|
|
59
59
|
"lodash.kebabcase": "^4.1.1",
|
|
60
60
|
"mem-fs": "2.2.1",
|
|
61
|
-
"mem-fs-editor": "9.
|
|
61
|
+
"mem-fs-editor": "9.4.0",
|
|
62
62
|
"minimist-argv": "^1.1.0",
|
|
63
63
|
"parse-author": "^2.0.0",
|
|
64
|
-
"pob-dependencies": "6.
|
|
64
|
+
"pob-dependencies": "6.6.1",
|
|
65
65
|
"prettier": "2.5.1",
|
|
66
66
|
"semver": "^7.3.4",
|
|
67
67
|
"yeoman-environment": "^3.5.1",
|
|
68
68
|
"yeoman-generator": "^5.4.0"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "9a3b1d4e78444d3be10d8d96e1586294dcab302c"
|
|
71
71
|
}
|