pob 10.5.0 → 10.8.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,51 @@
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
+ # [10.8.0](https://github.com/christophehurpeau/pob/compare/pob@10.7.0...pob@10.8.0) (2022-03-24)
7
+
8
+
9
+ ### Features
10
+
11
+ * **deps:** update dependency prettier to v2.6.0 ([#1240](https://github.com/christophehurpeau/pob/issues/1240)) ([acfaca1](https://github.com/christophehurpeau/pob/commit/acfaca1645a0eeb5e842aa55ae37970da98310ff))
12
+
13
+
14
+
15
+
16
+
17
+ # [10.7.0](https://github.com/christophehurpeau/pob/compare/pob@10.6.0...pob@10.7.0) (2022-03-13)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **pob:** update option in monorepo ([ddb2129](https://github.com/christophehurpeau/pob/commit/ddb21299e99ae7e1044cbb9f480a94f94a6bcd7d))
23
+
24
+
25
+ ### Features
26
+
27
+ * **deps:** update dependency eslint to v8.11.0 ([#1234](https://github.com/christophehurpeau/pob/issues/1234)) ([4f41e09](https://github.com/christophehurpeau/pob/commit/4f41e094c9f9e3cade7c72347a50477617b220d4))
28
+
29
+
30
+
31
+
32
+
33
+ # [10.6.0](https://github.com/christophehurpeau/pob/compare/pob@10.5.0...pob@10.6.0) (2022-03-09)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * autodetect monorepo ([6057838](https://github.com/christophehurpeau/pob/commit/60578383b053635808473aa165234b13747be4bf))
39
+ * remove inNpmLerna ([154ba42](https://github.com/christophehurpeau/pob/commit/154ba4248c1f59c0d37967dee8b5aa3df91928d1))
40
+ * when projectPkg doesnt exists ([12598fe](https://github.com/christophehurpeau/pob/commit/12598fe8079ab5f577bf1299ae12ef29c57f6036))
41
+
42
+
43
+ ### Features
44
+
45
+ * add remix app ([104756a](https://github.com/christophehurpeau/pob/commit/104756a3dce93e23b1fc48825425903d9763e550))
46
+
47
+
48
+
49
+
50
+
6
51
  # [10.5.0](https://github.com/christophehurpeau/pob/compare/pob@10.4.1...pob@10.5.0) (2022-03-05)
7
52
 
8
53
 
@@ -1,12 +1,11 @@
1
1
  import { execSync } from 'child_process';
2
2
  import Generator from 'yeoman-generator';
3
3
  import inLerna from '../../utils/inLerna.js';
4
- import inNpmLerna from '../../utils/inNpmLerna.js';
5
4
  import * as packageUtils from '../../utils/package.js';
6
5
  import { appIgnorePaths } from './ignorePaths.js';
7
6
 
8
- const appsWithTypescript = ['alp', 'next.js', 'pobpack'];
9
- const appsWithBrowser = ['alp', 'next.js'];
7
+ const appsWithTypescript = ['alp', 'next.js', 'remix', 'pobpack'];
8
+ const appsWithBrowser = ['alp', 'next.js', 'remix'];
10
9
 
11
10
  export default class PobAppGenerator extends Generator {
12
11
  constructor(args, opts) {
@@ -67,7 +66,15 @@ export default class PobAppGenerator extends Generator {
67
66
  name: 'type',
68
67
  message: 'What kind of app is this ?',
69
68
  default: (config && config.type) || 'alp',
70
- choices: ['alp', 'pobpack', 'next.js', 'node', 'alp-node', 'other'],
69
+ choices: [
70
+ 'alp',
71
+ 'pobpack',
72
+ 'next.js',
73
+ 'remix',
74
+ 'node',
75
+ 'alp-node',
76
+ 'other',
77
+ ],
71
78
  },
72
79
  {
73
80
  type: 'confirm',
@@ -154,44 +161,46 @@ export default class PobAppGenerator extends Generator {
154
161
  ) {
155
162
  return './src';
156
163
  }
157
- // if (this.appConfig.type === 'next.js') return '.';
164
+ if (this.appConfig.type === 'remix') return '.';
158
165
  return '';
159
166
  })(),
160
167
  });
161
168
 
162
169
  this.composeWith('pob:common:remove-old-dependencies');
163
170
 
164
- this.composeWith('pob:common:testing', {
165
- enable: this.appConfig.testing,
166
- testing: this.appConfig.testing,
167
- typescript: babel,
168
- documentation: false,
169
- codecov: this.appConfig.codecov,
170
- ci: this.appConfig.ci,
171
- packageManager: this.options.packageManager,
172
- isApp: true,
173
- });
171
+ if (this.appConfig.type !== 'remix') {
172
+ this.composeWith('pob:common:testing', {
173
+ enable: this.appConfig.testing,
174
+ testing: this.appConfig.testing,
175
+ typescript: babel,
176
+ documentation: false,
177
+ codecov: this.appConfig.codecov,
178
+ ci: this.appConfig.ci,
179
+ packageManager: this.options.packageManager,
180
+ isApp: true,
181
+ });
174
182
 
175
- this.composeWith('pob:common:format-lint', {
176
- documentation: false,
177
- testing: this.appConfig.testing,
178
- babel,
179
- node,
180
- browser,
181
- // nextjs now supports src rootAsSrc: this.appConfig.type === 'next.js',
182
- enableSrcResolver: true,
183
- packageManager: this.options.packageManager,
184
- yarnNodeLinker: this.options.yarnNodeLinker,
185
- ignorePaths: ignorePaths.join('\n'),
186
- buildDirectory: 'build',
187
- });
183
+ this.composeWith('pob:common:format-lint', {
184
+ documentation: false,
185
+ testing: this.appConfig.testing,
186
+ babel,
187
+ node,
188
+ browser,
189
+ // nextjs now supports src rootAsSrc: this.appConfig.type === 'next.js',
190
+ enableSrcResolver: true,
191
+ packageManager: this.options.packageManager,
192
+ yarnNodeLinker: this.options.yarnNodeLinker,
193
+ ignorePaths: ignorePaths.join('\n'),
194
+ buildDirectory: 'build',
195
+ });
188
196
 
189
- this.composeWith('pob:common:release', {
190
- enable: !inLerna && this.appConfig.testing && this.appConfig.ci,
191
- withBabel: babel,
192
- documentation: false,
193
- updateOnly: this.options.updateOnly,
194
- });
197
+ this.composeWith('pob:common:release', {
198
+ enable: !inLerna && this.appConfig.testing && this.appConfig.ci,
199
+ withBabel: babel,
200
+ documentation: false,
201
+ updateOnly: this.options.updateOnly,
202
+ });
203
+ }
195
204
 
196
205
  this.composeWith('pob:core:vscode', {
197
206
  root: !inLerna,
@@ -224,6 +233,9 @@ export default class PobAppGenerator extends Generator {
224
233
  export: this.appConfig.export,
225
234
  });
226
235
  break;
236
+ case 'remix':
237
+ this.composeWith('pob:app:remix', {});
238
+ break;
227
239
  }
228
240
 
229
241
  execSync(
@@ -237,10 +249,11 @@ export default class PobAppGenerator extends Generator {
237
249
  // Re-read the content at this point because a composed generator might modify it.
238
250
  const pkg = this.fs.readJSON(this.destinationPath('package.json'));
239
251
 
240
- if (inNpmLerna) {
241
- if (!pkg.engines) pkg.engines = {};
242
- pkg.engines.yarn = '< 0.0.0';
243
- } else if (pkg.engines) {
252
+ // if (isNpm) {
253
+ // if (!pkg.engines) pkg.engines = {};
254
+ // pkg.engines.yarn = '< 0.0.0';
255
+ // } else
256
+ if (pkg.engines) {
244
257
  delete pkg.engines.yarn;
245
258
  }
246
259
 
@@ -1,6 +1,7 @@
1
1
  export const appIgnorePaths = {
2
2
  alp: (config) => ['# alp paths', '/build', '/public', '/data'],
3
3
  'next.js': (config) => ['# next.js paths', '/.next', '/out', '/build'],
4
+ remix: (config) => ['# remix paths', '/.cache', '/build', '/public/build'],
4
5
  pobpack: (config) => ['/build', '/public'],
5
6
  node: (config) => ['/build'],
6
7
  'alp-node': (config) => ['/build'],
@@ -0,0 +1,17 @@
1
+ import Generator from 'yeoman-generator';
2
+ import * as packageUtils from '../../../utils/package.js';
3
+
4
+ // run "yarn create remix remix" first, then "cd remix ; pob app"
5
+ export default class AppRemixGenerator extends Generator {
6
+ writing() {
7
+ const pkg = this.fs.readJSON(this.destinationPath('package.json'));
8
+
9
+ packageUtils.addScripts(pkg, {
10
+ build: 'cross-env NODE_ENV=production remix build',
11
+ start: 'cross-env NODE_ENV=development remix dev',
12
+ 'start:prod': 'cross-env NODE_ENV=production remix-serve build',
13
+ });
14
+
15
+ this.fs.writeJSON(this.destinationPath('package.json'), pkg);
16
+ }
17
+ }
package/lib/pob.js CHANGED
@@ -7,6 +7,7 @@ import argv from 'minimist-argv';
7
7
  import yeoman from 'yeoman-environment';
8
8
  import PobAppGenerator from './generators/app/PobAppGenerator.js';
9
9
  import AppNextjsGenerator from './generators/app/nextjs/AppNextjsGenerator.js';
10
+ import AppRemixGenerator from './generators/app/remix/AppRemixGenerator.js';
10
11
  import CommonBabelGenerator from './generators/common/babel/CommonBabelGenerator.js';
11
12
  import CommonLintGenerator from './generators/common/format-lint/CommonLintGenerator.js';
12
13
  import CommonHuskyGenerator from './generators/common/husky/CommonHuskyGenerator.js';
@@ -84,6 +85,11 @@ env.registerStub(
84
85
  'pob:app:nextjs',
85
86
  `${__dirname}/generators/app/nextjs/AppNextjsGenerator.js`,
86
87
  );
88
+ env.registerStub(
89
+ AppRemixGenerator,
90
+ 'pob:app:remix',
91
+ `${__dirname}/generators/app/nextjs/AppRemixGenerator.js`,
92
+ );
87
93
  env.registerStub(
88
94
  CommonBabelGenerator,
89
95
  'pob:common:babel',
@@ -210,9 +216,10 @@ env.registerStub(
210
216
  `${__dirname}/generators/monorepo/typescript/MonorepoTypescriptGenerator.js`,
211
217
  );
212
218
 
213
- let monorepo = argv._[0] === 'lerna' || argv._[0] === 'monorepo';
214
- const action = monorepo ? argv._[1] : argv._[0];
215
219
  const projectPkg = readJson(path.resolve('./package.json'));
220
+ const monorepoArg = argv._[0] === 'lerna' || argv._[0] === 'monorepo';
221
+ let monorepo = monorepoArg || !!(projectPkg && projectPkg.workspaces);
222
+ const action = monorepoArg ? argv._[1] : argv._[0];
216
223
 
217
224
  if (action === 'add') {
218
225
  if (!projectPkg.workspaces) {
@@ -23,7 +23,7 @@ const getInLernaThings = () => {
23
23
 
24
24
  return {
25
25
  rootMonorepoPkg,
26
- lernaJsonPath,
26
+ lernaJsonPath: lernaJsonPath || path.resolve('lerna.json'),
27
27
  rootPath: rootMonorepo,
28
28
  root: rootMonorepo === cwd,
29
29
  rootPackageManager:
@@ -44,6 +44,9 @@ const getInLernaThings = () => {
44
44
  };
45
45
  };
46
46
 
47
- export default !(rootMonorepoPkg && (rootMonorepoPkg.lerna || !!lernaJsonPath))
47
+ export default !(
48
+ rootMonorepoPkg &&
49
+ (rootMonorepoPkg.workspaces || rootMonorepoPkg.lerna || !!lernaJsonPath)
50
+ )
48
51
  ? false
49
52
  : getInLernaThings();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "10.5.0",
3
+ "version": "10.8.0",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -48,7 +48,7 @@
48
48
  "@pob/sort-object": "^4.0.1",
49
49
  "@pob/sort-pkg": "^4.0.1",
50
50
  "@yarnpkg/parsers": "2.5.0",
51
- "eslint": "8.10.0",
51
+ "eslint": "8.11.0",
52
52
  "findup-sync": "^5.0.0",
53
53
  "git-remote-url": "^1.0.1",
54
54
  "github-username": "^6.0.0",
@@ -62,10 +62,10 @@
62
62
  "minimist-argv": "^1.1.0",
63
63
  "parse-author": "^2.0.0",
64
64
  "pob-dependencies": "6.17.0",
65
- "prettier": "2.5.1",
65
+ "prettier": "2.6.0",
66
66
  "semver": "^7.3.4",
67
67
  "yeoman-environment": "^3.5.1",
68
68
  "yeoman-generator": "^5.4.0"
69
69
  },
70
- "gitHead": "2a85644c2f3aa3147e3baa57f8b05119228e22e4"
70
+ "gitHead": "3d47ae330af7dede42546a119c93a33fcd581d20"
71
71
  }