pob 13.2.3 → 13.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,16 @@
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
+ ## [13.3.0](https://github.com/christophehurpeau/pob/compare/pob@13.2.3...pob@13.3.0) (2023-07-05)
7
+
8
+
9
+ ### Features
10
+
11
+ * **deps:** update dependency eslint to v8.44.0 ([#1694](https://github.com/christophehurpeau/pob/issues/1694)) ([1b75923](https://github.com/christophehurpeau/pob/commit/1b75923242c12b624c7c74585d3484c191c913ec))
12
+ * **pob:** add config for yarn-plugin app ([c18d783](https://github.com/christophehurpeau/pob/commit/c18d783621291bd22ea367bf6ca77b7cd84ec661))
13
+
14
+
15
+
6
16
  ## [13.2.3](https://github.com/christophehurpeau/pob/compare/pob@13.2.2...pob@13.2.3) (2023-06-30)
7
17
 
8
18
 
@@ -5,7 +5,14 @@ import inLerna from '../../utils/inLerna.js';
5
5
  import * as packageUtils from '../../utils/package.js';
6
6
  import { appIgnorePaths } from './ignorePaths.js';
7
7
 
8
- const appsWithTypescript = ['alp', 'next.js', 'remix', 'pobpack', 'expo'];
8
+ const appsWithTypescript = [
9
+ 'alp',
10
+ 'next.js',
11
+ 'remix',
12
+ 'pobpack',
13
+ 'expo',
14
+ 'yarn-plugin',
15
+ ];
9
16
  const appsWithBrowser = ['alp', 'next.js', 'remix'];
10
17
 
11
18
  export default class PobAppGenerator extends Generator {
@@ -114,6 +121,7 @@ export default class PobAppGenerator extends Generator {
114
121
  }
115
122
 
116
123
  default() {
124
+ const srcDir = this.appConfig.type === 'yarn-plugin' ? 'sources' : 'src';
117
125
  if (
118
126
  this.appConfig.type === 'node' ||
119
127
  this.appConfig.type === 'node-library' ||
@@ -146,6 +154,10 @@ export default class PobAppGenerator extends Generator {
146
154
  ? pkg.pob.jsx
147
155
  : packageUtils.hasReact(pkg);
148
156
 
157
+ if (!appIgnorePaths[this.appConfig.type]) {
158
+ throw new Error(`Unknown app type: ${this.appConfig.type}`);
159
+ }
160
+
149
161
  const ignorePaths = appIgnorePaths[this.appConfig.type](
150
162
  this.appConfig,
151
163
  ).filter(Boolean);
@@ -153,8 +165,8 @@ export default class PobAppGenerator extends Generator {
153
165
  this.composeWith('pob:common:typescript', {
154
166
  enable: babel,
155
167
  // nextjs now supports src
156
- rootDir: this.appConfig.type === 'expo' ? '.' : 'src',
157
- srcDir: 'src',
168
+ rootDir: this.appConfig.type === 'expo' ? '.' : srcDir,
169
+ srcDir,
158
170
  builddefs: false,
159
171
  dom: browser,
160
172
  jsx,
@@ -198,6 +210,7 @@ export default class PobAppGenerator extends Generator {
198
210
  isApp: true,
199
211
  splitCIJobs: false,
200
212
  onlyLatestLTS: true,
213
+ srcDir,
201
214
  });
202
215
 
203
216
  this.composeWith('pob:common:format-lint', {
@@ -26,4 +26,5 @@ export const appIgnorePaths = {
26
26
  '# Temporary files created by Metro to check the health of the file watcher',
27
27
  '.metro-health-check*',
28
28
  ],
29
+ 'yarn-plugin': (config) => [],
29
30
  };
@@ -85,6 +85,12 @@ export default class CommonTestingGenerator extends Generator {
85
85
  required: true,
86
86
  desc: 'only latest lts',
87
87
  });
88
+
89
+ this.option('srcDir', {
90
+ type: String,
91
+ default: 'src',
92
+ desc: 'customize srcDir, if different than rootDir',
93
+ });
88
94
  }
89
95
 
90
96
  default() {
@@ -207,14 +213,15 @@ export default class CommonTestingGenerator extends Generator {
207
213
  );
208
214
 
209
215
  if (!pkg.jest) pkg.jest = {};
216
+ const srcDir = this.options.srcDir;
210
217
  Object.assign(pkg.jest, {
211
218
  cacheDirectory: './node_modules/.cache/jest',
212
219
  testEnvironment: 'node',
213
220
  testMatch: [
214
- `<rootDir>/${workspacesPattern}/*/@(src|lib)/**/__tests__/**/*.${
221
+ `<rootDir>/${workspacesPattern}/*/@(${srcDir}|lib)/**/__tests__/**/*.${
215
222
  transpileWithBabel ? '(ts|js|cjs|mjs)' : '(js|cjs|mjs)'
216
223
  }${hasReact ? '?(x)' : ''}`,
217
- `<rootDir>/${workspacesPattern}/*/@(src|lib)/**/*.test.${
224
+ `<rootDir>/${workspacesPattern}/*/@(${srcDir}|lib)/**/*.test.${
218
225
  transpileWithBabel ? '(ts|js|cjs|mjs)' : '(js|cjs|mjs)'
219
226
  }${hasReact ? '?(x)' : ''}`,
220
227
  ],
@@ -242,7 +249,7 @@ export default class CommonTestingGenerator extends Generator {
242
249
  .replace('\\', '/')}`,
243
250
  });
244
251
  } else {
245
- const babelEnvs = pkg.pob.babelEnvs || [];
252
+ const babelEnvs = pkg.pob?.babelEnvs || [];
246
253
  const transpileWithBabel = packageUtils.transpileWithBabel(pkg);
247
254
 
248
255
  const shouldUseExperimentalVmModules =
@@ -267,7 +274,7 @@ export default class CommonTestingGenerator extends Generator {
267
274
  });
268
275
 
269
276
  if (this.options.runner === 'jest') {
270
- const srcDirectory = transpileWithBabel ? 'src' : 'lib';
277
+ const srcDirectory = transpileWithBabel ? this.options.srcDir : 'lib';
271
278
 
272
279
  if (!pkg.jest) pkg.jest = {};
273
280
  Object.assign(pkg.jest, {
@@ -334,10 +341,10 @@ export default class CommonTestingGenerator extends Generator {
334
341
  this.destinationPath('babel.config.cjs'),
335
342
  {
336
343
  only: !this.options.monorepo
337
- ? "'src'"
344
+ ? `'${this.options.srcDir}'`
338
345
  : pkg.workspaces
339
346
  .flatMap((workspace) => [
340
- `'${workspace}/src'`,
347
+ `'${workspace}/${this.options.srcDir}'`,
341
348
  `'${workspace}/lib'`,
342
349
  ])
343
350
  .join(', '),
@@ -29,6 +29,7 @@ export const transpileWithBabel = (pkg) =>
29
29
  (pkg.devDependencies &&
30
30
  (pkg.devDependencies['pob-babel'] ||
31
31
  pkg.devDependencies.next ||
32
+ pkg.devDependencies['@yarnpkg/builder'] ||
32
33
  pkg.devDependencies['alp-dev'])) ||
33
34
  // alp-dev has pob-babel in dependencies
34
35
  (pkg.dependencies &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "13.2.3",
3
+ "version": "13.3.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-pkg": "6.0.1",
47
47
  "@types/inquirer": "9.0.3",
48
48
  "@yeoman/types": "1.0.1",
49
- "eslint": "8.43.0",
49
+ "eslint": "8.44.0",
50
50
  "findup-sync": "^5.0.0",
51
51
  "git-remote-url": "^1.0.1",
52
52
  "github-username": "^7.0.0",
@@ -59,14 +59,14 @@
59
59
  "mem-fs-editor": "10.0.2",
60
60
  "minimist": "1.2.8",
61
61
  "parse-author": "2.0.0",
62
- "pob-dependencies": "8.2.0",
62
+ "pob-dependencies": "8.3.0",
63
63
  "prettier": "2.8.8",
64
64
  "semver": "7.5.3",
65
65
  "yeoman-environment": "4.0.0-beta.3",
66
66
  "yeoman-generator": "6.0.0-rc.2"
67
67
  },
68
68
  "devDependencies": {
69
- "@pob/root": "8.1.0"
69
+ "@pob/root": "8.1.1"
70
70
  },
71
- "gitHead": "17a6cf5590bcbb5a177c743558e3f62e2ca2f28f"
71
+ "gitHead": "30355e11140d1c91a1cb5de451868a64b3d54227"
72
72
  }