@w5s/mrm-preset 2.4.5 → 2.5.1

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,7 @@
1
- [1] : exited with code 0
1
+
2
+ [1] : exited with code 0
2
3
  [tsc]
3
- [tsc] > @w5s/mrm-preset@2.4.4 build:tsc
4
+ [tsc] > @w5s/mrm-preset@2.3.6 build:tsc
4
5
  [tsc] > tsc --noEmit --skipLibCheck
5
6
  [tsc]
6
7
  [tsc] npm run build:tsc exited with code 0
@@ -1,6 +1,7 @@
1
- [1] : exited with code 0
1
+
2
+ [1] : exited with code 0
2
3
  [src]
3
- [src] > @w5s/mrm-preset@2.4.4 lint:src
4
+ [src] > @w5s/mrm-preset@2.3.6 lint:src
4
5
  [src] > eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml
5
6
  [src]
6
7
  [src] npm run lint:src exited with code 0
@@ -1 +1,2 @@
1
- CSpell: Files checked: 52, Issues found: 0 in 0 files.
1
+
2
+ CSpell: Files checked: 52, Issues found: 0 in 0 files
@@ -1,6 +1,7 @@
1
- [1] : exited with code 0
1
+
2
+ [1] : exited with code 0
2
3
  [script]
3
- [script] > @w5s/mrm-preset@2.4.4 test:script
4
+ [script] > @w5s/mrm-preset@2.3.6 test:script
4
5
  [script] > mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir ..
5
6
  [script]
6
7
  [script] mkdir: _tester: File exists
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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.1](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@2.5.0...@w5s/mrm-preset@2.5.1) (2024-05-24)
7
+
8
+ **Note:** Version bump only for package @w5s/mrm-preset
9
+
10
+ # [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)
11
+
12
+ ### ✨ Features
13
+
14
+ - Add directory, directorySync ([98e3a28](https://github.com/w5s/project-config/commit/98e3a28))
15
+
16
+ **Note:** Version bump only for package @w5s/mrm-preset
17
+
6
18
  ## [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
19
 
8
20
  **Note:** Version bump only for package @w5s/mrm-preset
@@ -201,7 +201,7 @@ variables:
201
201
  # IMAGE_NAME: $CI_REGISTRY_IMAGE
202
202
 
203
203
  .autodevops_node_image:
204
- image: node:lts-alpine@sha256:291e84d956f1aff38454bbd3da38941461ad569a185c20aa289f71f37ea08e23
204
+ image: node:lts-alpine@sha256:a7b980c958bfe4d84ee9263badd95a40c8bb50ad5afdb87902c187fefaef0e24
205
205
 
206
206
  .autodevops_node_install:
207
207
  extends:
@@ -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:1601c02bbb4d2bc40012cdadd8df42ea186123c4f9574a1d108a849e48cb856b
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.1",
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": "82c472e8ba92e7e7b29be093654361b5e075b24f"
41
41
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/mrm-preset",
3
- "version": "2.4.5",
3
+ "version": "2.5.1",
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": "82c472e8ba92e7e7b29be093654361b5e075b24f"
60
60
  }
@@ -1,6 +0,0 @@
1
- [1] : exited with code 0
2
- [src]
3
- [src] > @w5s/mrm-preset@2.4.4 format:src
4
- [src] > eslint . --fix --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml
5
- [src]
6
- [src] npm run format:src exited with code 0