pob 17.0.0 → 17.2.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,28 @@
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
+ ## [17.2.0](https://github.com/christophehurpeau/pob/compare/pob@17.1.0...pob@17.2.0) (2023-12-27)
7
+
8
+
9
+ ### Features
10
+
11
+ * improve experimental typescript compiler ([c46d8f2](https://github.com/christophehurpeau/pob/commit/c46d8f2ea003fd1721ba481cfb42bc35e22e7537))
12
+
13
+ Version bump for dependency: root
14
+
15
+
16
+ ## [17.1.0](https://github.com/christophehurpeau/pob/compare/pob@17.0.0...pob@17.1.0) (2023-12-26)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * delete config.supportedArchitectures if option disableYarnGitCache is true ([9905b3b](https://github.com/christophehurpeau/pob/commit/9905b3bef1feb10f6867d2f2625480aaee63b56f))
22
+ * fix tsconfig when presets is empty ([63ce876](https://github.com/christophehurpeau/pob/commit/63ce8762ac960d89cbdff9970dbc34670c0cd365))
23
+ * **pob:** correctly detects if build is required ([d3e13e6](https://github.com/christophehurpeau/pob/commit/d3e13e6d052ecaed070a93c3f45ca83622750643))
24
+
25
+ Version bump for dependency: root
26
+
27
+
6
28
  ## [17.0.0](https://github.com/christophehurpeau/pob/compare/pob@16.1.0...pob@17.0.0) (2023-12-25)
7
29
 
8
30
 
@@ -125,7 +125,14 @@ export default class CommonLintGenerator extends Generator {
125
125
  const hasReact = useTypescript && packageUtils.hasReact(pkg);
126
126
  const useNode = !useBabel || babelEnvs.some((env) => env.target === 'node');
127
127
  const useNodeOnly =
128
- !useBabel ||
128
+ (!useBabel && !useTypescript) ||
129
+ (useTypescript &&
130
+ pkg.pob?.envs?.every((env) => env.target === 'node') &&
131
+ pkg.pob?.entries.every(
132
+ (entry) =>
133
+ typeof entry === 'string' ||
134
+ (entry.target && entry.target !== 'node'),
135
+ )) ||
129
136
  (babelEnvs.length > 0 && babelEnvs.every((env) => env.target === 'node'));
130
137
 
131
138
  if (this.fs.exists(this.destinationPath('.eslintignore'))) {
@@ -186,6 +186,14 @@ export default class CommonTestingGenerator extends Generator {
186
186
  this.fs.delete(this.destinationPath('jest.config.json'));
187
187
  }
188
188
 
189
+ packageUtils.addOrRemoveDevDependencies(
190
+ pkg,
191
+ this.options.enable &&
192
+ this.options.runner === 'node' &&
193
+ this.options.typescript,
194
+ ['tsimp'],
195
+ );
196
+
189
197
  if (!this.options.enable) {
190
198
  // if (inMonorepo) {
191
199
  // if (pkg.scripts.test === 'echo "No tests"') {
@@ -226,7 +234,11 @@ export default class CommonTestingGenerator extends Generator {
226
234
  ? 'NODE_OPTIONS=--experimental-vm-modules '
227
235
  : ''
228
236
  }jest`
229
- : 'node --test';
237
+ : `node ${
238
+ this.options.typescript ? '--import=tsimp/import ' : ''
239
+ }--test ${
240
+ this.options.typescript ? '**/*.test.ts' : '**/*.test.js'
241
+ }`;
230
242
 
231
243
  packageUtils.addScripts(pkg, {
232
244
  test: testCommand,
@@ -305,7 +317,11 @@ export default class CommonTestingGenerator extends Generator {
305
317
  ? 'NODE_OPTIONS=--experimental-vm-modules '
306
318
  : ''
307
319
  }jest`
308
- : 'node --test';
320
+ : `node ${
321
+ this.options.typescript ? '--import=tsimp/import ' : ''
322
+ }--test ${
323
+ this.options.typescript ? '**/*.test.ts' : '**/*.test.js'
324
+ }`;
309
325
 
310
326
  packageUtils.addScripts(pkg, {
311
327
  test: testCommand,
@@ -125,9 +125,16 @@ export default class CommonTypescriptGenerator extends Generator {
125
125
  }
126
126
  if (withTypescript) {
127
127
  const nodeVersion = this.options.onlyLatestLTS ? '20' : '18';
128
- return pkg.pob.rollup === false
129
- ? [`@pob/root/tsconfigs/targets/node-${nodeVersion}.json`]
130
- : [`@pob/root/tsconfigs/targets/rollup-node-${nodeVersion}.json`];
128
+ const envs = pkg.pob?.envs;
129
+ if (pkg.pob.rollup === false) {
130
+ return [`@pob/root/tsconfigs/targets/node-${nodeVersion}.json`];
131
+ }
132
+ if (envs && envs.every((env) => env.target === 'node')) {
133
+ return [
134
+ `@pob/root/tsconfigs/targets/rollup-node-${nodeVersion}.json`,
135
+ ];
136
+ }
137
+ return ['@pob/root/tsconfigs/targets/rollup-es2015.json'];
131
138
  }
132
139
  return [];
133
140
  })();
@@ -47,7 +47,7 @@
47
47
  "composite": true,
48
48
  <% } -%>
49
49
 
50
- <% if(!presets) { -%>
50
+ <% if(!presets || presets.length === 0) { -%>
51
51
  "target": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
52
52
  "module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
53
53
  "lib": [<%- dom ? '"dom", ' : '' %>"esnext"], /* Polyfills are imported either by babel or with polyfill.io */
@@ -63,7 +63,7 @@
63
63
  "plugins": [<%- plugins.map((pluginName) => `{"name": "${pluginName}"}`).join(', ') %>],
64
64
  <% } -%>
65
65
 
66
- <% if(!presets) { -%>
66
+ <% if(!presets || presets.length === 0) { -%>
67
67
  /* Module Resolution Options */
68
68
  "moduleResolution": "bundler" /* Specify module resolution strategy. */,
69
69
  <% if (resolveJsonModule) { -%>
@@ -119,19 +119,19 @@ export default class CorePackageGenerator extends Generator {
119
119
  {
120
120
  name: 'authorName',
121
121
  message: "Author's Name",
122
- when: !author || !author.name,
122
+ when: !pkg.authors && (!author || !author.name),
123
123
  default: this.git.name(),
124
124
  },
125
125
  {
126
126
  name: 'authorEmail',
127
127
  message: "Author's Email",
128
- when: !author || !author.email,
128
+ when: !pkg.authors && (!author || !author.email),
129
129
  default: this.git.email(),
130
130
  },
131
131
  {
132
132
  name: 'authorUrl',
133
133
  message: "Author's Homepage",
134
- when: !author || !author.url,
134
+ when: !pkg.authors && (!author || !author.url),
135
135
  },
136
136
  {
137
137
  name: 'type',
@@ -260,15 +260,17 @@ export default class CorePackageGenerator extends Generator {
260
260
  );
261
261
  }
262
262
 
263
- author = {
264
- name: props.authorName || author.name,
265
- email: props.authorEmail || author.email,
266
- url: props.authorUrl || (author && author.url),
267
- };
263
+ if (!pkg.authors) {
264
+ author = {
265
+ name: props.authorName || author.name,
266
+ email: props.authorEmail || author.email,
267
+ url: props.authorUrl || (author && author.url),
268
+ };
268
269
 
269
- pkg.author = `${author.name} <${author.email}>${
270
- author.url ? ` (${author.url})` : ''
271
- }`;
270
+ pkg.author = `${author.name} <${author.email}>${
271
+ author.url ? ` (${author.url})` : ''
272
+ }`;
273
+ }
272
274
 
273
275
  if (!pkg.license) {
274
276
  pkg.license = props.license;
@@ -145,6 +145,7 @@ export default class CoreYarnGenerator extends Generator {
145
145
  if (this.options.disableYarnGitCache) {
146
146
  config.compressionLevel = 'mixed'; // optimized for size
147
147
  config.enableGlobalCache = true;
148
+ delete config.supportedArchitectures;
148
149
  } else {
149
150
  config.compressionLevel = 0; // optimized for github config
150
151
  config.enableGlobalCache = false;
@@ -279,7 +279,7 @@ export default class PobLibGenerator extends Generator {
279
279
  runner: this.pobjson.testing
280
280
  ? this.pobjson.testing.runner || 'jest'
281
281
  : undefined,
282
- build: withBabel,
282
+ build: withBabel || withTypescript,
283
283
  typescript: withTypescript,
284
284
  documentation: !!this.pobjson.documentation,
285
285
  codecov: this.pobjson.testing && this.pobjson.testing.codecov,
@@ -331,7 +331,7 @@ export default class PobLibGenerator extends Generator {
331
331
  monorepo: false,
332
332
  packageManager: this.options.packageManager,
333
333
  yarnNodeLinker: this.options.yarnNodeLinker,
334
- typescript: withBabel,
334
+ typescript: withBabel || withTypescript,
335
335
  testing: this.pobjson.testing,
336
336
  });
337
337
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "17.0.0",
3
+ "version": "17.2.0",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -62,7 +62,7 @@
62
62
  "mem-fs-editor": "11.0.0",
63
63
  "minimist": "1.2.8",
64
64
  "parse-author": "2.0.0",
65
- "pob-dependencies": "10.0.0",
65
+ "pob-dependencies": "10.2.0",
66
66
  "prettier": "2.8.8",
67
67
  "semver": "7.5.4",
68
68
  "validate-npm-package-name": "^5.0.0",
@@ -71,6 +71,6 @@
71
71
  "yeoman-generator": "7.1.1"
72
72
  },
73
73
  "devDependencies": {
74
- "@pob/root": "8.9.1"
74
+ "@pob/root": "8.11.0"
75
75
  }
76
76
  }