pob 17.1.0 → 17.2.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,26 @@
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.1](https://github.com/christophehurpeau/pob/compare/pob@17.2.0...pob@17.2.1) (2023-12-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * add tsimp cache in gitignore ([d598fa4](https://github.com/christophehurpeau/pob/commit/d598fa4dfc20556319f204ee43dbefaa5f96f026))
12
+
13
+ Version bump for dependency: root
14
+
15
+
16
+ ## [17.2.0](https://github.com/christophehurpeau/pob/compare/pob@17.1.0...pob@17.2.0) (2023-12-27)
17
+
18
+
19
+ ### Features
20
+
21
+ * improve experimental typescript compiler ([c46d8f2](https://github.com/christophehurpeau/pob/commit/c46d8f2ea003fd1721ba481cfb42bc35e22e7537))
22
+
23
+ Version bump for dependency: root
24
+
25
+
6
26
  ## [17.1.0](https://github.com/christophehurpeau/pob/compare/pob@17.0.0...pob@17.1.0) (2023-12-26)
7
27
 
8
28
 
@@ -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
  })();
@@ -27,7 +27,11 @@ yarn-error.log*
27
27
  <% } -%>
28
28
  <% if (testing) { -%>
29
29
 
30
- # jest default coverage directory
30
+ <% if (typescript && !withBabel) { -%>
31
+ # tsimp cache
32
+ /.tsimp
33
+ <% } -%>
34
+ # default coverage directory
31
35
  /coverage
32
36
  <% } -%>
33
37
  <% if (typescript && buildInGit) { -%>
@@ -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;
@@ -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.1.0",
3
+ "version": "17.2.1",
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.1.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.10.0"
74
+ "@pob/root": "8.11.1"
75
75
  }
76
76
  }