pob 26.2.0 → 26.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 +11 -0
- package/lib/generators/common/babel/CommonBabelGenerator.js +11 -7
- package/lib/generators/common/transpiler/CommonTranspilerGenerator.js +21 -11
- package/lib/generators/common/typescript/CommonTypescriptGenerator.js +13 -6
- package/lib/generators/common/typescript/templates/tsconfig.check-js.json.ejs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.3.0](https://github.com/christophehurpeau/pob/compare/pob@26.2.0...pob@26.3.0) (2025-02-02)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add mjs and cjs to checkonly ([2666924](https://github.com/christophehurpeau/pob/commit/2666924e72980b7c9a5c1315ff7f8680642171ff))
|
|
11
|
+
* improve typescript checkonly support ([3355104](https://github.com/christophehurpeau/pob/commit/3355104897428d9014b11402ed771a10b1b94064))
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* avoid deleting @babel/core ([022d74d](https://github.com/christophehurpeau/pob/commit/022d74d8e462962432cf0bc53d5f3b0d79f86769))
|
|
16
|
+
|
|
6
17
|
## [26.2.0](https://github.com/christophehurpeau/pob/compare/pob@26.1.1...pob@26.2.0) (2025-02-02)
|
|
7
18
|
|
|
8
19
|
### Features
|
|
@@ -241,7 +241,7 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
241
241
|
pkg.pob.bundler === "rollup-babel"
|
|
242
242
|
) {
|
|
243
243
|
delete pkg.pob.babelEnvs;
|
|
244
|
-
if (pkg.pob.typescript
|
|
244
|
+
if (!pkg.pob.typescript) {
|
|
245
245
|
delete pkg.pob.envs;
|
|
246
246
|
delete pkg.pob.entries;
|
|
247
247
|
delete pkg.pob.jsx;
|
|
@@ -304,11 +304,14 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
304
304
|
|
|
305
305
|
/* dependencies */
|
|
306
306
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
if (
|
|
308
|
+
useBabel ||
|
|
309
|
+
(pkg.peerDependencies && pkg.peerDependencies["@babel/core"])
|
|
310
|
+
) {
|
|
311
|
+
packageUtils.addDevDependencies(pkg, ["@babel/core"]);
|
|
312
|
+
} else if (pkg.dependencies && pkg.dependencies["pob-babel"] && !useBabel) {
|
|
313
|
+
packageUtils.removeDevDependencies(pkg, ["@babel/core"]);
|
|
314
|
+
}
|
|
312
315
|
packageUtils.addOrRemoveDevDependencies(pkg, useBabel, ["pob-babel"]);
|
|
313
316
|
|
|
314
317
|
if (pkg.dependencies && pkg.dependencies["pob-babel"]) {
|
|
@@ -325,7 +328,8 @@ export default class CommonBabelGenerator extends Generator {
|
|
|
325
328
|
packageUtils.addOrRemoveDevDependencies(
|
|
326
329
|
pkg,
|
|
327
330
|
(useBabel && pkg.pob.jsx) ||
|
|
328
|
-
(pkg.devDependencies?.["@babel/preset-react"] &&
|
|
331
|
+
(pkg.devDependencies?.["@babel/preset-react"] &&
|
|
332
|
+
(isLibraryRollupPlugin || pkg.name === "alouette-icons")),
|
|
329
333
|
["@babel/preset-react"],
|
|
330
334
|
);
|
|
331
335
|
|
|
@@ -136,10 +136,10 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
136
136
|
default() {
|
|
137
137
|
const pkg = this.fs.readJSON(this.destinationPath("package.json"));
|
|
138
138
|
const withBabel = this.babelEnvs && this.babelEnvs.length > 0;
|
|
139
|
-
const withTypescript =
|
|
140
|
-
pkg.pob.typescript === true || withBabel || !!pkg.pob.bundler;
|
|
139
|
+
const withTypescript = pkg.pob.typescript || withBabel || !!pkg.pob.bundler;
|
|
141
140
|
const bundler =
|
|
142
141
|
withTypescript &&
|
|
142
|
+
pkg.pob?.typescript !== "check-only" &&
|
|
143
143
|
(pkg.pob.rollup === false ||
|
|
144
144
|
pkg.pob.bundler === "tsc" ||
|
|
145
145
|
(!pkg.pob.bundler && !pkg.pob.typescript === true)
|
|
@@ -202,7 +202,11 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
if (shouldBuildDefinitions) {
|
|
205
|
-
pkg.scripts.build
|
|
205
|
+
if (pkg.scripts.build) {
|
|
206
|
+
pkg.scripts.build += " && yarn run build:definitions";
|
|
207
|
+
} else {
|
|
208
|
+
pkg.scripts.build = "yarn run build:definitions";
|
|
209
|
+
}
|
|
206
210
|
} else if (!this.options.isApp && !bundler && !withTypescript) {
|
|
207
211
|
// check definitions, but also force lerna to execute build:definitions in right order
|
|
208
212
|
// example: nightingale-types depends on nightingale-levels
|
|
@@ -238,17 +242,23 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
238
242
|
);
|
|
239
243
|
packageUtils.addOrRemoveDevDependencies(
|
|
240
244
|
pkg,
|
|
241
|
-
bundler === "esbuild" &&
|
|
245
|
+
bundler === "esbuild" &&
|
|
246
|
+
withTypescript &&
|
|
247
|
+
pkg.pob?.typescript !== "check-only",
|
|
242
248
|
["@pob/esbuild"],
|
|
243
249
|
);
|
|
244
250
|
packageUtils.addOrRemoveDevDependencies(
|
|
245
251
|
pkg,
|
|
246
|
-
bundler === "rollup-esbuild" &&
|
|
252
|
+
bundler === "rollup-esbuild" &&
|
|
253
|
+
withTypescript &&
|
|
254
|
+
pkg.pob?.typescript !== "check-only",
|
|
247
255
|
["@pob/rollup-esbuild"],
|
|
248
256
|
);
|
|
249
257
|
packageUtils.addOrRemoveDependencies(
|
|
250
258
|
pkg,
|
|
251
|
-
(bundler === "tsc" || bundler === "rollup-typescript") &&
|
|
259
|
+
(bundler === "tsc" || bundler === "rollup-typescript") &&
|
|
260
|
+
withTypescript &&
|
|
261
|
+
pkg.pob?.typescript !== "check-only",
|
|
252
262
|
["tslib"],
|
|
253
263
|
"^",
|
|
254
264
|
);
|
|
@@ -289,7 +299,7 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
289
299
|
}
|
|
290
300
|
|
|
291
301
|
// if (!pkg.main || pkg.main.startsWith('./lib/')) {
|
|
292
|
-
if (bundler || withTypescript) {
|
|
302
|
+
if (bundler || (withTypescript && pkg.pob?.typescript !== "check-only")) {
|
|
293
303
|
// see pkg.exports instead.
|
|
294
304
|
delete pkg.main;
|
|
295
305
|
if (!this.options.isApp) {
|
|
@@ -298,12 +308,12 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
298
308
|
pkg.types = `./${this.options.srcDirectory}/index.ts`;
|
|
299
309
|
}
|
|
300
310
|
} else {
|
|
301
|
-
if (!pkg.main) {
|
|
311
|
+
if (!pkg.main && !pkg.pob.entries) {
|
|
302
312
|
pkg.exports = "./lib/index.js";
|
|
303
313
|
}
|
|
304
314
|
if (pkg.type === "module" && this.fs.exists("./lib/index.cjs")) {
|
|
305
315
|
pkg.main = "./lib/index.cjs";
|
|
306
|
-
} else {
|
|
316
|
+
} else if (!pkg.pob?.entries || pkg.pob.entries.includes("index")) {
|
|
307
317
|
pkg.main = "./lib/index.js";
|
|
308
318
|
}
|
|
309
319
|
if (!this.options.isApp || this.options.isAppLibrary) {
|
|
@@ -351,7 +361,7 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
351
361
|
}
|
|
352
362
|
|
|
353
363
|
/* webpack 5 and node with ESM support */
|
|
354
|
-
if (bundler || withTypescript) {
|
|
364
|
+
if (bundler || (withTypescript && pkg.pob?.typescript !== "check-only")) {
|
|
355
365
|
const omitTarget = bundler === "esbuild" || bundler === "tsc";
|
|
356
366
|
pkg.exports = {
|
|
357
367
|
"./package.json": "./package.json",
|
|
@@ -375,7 +385,7 @@ export default class CommonTranspilerGenerator extends Generator {
|
|
|
375
385
|
};
|
|
376
386
|
|
|
377
387
|
const defaultNodeEnv =
|
|
378
|
-
withBabel || withTypescript
|
|
388
|
+
withBabel || (withTypescript && pkg.pob?.typescript !== "check-only")
|
|
379
389
|
? envs.find((env) => env.target === "node")
|
|
380
390
|
: undefined;
|
|
381
391
|
|
|
@@ -237,20 +237,27 @@ export default class CommonTypescriptGenerator extends Generator {
|
|
|
237
237
|
]),
|
|
238
238
|
);
|
|
239
239
|
|
|
240
|
+
const isTypescriptPackageMap = new Map(
|
|
241
|
+
[...packageLocations.entries()].map(
|
|
242
|
+
([packageName, packageLocation]) => [
|
|
243
|
+
packageName,
|
|
244
|
+
existsSync(
|
|
245
|
+
`${packageLocations.get(packageName)}/tsconfig.json`,
|
|
246
|
+
) && existsSync(`${packageLocations.get(packageName)}/src`),
|
|
247
|
+
],
|
|
248
|
+
),
|
|
249
|
+
);
|
|
250
|
+
|
|
240
251
|
monorepoPackageSrcPaths = [...packageLocations.entries()].map(
|
|
241
252
|
([packageName, packageLocation]) => [
|
|
242
253
|
packageName,
|
|
243
254
|
`${packageLocation}/${
|
|
244
|
-
|
|
245
|
-
? "src"
|
|
246
|
-
: "lib"
|
|
255
|
+
isTypescriptPackageMap.get(packageName) ? "src" : "lib"
|
|
247
256
|
}`,
|
|
248
257
|
],
|
|
249
258
|
);
|
|
250
259
|
monorepoPackageReferences = yoConfig.pob.monorepo.packageNames
|
|
251
|
-
.filter((packageName) =>
|
|
252
|
-
existsSync(`${packageLocations.get(packageName)}/tsconfig.json`),
|
|
253
|
-
)
|
|
260
|
+
.filter((packageName) => isTypescriptPackageMap.get(packageName))
|
|
254
261
|
.map((packageName) => packageLocations.get(packageName));
|
|
255
262
|
// monorepoPackageBuildReferences = yoConfig.pob.monorepo.packageNames
|
|
256
263
|
// .filter((packageName) =>
|