pob 11.2.0 → 11.3.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
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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
|
+
# [11.3.0](https://github.com/christophehurpeau/pob/compare/pob@11.2.0...pob@11.3.0) (2022-11-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **pob:** fix in babel generator when formats is not defined ([8f975c8](https://github.com/christophehurpeau/pob/commit/8f975c84a9ef48475fbd70979b8a86ede5d8f3e6))
|
|
12
|
+
* **pob:** fix in babel generator when formats is not defined ([3a0fe7d](https://github.com/christophehurpeau/pob/commit/3a0fe7d8a5b937b8bdf31486e0d9cd86aa06acee))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **pob:** improve lint:eslint and add test scripts in monorepo ([3d6c9d5](https://github.com/christophehurpeau/pob/commit/3d6c9d5f462bf11e57683b2fa1fe198503eb4f71))
|
|
18
|
+
* **pob:** remove formats when cjs not in it ([e86d3f4](https://github.com/christophehurpeau/pob/commit/e86d3f4589ea19d32614ba1198018122229b1a45))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
# [11.2.0](https://github.com/christophehurpeau/pob/compare/pob@11.1.0...pob@11.2.0) (2022-11-15)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -106,8 +106,10 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
106
106
|
.filter((env) => env.target === 'browser')
|
|
107
107
|
.map((env) => (env.version === undefined ? 'supported' : env.version));
|
|
108
108
|
const formats = [
|
|
109
|
-
babelEnvs.some((env) => env.formats
|
|
110
|
-
babelEnvs.some((env) => env.formats.includes('es'))
|
|
109
|
+
babelEnvs.some((env) => env.formats?.includes('cjs')) ? 'cjs' : undefined,
|
|
110
|
+
babelEnvs.some((env) => !env.formats || env.formats.includes('es'))
|
|
111
|
+
? 'es'
|
|
112
|
+
: undefined,
|
|
111
113
|
].filter(Boolean);
|
|
112
114
|
const jsx =
|
|
113
115
|
(pkg.pob.jsx || pkg.pob.withReact) === undefined
|
|
@@ -201,8 +203,8 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
201
203
|
? // eslint-disable-next-line unicorn/no-nested-ternary
|
|
202
204
|
version === '16'
|
|
203
205
|
? babelConfig.formats
|
|
204
|
-
:
|
|
205
|
-
:
|
|
206
|
+
: undefined
|
|
207
|
+
: undefined,
|
|
206
208
|
})),
|
|
207
209
|
...(babelConfig.browserVersions || []).map((version) => ({
|
|
208
210
|
target: 'browser',
|
|
@@ -212,8 +214,8 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
212
214
|
? // eslint-disable-next-line unicorn/no-nested-ternary
|
|
213
215
|
version === 'supported'
|
|
214
216
|
? babelConfig.formats
|
|
215
|
-
:
|
|
216
|
-
:
|
|
217
|
+
: undefined
|
|
218
|
+
: undefined,
|
|
217
219
|
})),
|
|
218
220
|
];
|
|
219
221
|
|
|
@@ -505,18 +507,19 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
505
507
|
(env) =>
|
|
506
508
|
env.target === 'browser' &&
|
|
507
509
|
env.version === undefined &&
|
|
508
|
-
env.formats.includes('es'),
|
|
510
|
+
(!env.formats || env.formats.includes('es')),
|
|
509
511
|
);
|
|
510
512
|
|
|
511
513
|
const esModernBrowserEnv = this.babelEnvs.find(
|
|
512
514
|
(env) =>
|
|
513
515
|
env.target === 'browser' &&
|
|
514
516
|
env.version === 'modern' &&
|
|
515
|
-
env.formats.includes('es'),
|
|
517
|
+
(!env.formats || env.formats.includes('es')),
|
|
516
518
|
);
|
|
517
519
|
|
|
518
520
|
const esNodeEnv = this.babelEnvs.find(
|
|
519
|
-
(env) =>
|
|
521
|
+
(env) =>
|
|
522
|
+
env.target === 'node' && (!env.formats || env.formats.includes('es')),
|
|
520
523
|
);
|
|
521
524
|
|
|
522
525
|
// Legacy "dev" builds
|
|
@@ -601,13 +604,13 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
601
604
|
|
|
602
605
|
if (target === 'node') {
|
|
603
606
|
const cjsExt = pkg.type === 'module' ? 'cjs' : 'cjs.js';
|
|
604
|
-
if (formats.includes('es')) {
|
|
607
|
+
if (!formats || formats.includes('es')) {
|
|
605
608
|
exportTarget.import = `./${this.options.buildDirectory}/${entryDistName}-${target}${version}.mjs`;
|
|
606
609
|
|
|
607
|
-
if (formats.includes('cjs')) {
|
|
610
|
+
if (formats && formats.includes('cjs')) {
|
|
608
611
|
exportTarget.require = `./${this.options.buildDirectory}/${entryDistName}-${target}${version}.${cjsExt}`;
|
|
609
612
|
}
|
|
610
|
-
} else if (formats.includes('cjs')) {
|
|
613
|
+
} else if (formats && formats.includes('cjs')) {
|
|
611
614
|
exportTarget.default = `./${this.options.buildDirectory}/${entryDistName}-${target}${version}.${cjsExt}`;
|
|
612
615
|
}
|
|
613
616
|
// eslint: https://github.com/benmosher/eslint-plugin-import/issues/2132
|
|
@@ -621,13 +624,13 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
621
624
|
exportTarget.import;
|
|
622
625
|
}
|
|
623
626
|
} else if (target === 'browser') {
|
|
624
|
-
if (formats.includes('es')) {
|
|
627
|
+
if (!formats || formats.includes('es')) {
|
|
625
628
|
exportTarget.import = `./${
|
|
626
629
|
this.options.buildDirectory
|
|
627
630
|
}/${entryDistName}-${target}${version || ''}.es.js`;
|
|
628
631
|
}
|
|
629
632
|
|
|
630
|
-
if (formats.includes('cjs')) {
|
|
633
|
+
if (formats && formats.includes('cjs')) {
|
|
631
634
|
exportTarget.require = `./${
|
|
632
635
|
this.options.buildDirectory
|
|
633
636
|
}/index-${target}${version || ''}.cjs.js`;
|
|
@@ -524,7 +524,7 @@ export default class CommonLintGenerator extends Generator {
|
|
|
524
524
|
|
|
525
525
|
packageUtils.addScripts(pkg, {
|
|
526
526
|
'lint:eslint': globalEslint
|
|
527
|
-
? `
|
|
527
|
+
? `yarn ../.. run eslint ${args} ${path
|
|
528
528
|
.relative('../..', '.')
|
|
529
529
|
.replace('\\', '/')}`
|
|
530
530
|
: `eslint ${args} ${lintPaths.join(' ')}`,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
1
2
|
import Generator from 'yeoman-generator';
|
|
2
3
|
import inLerna from '../../../utils/inLerna.js';
|
|
3
4
|
import * as packageUtils from '../../../utils/package.js';
|
|
@@ -189,10 +190,14 @@ export default class CommonTestingGenerator extends Generator {
|
|
|
189
190
|
} else if (globalTesting) {
|
|
190
191
|
delete pkg.jest;
|
|
191
192
|
if (pkg.scripts) {
|
|
192
|
-
delete pkg.scripts.test;
|
|
193
193
|
delete pkg.scripts['generate:test-coverage'];
|
|
194
194
|
delete pkg.scripts['test:watch'];
|
|
195
195
|
}
|
|
196
|
+
pkg.addScripts(pkg, {
|
|
197
|
+
test: `yarn ../../ run test -- ${path
|
|
198
|
+
.relative('../..', '.')
|
|
199
|
+
.replace('\\', '/')}`,
|
|
200
|
+
});
|
|
196
201
|
} else {
|
|
197
202
|
const babelEnvs = pkg.pob.babelEnvs || [];
|
|
198
203
|
const transpileWithBabel = packageUtils.transpileWithBabel(pkg);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pob",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.3.0",
|
|
4
4
|
"description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"skeleton"
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@pob/root": "7.1.1"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "33e161c4d1126092c4ab2dfa490a03ac6359e663"
|
|
70
70
|
}
|