@pob/root 9.1.0 → 9.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 +33 -0
- package/bin/{pob-root-postinstall.cjs → pob-root-postinstall.js} +12 -10
- package/bin/postinstall/{install-github-workflows.cjs → install-github-workflows.js} +10 -8
- package/bin/postinstall/{install-husky.cjs → install-husky.js} +18 -17
- package/bin/postinstall/{install-scripts.cjs → install-scripts.js} +3 -5
- package/bin/postinstall/{install-vscode-tasks.cjs → install-vscode-tasks.js} +5 -7
- package/bin/postinstall/{update-yarn.cjs → update-yarn.js} +4 -6
- package/createLintStagedConfig.js +1 -0
- package/package.json +10 -8
- package/tsconfigs/targets/esbuild-node-18.json +10 -0
- package/tsconfigs/targets/esbuild-node-20.json +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
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.3.0](https://github.com/christophehurpeau/pob/compare/@pob/root@9.2.0...@pob/root@9.3.0) (2024-04-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **deps:** update @pob/eslint-config to v55 (major) ([#2020](https://github.com/christophehurpeau/pob/issues/2020)) ([434d5b3](https://github.com/christophehurpeau/pob/commit/434d5b3dce53b1925091138444881a13e2a962d9))
|
|
12
|
+
* simple esbuild bundler ([80659fa](https://github.com/christophehurpeau/pob/commit/80659fadb42190463585ff54e865af09e31fdc0d))
|
|
13
|
+
* support vitest ([2fe540e](https://github.com/christophehurpeau/pob/commit/2fe540e6ab66255735910745062a92636c87f21e))
|
|
14
|
+
|
|
15
|
+
Version bump for dependency: pretty-eslint-config
|
|
16
|
+
Version bump for dependency: pretty-pkg
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## [9.2.0](https://github.com/christophehurpeau/pob/compare/@pob/root@9.1.0...@pob/root@9.2.0) (2024-02-17)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **deps:** update dependency @commitlint/cli to v18.5.0 ([#1907](https://github.com/christophehurpeau/pob/issues/1907)) ([f2937ca](https://github.com/christophehurpeau/pob/commit/f2937cafcf86e47edf34180f5980a8cf35da7cf9))
|
|
25
|
+
* **deps:** update dependency @commitlint/cli to v18.6.0 ([#1911](https://github.com/christophehurpeau/pob/issues/1911)) ([ad8faa9](https://github.com/christophehurpeau/pob/commit/ad8faa98aa8a57d5db36d6255b9d9b707917ae40))
|
|
26
|
+
* **deps:** update dependency husky to v9 ([#1910](https://github.com/christophehurpeau/pob/issues/1910)) ([6b88cd0](https://github.com/christophehurpeau/pob/commit/6b88cd016cc52cf2630a15a619a66b8ff47308f7))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* **deps:** update dependency @commitlint/cli to v18.4.4 ([#1891](https://github.com/christophehurpeau/pob/issues/1891)) ([7d2cc61](https://github.com/christophehurpeau/pob/commit/7d2cc61261808491ff4bf51f4a752b853664eb05))
|
|
32
|
+
* **deps:** update dependency @commitlint/cli to v18.6.1 ([#1934](https://github.com/christophehurpeau/pob/issues/1934)) ([bee7710](https://github.com/christophehurpeau/pob/commit/bee77102ffdbc0b53de4116ca255cb009b7b56f7))
|
|
33
|
+
* **deps:** update dependency lint-staged to v15.2.1 ([#1922](https://github.com/christophehurpeau/pob/issues/1922)) ([f8376d3](https://github.com/christophehurpeau/pob/commit/f8376d3f9414ad168cac950315635e9740254297))
|
|
34
|
+
* **deps:** update dependency lint-staged to v15.2.2 ([#1929](https://github.com/christophehurpeau/pob/issues/1929)) ([051de50](https://github.com/christophehurpeau/pob/commit/051de50f705d37ff4ef9901b474c4d63c33f67a2))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## [9.1.0](https://github.com/christophehurpeau/pob/compare/@pob/root@9.0.0...@pob/root@9.1.0) (2023-12-31)
|
|
7
40
|
|
|
8
41
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable unicorn/no-await-expression-member */
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const path = require('node:path');
|
|
7
|
-
const whichPmRuns = require('which-pm-runs');
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import whichPmRuns from 'which-pm-runs';
|
|
8
7
|
|
|
9
8
|
if (!process.env.INIT_CWD) {
|
|
10
9
|
console.error(
|
|
@@ -36,11 +35,14 @@ if (pm.name !== 'yarn' && pm.name !== 'npm') {
|
|
|
36
35
|
process.exit(1);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
(await import('./postinstall/update-yarn.js')).default({ pkg, pm });
|
|
39
|
+
(await import('./postinstall/install-husky.js')).default({ pkg, pm });
|
|
40
|
+
(await import('./postinstall/install-github-workflows.js')).default({
|
|
41
|
+
pkg,
|
|
42
|
+
pm,
|
|
43
|
+
});
|
|
44
|
+
(await import('./postinstall/install-scripts.js')).default({ pkg, pm });
|
|
43
45
|
|
|
44
46
|
if (process.env.POB_EXPERIMENTAL_VSCODE_TASKS) {
|
|
45
|
-
|
|
47
|
+
(await import('./postinstall/install-vscode-tasks.js')).default({ pkg, pm });
|
|
46
48
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const semver = require('semver');
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import semver from 'semver';
|
|
6
5
|
|
|
7
6
|
const ensureWorkflowUninstalled = (workflowName) => {
|
|
8
7
|
try {
|
|
@@ -15,7 +14,10 @@ const installWorkflow = (workflowName, condition = true) => {
|
|
|
15
14
|
fs.writeFileSync(
|
|
16
15
|
path.resolve(`.github/workflows/${workflowName}.yml`),
|
|
17
16
|
fs.readFileSync(
|
|
18
|
-
path.resolve(
|
|
17
|
+
path.resolve(
|
|
18
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
19
|
+
`github-workflows/${workflowName}.yml`,
|
|
20
|
+
),
|
|
19
21
|
),
|
|
20
22
|
);
|
|
21
23
|
} else {
|
|
@@ -23,7 +25,7 @@ const installWorkflow = (workflowName, condition = true) => {
|
|
|
23
25
|
}
|
|
24
26
|
};
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
export default function installGithubWorkflows({ pkg, pm }) {
|
|
27
29
|
const yarnMajorVersion = pm.name === 'yarn' && semver.major(pm.version);
|
|
28
30
|
const isYarnBerry = pm.name === 'yarn' && yarnMajorVersion >= 2;
|
|
29
31
|
|
|
@@ -43,4 +45,4 @@ module.exports = function installGithubWorkflows({ pkg, pm }) {
|
|
|
43
45
|
ensureWorkflowUninstalled('push-renovate-build');
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
|
-
}
|
|
48
|
+
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/* eslint-disable complexity */
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const husky = require('husky');
|
|
8
|
-
const semver = require('semver');
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import husky from 'husky';
|
|
6
|
+
import semver from 'semver';
|
|
9
7
|
|
|
10
8
|
const ensureLegacyHuskyConfigDeleted = () => {
|
|
11
9
|
try {
|
|
@@ -27,7 +25,7 @@ const ensureHuskyNotInDevDependencies = (pkg) => {
|
|
|
27
25
|
const writeHook = (hookName, hookContent) => {
|
|
28
26
|
fs.writeFileSync(
|
|
29
27
|
path.resolve(`.husky/${hookName}`),
|
|
30
|
-
`#!/usr/bin/env sh\n
|
|
28
|
+
`#!/usr/bin/env sh\n\n${hookContent.trim()}\n`,
|
|
31
29
|
{
|
|
32
30
|
mode: '755',
|
|
33
31
|
},
|
|
@@ -48,7 +46,7 @@ const readYarnConfigFile = () => {
|
|
|
48
46
|
}
|
|
49
47
|
};
|
|
50
48
|
|
|
51
|
-
|
|
49
|
+
export default function installHusky({ pkg, pm }) {
|
|
52
50
|
const yarnMajorVersion = pm.name === 'yarn' && semver.major(pm.version);
|
|
53
51
|
const isYarnBerry = pm.name === 'yarn' && yarnMajorVersion >= 2;
|
|
54
52
|
const isYarnPnp =
|
|
@@ -105,13 +103,16 @@ fi`;
|
|
|
105
103
|
}
|
|
106
104
|
|
|
107
105
|
if (shouldRunTest()) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
106
|
+
const getTestCommand = () => {
|
|
107
|
+
if (pkg.devDependencies?.jest) {
|
|
108
|
+
return 'test --watchAll=false --changedSince=origin/main';
|
|
109
|
+
}
|
|
110
|
+
if (pkg.devDependencies?.vitest) {
|
|
111
|
+
return 'test --changed origin/main';
|
|
112
|
+
}
|
|
113
|
+
return 'test';
|
|
114
|
+
};
|
|
115
|
+
prePushHook.push(`${pm.name} ${getTestCommand()}`);
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
if (prePushHook.length > 0) {
|
|
@@ -137,5 +138,5 @@ done
|
|
|
137
138
|
ensureHookDeleted('pre-push');
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
|
|
141
|
-
}
|
|
141
|
+
process.stdout.write(husky('.husky'));
|
|
142
|
+
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const fs = require('node:fs');
|
|
1
|
+
import fs from 'node:fs';
|
|
4
2
|
|
|
5
3
|
const addPobRootPostinstallInScript = (pkg, scriptName) => {
|
|
6
4
|
if (!pkg.scripts[scriptName]) {
|
|
@@ -12,7 +10,7 @@ const addPobRootPostinstallInScript = (pkg, scriptName) => {
|
|
|
12
10
|
}
|
|
13
11
|
};
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
export default function installScripts({ pkg, pm }) {
|
|
16
14
|
if (!pkg.scripts) pkg.scripts = {};
|
|
17
15
|
if (pkg.name === 'pob-monorepo') return;
|
|
18
16
|
|
|
@@ -31,4 +29,4 @@ module.exports = function installScripts({ pkg, pm }) {
|
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
fs.writeFileSync('package.json', `${JSON.stringify(pkg, null, 2)}\n`, 'utf8');
|
|
34
|
-
}
|
|
32
|
+
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const JSON5 = require('json5');
|
|
5
|
-
const prettier = require('prettier');
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import JSON5 from 'json5';
|
|
3
|
+
import prettier from 'prettier';
|
|
6
4
|
|
|
7
5
|
function readJSON5(path, defaults = null) {
|
|
8
6
|
try {
|
|
@@ -28,7 +26,7 @@ function getProblemMatcherFromScriptName(scriptName) {
|
|
|
28
26
|
return [];
|
|
29
27
|
}
|
|
30
28
|
|
|
31
|
-
|
|
29
|
+
export default function installVscodeTasks({ pkg }) {
|
|
32
30
|
const existingConfig = readJSON5('.vscode/tasks.json');
|
|
33
31
|
const existingTasks = existingConfig?.tasks || [];
|
|
34
32
|
|
|
@@ -90,4 +88,4 @@ module.exports = function installVscodeTasks({ pkg }) {
|
|
|
90
88
|
},
|
|
91
89
|
),
|
|
92
90
|
);
|
|
93
|
-
}
|
|
91
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import semver from 'semver';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
const semver = require('semver');
|
|
5
|
-
|
|
6
|
-
module.exports = function updateYarn({ pkg, pm }) {
|
|
4
|
+
export default function updateYarn({ pkg, pm }) {
|
|
7
5
|
if (pm.name !== 'yarn' || !pm.version) return;
|
|
8
6
|
|
|
9
7
|
if (semver.lt(pm.version, '3.2.1')) {
|
|
@@ -28,4 +26,4 @@ module.exports = function updateYarn({ pkg, pm }) {
|
|
|
28
26
|
});
|
|
29
27
|
console.log('Yarn update success !');
|
|
30
28
|
}
|
|
31
|
-
}
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pob/root",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.3.0",
|
|
4
4
|
"description": "root package",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Christophe Hurpeau <christophe@hurpeau.com> (https://christophe.hurpeau.com)",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"bin": {
|
|
20
20
|
"commitlint": "./bin/commitlint.cjs",
|
|
21
21
|
"pob-root-lint-staged": "./bin/pob-root-lint-staged.js",
|
|
22
|
-
"pob-root-postinstall": "./bin/pob-root-postinstall.
|
|
22
|
+
"pob-root-postinstall": "./bin/pob-root-postinstall.js",
|
|
23
23
|
"pob-root-prettier": "./bin/prettier.cjs",
|
|
24
24
|
"prettier": "./bin/prettier.cjs",
|
|
25
25
|
"pretty-eslint-config": "./bin/pretty-eslint-config.js",
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
"./tsconfigs/targets/webpack.json": "./tsconfigs/targets/webpack.json",
|
|
47
47
|
"./tsconfigs/targets/rollup-node-18.json": "./tsconfigs/targets/rollup-node-18.json",
|
|
48
48
|
"./tsconfigs/targets/rollup-node-20.json": "./tsconfigs/targets/rollup-node-20.json",
|
|
49
|
+
"./tsconfigs/targets/esbuild-node-18.json": "./tsconfigs/targets/esbuild-node-18.json",
|
|
50
|
+
"./tsconfigs/targets/esbuild-node-20.json": "./tsconfigs/targets/esbuild-node-20.json",
|
|
49
51
|
"./package.json": "./package.json"
|
|
50
52
|
},
|
|
51
53
|
"publishConfig": {
|
|
@@ -66,15 +68,15 @@
|
|
|
66
68
|
"pob": {},
|
|
67
69
|
"prettier": "@pob/root/prettier-config",
|
|
68
70
|
"dependencies": {
|
|
69
|
-
"@commitlint/cli": "18.
|
|
70
|
-
"@pob/pretty-eslint-config": "5.
|
|
71
|
-
"@pob/pretty-pkg": "7.
|
|
71
|
+
"@commitlint/cli": "18.6.1",
|
|
72
|
+
"@pob/pretty-eslint-config": "5.4.0",
|
|
73
|
+
"@pob/pretty-pkg": "7.1.0",
|
|
72
74
|
"conventional-changelog-conventionalcommits": "^7.0.0",
|
|
73
75
|
"cosmiconfig": "^8.3.6",
|
|
74
|
-
"husky": "~
|
|
76
|
+
"husky": "~9.0.11",
|
|
75
77
|
"json5": "^2.2.2",
|
|
76
|
-
"lint-staged": "15.2.
|
|
77
|
-
"pob-dependencies": "11.0
|
|
78
|
+
"lint-staged": "15.2.2",
|
|
79
|
+
"pob-dependencies": "11.2.0",
|
|
78
80
|
"prettier": "2.8.8",
|
|
79
81
|
"repository-check-dirty": "6.3.1",
|
|
80
82
|
"semver": "^7.3.7",
|