@w5s/mrm-preset 1.1.1 → 1.2.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 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.2.0](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.1.1...@w5s/mrm-preset@1.2.0) (2023-08-01)
7
+
8
+
9
+ ### ✨ Features
10
+
11
+ - Add support for asdf ([a67f3b5](https://github.com/w5s/project-config/commit/a67f3b5)) - Add support for turbo caching in github actions ([d61aca7](https://github.com/w5s/project-config/commit/d61aca7))
12
+
13
+ **Note:** Version bump only for package @w5s/mrm-preset
14
+
15
+
16
+
17
+
18
+
6
19
  ## [1.1.1](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.1.0...@w5s/mrm-preset@1.1.1) (2023-07-12)
7
20
 
8
21
  **Note:** Version bump only for package @w5s/mrm-preset
package/asdf/index.js ADDED
@@ -0,0 +1,16 @@
1
+ const { asdfConfig } = require('../core/asdf.js');
2
+
3
+ function task() {
4
+ asdfConfig({
5
+ state: 'present',
6
+ update: (config) => ({
7
+ nodejs: '18.17.0',
8
+ ...config,
9
+ }),
10
+ });
11
+ }
12
+
13
+ task.description = 'Configure ASDF';
14
+ task.parameters = {};
15
+
16
+ module.exports = task;
package/ci/github.js CHANGED
@@ -33,11 +33,11 @@ function task() {
33
33
  'runs-on': 'ubuntu-latest',
34
34
  steps: [
35
35
  { uses: 'actions/checkout@v3' },
36
+ { uses: 'dtinth/setup-github-actions-caching-for-turbo@v1' },
36
37
  {
37
- name: 'Use Node.js',
38
38
  uses: 'actions/setup-node@v3',
39
39
  with: {
40
- 'node-version': 'lts/*',
40
+ 'node-version-file': '.tool-versions',
41
41
  cache: packageManager,
42
42
  },
43
43
  },
package/config.json CHANGED
@@ -5,6 +5,7 @@
5
5
  "project",
6
6
  "contributing",
7
7
  "licenses",
8
+ "asdf",
8
9
  "release",
9
10
  "ci",
10
11
  "lang",
package/core/asdf.js ADDED
@@ -0,0 +1,41 @@
1
+ const { file } = require('mrm-core');
2
+
3
+ /**
4
+ * @typedef {{ [tool: string]: string }} ASDFConfig
5
+ */
6
+ /**
7
+ * @param {{
8
+ * state: 'present'|'absent',
9
+ * update?: (config: ASDFConfig) => ASDFConfig
10
+ * }} options
11
+ */
12
+ function asdfConfig({ state, update }) {
13
+ const hasASDF = state === 'present';
14
+ const toolVersionsFile = file('.tool-versions');
15
+
16
+ if (hasASDF) {
17
+ const eol = '\n';
18
+ const content = toolVersionsFile.get();
19
+ const parsed = Object.fromEntries(
20
+ content
21
+ .split(eol)
22
+ .map((_) => _.split(/\s+/, 2))
23
+ .filter((_) => _[0] !== '')
24
+ );
25
+
26
+ // @ts-ignore
27
+ const updated = update ? update(parsed) : parsed;
28
+
29
+ const formatted = Object.keys(updated)
30
+ .map((tool) => `${tool} ${updated[tool]}`)
31
+ .join(eol);
32
+
33
+ toolVersionsFile.save(formatted);
34
+ } else {
35
+ toolVersionsFile.delete();
36
+ }
37
+ }
38
+
39
+ module.exports = {
40
+ asdfConfig,
41
+ };
package/core/githubCI.js CHANGED
@@ -1,6 +1,6 @@
1
- const { yaml } = require('mrm-core');
2
1
  const path = require('node:path');
3
2
  const fs = require('node:fs');
3
+ const { yaml } = require('mrm-core');
4
4
 
5
5
  const FILE_PATH = '.github/workflows';
6
6
 
package/core/pkg.js CHANGED
@@ -5,11 +5,11 @@
5
5
  * @typedef {string|boolean|number|null|Array<unknown>|Record<string, unknown>} JsonValue
6
6
  */
7
7
 
8
+ const path = require('node:path');
8
9
  // @ts-ignore
9
10
  const { intersect } = require('semver-intersect');
10
11
  const { packageJson, file, json } = require('mrm-core');
11
12
  const glob = require('glob');
12
- const path = require('node:path');
13
13
  const jsonFile = require('./jsonFile.js');
14
14
 
15
15
  /**
package/core/vitest.js CHANGED
@@ -1,5 +1,5 @@
1
- const { file, packageJson } = require('mrm-core');
2
1
  const fs = require('node:fs');
2
+ const { file, packageJson } = require('mrm-core');
3
3
  const pkg = require('./pkg.js');
4
4
  const npm = require('./npm.js');
5
5
  const project = require('./project.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/mrm-preset",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -52,5 +52,5 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  },
55
- "gitHead": "80e6661d57dd6ed7a832f7e34fe3eab7adcddb88"
55
+ "gitHead": "a10793f9e40481a6e84451e57851a3af630ce953"
56
56
  }
@@ -1,6 +0,0 @@
1
- [1] : exited with code 0
2
- [tsc]
3
- [tsc] > @w5s/mrm-preset@1.1.0 build:tsc
4
- [tsc] > tsc --noEmit --skipLibCheck
5
- [tsc]
6
- [tsc] npm run build:tsc exited with code 0
@@ -1,6 +0,0 @@
1
- [1] : exited with code 0
2
- [src]
3
- [src] > @w5s/mrm-preset@1.1.0 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,52 +0,0 @@
1
- [1] : exited with code 0
2
- [script]
3
- [script] > @w5s/mrm-preset@1.1.0 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 release...
15
- [script] Running ci...
16
- [script] Running lang...
17
- [script] Update tsconfig.json
18
- [script] Running commitlint...
19
- [script] Update .vscode/extensions.json
20
- [script] Running editorconfig...
21
- [script] Running eslint...
22
- [script] Installing @w5s/eslint-config...
23
- [script] npm ERR! code ERESOLVE
24
- [script] npm ERR! ERESOLVE unable to resolve dependency tree
25
- [script] npm ERR!
26
- [script] npm ERR! While resolving: _tester@1.0.0-alpha.0
27
- [script] npm ERR! Found: prettier@3.0.0
28
- [script] npm ERR! node_modules/prettier
29
- [script] npm ERR! dev prettier@"^3.0.0" from the root project
30
- [script] npm ERR!
31
- [script] npm ERR! Could not resolve dependency:
32
- npm ERR! peer prettier@"2.x" from @w5s/eslint-config@1.1.1
33
- [script] npm ERR! node_modules/@w5s/eslint-config
34
- [script] npm ERR! dev @w5s/eslint-config@"1.1.1" from the root project
35
- [script] npm ERR!
36
- [script] npm ERR! Fix the upstream dependency conflict, or retry
37
- [script] npm ERR! this command with --force or --legacy-peer-deps
38
- [script] npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
39
- [script] npm ERR!
40
- [script] npm ERR!
41
- [script] npm ERR! For a full report see:
42
- [script] npm ERR! /Users/julienpolo/Library/Caches/npm/_logs/2023-07-12T19_18_18_503Z-eresolve-report.txt
43
- [script]
44
- [script] npm ERR! A complete log of this run can be found in:
45
- npm ERR! /Users/julienpolo/Library/Caches/npm/_logs/2023-07-12T19_18_18_503Z-debug-0.log
46
- [script] Running cspell...
47
- [script] Update .cspell.json
48
- [script] Running vitest...
49
- [script] Running renovate...
50
- [script] Running githooks...
51
- [script] Running postconfigure...
52
- [script] npm run test:script exited with code 0