pob 10.2.1 → 10.4.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,52 @@
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.4.0](https://github.com/christophehurpeau/pob/compare/pob@10.3.1...pob@10.4.0) (2022-03-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **deps:** update dependency @yarnpkg/parsers to v2.5.0 ([#1216](https://github.com/christophehurpeau/pob/issues/1216)) ([87cfb68](https://github.com/christophehurpeau/pob/commit/87cfb68046d184a30c0e5ede696dd4d74a7c7382))
12
+
13
+
14
+ ### Features
15
+
16
+ * **deps:** update dependency eslint to v8.10.0 ([#1223](https://github.com/christophehurpeau/pob/issues/1223)) ([a0bec26](https://github.com/christophehurpeau/pob/commit/a0bec26c62a46771458e061add0f008dcd5e2681))
17
+ * update actions/checkout ([b8abb40](https://github.com/christophehurpeau/pob/commit/b8abb40cfecaeceda0998246be17c7ef35f05d32))
18
+
19
+
20
+
21
+
22
+
23
+ ## [10.3.1](https://github.com/christophehurpeau/pob/compare/pob@10.3.0...pob@10.3.1) (2022-02-20)
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * **pob:** fix app import/resolver config ([5179b36](https://github.com/christophehurpeau/pob/commit/5179b364d1b72f0ed3a3b7df577e46d49e23d69a))
29
+
30
+
31
+
32
+
33
+
34
+ # [10.3.0](https://github.com/christophehurpeau/pob/compare/pob@10.2.1...pob@10.3.0) (2022-02-20)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * alllow "allow-unsafe" in extends in eslint configs ([e1c0d69](https://github.com/christophehurpeau/pob/commit/e1c0d695feaba044c8a80d430254481854861dec))
40
+ * **pob:** fix tsconfig references for apps ([ea5e185](https://github.com/christophehurpeau/pob/commit/ea5e185ae67ded3ea55f5d4bc992e9526ba98c0a))
41
+ * use buid directory option in babel generator ([03a6754](https://github.com/christophehurpeau/pob/commit/03a6754a5356ed97dd39dc4e9292126f0696a44e))
42
+
43
+
44
+ ### Features
45
+
46
+ * experimental vscode tasks generator ([d7a727f](https://github.com/christophehurpeau/pob/commit/d7a727fa1f8aec1e0f6f56b8219ea781b0759240))
47
+
48
+
49
+
50
+
51
+
6
52
  ## [10.2.1](https://github.com/christophehurpeau/pob/compare/pob@10.2.0...pob@10.2.1) (2022-02-19)
7
53
 
8
54
 
@@ -470,7 +470,9 @@ export default class CommonBabelGenerator extends Generator {
470
470
  if (useBabel) {
471
471
  // see pkg.exports instead.
472
472
  delete pkg.main;
473
- if (!this.options.isApp) pkg.types = './dist/index.d.ts';
473
+ if (!this.options.isApp) {
474
+ pkg.types = `./${this.options.buildDirectory}/index.d.ts`;
475
+ }
474
476
  } else {
475
477
  if (!pkg.main) {
476
478
  pkg.exports = './lib/index.js';
@@ -529,15 +531,17 @@ export default class CommonBabelGenerator extends Generator {
529
531
 
530
532
  /* webpack 4 */
531
533
  if (esAllBrowserEnv) {
532
- pkg.module = './dist/index-browser.es.js';
533
- pkg.browser = './dist/index-browser.es.js';
534
+ pkg.module = `./${this.options.buildDirectory}/index-browser.es.js`;
535
+ pkg.browser = `./${this.options.buildDirectory}/index-browser.es.js`;
534
536
  } else {
535
537
  delete pkg.module;
536
538
  delete pkg.browser;
537
539
  }
538
540
 
539
541
  if (esModernBrowserEnv) {
540
- pkg['module:modern-browsers'] = './dist/index-browsermodern.es.js';
542
+ pkg[
543
+ 'module:modern-browsers'
544
+ ] = `./${this.options.buildDirectory}/index-browsermodern.es.js`;
541
545
  } else {
542
546
  delete pkg['module:modern-browsers'];
543
547
  }
@@ -546,7 +550,7 @@ export default class CommonBabelGenerator extends Generator {
546
550
  // webpack 4 node
547
551
  pkg[
548
552
  'module:node'
549
- ] = `./dist/index-${esNodeEnv.target}${esNodeEnv.version}.mjs`;
553
+ ] = `./${this.options.buildDirectory}/index-${esNodeEnv.target}${esNodeEnv.version}.mjs`;
550
554
  }
551
555
 
552
556
  const aliases = (this.entries || []).filter((entry) => entry !== 'index');
@@ -572,11 +576,9 @@ export default class CommonBabelGenerator extends Generator {
572
576
  const isBrowserOnly =
573
577
  aliasName === 'browser' && env.target !== 'node';
574
578
  const aliasDistName = isBrowserOnly ? 'index' : aliasName;
575
- pkg[`module:aliases-${key}`][
576
- `./${aliasName}.js`
577
- ] = `./dist/${aliasDistName}-${env.target}${
578
- env.version || ''
579
- }.es.js`;
579
+ pkg[`module:aliases-${key}`][`./${aliasName}.js`] = `./${
580
+ this.options.buildDirectory
581
+ }/${aliasDistName}-${env.target}${env.version || ''}.es.js`;
580
582
  });
581
583
  });
582
584
  }
@@ -610,13 +612,13 @@ export default class CommonBabelGenerator extends Generator {
610
612
  if (target === 'node') {
611
613
  const cjsExt = pkg.type === 'module' ? 'cjs' : 'cjs.js';
612
614
  if (formats.includes('es')) {
613
- exportTarget.import = `./dist/${entryDistName}-${target}${version}.mjs`;
615
+ exportTarget.import = `./${this.options.buildDirectory}/${entryDistName}-${target}${version}.mjs`;
614
616
 
615
617
  if (formats.includes('cjs')) {
616
- exportTarget.require = `./dist/${entryDistName}-${target}${version}.${cjsExt}`;
618
+ exportTarget.require = `./${this.options.buildDirectory}/${entryDistName}-${target}${version}.${cjsExt}`;
617
619
  }
618
620
  } else if (formats.includes('cjs')) {
619
- exportTarget.default = `./dist/${entryDistName}-${target}${version}.${cjsExt}`;
621
+ exportTarget.default = `./${this.options.buildDirectory}/${entryDistName}-${target}${version}.${cjsExt}`;
620
622
  }
621
623
  // eslint: https://github.com/benmosher/eslint-plugin-import/issues/2132
622
624
  // jest: https://github.com/facebook/jest/issues/9771
@@ -630,15 +632,15 @@ export default class CommonBabelGenerator extends Generator {
630
632
  }
631
633
  } else if (target === 'browser') {
632
634
  if (formats.includes('es')) {
633
- exportTarget.import = `./dist/${entryDistName}-${target}${
634
- version || ''
635
- }.es.js`;
635
+ exportTarget.import = `./${
636
+ this.options.buildDirectory
637
+ }/${entryDistName}-${target}${version || ''}.es.js`;
636
638
  }
637
639
 
638
640
  if (formats.includes('cjs')) {
639
- exportTarget.require = `./dist/index-${target}${
640
- version || ''
641
- }.cjs.js`;
641
+ exportTarget.require = `./${
642
+ this.options.buildDirectory
643
+ }/index-${target}${version || ''}.cjs.js`;
642
644
  }
643
645
  }
644
646
 
@@ -477,7 +477,7 @@ export default class CommonLintGenerator extends Generator {
477
477
  'import/resolver': this.options.enableSrcResolver
478
478
  ? {
479
479
  node: {
480
- paths: ['./node_modules', './src'],
480
+ moduleDirectory: ['node_modules', 'src'],
481
481
  },
482
482
  }
483
483
  : false,
@@ -112,7 +112,15 @@ export default function updateEslintConfig(
112
112
  },
113
113
  ) {
114
114
  config.root = true;
115
- config.extends = extendsConfig;
115
+ config.extends = [
116
+ ...extendsConfig,
117
+ ...(config?.extends
118
+ ? config.extends.filter(
119
+ (extendsValue) =>
120
+ extendsValue === '@pob/eslint-config-typescript/allow-unsafe',
121
+ )
122
+ : []),
123
+ ];
116
124
 
117
125
  config = updateParserAndPlugins(
118
126
  config,
@@ -17,7 +17,7 @@ jobs:
17
17
  package-name: release-please-action
18
18
 
19
19
  # publish:
20
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v3
21
21
  # these if statements ensure that a publication only occurs when
22
22
  # a new release is created:
23
23
  if: ${{ steps.release.outputs.release_created }}
@@ -78,6 +78,7 @@ export default class CommonTypescriptGenerator extends Generator {
78
78
  if (this.options.enable) {
79
79
  const { jsx, dom } = this.options;
80
80
  let composite;
81
+ let monorepoPackageReferences;
81
82
  let monorepoPackageBuildReferences;
82
83
  let monorepoPackageSrcPaths;
83
84
 
@@ -122,6 +123,11 @@ export default class CommonTypescriptGenerator extends Generator {
122
123
  }`,
123
124
  ],
124
125
  );
126
+ monorepoPackageReferences = yoConfig.pob.monorepo.packageNames
127
+ .filter((packageName) =>
128
+ existsSync(`${packageLocations.get(packageName)}/tsconfig.json`),
129
+ )
130
+ .map((packageName) => packageLocations.get(packageName));
125
131
  monorepoPackageBuildReferences = yoConfig.pob.monorepo.packageNames
126
132
  .filter((packageName) =>
127
133
  existsSync(
@@ -138,7 +144,7 @@ export default class CommonTypescriptGenerator extends Generator {
138
144
  tsconfigPath,
139
145
  {
140
146
  monorepoPackageSrcPaths,
141
- monorepoPackageBuildReferences,
147
+ monorepoPackageReferences,
142
148
  rootDir: this.options.rootDir,
143
149
  jsx,
144
150
  composite,
@@ -59,10 +59,10 @@
59
59
  "<%= packageName %>/*": ["../<%= packageLocation %>/*"]<%= index === monorepoPackageSrcPaths.length -1 ? '' : ',' -%>
60
60
  <% }) %>
61
61
  }<% } %>
62
- }<% if (monorepoPackageBuildReferences && monorepoPackageBuildReferences.length) { -%>,
62
+ }<% if (monorepoPackageReferences && monorepoPackageReferences.length) { -%>,
63
63
  "references": [
64
- <% monorepoPackageBuildReferences.forEach((monorepoPackageSrcPath, index) => { -%>
65
- { "path": "<%= monorepoPackageSrcPath %>/tsconfig.json" }<%= index === monorepoPackageBuildReferences.length -1 ? '' : ',' %>
64
+ <% monorepoPackageReferences.forEach((monorepoPackageSrcPath, index) => { -%>
65
+ { "path": "<%= monorepoPackageSrcPath %>/tsconfig.json" }<%= index === monorepoPackageReferences.length -1 ? '' : ',' %>
66
66
  <% }) -%>
67
67
  ],
68
68
  <% } -%>
@@ -8,7 +8,7 @@ jobs:
8
8
  create-documentation-and-deploy:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
- - uses: actions/checkout@v2
11
+ - uses: actions/checkout@v3
12
12
 
13
13
  - uses: actions/setup-node@v2
14
14
  with:
@@ -11,7 +11,7 @@ jobs:
11
11
  node-version: [<% if (supportsNode14) { -%>14.x, <% } -%>16.x]
12
12
 
13
13
  steps:
14
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v3
15
15
 
16
16
  - name: Use Node.js ${{ matrix.node-version }}
17
17
  uses: actions/setup-node@v2
@@ -93,13 +93,15 @@ export default class CoreVSCodeGenerator extends Generator {
93
93
  this.destinationPath('.vscode/tasks.json'),
94
94
  {},
95
95
  );
96
+ const tasks = tasksConfig.tasks || [];
97
+
96
98
  copyAndFormatTpl(
97
99
  this.fs,
98
100
  this.templatePath('tasks.json.ejs'),
99
101
  this.destinationPath('.vscode/tasks.json'),
100
102
  {
101
103
  typescript: this.options.typescript,
102
- tasks: JSON.stringify(tasksConfig.tasks || [], null, 2),
104
+ tasks: JSON.stringify(tasks, null, 2),
103
105
  },
104
106
  );
105
107
 
@@ -21,6 +21,11 @@
21
21
  "typescript.enablePromptUseWorkspaceTsdk": true,
22
22
  <% } -%>
23
23
 
24
+ <% if (yarn) { -%>
25
+ // set yarn as package manager to run scripts and tasks
26
+ "npm.packageManager": "yarn",
27
+ <% } -%>
28
+
24
29
  // save config
25
30
  "editor.formatOnSave": true,
26
31
  "eslint.codeActionsOnSave.mode": "all",
@@ -11,7 +11,7 @@ jobs:
11
11
  publish:
12
12
  runs-on: ubuntu-latest
13
13
  steps:
14
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v3
15
15
  with:
16
16
  token: ${{ secrets.GH_TOKEN }}
17
17
  fetch-depth: 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pob",
3
- "version": "10.2.1",
3
+ "version": "10.4.0",
4
4
  "description": "Pile of bones, library generator with git/babel/typescript/typedoc/readme/jest",
5
5
  "keywords": [
6
6
  "skeleton"
@@ -47,8 +47,8 @@
47
47
  "@pob/sort-eslint-config": "^3.0.1",
48
48
  "@pob/sort-object": "^4.0.1",
49
49
  "@pob/sort-pkg": "^4.0.1",
50
- "@yarnpkg/parsers": "2.5.0-rc.14",
51
- "eslint": "8.9.0",
50
+ "@yarnpkg/parsers": "2.5.0",
51
+ "eslint": "8.10.0",
52
52
  "findup-sync": "^5.0.0",
53
53
  "git-remote-url": "^1.0.1",
54
54
  "github-username": "^6.0.0",
@@ -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.16.0",
64
+ "pob-dependencies": "6.17.0",
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": "f23f89112a35d2df5b8e6da96dee061043b4c362"
70
+ "gitHead": "2e8a1622f20909fb5f9f6793ad85963bf094c23e"
71
71
  }