@pob/root 6.23.1 → 7.1.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/.eslintrc.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "root": true,
3
- "extends": ["@pob/eslint-config/root-commonjs"]
3
+ "extends": ["@pob/eslint-config/root-module"]
4
4
  }
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
+ # [7.1.0](https://github.com/christophehurpeau/pob/compare/@pob/root@7.0.0...@pob/root@7.1.0) (2022-11-15)
7
+
8
+
9
+ ### Features
10
+
11
+ * lint-staged config esm ([9a2fc45](https://github.com/christophehurpeau/pob/commit/9a2fc45740eb4374171d1f0de2d73f99df90e243))
12
+
13
+
14
+
15
+
16
+
17
+ # [7.0.0](https://github.com/christophehurpeau/pob/compare/@pob/root@6.23.1...@pob/root@7.0.0) (2022-11-13)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * fix repository-check-dirty ([93ff29d](https://github.com/christophehurpeau/pob/commit/93ff29d0d1d44f79e59e049213e6caa6a1fedf22))
23
+
24
+
25
+ ### Features
26
+
27
+ * **deps:** update dependency @commitlint/cli to v17.2.0 ([#1447](https://github.com/christophehurpeau/pob/issues/1447)) ([e5b9440](https://github.com/christophehurpeau/pob/commit/e5b9440ba6f2c052e93cc9db69904e697707bad7))
28
+ * update to node 16 and ESM ([fcdc84f](https://github.com/christophehurpeau/pob/commit/fcdc84f423ac27fd6324b673b9da340b0d22a738))
29
+
30
+
31
+ ### BREAKING CHANGES
32
+
33
+ * drop node 14
34
+
35
+
36
+
37
+
38
+
6
39
  ## [6.23.1](https://github.com/christophehurpeau/pob/compare/@pob/root@6.23.0...@pob/root@6.23.1) (2022-10-19)
7
40
 
8
41
  **Note:** Version bump only for package @pob/root
package/README.md CHANGED
@@ -8,6 +8,9 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://npmjs.org/package/@pob/root"><img src="https://img.shields.io/npm/v/@pob/root.svg?style=flat-square"></a>
11
+ <a href="https://npmjs.org/package/@pob/root"><img src="https://img.shields.io/npm/dw/@pob/root.svg?style=flat-square"></a>
12
+ <a href="https://npmjs.org/package/@pob/root"><img src="https://img.shields.io/node/v/@pob/root.svg?style=flat-square"></a>
13
+ <a href="https://npmjs.org/package/@pob/root"><img src="https://img.shields.io/npm/types/@pob/root.svg?style=flat-square"></a>
11
14
  </p>
12
15
 
13
16
  ## Install
File without changes
@@ -36,11 +36,11 @@ if (pm.name !== 'yarn' && pm.name !== 'npm') {
36
36
  process.exit(1);
37
37
  }
38
38
 
39
- require('./postinstall/update-yarn')({ pkg, pm });
40
- require('./postinstall/install-husky')({ pkg, pm });
41
- require('./postinstall/install-github-workflows')({ pkg, pm });
42
- require('./postinstall/install-scripts')({ pkg, pm });
39
+ require('./postinstall/update-yarn.cjs')({ pkg, pm });
40
+ require('./postinstall/install-husky.cjs')({ pkg, pm });
41
+ require('./postinstall/install-github-workflows.cjs')({ pkg, pm });
42
+ require('./postinstall/install-scripts.cjs')({ pkg, pm });
43
43
 
44
44
  if (process.env.POB_EXPERIMENTAL_VSCODE_TASKS) {
45
- require('./postinstall/install-vscode-tasks')({ pkg, pm });
45
+ require('./postinstall/install-vscode-tasks.cjs')({ pkg, pm });
46
46
  }
File without changes
File without changes
@@ -1,12 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- 'use strict';
4
-
5
- const path = require('path');
6
- const pkg = require('repository-check-dirty/package.json');
7
-
8
- // eslint-disable-next-line import/no-dynamic-require
9
- require(path.join(
10
- 'repository-check-dirty',
11
- typeof pkg.bin === 'string' ? pkg.bin : pkg.bin['repository-check-dirty'],
12
- ));
3
+ import 'repository-check-dirty/bin/repository-check-dirty.js';
@@ -0,0 +1,108 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const semver = require('semver');
6
+ const whichPmRuns = require('which-pm-runs');
7
+
8
+ const pm =
9
+ whichPmRuns() ||
10
+ (fs.existsSync('package-lock.json') ? { name: 'npm' } : undefined);
11
+
12
+ if (pm.name !== 'yarn' && pm.name !== 'npm') {
13
+ throw new Error(
14
+ `Package manager not supported: ${pm.name}. Please run with yarn or npm !`,
15
+ );
16
+ }
17
+ const yarnMajorVersion = pm.name === 'yarn' && semver.major(pm.version);
18
+ const lockfile = pm.name === 'yarn' ? 'yarn.lock' : 'package-lock.json';
19
+
20
+ // eslint-disable-next-line import/no-dynamic-require
21
+ const pkg = require(path.resolve('package.json'));
22
+ const workspaces = pkg.workspaces || false;
23
+
24
+ const getSrcDirectories = () => {
25
+ if (workspaces) {
26
+ return `${
27
+ workspaces.length === 1 ? workspaces[0] : `{${workspaces.join(',')}}`
28
+ }/{src,lib}`;
29
+ }
30
+
31
+ return '{src,lib}';
32
+ };
33
+
34
+ // const getDistDirectories = () => {
35
+ // if (workspaces) {
36
+ // return `${
37
+ // workspaces.length === 1 ? workspaces[0] : `{${workspaces.join(',')}}`
38
+ // }/dist`;
39
+ // }
40
+
41
+ // return 'dist';
42
+ // };
43
+
44
+ const generateInstallAndDedupe = () => {
45
+ if (pm.name === 'npm') {
46
+ return ['npm install', 'npm dedupe'];
47
+ }
48
+
49
+ return ['yarn', 'yarn dedupe'];
50
+ };
51
+
52
+ module.exports = function createLintStagedConfig() {
53
+ const srcDirectories = getSrcDirectories();
54
+
55
+ const installAndDedupe = generateInstallAndDedupe();
56
+
57
+ return {
58
+ [`{${lockfile},package.json${
59
+ workspaces
60
+ ? `,${workspaces
61
+ .map((workspacePath) => `${workspacePath}/package.json`)
62
+ .join(',')}`
63
+ : ''
64
+ }}`]: (filenames) => {
65
+ const packagejsonFilenames = filenames.filter((filename) =>
66
+ filename.endsWith('.json'),
67
+ );
68
+
69
+ return [
70
+ ...installAndDedupe,
71
+ pkg.scripts?.checks ? 'yarn run checks' : undefined,
72
+ packagejsonFilenames.length === 0
73
+ ? undefined
74
+ : `pretty-pkg "${packagejsonFilenames.join('" "')}"`,
75
+ `git add ${lockfile}${
76
+ pm.name === 'yarn' && yarnMajorVersion >= 2
77
+ ? ' .yarn .yarnrc.yml'
78
+ : ''
79
+ }`,
80
+ ].filter(Boolean);
81
+ },
82
+ '!(package|package-lock|.eslintrc).json': ['prettier --write'],
83
+ '.eslintrc.json': ['pretty-eslint-config'],
84
+ [`{scripts,config,${srcDirectories}}/**/*.{yml,yaml,md}`]: [
85
+ 'prettier --write',
86
+ ],
87
+ './*.{yml,yaml,md}': ['prettier --write'],
88
+ [`${srcDirectories}/**/*.{js,ts,tsx}`]: [
89
+ 'prettier --write',
90
+ 'eslint --fix --quiet --report-unused-disable-directives --resolve-plugins-relative-to .',
91
+ ],
92
+ '{scripts,config,.storyboook}/**/*.{js,mjs,cjs}': [
93
+ 'prettier --write',
94
+ 'eslint --fix --quiet --report-unused-disable-directives --resolve-plugins-relative-to .',
95
+ ],
96
+ [`{.storybook,${srcDirectories}}/**/*.css`]: [
97
+ 'prettier --parser css --write',
98
+ ],
99
+ [`${srcDirectories}/**/*.{ts,tsx}`]: () =>
100
+ pkg.devDependencies && pkg.devDependencies['pob-babel']
101
+ ? [
102
+ 'rollup --config rollup.config.mjs',
103
+ 'tsc -b tsconfig.build.json',
104
+ // `git --glob-pathspecs add ${getDistDirectories()}/**/*`,
105
+ ]
106
+ : ['tsc'],
107
+ };
108
+ };
@@ -1,108 +1,5 @@
1
- 'use strict';
1
+ import { createRequire } from 'module';
2
2
 
3
- const fs = require('fs');
4
- const path = require('path');
5
- const semver = require('semver');
6
- const whichPmRuns = require('which-pm-runs');
3
+ const require = createRequire(import.meta.url);
7
4
 
8
- const pm =
9
- whichPmRuns() ||
10
- (fs.existsSync('package-lock.json') ? { name: 'npm' } : undefined);
11
-
12
- if (pm.name !== 'yarn' && pm.name !== 'npm') {
13
- throw new Error(
14
- `Package manager not supported: ${pm.name}. Please run with yarn or npm !`,
15
- );
16
- }
17
- const yarnMajorVersion = pm.name === 'yarn' && semver.major(pm.version);
18
- const lockfile = pm.name === 'yarn' ? 'yarn.lock' : 'package-lock.json';
19
-
20
- // eslint-disable-next-line import/no-dynamic-require
21
- const pkg = require(path.resolve('package.json'));
22
- const workspaces = pkg.workspaces || false;
23
-
24
- const getSrcDirectories = () => {
25
- if (workspaces) {
26
- return `${
27
- workspaces.length === 1 ? workspaces[0] : `{${workspaces.join(',')}}`
28
- }/{src,lib}`;
29
- }
30
-
31
- return '{src,lib}';
32
- };
33
-
34
- const getDistDirectories = () => {
35
- if (workspaces) {
36
- return `${
37
- workspaces.length === 1 ? workspaces[0] : `{${workspaces.join(',')}}`
38
- }/dist`;
39
- }
40
-
41
- return 'dist';
42
- };
43
-
44
- const generateInstallAndDedupe = () => {
45
- if (pm.name === 'npm') {
46
- return ['npm install', 'npm dedupe'];
47
- }
48
-
49
- return ['yarn', 'yarn dedupe'];
50
- };
51
-
52
- module.exports = function createLintStagedConfig() {
53
- const srcDirectories = getSrcDirectories();
54
-
55
- const installAndDedupe = generateInstallAndDedupe();
56
-
57
- return {
58
- [`{${lockfile},package.json${
59
- workspaces
60
- ? `,${workspaces
61
- .map((workspacePath) => `${workspacePath}/package.json`)
62
- .join(',')}`
63
- : ''
64
- }}`]: (filenames) => {
65
- const packagejsonFilenames = filenames.filter((filename) =>
66
- filename.endsWith('.json'),
67
- );
68
-
69
- return [
70
- ...installAndDedupe,
71
- pkg.scripts?.checks ? 'yarn run checks' : undefined,
72
- packagejsonFilenames.length === 0
73
- ? undefined
74
- : `pretty-pkg "${packagejsonFilenames.join('" "')}"`,
75
- `git add ${lockfile}${
76
- pm.name === 'yarn' && yarnMajorVersion >= 2
77
- ? ' .yarn .yarnrc.yml'
78
- : ''
79
- }`,
80
- ].filter(Boolean);
81
- },
82
- '!(package|package-lock|.eslintrc).json': ['prettier --write'],
83
- '.eslintrc.json': ['pretty-eslint-config'],
84
- [`{scripts,config,${srcDirectories}}/**/*.{yml,yaml,md}`]: [
85
- 'prettier --write',
86
- ],
87
- './*.{yml,yaml,md}': ['prettier --write'],
88
- [`${srcDirectories}/**/*.{js,ts,tsx}`]: [
89
- 'prettier --write',
90
- 'eslint --fix --quiet --report-unused-disable-directives --resolve-plugins-relative-to .',
91
- ],
92
- '{scripts,config,.storyboook}/**/*.{js,mjs,cjs}': [
93
- 'prettier --write',
94
- 'eslint --fix --quiet --report-unused-disable-directives --resolve-plugins-relative-to .',
95
- ],
96
- [`{.storybook,${srcDirectories}}/**/*.css`]: [
97
- 'prettier --parser css --write',
98
- ],
99
- [`${srcDirectories}/**/*.{ts,tsx}`]: () =>
100
- pkg.devDependencies && pkg.devDependencies['pob-babel']
101
- ? [
102
- 'rollup --config rollup.config.mjs',
103
- 'tsc -b tsconfig.build.json',
104
- `git --glob-pathspecs add ${getDistDirectories()}/**/*`,
105
- ]
106
- : ['tsc'],
107
- };
108
- };
5
+ export default require('./createLintStagedConfig.cjs');
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "root": true,
3
- "extends": ["@pob/eslint-config/node-commonjs"],
3
+ "extends": ["@pob/eslint-config/node-module"],
4
4
  "overrides": [
5
5
  {
6
- "files": ["**/*.test.{mjs,js}", "__tests__/**/*.{mjs,js}"],
6
+ "files": ["**/*.test.{cjs,js}", "__tests__/**/*.{cjs,js}"],
7
7
  "env": {
8
8
  "jest": true
9
9
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pob/root",
3
- "version": "6.23.1",
3
+ "version": "7.1.0",
4
4
  "description": "root package",
5
5
  "keywords": [],
6
6
  "author": "Christophe Hurpeau <christophe@hurpeau.com> (https://christophe.hurpeau.com)",
@@ -11,9 +11,9 @@
11
11
  "directory": "@pob/root"
12
12
  },
13
13
  "homepage": "https://github.com/christophehurpeau/pob",
14
- "type": "commonjs",
14
+ "type": "module",
15
15
  "engines": {
16
- "node": "^14.13.1 || >=16.0.0"
16
+ "node": ">=16.0.0"
17
17
  },
18
18
  "publishConfig": {
19
19
  "access": "public"
@@ -23,21 +23,22 @@
23
23
  ".": "./lib/index.js",
24
24
  "./createLintStagedConfig": "./createLintStagedConfig.js",
25
25
  "./createLintStagedConfig.js": "./createLintStagedConfig.js",
26
- "./prettier-config": "./prettier-config.js",
27
- "./prettier-config.js": "./prettier-config.js",
26
+ "./createLintStagedConfig.cjs": "./createLintStagedConfig.cjs",
27
+ "./prettier-config": "./prettier-config.cjs",
28
+ "./prettier-config.js": "./prettier-config.cjs",
29
+ "./prettier-config.cjs": "./prettier-config.cjs",
28
30
  "./package.json": "./package.json"
29
31
  },
30
32
  "sideEffects": false,
31
33
  "bin": {
32
- "commitlint": "./bin/commitlint.js",
33
- "pob-root-lint-staged": "./bin/pob-root-lint-staged.mjs",
34
- "pob-root-postinstall": "./bin/pob-root-postinstall.js",
35
- "pob-root-prettier": "./bin/prettier.js",
36
- "prettier": "./bin/prettier.js",
37
- "pretty-eslint-config": "./bin/pretty-eslint-config.mjs",
38
- "pretty-pkg": "./bin/pretty-pkg.mjs",
39
- "repository-check-dirty": "./bin/repository-check-dirty.js",
40
- "yarnhook": "./bin/yarnhook.js"
34
+ "commitlint": "./bin/commitlint.cjs",
35
+ "pob-root-lint-staged": "./bin/pob-root-lint-staged.js",
36
+ "pob-root-postinstall": "./bin/pob-root-postinstall.cjs",
37
+ "pob-root-prettier": "./bin/prettier.cjs",
38
+ "prettier": "./bin/prettier.cjs",
39
+ "pretty-eslint-config": "./bin/pretty-eslint-config.js",
40
+ "pretty-pkg": "./bin/pretty-pkg.js",
41
+ "repository-check-dirty": "./bin/repository-check-dirty.js"
41
42
  },
42
43
  "scripts": {
43
44
  "lint": "yarn run lint:eslint",
@@ -46,17 +47,17 @@
46
47
  "prettier": "@pob/root/prettier-config",
47
48
  "pob": {},
48
49
  "dependencies": {
49
- "@commitlint/cli": "17.1.2",
50
- "@pob/pretty-eslint-config": "3.3.0",
51
- "@pob/pretty-pkg": "4.3.0",
50
+ "@commitlint/cli": "17.2.0",
51
+ "@pob/pretty-eslint-config": "4.0.0",
52
+ "@pob/pretty-pkg": "5.0.0",
52
53
  "husky": "~8.0.1",
53
54
  "json5": "^2.2.1",
54
55
  "lint-staged": "13.0.3",
55
- "pob-dependencies": "6.33.0",
56
+ "pob-dependencies": "7.1.0",
56
57
  "prettier": "2.7.1",
57
- "repository-check-dirty": "4.2.0",
58
+ "repository-check-dirty": "5.0.0",
58
59
  "semver": "^7.3.7",
59
60
  "which-pm-runs": "1.1.0"
60
61
  },
61
- "gitHead": "731b169f373af61b2aa965f8f086b229387ab6eb"
62
+ "gitHead": "cfac4a5dd8c45fbdcf93a5ca4354bb1d3352f8fa"
62
63
  }
File without changes