pob 14.5.0 → 14.5.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 +11 -0
- package/lib/generators/core/yarn/CoreYarnGenerator.js +25 -10
- package/lib/generators/monorepo/PobMonorepoGenerator.js +1 -2
- package/lib/generators/monorepo/lerna/MonorepoLernaGenerator.js +1 -1
- package/lib/generators/monorepo/workspaces/MonorepoWorkspacesGenerator.js +2 -3
- package/lib/utils/writeAndFormat.js +1 -0
- package/package.json +2 -2
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
|
+
## [14.5.1](https://github.com/christophehurpeau/pob/compare/pob@14.5.0...pob@14.5.1) (2023-11-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* force update plugin if lifecycle script is missing ([1e29b9d](https://github.com/christophehurpeau/pob/commit/1e29b9d8a2eb4108299afba653f66004ed21e49b))
|
|
12
|
+
* **pob:** fix yarnrc dump options ([bf27b86](https://github.com/christophehurpeau/pob/commit/bf27b86ae1faccff12cbdefd26cdb05166b4b2f2))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [14.5.0](https://github.com/christophehurpeau/pob/compare/pob@14.4.2...pob@14.5.0) (2023-11-05)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -84,9 +84,15 @@ export default class CoreYarnGenerator extends Generator {
|
|
|
84
84
|
this.spawnSync('yarn', ['plugin', 'remove', name]);
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
const installPluginIfNotInstalled = (
|
|
87
|
+
const installPluginIfNotInstalled = (
|
|
88
|
+
name,
|
|
89
|
+
nameOrUrl = name,
|
|
90
|
+
forceInstallIfInstalled = () => false,
|
|
91
|
+
) => {
|
|
88
92
|
if (!isPluginInstalled(name)) {
|
|
89
93
|
installPlugin(nameOrUrl);
|
|
94
|
+
} else if (forceInstallIfInstalled()) {
|
|
95
|
+
installPlugin(nameOrUrl);
|
|
90
96
|
}
|
|
91
97
|
};
|
|
92
98
|
|
|
@@ -109,14 +115,17 @@ export default class CoreYarnGenerator extends Generator {
|
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
if (pkg.workspaces) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
installPluginIfNotInstalled(
|
|
119
|
+
versionPluginName,
|
|
120
|
+
'https://raw.githubusercontent.com/christophehurpeau/yarn-plugin-conventional-version/main/bundles/%40yarnpkg/plugin-conventional-version.cjs',
|
|
121
|
+
() => {
|
|
122
|
+
const content = fs.readFileSync(
|
|
123
|
+
'.yarn/plugins/@yarnpkg/plugin-conventional-version.cjs',
|
|
124
|
+
'utf8',
|
|
125
|
+
);
|
|
126
|
+
return !content.includes('Lifecycle script: preversion');
|
|
127
|
+
},
|
|
128
|
+
);
|
|
120
129
|
} else {
|
|
121
130
|
installPluginIfNotInstalled(
|
|
122
131
|
versionPluginName,
|
|
@@ -160,7 +169,13 @@ export default class CoreYarnGenerator extends Generator {
|
|
|
160
169
|
delete config.yarnPath;
|
|
161
170
|
}
|
|
162
171
|
|
|
163
|
-
writeAndFormat(
|
|
172
|
+
writeAndFormat(
|
|
173
|
+
this.fs,
|
|
174
|
+
'.yarnrc.yml',
|
|
175
|
+
yml.dump(sortObject(config), {
|
|
176
|
+
lineWidth: 9999,
|
|
177
|
+
}),
|
|
178
|
+
);
|
|
164
179
|
} else {
|
|
165
180
|
this.fs.delete('.yarn');
|
|
166
181
|
this.fs.delete('.yarnrc.yml');
|
|
@@ -218,8 +218,7 @@ export default class PobMonorepoGenerator extends Generator {
|
|
|
218
218
|
|
|
219
219
|
this.composeWith('pob:common:husky', {});
|
|
220
220
|
|
|
221
|
-
const isYarnVersionEnabled =
|
|
222
|
-
this.pobLernaConfig.ci && !pkg.devDependencies?.['@pob/lerna-light'];
|
|
221
|
+
const isYarnVersionEnabled = this.pobLernaConfig.ci;
|
|
223
222
|
|
|
224
223
|
const splitCIJobs = this.packageNames.length > 8;
|
|
225
224
|
|
|
@@ -100,7 +100,7 @@ export default class MonorepoLernaGenerator extends Generator {
|
|
|
100
100
|
packageUtils.removeDevDependencies(pkg, ['lerna']);
|
|
101
101
|
|
|
102
102
|
// TODO remove lerna completely
|
|
103
|
-
const isYarnVersionEnabled =
|
|
103
|
+
const isYarnVersionEnabled = true;
|
|
104
104
|
|
|
105
105
|
const getPackagePobConfig = (config) => ({
|
|
106
106
|
babelEnvs: [],
|
|
@@ -67,6 +67,7 @@ export default class MonorepoWorkspacesGenerator extends Generator {
|
|
|
67
67
|
// package.json
|
|
68
68
|
const pkg = this.fs.readJSON(this.destinationPath('package.json'), {});
|
|
69
69
|
packageUtils.removeDependencies(pkg, ['@pob/lerna-light']);
|
|
70
|
+
packageUtils.removeDevDependencies(pkg, ['@pob/lerna-light']);
|
|
70
71
|
|
|
71
72
|
if (this.npm) {
|
|
72
73
|
if (!pkg.engines) pkg.engines = {};
|
|
@@ -76,9 +77,7 @@ export default class MonorepoWorkspacesGenerator extends Generator {
|
|
|
76
77
|
delete pkg.engines.yarn;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const isYarnVersionEnabled = !pkg.devDependencies?.['@pob/lerna-light'];
|
|
80
|
+
const isYarnVersionEnabled = true;
|
|
82
81
|
|
|
83
82
|
if (pkg.name !== 'pob-monorepo') {
|
|
84
83
|
packageUtils.addDevDependencies(pkg, ['repository-check-dirty']);
|
|
@@ -9,6 +9,7 @@ export function writeAndFormat(fs, destinationPath, content, { parser } = {}) {
|
|
|
9
9
|
trailingComma: 'all',
|
|
10
10
|
singleQuote: !destinationPath.endsWith('.yml'),
|
|
11
11
|
arrowParens: 'always',
|
|
12
|
+
printWidth: destinationPath === '.yarnrc.yml' ? 9999 : undefined,
|
|
12
13
|
}),
|
|
13
14
|
);
|
|
14
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pob",
|
|
3
|
-
"version": "14.5.
|
|
3
|
+
"version": "14.5.1",
|
|
4
4
|
"description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"skeleton"
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"mem-fs-editor": "10.0.3",
|
|
65
65
|
"minimist": "1.2.8",
|
|
66
66
|
"parse-author": "2.0.0",
|
|
67
|
-
"pob-dependencies": "8.8.
|
|
67
|
+
"pob-dependencies": "8.8.1",
|
|
68
68
|
"prettier": "2.8.8",
|
|
69
69
|
"semver": "7.5.4",
|
|
70
70
|
"yarn-workspace-utils": "1.1.0",
|