pob 9.12.1 → 9.12.2

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,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
+ ## [9.12.2](https://github.com/christophehurpeau/pob/compare/pob@9.12.1...pob@9.12.2) (2022-01-02)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **pob:** stop ci testing on node 14 on app projects ([c775697](https://github.com/christophehurpeau/pob/commit/c77569741136dc3feefcdc61f666092751be944c))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [9.12.1](https://github.com/christophehurpeau/pob/compare/pob@9.12.0...pob@9.12.1) (2022-01-02)
7
18
 
8
19
 
@@ -157,6 +157,7 @@ export default class PobAppGenerator extends Generator {
157
157
  codecov: false,
158
158
  ci: this.appConfig.ci,
159
159
  packageManager: this.options.packageManager,
160
+ isApp: true,
160
161
  });
161
162
 
162
163
  this.composeWith('pob:common:format-lint', {
@@ -125,10 +125,6 @@ export default class CommonBabelGenerator extends Generator {
125
125
  validate: (versions) => versions.length > 0,
126
126
  default: nodeVersions,
127
127
  choices: [
128
- {
129
- name: '12 (Maintenance LTS)',
130
- value: '12',
131
- },
132
128
  {
133
129
  name: '14 (Maintenance LTS)',
134
130
  value: '14',
@@ -48,6 +48,12 @@ export default class CommonTestingGenerator extends Generator {
48
48
  defaults: 'yarn',
49
49
  desc: 'yarn or npm',
50
50
  });
51
+
52
+ this.option('isApp', {
53
+ type: Boolean,
54
+ required: true,
55
+ desc: 'is app',
56
+ });
51
57
  }
52
58
 
53
59
  default() {
@@ -60,6 +66,7 @@ export default class CommonTestingGenerator extends Generator {
60
66
  documentation: this.options.documentation,
61
67
  codecov: this.options.codecov,
62
68
  packageManager: this.options.packageManager,
69
+ isApp: this.options.isApp,
63
70
  });
64
71
  } else {
65
72
  this.composeWith('pob:core:ci', {
@@ -54,6 +54,12 @@ export default class CoreCIGenerator extends Generator {
54
54
  required: true,
55
55
  desc: 'Include documentation generation',
56
56
  });
57
+
58
+ this.option('isApp', {
59
+ type: Boolean,
60
+ required: true,
61
+ desc: 'is app',
62
+ });
57
63
  }
58
64
 
59
65
  default() {
@@ -75,6 +81,7 @@ export default class CoreCIGenerator extends Generator {
75
81
  build: this.options.build,
76
82
  typescript: this.options.typescript,
77
83
  codecov: this.options.codecov,
84
+ supportsNode14: !this.options.isApp,
78
85
  },
79
86
  );
80
87
  } else {
@@ -8,7 +8,7 @@ jobs:
8
8
 
9
9
  strategy:
10
10
  matrix:
11
- node-version: [14.x, 16.x]
11
+ node-version: [<% if (supportsNode14) { -%>14.x, <% } -%>16.x]
12
12
 
13
13
  steps:
14
14
  - uses: actions/checkout@v2
@@ -13,6 +13,12 @@ export default class CoreGitGenerator extends Generator {
13
13
  defaults: '',
14
14
  desc: 'Should create the repo on github',
15
15
  });
16
+
17
+ this.option('isApp', {
18
+ type: String,
19
+ required: true,
20
+ desc: 'is app',
21
+ });
16
22
  }
17
23
 
18
24
  async initializing() {
@@ -94,6 +100,7 @@ export default class CoreGitGenerator extends Generator {
94
100
  shouldCreate: !this.originUrl,
95
101
  gitHostAccount: this.gitHostAccount,
96
102
  repoName: this.repoName,
103
+ isApp: this.options.isApp,
97
104
  });
98
105
  }
99
106
  }
@@ -15,14 +15,18 @@ const gh = got.extend({
15
15
  },
16
16
  });
17
17
 
18
- const configureProtectionRule = async (owner, repo) => {
18
+ const configureProtectionRule = async (owner, repo, isApp) => {
19
19
  for (const branch of ['main', 'master']) {
20
20
  try {
21
21
  await gh.put(`repos/${owner}/${repo}/branches/${branch}/protection`, {
22
22
  json: {
23
23
  required_status_checks: {
24
24
  strict: false,
25
- contexts: ['build (14.x)', 'build (16.x)', 'reviewflow'],
25
+ contexts: [
26
+ !isApp && 'build (14.x)',
27
+ 'build (16.x)',
28
+ 'reviewflow',
29
+ ].filter(Boolean),
26
30
  },
27
31
  enforce_admins: false, // true,
28
32
  required_pull_request_reviews: null,
@@ -67,6 +71,12 @@ export default class CoreGitGithubGenerator extends Generator {
67
71
  desc: 'repo name',
68
72
  });
69
73
 
74
+ this.option('isApp', {
75
+ type: String,
76
+ required: true,
77
+ desc: 'is app',
78
+ });
79
+
70
80
  if (!GITHUB_TOKEN && process.env.CI !== 'true') {
71
81
  throw new Error(
72
82
  'Missing POB_GITHUB_TOKEN. Create one with https://github.com/settings/tokens/new?scopes=repo&description=POB%20Generator and add it in your env variables.',
@@ -137,7 +147,7 @@ export default class CoreGitGithubGenerator extends Generator {
137
147
  cwd,
138
148
  });
139
149
 
140
- configureProtectionRule(owner, repo);
150
+ configureProtectionRule(owner, repo, this.options.isApp);
141
151
 
142
152
  // await gh.put(`/repos/${owner}/${repo}/topics`, {
143
153
  // names: pkg.keywords,
@@ -162,7 +172,7 @@ export default class CoreGitGithubGenerator extends Generator {
162
172
  },
163
173
  });
164
174
 
165
- configureProtectionRule(owner, repo);
175
+ configureProtectionRule(owner, repo, this.options.isApp);
166
176
  }
167
177
  }
168
178
  }
@@ -250,6 +250,7 @@ export default class PobLibGenerator extends Generator {
250
250
  codecov: this.pobjson.testing && this.pobjson.testing.codecov,
251
251
  ci: this.pobjson.testing && this.pobjson.testing.ci,
252
252
  packageManager: this.options.packageManager,
253
+ isApp: false,
253
254
  });
254
255
 
255
256
  // must be after testing
@@ -193,6 +193,7 @@ export default class PobMonorepoGenerator extends Generator {
193
193
  codecov: this.pobLernaConfig.testing && this.pobLernaConfig.codecov,
194
194
  ci: this.pobLernaConfig.ci,
195
195
  packageManager: this.options.packageManager,
196
+ isApp: this.options.isAppProject,
196
197
  });
197
198
 
198
199
  this.composeWith('pob:common:format-lint', {
@@ -165,7 +165,9 @@ export default class PobBaseGenerator extends Generator {
165
165
  });
166
166
 
167
167
  if (!this.inLerna) {
168
- this.composeWith('pob:core:git');
168
+ this.composeWith('pob:core:git', {
169
+ isApp: this.projectConfig.type === 'app',
170
+ });
169
171
  } else {
170
172
  if (this.fs.exists('.git-hooks')) this.fs.delete('.git-hooks');
171
173
  if (this.fs.exists('git-hooks')) this.fs.delete('git-hooks');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "9.12.1",
3
+ "version": "9.12.2",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -61,11 +61,11 @@
61
61
  "mem-fs-editor": "9.4.0",
62
62
  "minimist-argv": "^1.1.0",
63
63
  "parse-author": "^2.0.0",
64
- "pob-dependencies": "6.6.1",
64
+ "pob-dependencies": "6.6.2",
65
65
  "prettier": "2.5.1",
66
66
  "semver": "^7.3.4",
67
67
  "yeoman-environment": "^3.5.1",
68
68
  "yeoman-generator": "^5.4.0"
69
69
  },
70
- "gitHead": "9a3b1d4e78444d3be10d8d96e1586294dcab302c"
70
+ "gitHead": "a24cc6360630314a3ed2ea8fd2cc0c5f02e300ce"
71
71
  }