pob 26.1.1 → 26.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,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
+ ## [26.2.0](https://github.com/christophehurpeau/pob/compare/pob@26.1.1...pob@26.2.0) (2025-02-02)
7
+
8
+ ### Features
9
+
10
+ * better tamagui support ([7af3a16](https://github.com/christophehurpeau/pob/commit/7af3a161ed462135bb562fff46ad0ca8d606faf1))
11
+ * support react-native target ([7e374f8](https://github.com/christophehurpeau/pob/commit/7e374f842c5aaf78f886722c305ac52f9a6aa5db))
12
+
13
+ Version bump for dependency: @pob/root
14
+
15
+
6
16
  ## [26.1.1](https://github.com/christophehurpeau/pob/compare/pob@26.1.0...pob@26.1.1) (2025-02-02)
7
17
 
8
18
  Version bump for dependency: @pob/root
@@ -392,48 +392,73 @@ export default class CommonTranspilerGenerator extends Generator {
392
392
 
393
393
  const exportTarget = {};
394
394
 
395
- if (target === "node") {
396
- const cjsExt = pkg.type === "module" ? "cjs" : "cjs.js";
397
- const filenameWithoutExt = `${entryDistName}${
398
- omitTarget
399
- ? ""
400
- : `-${target}${omitVersionInFileName ? "" : version}`
401
- }`;
402
- if (bundler === "tsc") {
403
- if (formats) {
404
- throw new Error("tsc does not support formats");
395
+ switch (target) {
396
+ case "node": {
397
+ const cjsExt = pkg.type === "module" ? "cjs" : "cjs.js";
398
+ const filenameWithoutExt = `${entryDistName}${
399
+ omitTarget
400
+ ? ""
401
+ : `-${target}${omitVersionInFileName ? "" : version}`
402
+ }`;
403
+ if (bundler === "tsc") {
404
+ if (formats) {
405
+ throw new Error("tsc does not support formats");
406
+ }
407
+ exportTarget.import = `./${this.options.buildDirectory}/${filenameWithoutExt}.js`;
408
+ } else if (!formats || formats.includes("es")) {
409
+ exportTarget.import = `./${this.options.buildDirectory}/${filenameWithoutExt}.mjs`;
410
+
411
+ if (formats && formats.includes("cjs")) {
412
+ exportTarget.require = `./${this.options.buildDirectory}/${filenameWithoutExt}.${cjsExt}`;
413
+ }
414
+ } else if (formats && formats.includes("cjs")) {
415
+ exportTarget.default = `./${this.options.buildDirectory}/${filenameWithoutExt}.${cjsExt}`;
416
+ }
417
+ // eslint: https://github.com/benmosher/eslint-plugin-import/issues/2132
418
+ // jest: https://github.com/facebook/jest/issues/9771
419
+ if (!pkg.main && exportName === ".") {
420
+ pkg.main =
421
+ pkg.type === "module"
422
+ ? exportTarget.import
423
+ : exportTarget.default ||
424
+ exportTarget.require ||
425
+ exportTarget.import;
426
+ }
427
+
428
+ break;
429
+ }
430
+ case "browser": {
431
+ if (!formats || formats.includes("es")) {
432
+ exportTarget.import = `./${
433
+ this.options.buildDirectory
434
+ }/${entryDistName}-${target}${version || ""}.es.js`;
405
435
  }
406
- exportTarget.import = `./${this.options.buildDirectory}/${filenameWithoutExt}.js`;
407
- } else if (!formats || formats.includes("es")) {
408
- exportTarget.import = `./${this.options.buildDirectory}/${filenameWithoutExt}.mjs`;
409
436
 
410
437
  if (formats && formats.includes("cjs")) {
411
- exportTarget.require = `./${this.options.buildDirectory}/${filenameWithoutExt}.${cjsExt}`;
438
+ exportTarget.require = `./${
439
+ this.options.buildDirectory
440
+ }/${entryDistName}-${target}${version || ""}.cjs.js`;
412
441
  }
413
- } else if (formats && formats.includes("cjs")) {
414
- exportTarget.default = `./${this.options.buildDirectory}/${filenameWithoutExt}.${cjsExt}`;
415
- }
416
- // eslint: https://github.com/benmosher/eslint-plugin-import/issues/2132
417
- // jest: https://github.com/facebook/jest/issues/9771
418
- if (!pkg.main && exportName === ".") {
419
- pkg.main =
420
- pkg.type === "module"
421
- ? exportTarget.import
422
- : exportTarget.default ||
423
- exportTarget.require ||
424
- exportTarget.import;
425
- }
426
- } else if (target === "browser") {
427
- if (!formats || formats.includes("es")) {
428
- exportTarget.import = `./${
429
- this.options.buildDirectory
430
- }/${entryDistName}-${target}${version || ""}.es.js`;
442
+
443
+ break;
431
444
  }
445
+ case "react-native": {
446
+ if (!formats || formats.includes("es")) {
447
+ exportTarget.import = `./${
448
+ this.options.buildDirectory
449
+ }/${entryDistName}-${target}.es.js`;
450
+ }
451
+
452
+ if (formats && formats.includes("cjs")) {
453
+ exportTarget.require = `./${
454
+ this.options.buildDirectory
455
+ }/${entryDistName}-${target}.cjs.js`;
456
+ }
432
457
 
433
- if (formats && formats.includes("cjs")) {
434
- exportTarget.require = `./${
435
- this.options.buildDirectory
436
- }/${entryDistName}-${target}${version || ""}.cjs.js`;
458
+ break;
459
+ }
460
+ default: {
461
+ throw new Error(`Invalid target: ${target}`);
437
462
  }
438
463
  }
439
464
 
@@ -135,9 +135,9 @@ export default class CoreYarnGenerator extends Generator {
135
135
  if (
136
136
  !pkg.packageManager ||
137
137
  !pkg.packageManager.startsWith("yarn@") ||
138
- lt(pkg.packageManager.slice("yarn@".length), "4.0.2")
138
+ lt(pkg.packageManager.slice("yarn@".length), "4.6.0")
139
139
  ) {
140
- pkg.packageManager = "yarn@4.0.2";
140
+ pkg.packageManager = "yarn@4.6.0";
141
141
  }
142
142
 
143
143
  // must be done after plugins installed
@@ -61,13 +61,12 @@ const hasBuild = (packages, configs) =>
61
61
  );
62
62
 
63
63
  const hasTamagui = (packages, configs) =>
64
- configs.some(
65
- (config, index) =>
64
+ packages.some(
65
+ (pkg) =>
66
66
  !!(
67
- config &&
68
- config.project &&
69
- config.project.type === "app" &&
70
- ["storybook"].includes(config.app.type)
67
+ pkg.dependencies?.tamagui ||
68
+ pkg.dependencies?.["@tamagui/core"] ||
69
+ pkg.dependencies?.alouette
71
70
  ),
72
71
  );
73
72
 
@@ -254,6 +253,10 @@ export default class PobMonorepoGenerator extends Generator {
254
253
  splitCIJobs,
255
254
  });
256
255
 
256
+ const gitignorePaths = [
257
+ hasTamagui(this.packages, this.packageConfigs) && ".tamagui",
258
+ ].filter(Boolean);
259
+
257
260
  this.composeWith("pob:common:format-lint", {
258
261
  monorepo: true,
259
262
  documentation: this.pobLernaConfig.documentation,
@@ -265,9 +268,9 @@ export default class PobMonorepoGenerator extends Generator {
265
268
  yarnNodeLinker: this.options.yarnNodeLinker,
266
269
  appTypes: JSON.stringify(getAppTypes(this.packageConfigs)),
267
270
  ignorePaths: [
271
+ ...gitignorePaths.map((path) => `/${path}`),
268
272
  hasDist(this.packages, this.packageConfigs) && "/dist",
269
273
  hasBuild(this.packages, this.packageConfigs) && "/build",
270
- hasTamagui(this.packages, this.packageConfigs) && "/.tamagui",
271
274
  ]
272
275
  .filter(Boolean)
273
276
  .join("\n"),
@@ -300,6 +303,8 @@ export default class PobMonorepoGenerator extends Generator {
300
303
  typescript: this.pobLernaConfig.typescript,
301
304
  documentation: this.pobLernaConfig.documentation,
302
305
  testing: this.pobLernaConfig.testing,
306
+ // TODO add workspaces paths like we do in format-lint
307
+ paths: gitignorePaths.join("\n"),
303
308
  // todo: fix this using workspaces
304
309
  // buildDirectory: this.pobLernaConfig.typescript ? `/*/build` : "",
305
310
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "26.1.1",
3
+ "version": "26.2.0",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -65,7 +65,7 @@
65
65
  "mem-fs-editor": "11.1.4",
66
66
  "minimist": "1.2.8",
67
67
  "parse-author": "2.0.0",
68
- "pob-dependencies": "17.1.0",
68
+ "pob-dependencies": "17.2.0",
69
69
  "prettier": "3.4.2",
70
70
  "semver": "7.7.0",
71
71
  "typescript": "5.7.3",
@@ -75,7 +75,7 @@
75
75
  "yeoman-generator": "7.4.0"
76
76
  },
77
77
  "devDependencies": {
78
- "@pob/root": "16.1.1",
78
+ "@pob/root": "16.2.0",
79
79
  "@types/node": "22.13.0"
80
80
  }
81
81
  }