pob 9.9.0 → 9.9.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 CHANGED
@@ -3,6 +3,19 @@
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.9.1](https://github.com/christophehurpeau/pob/compare/pob@9.9.0...pob@9.9.1) (2021-12-19)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **pob:** add missing workspaces plugin when needed ([f3759c3](https://github.com/christophehurpeau/pob/commit/f3759c3f9bc34f30a7f72580df85b352fb67fbad))
12
+ * **pob:** exports for browser only ([0ede342](https://github.com/christophehurpeau/pob/commit/0ede342c71aefbcad6b037c3bd6ea1ac4eec2a61))
13
+ * **pob:** watch command ([e026f52](https://github.com/christophehurpeau/pob/commit/e026f5209d5bc0eb81ce766bbc8b7e5f62abe4b7))
14
+
15
+
16
+
17
+
18
+
6
19
  # [9.9.0](https://github.com/christophehurpeau/pob/compare/pob@9.8.0...pob@9.9.0) (2021-12-18)
7
20
 
8
21
 
@@ -421,6 +421,17 @@ export default class CommonBabelGenerator extends Generator {
421
421
  'not safari < 10',
422
422
  'not ios_saf < 10',
423
423
  ];
424
+ } else if (this.options.isApp && pkg.browserslist) {
425
+ pkg.browserslist = {
426
+ ...pkg.browserslist,
427
+ production: [
428
+ 'defaults',
429
+ '> 0.2%',
430
+ 'not ie < 12',
431
+ 'not safari < 10',
432
+ 'not ios_saf < 10',
433
+ ],
434
+ };
424
435
  } else {
425
436
  delete pkg.browserslist;
426
437
  }
@@ -568,9 +579,10 @@ export default class CommonBabelGenerator extends Generator {
568
579
  this.entries.forEach((entry) => {
569
580
  const isBrowserOnly =
570
581
  entry === 'browser' &&
571
- this.babelEnvs.every((env) => env.target === 'browser');
582
+ (this.babelEnvs.every((env) => env.target === 'browser') ||
583
+ (this.entries.length === 2 && this.entries.includes('index')));
572
584
  const entryDistName = isBrowserOnly ? 'index' : entry;
573
- const exportName = entryDistName === 'index' ? '.' : `./${entry}`;
585
+ const exportName = entry === 'index' ? '.' : `./${entry}`;
574
586
 
575
587
  const targets = {};
576
588
 
@@ -66,22 +66,32 @@ export default class CoreYarnGenerator extends Generator {
66
66
  const isPluginInstalled = (name) =>
67
67
  installedPlugins.some((plugin) => plugin.name === name);
68
68
 
69
+ const installPlugin = (nameOrUrl) => {
70
+ this.spawnCommandSync('yarn', ['plugin', 'import', nameOrUrl]);
71
+ };
72
+ const removePlugin = (name) => {
73
+ this.spawnCommandSync('yarn', ['plugin', 'remove', name]);
74
+ };
75
+
69
76
  const postinstallDevPluginName = '@yarnpkg/plugin-postinstall-dev';
77
+ const workspacesPluginName = '@yarnpkg/plugin-workspace-tools';
70
78
 
71
79
  if (!inLerna && !pkg.private) {
72
80
  if (!isPluginInstalled(postinstallDevPluginName)) {
73
- this.spawnCommandSync('yarn', [
74
- 'plugin',
75
- 'import',
81
+ installPlugin(
76
82
  'https://raw.githubusercontent.com/sachinraja/yarn-plugin-postinstall-dev/main/bundles/%40yarnpkg/plugin-postinstall-dev.js',
77
- ]);
83
+ );
78
84
  }
79
85
  } else if (isPluginInstalled(postinstallDevPluginName)) {
80
- this.spawnCommandSync('yarn', [
81
- 'plugin',
82
- 'remove',
83
- postinstallDevPluginName,
84
- ]);
86
+ removePlugin(postinstallDevPluginName);
87
+ }
88
+
89
+ if (pkg.workspaces) {
90
+ if (!isPluginInstalled(workspacesPluginName)) {
91
+ installPlugin(workspacesPluginName);
92
+ }
93
+ } else if (isPluginInstalled(workspacesPluginName)) {
94
+ removePlugin(workspacesPluginName);
85
95
  }
86
96
 
87
97
  // must be done after plugins installed
@@ -194,7 +194,7 @@ export default class MonorepoLernaGenerator extends Generator {
194
194
  build:
195
195
  'yarn workspaces foreach --parallel --topological-dev -Av run build',
196
196
  watch:
197
- 'yarn workspaces foreach --parallel --exclude "*-example" -Av run watch',
197
+ 'yarn workspaces foreach --parallel --jobs unlimited --interlaced --exclude "*-example" -Av run watch',
198
198
  });
199
199
 
200
200
  // packageUtils.addOrRemoveScripts(pkg, withTypescript, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "9.9.0",
3
+ "version": "9.9.1",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -61,11 +61,11 @@
61
61
  "mem-fs-editor": "9.3.0",
62
62
  "minimist-argv": "^1.1.0",
63
63
  "parse-author": "^2.0.0",
64
- "pob-dependencies": "6.4.0",
64
+ "pob-dependencies": "6.4.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": "7f9d0b3c9e18734e5761e61dc09e89f3542b973b"
70
+ "gitHead": "b74ca55fffe82bac436ec6d5ff3d31a2393c110e"
71
71
  }