pob 10.2.1 → 10.3.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 +18 -0
- package/lib/generators/common/babel/CommonBabelGenerator.js +21 -19
- package/lib/generators/common/format-lint/updateEslintConfig.js +9 -1
- package/lib/generators/common/typescript/CommonTypescriptGenerator.js +7 -1
- package/lib/generators/common/typescript/templates/tsconfig.json.ejs +3 -3
- package/lib/generators/core/vscode/CoreVSCodeGenerator.js +3 -1
- package/lib/generators/core/vscode/templates/settings.json.ejs +5 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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.3.0](https://github.com/christophehurpeau/pob/compare/pob@10.2.1...pob@10.3.0) (2022-02-20)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* alllow "allow-unsafe" in extends in eslint configs ([e1c0d69](https://github.com/christophehurpeau/pob/commit/e1c0d695feaba044c8a80d430254481854861dec))
|
|
12
|
+
* **pob:** fix tsconfig references for apps ([ea5e185](https://github.com/christophehurpeau/pob/commit/ea5e185ae67ded3ea55f5d4bc992e9526ba98c0a))
|
|
13
|
+
* use buid directory option in babel generator ([03a6754](https://github.com/christophehurpeau/pob/commit/03a6754a5356ed97dd39dc4e9292126f0696a44e))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* experimental vscode tasks generator ([d7a727f](https://github.com/christophehurpeau/pob/commit/d7a727fa1f8aec1e0f6f56b8219ea781b0759240))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [10.2.1](https://github.com/christophehurpeau/pob/compare/pob@10.2.0...pob@10.2.1) (2022-02-19)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -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)
|
|
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 =
|
|
533
|
-
pkg.browser =
|
|
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[
|
|
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
|
-
] =
|
|
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
|
-
|
|
577
|
-
|
|
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 =
|
|
615
|
+
exportTarget.import = `./${this.options.buildDirectory}/${entryDistName}-${target}${version}.mjs`;
|
|
614
616
|
|
|
615
617
|
if (formats.includes('cjs')) {
|
|
616
|
-
exportTarget.require =
|
|
618
|
+
exportTarget.require = `./${this.options.buildDirectory}/${entryDistName}-${target}${version}.${cjsExt}`;
|
|
617
619
|
}
|
|
618
620
|
} else if (formats.includes('cjs')) {
|
|
619
|
-
exportTarget.default =
|
|
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 =
|
|
634
|
-
|
|
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 =
|
|
640
|
-
|
|
641
|
-
}.cjs.js`;
|
|
641
|
+
exportTarget.require = `./${
|
|
642
|
+
this.options.buildDirectory
|
|
643
|
+
}/index-${target}${version || ''}.cjs.js`;
|
|
642
644
|
}
|
|
643
645
|
}
|
|
644
646
|
|
|
@@ -112,7 +112,15 @@ export default function updateEslintConfig(
|
|
|
112
112
|
},
|
|
113
113
|
) {
|
|
114
114
|
config.root = true;
|
|
115
|
-
config.extends =
|
|
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,
|
|
@@ -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
|
-
|
|
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 (
|
|
62
|
+
}<% if (monorepoPackageReferences && monorepoPackageReferences.length) { -%>,
|
|
63
63
|
"references": [
|
|
64
|
-
<%
|
|
65
|
-
{ "path": "<%= monorepoPackageSrcPath %>/tsconfig.json" }<%= index ===
|
|
64
|
+
<% monorepoPackageReferences.forEach((monorepoPackageSrcPath, index) => { -%>
|
|
65
|
+
{ "path": "<%= monorepoPackageSrcPath %>/tsconfig.json" }<%= index === monorepoPackageReferences.length -1 ? '' : ',' %>
|
|
66
66
|
<% }) -%>
|
|
67
67
|
],
|
|
68
68
|
<% } -%>
|
|
@@ -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(
|
|
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",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pob",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.3.0",
|
|
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.
|
|
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": "
|
|
70
|
+
"gitHead": "033cb44fe500dedc8aed5c19484ef39baa7a90b9"
|
|
71
71
|
}
|