pob 10.4.0 → 10.6.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,46 @@
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.6.0](https://github.com/christophehurpeau/pob/compare/pob@10.5.0...pob@10.6.0) (2022-03-09)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * autodetect monorepo ([6057838](https://github.com/christophehurpeau/pob/commit/60578383b053635808473aa165234b13747be4bf))
12
+ * remove inNpmLerna ([154ba42](https://github.com/christophehurpeau/pob/commit/154ba4248c1f59c0d37967dee8b5aa3df91928d1))
13
+ * when projectPkg doesnt exists ([12598fe](https://github.com/christophehurpeau/pob/commit/12598fe8079ab5f577bf1299ae12ef29c57f6036))
14
+
15
+
16
+ ### Features
17
+
18
+ * add remix app ([104756a](https://github.com/christophehurpeau/pob/commit/104756a3dce93e23b1fc48825425903d9763e550))
19
+
20
+
21
+
22
+
23
+
24
+ # [10.5.0](https://github.com/christophehurpeau/pob/compare/pob@10.4.1...pob@10.5.0) (2022-03-05)
25
+
26
+
27
+ ### Features
28
+
29
+ * update actions/setup-node@v3 ([2ab3475](https://github.com/christophehurpeau/pob/commit/2ab3475da500ae3aaee0d9969eb7bb9bc207a8d0))
30
+
31
+
32
+
33
+
34
+
35
+ ## [10.4.1](https://github.com/christophehurpeau/pob/compare/pob@10.4.0...pob@10.4.1) (2022-03-05)
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * alp-rollup-plugin-config in devDependencies ([40e6a09](https://github.com/christophehurpeau/pob/commit/40e6a09a8bb9a78412a75834635c813bf377f756))
41
+
42
+
43
+
44
+
45
+
6
46
  # [10.4.0](https://github.com/christophehurpeau/pob/compare/pob@10.3.1...pob@10.4.0) (2022-03-05)
7
47
 
8
48
 
@@ -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
+ }
@@ -727,7 +727,8 @@ export default class CommonBabelGenerator extends Generator {
727
727
  /* pob-babel config */
728
728
 
729
729
  packageUtils.removeDevDependencies(pkg, ['@rollup/plugin-run']);
730
- packageUtils.addOrRemoveDependencies(
730
+ packageUtils.removeDependencies(pkg, ['alp-rollup-plugin-config']);
731
+ packageUtils.addOrRemoveDevDependencies(
731
732
  pkg,
732
733
  useBabel && this.options.isApp && this.options.useAppConfig,
733
734
  ['alp-rollup-plugin-config'],
@@ -22,7 +22,7 @@ jobs:
22
22
  # a new release is created:
23
23
  if: ${{ steps.release.outputs.release_created }}
24
24
 
25
- - uses: actions/setup-node@v2
25
+ - uses: actions/setup-node@v3
26
26
  with:
27
27
  node-version: 14
28
28
  registry-url: 'https://registry.npmjs.org'
@@ -10,7 +10,7 @@ jobs:
10
10
  steps:
11
11
  - uses: actions/checkout@v3
12
12
 
13
- - uses: actions/setup-node@v2
13
+ - uses: actions/setup-node@v3
14
14
  with:
15
15
  node-version: 16
16
16
 
@@ -14,7 +14,7 @@ jobs:
14
14
  - uses: actions/checkout@v3
15
15
 
16
16
  - name: Use Node.js ${{ matrix.node-version }}
17
- uses: actions/setup-node@v2
17
+ uses: actions/setup-node@v3
18
18
  with:
19
19
  node-version: ${{ matrix.node-version }}
20
20
 
@@ -16,7 +16,7 @@ jobs:
16
16
  token: ${{ secrets.GH_TOKEN }}
17
17
  fetch-depth: 0
18
18
 
19
- - uses: actions/setup-node@v2
19
+ - uses: actions/setup-node@v3
20
20
  with:
21
21
  node-version: 14
22
22
 
@@ -59,7 +59,7 @@ jobs:
59
59
  YARN_ENABLE_IMMUTABLE_INSTALLS: false
60
60
  <% if (publish) { -%>
61
61
 
62
- - uses: actions/setup-node@v2
62
+ - uses: actions/setup-node@v3
63
63
  if: |
64
64
  github.ref == 'refs/heads/main'
65
65
  && contains(github.event.inputs.dry-run, 'y') == false
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,12 @@ 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
+ let monorepo =
221
+ argv._[0] === 'lerna' ||
222
+ argv._[0] === 'monorepo' ||
223
+ !!(projectPkg && projectPkg.workspaces);
224
+ const action = monorepo ? argv._[1] : argv._[0];
216
225
 
217
226
  if (action === 'add') {
218
227
  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.4.0",
3
+ "version": "10.6.0",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -67,5 +67,5 @@
67
67
  "yeoman-environment": "^3.5.1",
68
68
  "yeoman-generator": "^5.4.0"
69
69
  },
70
- "gitHead": "2e8a1622f20909fb5f9f6793ad85963bf094c23e"
70
+ "gitHead": "67aeeddf475269b9eb3d6319a8e128e7441695ec"
71
71
  }