pob 10.20.0 → 10.21.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,27 @@
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
+ # [10.21.0](https://github.com/christophehurpeau/pob/compare/pob@10.20.0...pob@10.21.0) (2022-10-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **deps:** update dependency minimist to v1.2.7 ([#1429](https://github.com/christophehurpeau/pob/issues/1429)) ([273c62d](https://github.com/christophehurpeau/pob/commit/273c62dddc85d92be1dbdb1d304ca15da0af2362))
12
+ * **deps:** update dependency yeoman-environment to v3.12.1 ([#1430](https://github.com/christophehurpeau/pob/issues/1430)) ([b188b91](https://github.com/christophehurpeau/pob/commit/b188b9130527a570e39efa95f79e1769fb72ee69))
13
+ * **pob:** fix config app eslint ([dbec241](https://github.com/christophehurpeau/pob/commit/dbec2410e2c339f2a25860968d32345b272f9b9f))
14
+
15
+
16
+ ### Features
17
+
18
+ * **deps:** update dependency eslint to v8.25.0 ([#1421](https://github.com/christophehurpeau/pob/issues/1421)) ([a517b35](https://github.com/christophehurpeau/pob/commit/a517b35bfd3bd8c966538774b45eebf2199bb08c))
19
+ * improve generator for react-native-web monorepo ([49f0cd0](https://github.com/christophehurpeau/pob/commit/49f0cd0c55b842a9d5781cf062923dfc62d91e9e))
20
+ * **pob:** add support for cjs in extraEntries ([d46794a](https://github.com/christophehurpeau/pob/commit/d46794ac20555e3d54536f063f3b1edb5281d854))
21
+ * **pob:** improve config for apps ([50dbce0](https://github.com/christophehurpeau/pob/commit/50dbce05a34a04da9a216260a92e5286b8010a18))
22
+
23
+
24
+
25
+
26
+
6
27
  # [10.20.0](https://github.com/christophehurpeau/pob/compare/pob@10.19.0...pob@10.20.0) (2022-10-05)
7
28
 
8
29
 
@@ -185,6 +185,7 @@ export default class PobAppGenerator extends Generator {
185
185
  });
186
186
 
187
187
  this.composeWith('pob:common:format-lint', {
188
+ isApp: true,
188
189
  documentation: false,
189
190
  testing: this.appConfig.testing,
190
191
  babel,
@@ -258,7 +258,14 @@ export default class CommonBabelGenerator extends Generator {
258
258
  if (this.entries) {
259
259
  this.entries.forEach((entry) => {
260
260
  const entryDestPath = this.destinationPath(`${entry}.js`);
261
- this.fs.delete(entryDestPath);
261
+ if (this.options.isApp && entry !== 'index') {
262
+ this.fs.write(
263
+ entryDestPath,
264
+ `// resolution for eslint-plugin-import\nexport * from './src/${entry}/index.ts';\n`,
265
+ );
266
+ } else {
267
+ this.fs.delete(entryDestPath);
268
+ }
262
269
  });
263
270
  }
264
271
  //
@@ -667,7 +674,10 @@ export default class CommonBabelGenerator extends Generator {
667
674
  pkg.pob.extraEntries.forEach((exportName) => {
668
675
  pkg.exports[`./${exportName}`] =
669
676
  pkg.type === 'module'
670
- ? `./${exportName}.js`
677
+ ? // eslint-disable-next-line unicorn/no-nested-ternary
678
+ exportName.endsWith('cjs')
679
+ ? `./${exportName}`
680
+ : `./${exportName}.js`
671
681
  : {
672
682
  import: `./${exportName}.mjs`,
673
683
  require: `./${exportName}.js`,
@@ -1,8 +1,8 @@
1
+ import { dirname } from 'path';
2
+ import { fileURLToPath } from 'url';
1
3
  <% if (config) { -%>
2
4
  import config from 'alp-rollup-plugin-config';
3
5
  <% } -%>
4
- import { dirname } from 'path';
5
- import { fileURLToPath } from 'url';
6
6
  import createRollupConfig from 'pob-babel/createRollupConfig.js';
7
7
  import run from 'pob-babel/plugin-run.cjs';
8
8
 
@@ -19,6 +19,13 @@ export default class CommonLintGenerator extends Generator {
19
19
  description: 'Is root monorepo',
20
20
  });
21
21
 
22
+ this.option('isApp', {
23
+ type: Boolean,
24
+ required: false,
25
+ defaults: false,
26
+ description: 'Is app',
27
+ });
28
+
22
29
  this.option('babel', {
23
30
  type: String,
24
31
  required: false,
@@ -340,7 +347,11 @@ export default class CommonLintGenerator extends Generator {
340
347
  return [
341
348
  '@pob/eslint-config-typescript',
342
349
  useNodeOnly && '@pob/eslint-config-typescript/node',
343
- hasReact && '@pob/eslint-config-typescript-react',
350
+ this.options.isApp && '@pob/eslint-config-typescript/app',
351
+ hasReact &&
352
+ `@pob/eslint-config-typescript-react${
353
+ pkg.dependencies?.['react-native-web'] ? '/react-native-web' : ''
354
+ }`,
344
355
  ].filter(Boolean);
345
356
  }
346
357
 
@@ -101,7 +101,11 @@ export default class CommonTestingGenerator extends Generator {
101
101
  const transpileWithBabel = this.options.monorepo
102
102
  ? yoConfigPobMonorepo.typescript
103
103
  : pkg.pob && pkg.pob.babelEnvs && pkg.pob.babelEnvs.length > 0;
104
- let hasReact = transpileWithBabel && packageUtils.hasReact(pkg);
104
+ let hasReact =
105
+ transpileWithBabel &&
106
+ (this.options.monorepo
107
+ ? yoConfigPobMonorepo.react ?? packageUtils.hasReact(pkg)
108
+ : packageUtils.hasReact(pkg));
105
109
 
106
110
  if (!this.options.enable) {
107
111
  packageUtils.removeDevDependencies(pkg, ['jest', '@types/jest']);
@@ -109,7 +109,12 @@ export default class CommonTypescriptGenerator extends Generator {
109
109
  packageName,
110
110
  `../../${
111
111
  packageName[0] === '@'
112
- ? packageName
112
+ ? // eslint-disable-next-line unicorn/no-nested-ternary
113
+ yoConfig.pob.project.type === 'app'
114
+ ? `packages/${packageName.slice(
115
+ packageName.indexOf('/') + 1,
116
+ )}`
117
+ : packageName
113
118
  : `packages/${packageName}`
114
119
  }`,
115
120
  ]),
@@ -119,7 +124,9 @@ export default class CommonTypescriptGenerator extends Generator {
119
124
  ([packageName, packageLocation]) => [
120
125
  packageName,
121
126
  `${packageLocation}/${
122
- existsSync(`${packageLocation}/src`) ? 'src' : 'lib'
127
+ existsSync(`${packageLocations.get(packageName)}/tsconfig.json`)
128
+ ? 'src'
129
+ : 'lib'
123
130
  }`,
124
131
  ],
125
132
  );
@@ -111,7 +111,9 @@ export default class CoreCIGenerator extends Generator {
111
111
  build: this.options.build,
112
112
  typescript: this.options.typescript,
113
113
  codecov: this.options.codecov,
114
- supportsNode14: !this.options.isApp,
114
+ supportsNode14:
115
+ !this.options.isApp ||
116
+ inLerna.pobConfig?.project?.supportsNode14 !== false,
115
117
 
116
118
  isReleasePleaseEnabled: this.isReleasePleaseEnabled,
117
119
  publishSinglePackage: this.isReleasePleaseEnabled && !pkg.private,
@@ -80,7 +80,6 @@ export default class LibReadmeGenerator extends Generator {
80
80
  {
81
81
  privatePackage: pkg.private,
82
82
  packageName: pkg.name,
83
- packagePath: `${pkg.name[0] === '@' ? '' : 'packages/'}${pkg.name}`,
84
83
  camelCaseProjectName: camelCase(pkg.name),
85
84
  description: pkg.description,
86
85
  inLerna,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "10.20.0",
3
+ "version": "10.21.0",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -43,7 +43,7 @@
43
43
  "@pob/sort-eslint-config": "3.1.0",
44
44
  "@pob/sort-object": "4.1.0",
45
45
  "@pob/sort-pkg": "4.1.0",
46
- "eslint": "8.24.0",
46
+ "eslint": "8.25.0",
47
47
  "findup-sync": "^5.0.0",
48
48
  "git-remote-url": "^1.0.1",
49
49
  "github-username": "^6.0.0",
@@ -55,16 +55,16 @@
55
55
  "lodash.kebabcase": "^4.1.1",
56
56
  "mem-fs": "2.2.1",
57
57
  "mem-fs-editor": "9.5.0",
58
- "minimist": "1.2.6",
58
+ "minimist": "1.2.7",
59
59
  "parse-author": "2.0.0",
60
- "pob-dependencies": "6.32.0",
60
+ "pob-dependencies": "6.33.0",
61
61
  "prettier": "2.7.1",
62
62
  "semver": "7.3.8",
63
- "yeoman-environment": "3.12.0",
63
+ "yeoman-environment": "3.12.1",
64
64
  "yeoman-generator": "5.7.0"
65
65
  },
66
66
  "devDependencies": {
67
- "@pob/root": "6.23.0"
67
+ "@pob/root": "6.23.1"
68
68
  },
69
- "gitHead": "eeba016a9877a33eac8fde9ef79c49957308c394"
69
+ "gitHead": "731b169f373af61b2aa965f8f086b229387ab6eb"
70
70
  }