@w5s/mrm-preset 2.4.5 → 2.5.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.
@@ -1,6 +1,6 @@
1
1
  [1] : exited with code 0
2
2
  [tsc]
3
- [tsc] > @w5s/mrm-preset@2.4.4 build:tsc
3
+ [tsc] > @w5s/mrm-preset@2.4.5 build:tsc
4
4
  [tsc] > tsc --noEmit --skipLibCheck
5
5
  [tsc]
6
6
  [tsc] npm run build:tsc exited with code 0
@@ -1,6 +1,6 @@
1
1
  [1] : exited with code 0
2
2
  [src]
3
- [src] > @w5s/mrm-preset@2.4.4 format:src
3
+ [src] > @w5s/mrm-preset@2.4.5 format:src
4
4
  [src] > eslint . --fix --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml
5
5
  [src]
6
6
  [src] npm run format:src exited with code 0
@@ -1,6 +1,6 @@
1
- [1] : exited with code 0
2
- [src]
3
- [src] > @w5s/mrm-preset@2.4.4 lint:src
4
- [src] > eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml
5
- [src]
6
- [src] npm run lint:src exited with code 0
1
+ [1] : exited with code 0
2
+ [src]
3
+ [src] > @w5s/mrm-preset@2.4.5 lint:src
4
+ [src] > eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml
5
+ [src]
6
+ [src] npm run lint:src exited with code 0
@@ -1 +1 @@
1
- CSpell: Files checked: 52, Issues found: 0 in 0 files.
1
+ CSpell: Files checked: 52, Issues found: 0 in 0 files.
@@ -1,29 +1,79 @@
1
- [1] : exited with code 0
2
- [script]
3
- [script] > @w5s/mrm-preset@2.4.4 test:script
4
- [script] > mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir ..
5
- [script]
6
- [script] mkdir: _tester: File exists
7
- [script] Running bootstrap...
8
- [script] Running alias configure...
9
- [script] Running gitignore...
10
- [script] Running project...
11
- [script] Update turbo.json
12
- [script] Running contributing...
13
- [script] Running licenses...
14
- [script] Running asdf...
15
- [script] Running release...
16
- [script] Running ci...
17
- [script] Running lang...
18
- [script] Update tsconfig.json
19
- [script] Running commitlint...
20
- [script] Update .vscode/extensions.json
21
- [script] Running editorconfig...
22
- [script] Running eslint...
23
- [script] Running cspell...
24
- [script] Update .cspell.json
25
- [script] Running vitest...
26
- [script] Running renovate...
27
- [script] Running githooks...
28
- [script] Running post-configure...
29
- [script] npm run test:script exited with code 0
1
+ [1] : exited with code 0
2
+ [script]
3
+ [script] > @w5s/mrm-preset@2.4.5 test:script
4
+ [script] > mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir ..
5
+ [script]
6
+ [script] mkdir: _tester: File exists
7
+ [script] Running bootstrap...
8
+ [script] Running alias configure...
9
+ [script] Running gitignore...
10
+ [script] Running project...
11
+ [script] Running contributing...
12
+ [script] Running licenses...
13
+ [script] Running asdf...
14
+ [script] Running release...
15
+ [script] Running ci...
16
+ [script] Running lang...
17
+ [script] Running commitlint...
18
+ [script] Running editorconfig...
19
+ [script] Running eslint...
20
+ [script] Installing @w5s/eslint-config...
21
+ [script] npm WARN ERESOLVE overriding peer dependency
22
+ [script] npm WARN ERESOLVE overriding peer dependency
23
+ [script] npm ERR! code ERESOLVE
24
+ [script] npm ERR! ERESOLVE could not resolve
25
+ [script] npm ERR!
26
+ [script] npm ERR! While resolving: @w5s/eslint-config@2.0.17
27
+ [script] npm ERR! Found: eslint@9.3.0
28
+ [script] npm ERR! node_modules/eslint
29
+ [script] npm ERR! peer eslint@"^8.56.0" from @typescript-eslint/parser@7.10.0
30
+ [script] npm ERR! node_modules/@w5s/eslint-config/node_modules/@typescript-eslint/parser
31
+ [script] npm ERR! @typescript-eslint/parser@"^7.0.0" from @w5s/eslint-config@2.0.17
32
+ [script] npm ERR! node_modules/@w5s/eslint-config
33
+ [script] npm ERR! dev @w5s/eslint-config@"2.0.17" from the root project
34
+ [script] npm ERR! peer @typescript-eslint/parser@"^7.0.0" from @typescript-eslint/eslint-plugin@7.10.0
35
+ npm ERR! node_modules/@w5s/eslint-config/node_modules/@typescript-eslint/eslint-plugin
36
+ [script] npm ERR! @typescript-eslint/eslint-plugin@"^7.0.0" from @w5s/eslint-config@2.0.17
37
+ [script] npm ERR! node_modules/@w5s/eslint-config
38
+ [script] npm ERR! dev @w5s/eslint-config@"2.0.17" from the root project
39
+ [script] npm ERR!
40
+ [script] npm ERR! Could not resolve dependency:
41
+ [script] npm ERR! peerOptional eslint@"8.x" from @w5s/eslint-config@2.0.17
42
+ [script] npm ERR! node_modules/@w5s/eslint-config
43
+ [script] npm ERR! dev @w5s/eslint-config@"2.0.17" from the root project
44
+ [script] npm ERR!
45
+ [script] npm ERR! Conflicting peer dependency: eslint@8.57.0
46
+ [script] npm ERR! node_modules/eslint
47
+ [script] npm ERR! peerOptional eslint@"8.x" from @w5s/eslint-config@2.0.17
48
+ [script] npm ERR! node_modules/@w5s/eslint-config
49
+ [script] npm ERR! dev @w5s/eslint-config@"2.0.17" from the root project
50
+ [script] npm ERR!
51
+ [script] npm ERR! Fix the upstream dependency conflict, or retry
52
+ [script] npm ERR! this command with --force or --legacy-peer-deps
53
+ [script] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
54
+ [script] npm ERR!
55
+ [script] npm ERR!
56
+ [script] npm ERR! For a full report see:
57
+ [script] npm ERR! /Users/julienpolo/Library/Caches/npm/_logs/2024-05-21T19_16_14_380Z-eresolve-report.txt
58
+ [script]
59
+ [script] npm ERR! A complete log of this run can be found in: /Users/julienpolo/Library/Caches/npm/_logs/2024-05-21T19_16_14_380Z-debug-0.log
60
+ [script] Running cspell...
61
+ [script] Running vitest...
62
+ [script] Running renovate...
63
+ [script] Running githooks...
64
+ [script] Running post-configure...
65
+ [script] Error: to format code
66
+ [script]
67
+ [script] > _tester@1.0.0-alpha.0 format
68
+ [script] > concurrently "npm:format:*" ":"
69
+ [script]
70
+ [script] [1] : exited with code 0
71
+ [script] [root]
72
+ [script] [root] > _tester@1.0.0-alpha.0 format:root
73
+ [script] [root] > eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml --fix
74
+ [script] [root]
75
+ [script] [root] Invalid option '--ext' - perhaps you meant '-c'?
76
+ [script] [root] You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.
77
+ [script] [root] npm run format:root exited with code 2
78
+ [script]
79
+ [script] npm run test:script exited with code 0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
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
+ # [2.5.0](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@2.4.5...@w5s/mrm-preset@2.5.0) (2024-05-21)
7
+
8
+ ### ✨ Features
9
+
10
+ - Add directory, directorySync ([98e3a28](https://github.com/w5s/project-config/commit/98e3a28))
11
+
12
+ **Note:** Version bump only for package @w5s/mrm-preset
13
+
6
14
  ## [2.4.5](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@2.4.4...@w5s/mrm-preset@2.4.5) (2024-05-12)
7
15
 
8
16
  **Note:** Version bump only for package @w5s/mrm-preset
@@ -13,7 +13,7 @@
13
13
  when: always
14
14
  - when: never
15
15
  image:
16
- name: renovate/renovate@sha256:3a2ecbdafb8d6afcb36526da9bd9ea34a23b7cd28bc80e395f1d61ff20e2143b
16
+ name: renovate/renovate@sha256:31b9a88f54e5193a5dc8dc785ed1fa383479aea680d72c5aa934841e83d0da84
17
17
  entrypoint: ['']
18
18
  script:
19
19
  - >
package/core/githooks.js CHANGED
@@ -1,36 +1,8 @@
1
- const { execSync } = require('node:child_process');
2
1
  const path = require('node:path');
3
- const { file, makeDirs } = require('mrm-core');
4
- const { blockSync } = require('@w5s/dev');
5
- const project = require('./project.js');
6
- const npm = require('./npm.js');
7
- const pkg = require('./pkg.js');
2
+ const { blockSync, directorySync, fileSync } = require('@w5s/dev');
8
3
 
9
4
  const hookDirectory = '.githooks';
10
5
 
11
- /**
12
- * @param {{
13
- * state: 'present'|'absent',
14
- * }} options
15
- */
16
- function husky({ state }) {
17
- const hasHusky = state === 'present';
18
-
19
- npm.dependency({
20
- dev: true,
21
- name: ['husky'],
22
- state: 'absent',
23
- });
24
-
25
- pkg.withPackageJson((packageFile) => {
26
- pkg.script(packageFile, {
27
- name: `${project.prepare}:githooks`,
28
- state: hasHusky ? 'present' : 'absent',
29
- update: `[ -n "\${CI:-}" ] || npx husky ${hookDirectory}`,
30
- });
31
- });
32
- }
33
-
34
6
  /**
35
7
  * @param {{
36
8
  * name: 'pre-push'|'pre-commit'|'commit-msg',
@@ -42,23 +14,28 @@ function gitHook({ name, state, content }) {
42
14
  const hasGitHook = state === 'present';
43
15
  const hookFileName = path.join(hookDirectory, name);
44
16
  if (hasGitHook) {
45
- makeDirs(hookDirectory);
46
-
47
- if (!file(hookFileName).exists()) {
48
- execSync(`npm exec -- husky add ${hookFileName} ""`, { stdio: 'inherit' });
49
- }
50
-
17
+ directorySync({
18
+ path: hookDirectory,
19
+ state: 'present',
20
+ });
21
+ fileSync({
22
+ path: hookFileName,
23
+ state,
24
+ update: (_) => (_.length === 0 ? '#!/usr/bin/env bash\nset -euo pipefail\n' : _),
25
+ });
51
26
  blockSync({
52
27
  path: hookFileName,
53
28
  block: content,
54
29
  insertPosition: ['after', 'EndOfFile'],
55
30
  });
56
31
  } else {
57
- file(hookFileName).delete();
32
+ fileSync({
33
+ path: hookFileName,
34
+ state,
35
+ });
58
36
  }
59
37
  }
60
38
 
61
39
  module.exports = {
62
- husky,
63
40
  gitHook,
64
41
  };
package/githooks/index.js CHANGED
@@ -4,7 +4,7 @@ const { fileSync } = require('@w5s/dev');
4
4
  const project = require('../core/project.js');
5
5
  const pkg = require('../core/pkg.js');
6
6
  const { hasGit } = require('../core/git.js');
7
- const { gitHook, husky } = require('../core/githooks.js');
7
+ const { gitHook } = require('../core/githooks.js');
8
8
  const { lintStaged } = require('../core/lintStaged.js');
9
9
 
10
10
  function task() {
@@ -12,9 +12,6 @@ function task() {
12
12
  const packageFile = packageJson();
13
13
  const hasESLint = pkg.hasDependency(packageFile, 'eslint', 'dev');
14
14
 
15
- husky({
16
- state: gitSupported ? 'present' : 'absent',
17
- });
18
15
  lintStaged({
19
16
  state: gitSupported ? 'present' : 'absent',
20
17
  update: (config) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/mrm-preset",
3
- "version": "2.4.5",
3
+ "version": "2.5.0",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -24,7 +24,7 @@
24
24
  "postpack": "npx clean-package restore"
25
25
  },
26
26
  "dependencies": {
27
- "@w5s/dev": "^2.1.7",
27
+ "@w5s/dev": "^2.2.0",
28
28
  "debug": "^4.3.3",
29
29
  "glob": "^10.0.0",
30
30
  "mrm-core": "^7.0.0",
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "175855da4a13fb5b1e3e2e82923a616823f87311"
40
+ "gitHead": "83fd8a5230a660921d5c785190b58f38a1d3cdb0"
41
41
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/mrm-preset",
3
- "version": "2.4.5",
3
+ "version": "2.5.0",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -37,7 +37,7 @@
37
37
  "test:script": "mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir .."
38
38
  },
39
39
  "dependencies": {
40
- "@w5s/dev": "^2.1.7",
40
+ "@w5s/dev": "^2.2.0",
41
41
  "debug": "^4.3.3",
42
42
  "glob": "^10.0.0",
43
43
  "mrm-core": "^7.0.0",
@@ -56,5 +56,5 @@
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "175855da4a13fb5b1e3e2e82923a616823f87311"
59
+ "gitHead": "83fd8a5230a660921d5c785190b58f38a1d3cdb0"
60
60
  }