@w5s/mrm-preset 1.1.0 → 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 +21 -0
- package/asdf/index.js +16 -0
- package/ci/github.js +2 -2
- package/config.json +1 -0
- package/core/asdf.js +41 -0
- package/core/githubCI.js +1 -1
- package/core/pkg.js +1 -1
- package/core/vitest.js +1 -1
- package/eslint/index.js +1 -1
- package/githooks/index.js +5 -1
- package/package.json +2 -2
- package/.turbo/turbo-build.log +0 -6
- package/.turbo/turbo-format.log +0 -6
- package/.turbo/turbo-lint.log +0 -6
- package/.turbo/turbo-test.log +0 -28
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
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
|
+
|
|
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)
|
|
20
|
+
|
|
21
|
+
**Note:** Version bump only for package @w5s/mrm-preset
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
6
27
|
# [1.1.0](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.4...@w5s/mrm-preset@1.1.0) (2023-07-04)
|
|
7
28
|
|
|
8
29
|
### ✨ Features
|
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': '
|
|
40
|
+
'node-version-file': '.tool-versions',
|
|
41
41
|
cache: packageManager,
|
|
42
42
|
},
|
|
43
43
|
},
|
package/config.json
CHANGED
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
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
package/eslint/index.js
CHANGED
package/githooks/index.js
CHANGED
|
@@ -44,7 +44,11 @@ function task() {
|
|
|
44
44
|
path: 'CODEOWNERS',
|
|
45
45
|
state: gitSupported ? 'file' : 'absent',
|
|
46
46
|
update: (content) =>
|
|
47
|
-
content.length === 0
|
|
47
|
+
content.length === 0
|
|
48
|
+
? template('', path.join(__dirname, 'templates', 'CODEOWNERS'))
|
|
49
|
+
.apply()
|
|
50
|
+
.get()
|
|
51
|
+
: undefined,
|
|
48
52
|
});
|
|
49
53
|
}
|
|
50
54
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/mrm-preset",
|
|
3
|
-
"version": "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": "
|
|
55
|
+
"gitHead": "a10793f9e40481a6e84451e57851a3af630ce953"
|
|
56
56
|
}
|
package/.turbo/turbo-build.log
DELETED
package/.turbo/turbo-format.log
DELETED
package/.turbo/turbo-lint.log
DELETED
package/.turbo/turbo-test.log
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
[1] : exited with code 0
|
|
2
|
-
[script]
|
|
3
|
-
[script] > @w5s/mrm-preset@1.0.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] [36mRunning bootstrap...[39m
|
|
8
|
-
[script] [33mRunning alias configure...[39m
|
|
9
|
-
[script] [36mRunning gitignore...[39m
|
|
10
|
-
[script] [36mRunning project...[39m
|
|
11
|
-
[script] [32mUpdate turbo.json[39m
|
|
12
|
-
[script] [36mRunning contributing...[39m
|
|
13
|
-
[script] [36mRunning licenses...[39m
|
|
14
|
-
[script] [36mRunning release...[39m
|
|
15
|
-
[script] [36mRunning ci...[39m
|
|
16
|
-
[script] [36mRunning lang...[39m
|
|
17
|
-
[script] [32mUpdate tsconfig.json[39m
|
|
18
|
-
[script] [36mRunning commitlint...[39m
|
|
19
|
-
[script] [32mUpdate .vscode/extensions.json[39m
|
|
20
|
-
[script] [36mRunning editorconfig...[39m
|
|
21
|
-
[script] [36mRunning eslint...[39m
|
|
22
|
-
[script] [36mRunning cspell...[39m
|
|
23
|
-
[script] [32mUpdate .cspell.json[39m
|
|
24
|
-
[script] [36mRunning vitest...[39m
|
|
25
|
-
[script] [36mRunning renovate...[39m
|
|
26
|
-
[script] [36mRunning githooks...[39m
|
|
27
|
-
[script] [36mRunning postconfigure...[39m
|
|
28
|
-
[script] npm run test:script exited with code 0
|