@w5s/mrm-preset 1.0.0-alpha.42 → 1.0.0-alpha.44

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@1.0.0-alpha.41 build:tsc
3
+ [tsc] > @w5s/mrm-preset@1.0.0-alpha.43 build:tsc
4
4
  [tsc] > tsc --noEmit --skipLibCheck
5
5
  [tsc]
6
6
  [tsc] npm run build:tsc exited with code 0
@@ -0,0 +1,9 @@
1
+ ✔ README.md Updated
2
+ Transforms run
3
+ ⁕ PKG_JSON:template=# W5s Mrm Preset _(${name})_
4
+ ⁕ PKG_JSON:template=> ${description}&unknownTxt=
5
+ ⁕ PKG_JSON:template=[${license}][license-url] © ${author}
6
+ ⁕ PKG_JSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
7
+ ⁕ PKG_JSON:template=[package-url]: https://www.npmjs.com/package/${name}
8
+ ⁕ PKG_JSON:template=[license-image]: https://img.shields.io/badge/license-${license}-green.svg?style=flat-square
9
+
@@ -1,6 +1,6 @@
1
1
  [1] : exited with code 0
2
2
  [src]
3
- [src] > @w5s/mrm-preset@1.0.0-alpha.41 lint:src
3
+ [src] > @w5s/mrm-preset@1.0.0-alpha.43 lint:src
4
4
  [src] > eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml
5
5
  [src]
6
6
  [src] npm run lint:src exited with code 0
@@ -1,5 +1,5 @@
1
1
  [src]
2
- [src] > @w5s/mrm-preset@1.0.0-alpha.41 test:src
2
+ [src] > @w5s/mrm-preset@1.0.0-alpha.43 test:src
3
3
  [src] > mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir ..
4
4
  [src]
5
5
  [src] mkdir: _tester: File exists
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
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
+ ## 1.0.0-alpha.44 (2023-02-28)
7
+
8
+ - ✨ Use always latest mrm preset ([abf6c51](https://github.com/w5s/project-config/commit/abf6c51))
9
+ - 👷 Update mrm presets ([4a56dbc](https://github.com/w5s/project-config/commit/4a56dbc))
10
+
11
+ ## 1.0.0-alpha.43 (2023-02-23)
12
+
13
+ - ✨ Improve mrm bootstrap script ([0445277](https://github.com/w5s/project-config/commit/0445277))
14
+ - ➖ Remove is-ci, lint-staged, commitlint dependency (used through npx) ([ae39f34](https://github.com/w5s/project-config/commit/ae39f34))
15
+ - ➖ Remove mrm dependency ([7ee3d94](https://github.com/w5s/project-config/commit/7ee3d94))
16
+ - 🐛 Fix unbound variable error ([d2aa040](https://github.com/w5s/project-config/commit/d2aa040))
17
+ - 💚 Fix ci ([cded057](https://github.com/w5s/project-config/commit/cded057))
18
+
6
19
  ## 1.0.0-alpha.42 (2023-02-10)
7
20
 
8
21
  - ✨ Configure @w5s/conventional-changelog ([b19e437](https://github.com/w5s/project-config/commit/b19e437))
@@ -1,5 +1,5 @@
1
1
  # Bootstrap task
2
2
 
3
3
  ```bash
4
- npm exec -p mrm -p @w5s/mrm-preset -- mrm bootstrap --preset @w5s/mrm-preset
4
+ npm exec --package=mrm --package=@w5s/mrm-preset@latest -- mrm bootstrap --preset @w5s/mrm-preset
5
5
  ```
@@ -29,25 +29,23 @@ function task({ mrmPreset, mrmTask, packageManager }) {
29
29
 
30
30
  npm.bootstrap(packageManager);
31
31
 
32
- npm.dependency({
33
- dev: true,
34
- name: ['mrm', mrmPreset],
35
- state: 'present',
36
- });
32
+ // npm.dependency({
33
+ // dev: true,
34
+ // name: ['mrm', mrmPreset],
35
+ // state: 'present',
36
+ // });
37
37
 
38
38
  pkg.withPackageJson((packageFile) => {
39
- const currentPackageManager = pkg.manager(packageFile);
40
-
41
39
  // Add MRM default scripts
42
40
  pkg.script(packageFile, {
43
41
  name: 'configure',
44
42
  state: 'present',
45
- default: currentPackageManager === 'npm' ? `npm run mrm -- ${mrmTask}` : `yarn mrm ${mrmTask}`,
43
+ default: `npm run mrm -- ${mrmTask}`,
46
44
  });
47
45
  pkg.script(packageFile, {
48
46
  name: 'mrm',
49
47
  state: 'present',
50
- default: `mrm --preset ${mrmPreset}`,
48
+ default: `npm exec --package=mrm --package=${mrmPreset}@latest -- mrm --preset ${mrmPreset}`,
51
49
  });
52
50
  });
53
51
  }
@@ -23,13 +23,13 @@ function commitlint({ state, preset }) {
23
23
 
24
24
  gitHook({
25
25
  name: 'commit-msg',
26
- content: 'npm exec --no -- commitlint --edit $1',
26
+ content: 'npm exec -- commitlint --edit $1',
27
27
  state,
28
28
  });
29
29
 
30
30
  npm.dependency({
31
31
  dev: true,
32
- name: ['@commitlint/cli', preset],
32
+ name: [preset],
33
33
  state,
34
34
  });
35
35
  }
package/core/githooks.js CHANGED
@@ -1,11 +1,13 @@
1
1
  const { execSync } = require('node:child_process');
2
2
  const path = require('node:path');
3
- const { file, packageJson, makeDirs } = require('mrm-core');
3
+ const { file, makeDirs } = require('mrm-core');
4
4
  const project = require('./project.js');
5
5
  const npm = require('./npm.js');
6
6
  const pkg = require('./pkg.js');
7
7
  const block = require('./block.js');
8
8
 
9
+ const hookDirectory = '.githooks';
10
+
9
11
  /**
10
12
  * @param {{
11
13
  * state: 'present'|'absent',
@@ -17,21 +19,14 @@ function husky({ state }) {
17
19
  npm.dependency({
18
20
  dev: true,
19
21
  name: ['husky'],
20
- state: hasHusky ? 'present' : 'absent',
22
+ state: 'absent',
21
23
  });
22
- if (hasHusky) {
23
- npm.dependency({
24
- dev: true,
25
- name: ['is-ci'],
26
- state: 'present',
27
- });
28
- }
29
24
 
30
25
  pkg.withPackageJson((packageFile) => {
31
26
  pkg.script(packageFile, {
32
- name: `${project.prepare}:husky`,
27
+ name: `${project.prepare}:githooks`,
33
28
  state: hasHusky ? 'present' : 'absent',
34
- update: 'is-ci || husky install',
29
+ update: `[ -n "\${CI:-}" ] || npx husky install ${hookDirectory}`,
35
30
  });
36
31
  });
37
32
  }
@@ -44,10 +39,7 @@ function husky({ state }) {
44
39
  * }} options
45
40
  */
46
41
  function gitHook({ name, state, content }) {
47
- const packageFileDefault = packageJson();
48
- const hasHusky = pkg.hasDependency(packageFileDefault, 'husky', 'dev');
49
- const hasGitHook = hasHusky && state === 'present';
50
- const hookDirectory = '.husky';
42
+ const hasGitHook = state === 'present';
51
43
  const hookFileName = path.join(hookDirectory, name);
52
44
  if (hasGitHook) {
53
45
  makeDirs(hookDirectory);
package/githooks/index.js CHANGED
@@ -31,7 +31,7 @@ function task() {
31
31
  });
32
32
  gitHook({
33
33
  name: 'pre-commit',
34
- content: `npm exec --no -- lint-staged`,
34
+ content: `npm exec -- lint-staged`,
35
35
  state: gitSupported ? 'present' : 'absent',
36
36
  });
37
37
  gitHook({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/mrm-preset",
3
- "version": "1.0.0-alpha.42",
3
+ "version": "1.0.0-alpha.44",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -43,7 +43,8 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/debug": "4.1.7",
46
- "mrm": "4.1.13"
46
+ "mrm": "4.1.13",
47
+ "mrm-preset-default": "4.1.11"
47
48
  },
48
49
  "engines": {
49
50
  "node": ">=16.0.0"
@@ -51,5 +52,5 @@
51
52
  "publishConfig": {
52
53
  "access": "public"
53
54
  },
54
- "gitHead": "918c1157da6808ff19124ee96a4fe499f0da1877"
55
+ "gitHead": "5796f2161110005d806c8991c8497f6f0dab74c1"
55
56
  }
@@ -2,8 +2,16 @@ const { spawnSync } = require('node:child_process');
2
2
  const { packageJson } = require('mrm-core');
3
3
  const project = require('../core/project.js');
4
4
  const pkg = require('../core/pkg.js');
5
+ const npm = require('../core/npm.js');
5
6
 
6
7
  function task() {
8
+ // Remove old deps
9
+ npm.dependency({
10
+ dev: true,
11
+ name: ['is-ci', '@commitlint/cli', 'lint-staged', 'mrm'],
12
+ state: 'absent',
13
+ });
14
+
7
15
  const packageFile = packageJson();
8
16
  const packageManager = pkg.manager(packageFile);
9
17
  const formatResult = spawnSync(packageManager, ['run', project.format]);
package/release/index.js CHANGED
@@ -10,7 +10,8 @@ function task() {
10
10
  pkg.withPackageJson((packageFile) => {
11
11
  pkg.script(packageFile, {
12
12
  name: project.release,
13
- update: useWorkspace ? 'is-ci && lerna publish --yes || lerna publish' : semanticRelease.command(),
13
+ // eslint-disable-next-line no-template-curly-in-string
14
+ update: useWorkspace ? '[ -n "${CI:-}" ] && lerna publish --yes || lerna publish' : semanticRelease.command(),
14
15
  state: 'present',
15
16
  });
16
17
  });
@@ -1,6 +0,0 @@
1
- [1] : exited with code 0
2
- [src]
3
- [src] > @w5s/mrm-preset@1.0.0-alpha.41 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