@w5s/mrm-preset 1.1.1 → 1.2.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,6 @@
1
1
  [1] : exited with code 0
2
2
  [tsc]
3
- [tsc] > @w5s/mrm-preset@1.1.0 build:tsc
3
+ [tsc] > @w5s/mrm-preset@1.2.0 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@1.1.0 lint:src
3
+ [src] > @w5s/mrm-preset@1.2.0 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,6 +1,6 @@
1
1
  [1] : exited with code 0
2
2
  [script]
3
- [script] > @w5s/mrm-preset@1.1.0 test:script
3
+ [script] > @w5s/mrm-preset@1.2.0 test:script
4
4
  [script] > mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir ..
5
5
  [script]
6
6
  [script] mkdir: _tester: File exists
@@ -8,43 +8,16 @@
8
8
  [script] Running alias configure...
9
9
  [script] Running gitignore...
10
10
  [script] Running project...
11
- [script] Update turbo.json
12
11
  [script] Running contributing...
13
12
  [script] Running licenses...
13
+ [script] Running asdf...
14
14
  [script] Running release...
15
15
  [script] Running ci...
16
16
  [script] Running lang...
17
- [script] Update tsconfig.json
18
17
  [script] Running commitlint...
19
- [script] Update .vscode/extensions.json
20
18
  [script] Running editorconfig...
21
19
  [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
20
  [script] Running cspell...
47
- [script] Update .cspell.json
48
21
  [script] Running vitest...
49
22
  [script] Running renovate...
50
23
  [script] Running githooks...
package/CHANGELOG.md CHANGED
@@ -3,6 +3,32 @@
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.1](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.2.0...@w5s/mrm-preset@1.2.1) (2023-08-08)
7
+
8
+
9
+ ### 🐛 Bug Fixes
10
+
11
+ - Fix doc configuration in mrm ([fe81b1a](https://github.com/w5s/project-config/commit/fe81b1a))
12
+
13
+ **Note:** Version bump only for package @w5s/mrm-preset
14
+
15
+
16
+
17
+
18
+
19
+ # [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)
20
+
21
+
22
+ ### ✨ Features
23
+
24
+ - 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))
25
+
26
+ **Note:** Version bump only for package @w5s/mrm-preset
27
+
28
+
29
+
30
+
31
+
6
32
  ## [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
33
 
8
34
  **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.1",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -21,18 +21,7 @@
21
21
  "type": "commonjs",
22
22
  "main": "config.json",
23
23
  "scripts": {
24
- "build": "concurrently \"npm:build:*\" \":\"",
25
- "build:tsc": "tsc --noEmit --skipLibCheck",
26
- "clean": "concurrently \"npm:clean:*\" \":\"",
27
- "docs": "node ../../markdown.mjs",
28
- "format": "concurrently \"npm:format:*\" \":\"",
29
- "format:src": "eslint . --fix --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml",
30
- "lint": "concurrently \"npm:lint:*\" \":\"",
31
- "lint:src": "eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml",
32
- "prepare": "concurrently \"npm:prepare:*\" \":\"",
33
- "spellcheck": "cspell --no-progress '**'",
34
- "test": "concurrently \"npm:test:*\" \":\"",
35
- "test:script": "mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir .."
24
+ "postpack": "npx clean-package restore"
36
25
  },
37
26
  "dependencies": {
38
27
  "debug": "^4.3.3",
@@ -41,16 +30,11 @@
41
30
  "semver-intersect": "^1.4.0",
42
31
  "sync-directory": "^6.0.0"
43
32
  },
44
- "devDependencies": {
45
- "@types/debug": "4.1.8",
46
- "mrm": "4.1.17",
47
- "mrm-preset-default": "4.1.11"
48
- },
49
33
  "engines": {
50
34
  "node": ">=16.0.0"
51
35
  },
52
36
  "publishConfig": {
53
37
  "access": "public"
54
38
  },
55
- "gitHead": "80e6661d57dd6ed7a832f7e34fe3eab7adcddb88"
39
+ "gitHead": "16aaafb3d78f8485ca110ee2842005e6b938111b"
56
40
  }
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@w5s/mrm-preset",
3
+ "version": "1.2.1",
4
+ "description": "Mrm configuration presets",
5
+ "keywords": [
6
+ "mrm",
7
+ "config",
8
+ "bootstrap"
9
+ ],
10
+ "homepage": "https://github.com/w5s/project-config/blob/main/packages/mrm-preset#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/w5s/project-config.git/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git@github.com:w5s/project-config.git",
17
+ "directory": "packages/mrm-preset"
18
+ },
19
+ "license": "MIT",
20
+ "author": "Julien Polo <julien.polo@gmail.com>",
21
+ "type": "commonjs",
22
+ "main": "config.json",
23
+ "scripts": {
24
+ "build": "concurrently \"npm:build:*\" \":\"",
25
+ "build:tsc": "tsc --noEmit --skipLibCheck",
26
+ "clean": "concurrently \"npm:clean:*\" \":\"",
27
+ "docs": "node ../../markdown.mjs",
28
+ "format": "concurrently \"npm:format:*\" \":\"",
29
+ "format:src": "eslint . --fix --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml",
30
+ "lint": "concurrently \"npm:lint:*\" \":\"",
31
+ "lint:src": "eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml",
32
+ "postpack": "npx clean-package restore",
33
+ "prepack": "npx clean-package",
34
+ "prepare": "concurrently \"npm:prepare:*\" \":\"",
35
+ "spellcheck": "cspell --no-progress '**'",
36
+ "test": "concurrently \"npm:test:*\" \":\"",
37
+ "test:script": "mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir .."
38
+ },
39
+ "dependencies": {
40
+ "debug": "^4.3.3",
41
+ "glob": "^10.0.0",
42
+ "mrm-core": "^7.0.0",
43
+ "semver-intersect": "^1.4.0",
44
+ "sync-directory": "^6.0.0"
45
+ },
46
+ "devDependencies": {
47
+ "@types/debug": "4.1.8",
48
+ "mrm": "4.1.17",
49
+ "mrm-preset-default": "4.1.11"
50
+ },
51
+ "clean-package": "../../clean-package.config.cjs",
52
+ "engines": {
53
+ "node": ">=16.0.0"
54
+ },
55
+ "publishConfig": {
56
+ "access": "public"
57
+ },
58
+ "gitHead": "16aaafb3d78f8485ca110ee2842005e6b938111b"
59
+ }
package/project/index.js CHANGED
@@ -254,6 +254,7 @@ function task() {
254
254
  update: (_) => ({
255
255
  ..._,
256
256
  pipeline: {
257
+ ..._.pipeline,
257
258
  [project.build]: {
258
259
  dependsOn: [`^${project.build}`, `//#${project.build}:root`],
259
260
  outputs: ['lib/**', 'dist/**', '.next/**'],
@@ -272,7 +273,11 @@ function task() {
272
273
  dependsOn: [`//#${project.format}:root`],
273
274
  },
274
275
  [`//#${project.format}:root`]: {},
275
- [project.docs]: {},
276
+ [project.docs]: {
277
+ dependsOn: [`//#${project.docs}:root`],
278
+ cache: false,
279
+ },
280
+ [`//#${project.docs}:root`]: {},
276
281
  [project.spellcheck]: {
277
282
  dependsOn: [`//#${project.spellcheck}:root`],
278
283
  },