@w5s/mrm-preset 1.0.0-alpha.1 → 1.0.0-alpha.10
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/.turbo/turbo-build.log +1 -0
- package/.turbo/turbo-docs.log +43 -0
- package/.turbo/turbo-lint.log +1 -0
- package/.turbo/turbo-test.log +20 -0
- package/CHANGELOG.md +126 -0
- package/LICENSE +21 -0
- package/README.md +1 -1
- package/bootstrap/index.js +40 -39
- package/ci/gitlab.js +1 -3
- package/contributing/templates/CODE_OF_CONDUCT.md +3 -4
- package/core/block.js +3 -6
- package/{gitignore/template.js → core/git.ignore.js} +32 -6
- package/core/git.js +25 -16
- package/core/githooks.js +2 -1
- package/core/jest.js +44 -53
- package/core/npm.js +54 -21
- package/core/pkg.js +35 -8
- package/core/semanticRelease.js +1 -1
- package/core/typedoc.js +4 -17
- package/core/vscode.js +2 -8
- package/cspell/index.js +0 -11
- package/editorconfig/index.js +2 -0
- package/eslint/index.js +18 -19
- package/githooks/index.js +41 -50
- package/gitignore/index.js +5 -22
- package/jest/index.js +11 -15
- package/lang/.eslintrc.json +4 -1
- package/lang/index.js +13 -11
- package/package.json +8 -7
- package/project/index.js +60 -33
- package/release/index.js +1 -1
- package/renovate/index.js +4 -6
- package/tsconfig.json +1 -0
- package/core/workspace.js +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@w5s/mrm-preset:build: cache hit, replaying output f5896e66681a4f6f
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@w5s/mrm-preset:docs: cache hit, replaying output 56cb27b41ce298a4
|
|
2
|
+
@w5s/mrm-preset:docs: Starting markdown-magic [ '**/*.md', '!node_modules/**' ]
|
|
3
|
+
@w5s/mrm-preset:docs: ℹ Notice:
|
|
4
|
+
@w5s/mrm-preset:docs: Missing transforms "BASIC_RULES","JSX_RULES" in _tester/node_modules/eslint-plugin-react/README.md
|
|
5
|
+
@w5s/mrm-preset:docs:
|
|
6
|
+
@w5s/mrm-preset:docs: ✔ README.md Updated
|
|
7
|
+
@w5s/mrm-preset:docs: Transforms run
|
|
8
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=# W5s Mrm Preset _(${name})_
|
|
9
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=> ${description}&unknownTxt=
|
|
10
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[${license}][license-url] © ${author}
|
|
11
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
|
|
12
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[package-url]: https://www.npmjs.com/package/${name}
|
|
13
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[license-image]: https://img.shields.io/badge/license-${license}-green.svg?style=flat-square
|
|
14
|
+
@w5s/mrm-preset:docs:
|
|
15
|
+
@w5s/mrm-preset:docs: ✔ _tester/node_modules/@w5s/mrm-preset/README.md Updated
|
|
16
|
+
@w5s/mrm-preset:docs: Transforms run
|
|
17
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=# W5s Mrm Preset _(${name})_
|
|
18
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=> ${description}&unknownTxt=
|
|
19
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[${license}][license-url] © ${author}
|
|
20
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
|
|
21
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[package-url]: https://www.npmjs.com/package/${name}
|
|
22
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[license-image]: https://img.shields.io/badge/license-${license}-green.svg?style=flat-square
|
|
23
|
+
@w5s/mrm-preset:docs:
|
|
24
|
+
@w5s/mrm-preset:docs: ✔ _tester/node_modules/@w5s/eslint-config/README.md Updated
|
|
25
|
+
@w5s/mrm-preset:docs: Transforms run
|
|
26
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=# W5s ESLint configuration _(${name})_
|
|
27
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=> ${description}&unknownTxt=
|
|
28
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=```console\nnpm install --save-dev ${name}\n```
|
|
29
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[${license}][license-url] © ${author}
|
|
30
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
|
|
31
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[package-url]: https://www.npmjs.com/package/${name}
|
|
32
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[license-image]: https://img.shields.io/badge/license-${license}-green.svg?style=flat-square
|
|
33
|
+
@w5s/mrm-preset:docs:
|
|
34
|
+
@w5s/mrm-preset:docs: ✔ _tester/node_modules/@w5s/ts-config/README.md Updated
|
|
35
|
+
@w5s/mrm-preset:docs: Transforms run
|
|
36
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=# W5s Typescript configuration _(${name})_
|
|
37
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=> ${description}&unknownTxt=
|
|
38
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=```console\nnpm install --save-dev ${name}\n```
|
|
39
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[${license}][license-url] © ${author}
|
|
40
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
|
|
41
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[package-url]: https://www.npmjs.com/package/${name}
|
|
42
|
+
@w5s/mrm-preset:docs: ⁕ PKGJSON:template=[license-image]: https://img.shields.io/badge/license-${license}-green.svg?style=flat-square
|
|
43
|
+
@w5s/mrm-preset:docs:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@w5s/mrm-preset:lint: cache hit, replaying output 9b4498f76ba22156
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@w5s/mrm-preset:test: cache hit, replaying output 8744e1e74430cf77
|
|
2
|
+
@w5s/mrm-preset:test: mkdir: _tester: File exists
|
|
3
|
+
@w5s/mrm-preset:test: [36mRunning bootstrap...[39m
|
|
4
|
+
@w5s/mrm-preset:test: [33mRunning alias configure...[39m
|
|
5
|
+
@w5s/mrm-preset:test: [36mRunning gitignore...[39m
|
|
6
|
+
@w5s/mrm-preset:test: [36mRunning project...[39m
|
|
7
|
+
@w5s/mrm-preset:test: [32mUpdate package.json[39m
|
|
8
|
+
@w5s/mrm-preset:test: [36mRunning contributing...[39m
|
|
9
|
+
@w5s/mrm-preset:test: [36mRunning release...[39m
|
|
10
|
+
@w5s/mrm-preset:test: [36mRunning ci...[39m
|
|
11
|
+
@w5s/mrm-preset:test: [36mRunning lang...[39m
|
|
12
|
+
@w5s/mrm-preset:test: [36mRunning commitlint...[39m
|
|
13
|
+
@w5s/mrm-preset:test: [36mRunning editorconfig...[39m
|
|
14
|
+
@w5s/mrm-preset:test: [36mRunning eslint...[39m
|
|
15
|
+
@w5s/mrm-preset:test: [36mRunning cspell...[39m
|
|
16
|
+
@w5s/mrm-preset:test: [36mRunning jest...[39m
|
|
17
|
+
@w5s/mrm-preset:test: [32mUpdate package.json[39m
|
|
18
|
+
@w5s/mrm-preset:test: [36mRunning renovate...[39m
|
|
19
|
+
@w5s/mrm-preset:test: [36mRunning githooks...[39m
|
|
20
|
+
@w5s/mrm-preset:test: [36mRunning postconfigure...[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,132 @@
|
|
|
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.10](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.9...@w5s/mrm-preset@1.0.0-alpha.10) (2022-05-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* remove tsc on lint-staged because buggy ([6b0f4f2](https://github.com/w5s/project-config/commit/6b0f4f2c6d5d06f959ee1edc5cc6266464747d7e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [1.0.0-alpha.9](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.8...@w5s/mrm-preset@1.0.0-alpha.9) (2022-04-12)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* correct default mrm task ([1a59cb1](https://github.com/w5s/project-config/commit/1a59cb1a114c2cba091c4729b5e66e5a5354004e))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# [1.0.0-alpha.8](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.7...@w5s/mrm-preset@1.0.0-alpha.8) (2022-03-08)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* add missing $schema for tsconfig ([c33c7ae](https://github.com/w5s/project-config/commit/c33c7aeba405d651eba19187436724780dd90aff))
|
|
34
|
+
* remove unused typedoc script ([51238f0](https://github.com/w5s/project-config/commit/51238f04b8f3d95baac7f0a367ba1c07061d2ce4))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# [1.0.0-alpha.7](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.6...@w5s/mrm-preset@1.0.0-alpha.7) (2022-03-01)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* correct bootstrap step ([da7f539](https://github.com/w5s/project-config/commit/da7f539560ba143f830c9ea824b0d79c6a50522c))
|
|
46
|
+
* correct is-ci script that fails in some yarn berry ([4e4707d](https://github.com/w5s/project-config/commit/4e4707d7e8c0cd2c88e1dc6bc94705317dcf9e98))
|
|
47
|
+
* improve yarn check ([3af241a](https://github.com/w5s/project-config/commit/3af241af004d747518733983260eb295aa75e5cb))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# [1.0.0-alpha.6](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.5...@w5s/mrm-preset@1.0.0-alpha.6) (2022-02-23)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Bug Fixes
|
|
57
|
+
|
|
58
|
+
* correct gitignore task ([b4f0903](https://github.com/w5s/project-config/commit/b4f0903561c97500aef65488ef06ccd7eae0db80))
|
|
59
|
+
* remove jest on lint-staged ([2fbc851](https://github.com/w5s/project-config/commit/2fbc85132ab380429d6966bff47b176bcfb51f6d))
|
|
60
|
+
* shorten eslint extensions ([aecc870](https://github.com/w5s/project-config/commit/aecc870ce0b288436208757376bc05504bff3331))
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Features
|
|
64
|
+
|
|
65
|
+
* use es-jest as default jest preset ([61535d9](https://github.com/w5s/project-config/commit/61535d9c47c25150becc564a5dd273d7cc14b579))
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
# [1.0.0-alpha.5](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.4...@w5s/mrm-preset@1.0.0-alpha.5) (2022-02-18)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Bug Fixes
|
|
75
|
+
|
|
76
|
+
* change bootstrap behavior ([497c83a](https://github.com/w5s/project-config/commit/497c83a4082f7fd4e3b8b6913802ebcb21caa65a))
|
|
77
|
+
* remove lint-staged + cspell integration ([6747c83](https://github.com/w5s/project-config/commit/6747c83ec997034d25d136bc5aa008ed108ceb96))
|
|
78
|
+
* use UNLICENSED for default license ([608ee8f](https://github.com/w5s/project-config/commit/608ee8f0bf57fec94636587b116d5bda0fb4ee3f))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### Features
|
|
82
|
+
|
|
83
|
+
* add gitignore for yarn v2 ([06c547a](https://github.com/w5s/project-config/commit/06c547a6b7813f935678c29b410aee62da5b3866))
|
|
84
|
+
* add support for yarn berry ([2b77669](https://github.com/w5s/project-config/commit/2b77669a29316825a38470c80a48aff8ab068f7f))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# [1.0.0-alpha.4](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.3...@w5s/mrm-preset@1.0.0-alpha.4) (2022-02-16)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
### Bug Fixes
|
|
94
|
+
|
|
95
|
+
* correct eslint vscode settings ([a32e0fb](https://github.com/w5s/project-config/commit/a32e0fb739cbe349565b26ea412cdf37e3d56bdb))
|
|
96
|
+
* correct mrm preset url ([ad6f030](https://github.com/w5s/project-config/commit/ad6f03091e0a294c043974b564e24c79023e659b))
|
|
97
|
+
* correct typo ([2218859](https://github.com/w5s/project-config/commit/221885997fec37149f7e349b00a58fbcb3bfb8db))
|
|
98
|
+
* rollback to eslint.validate vscode setting ([769a2e1](https://github.com/w5s/project-config/commit/769a2e100083aca4f5e9037fa539fcf1f6002d65))
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Features
|
|
102
|
+
|
|
103
|
+
* improve typescript eslint configuration ([efc6f1c](https://github.com/w5s/project-config/commit/efc6f1cef876e8fc5d4d1d1b94ca90a6805fbbbf))
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# [1.0.0-alpha.3](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.2...@w5s/mrm-preset@1.0.0-alpha.3) (2022-02-15)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Features
|
|
113
|
+
|
|
114
|
+
* use airbnb-base as default presets ([e499fc1](https://github.com/w5s/project-config/commit/e499fc115023571e749072db33d774b443b68bb7))
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
# [1.0.0-alpha.2](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.1...@w5s/mrm-preset@1.0.0-alpha.2) (2022-02-15)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### Features
|
|
124
|
+
|
|
125
|
+
* enable source.fixAll for vscode ([d484156](https://github.com/w5s/project-config/commit/d484156c063f2bf9f5cb3212878aa07bb4f8fd6f))
|
|
126
|
+
* improve arrow-body-style configuration ([a4ee8a9](https://github.com/w5s/project-config/commit/a4ee8a9f3912285b45287afc4ccae2fa57431c6a))
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
6
132
|
# 1.0.0-alpha.1 (2022-02-12)
|
|
7
133
|
|
|
8
134
|
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Julien Polo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Initialize your project using this command :
|
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
21
|
# from the root of your project
|
|
22
|
-
npm exec
|
|
22
|
+
npm exec --package=@w5s/mrm-preset -- mrm bootstrap --preset @w5s/mrm-preset
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
This will install in `package.json` the npm scripts
|
package/bootstrap/index.js
CHANGED
|
@@ -3,13 +3,14 @@ const path = require('path');
|
|
|
3
3
|
const { packageJson, file } = require('mrm-core');
|
|
4
4
|
const npm = require('../core/npm');
|
|
5
5
|
const pkg = require('../core/pkg');
|
|
6
|
+
const { gitIgnoreTemplate } = require('../core/git');
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @param {{
|
|
9
10
|
* mrmPreset: string,
|
|
10
11
|
* mrmTask: string,
|
|
11
12
|
* packageArchetype: 'application'|'library'|'workspace',
|
|
12
|
-
* packageManager: 'npm'|'yarn'
|
|
13
|
+
* packageManager: 'npm'|'yarn@classic'|'yarn@berry'
|
|
13
14
|
* }} config
|
|
14
15
|
* @returns {void}
|
|
15
16
|
*/
|
|
@@ -18,53 +19,53 @@ function task({ mrmPreset, mrmTask, packageArchetype, packageManager }) {
|
|
|
18
19
|
* setup package.json from following object
|
|
19
20
|
*/
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
packageJson({
|
|
22
23
|
name: path.basename(process.cwd()),
|
|
23
24
|
version: '1.0.0-alpha.0',
|
|
24
25
|
private: true,
|
|
25
|
-
license: '
|
|
26
|
+
license: 'UNLICENSED',
|
|
26
27
|
description: '',
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
packageFile.merge({
|
|
30
|
-
scripts: {
|
|
31
|
-
configure: `npm run mrm -- ${mrmTask}`,
|
|
32
|
-
mrm: `mrm --preset ${mrmPreset}`,
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
pkg.value(packageFile, {
|
|
36
|
-
path: 'packageManager',
|
|
37
|
-
state: 'present',
|
|
38
|
-
update: packageManager,
|
|
39
|
-
default: () => {
|
|
40
|
-
if (file('yarn.lock').exists()) {
|
|
41
|
-
return 'yarn';
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// return 'npm';
|
|
45
|
-
return undefined;
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
pkg.value(packageFile, {
|
|
49
|
-
path: 'mrmConfig.packageArchetype',
|
|
50
|
-
state: 'present',
|
|
51
|
-
update: packageArchetype,
|
|
52
|
-
default: () => {
|
|
53
|
-
if (file('lerna.json').exists() || Boolean(packageFile.get('workspaces'))) {
|
|
54
|
-
return 'workspace';
|
|
55
|
-
}
|
|
28
|
+
}).save();
|
|
29
|
+
gitIgnoreTemplate(['macOS', 'NodeJS', 'VisualStudioCode']);
|
|
56
30
|
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
});
|
|
60
|
-
packageFile.save();
|
|
31
|
+
npm.bootstrap(packageManager);
|
|
61
32
|
|
|
62
33
|
npm.dependency({
|
|
63
34
|
dev: true,
|
|
64
35
|
name: ['mrm', mrmPreset],
|
|
65
|
-
yarn: packageManager === 'yarn',
|
|
66
36
|
state: 'present',
|
|
67
37
|
});
|
|
38
|
+
|
|
39
|
+
pkg.withPackageJson((packageFile) => {
|
|
40
|
+
const currentPackageManager = pkg.manager(packageFile);
|
|
41
|
+
|
|
42
|
+
// Add MRM default scripts
|
|
43
|
+
pkg.script(packageFile, {
|
|
44
|
+
name: 'configure',
|
|
45
|
+
state: 'default',
|
|
46
|
+
script: currentPackageManager === 'npm' ? `npm run mrm -- ${mrmTask}` : `yarn mrm ${mrmTask}`,
|
|
47
|
+
});
|
|
48
|
+
pkg.script(packageFile, {
|
|
49
|
+
name: 'mrm',
|
|
50
|
+
state: 'default',
|
|
51
|
+
script: `mrm --preset ${mrmPreset}`,
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
pkg.withPackageJson((packageFile) => {
|
|
56
|
+
pkg.value(packageFile, {
|
|
57
|
+
path: 'mrmConfig.packageArchetype',
|
|
58
|
+
state: 'present',
|
|
59
|
+
update: packageArchetype,
|
|
60
|
+
default: () => {
|
|
61
|
+
if (file('lerna.json').exists() || Boolean(packageFile.get('workspaces'))) {
|
|
62
|
+
return 'workspace';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return 'library';
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
});
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
task.description = 'Bootstrap a new project.';
|
|
@@ -87,8 +88,8 @@ task.parameters = {
|
|
|
87
88
|
type: 'input',
|
|
88
89
|
},
|
|
89
90
|
packageManager: {
|
|
90
|
-
default: 'yarn',
|
|
91
|
-
choices: ['yarn', 'npm'],
|
|
91
|
+
default: 'yarn@berry',
|
|
92
|
+
choices: ['yarn@berry', 'yarn@classic', 'npm'],
|
|
92
93
|
message: 'Which default package manager ?',
|
|
93
94
|
name: 'packageManager',
|
|
94
95
|
type: 'input',
|
package/ci/gitlab.js
CHANGED
|
@@ -21,9 +21,7 @@ function task() {
|
|
|
21
21
|
/**
|
|
22
22
|
* @param {string|{local: string}} include
|
|
23
23
|
*/
|
|
24
|
-
(include) =>
|
|
25
|
-
return (typeof include === 'string' ? include : include.local) === includePath;
|
|
26
|
-
}
|
|
24
|
+
(include) => (typeof include === 'string' ? include : include.local) === includePath
|
|
27
25
|
);
|
|
28
26
|
const addInclude = (/** @type {string} */ includePath) =>
|
|
29
27
|
gitlabCIConfig.set('include', gitlabCIConfig.get('include', []).concat([{ local: includePath }]));
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
We as members, contributors, and leaders pledge to make participation in our
|
|
7
7
|
community a harassment-free experience for everyone, regardless of age, body
|
|
8
8
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
9
|
-
identity and expression, level of experience, education,
|
|
9
|
+
identity and expression, level of experience, education, socioeconomic status,
|
|
10
10
|
nationality, personal appearance, race, caste, color, religion, or sexual identity
|
|
11
11
|
and orientation.
|
|
12
12
|
|
|
@@ -119,11 +119,11 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
|
|
119
119
|
version 2.0, available at
|
|
120
120
|
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
|
|
121
121
|
|
|
122
|
-
Community Impact Guidelines were inspired by
|
|
122
|
+
Community Impact Guidelines were inspired by
|
|
123
123
|
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
124
124
|
|
|
125
125
|
For answers to common questions about this code of conduct, see the FAQ at
|
|
126
|
-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
|
|
126
|
+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
|
|
127
127
|
at [https://www.contributor-covenant.org/translations][translations].
|
|
128
128
|
|
|
129
129
|
[homepage]: https://www.contributor-covenant.org
|
|
@@ -131,4 +131,3 @@ at [https://www.contributor-covenant.org/translations][translations].
|
|
|
131
131
|
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
132
132
|
[FAQ]: https://www.contributor-covenant.org/faq
|
|
133
133
|
[translations]: https://www.contributor-covenant.org/translations
|
|
134
|
-
|
package/core/block.js
CHANGED
|
@@ -20,13 +20,10 @@ const { file } = require('mrm-core');
|
|
|
20
20
|
function block({
|
|
21
21
|
markerBegin = 'BEGIN',
|
|
22
22
|
markerEnd = 'END',
|
|
23
|
-
marker = (mark) => {
|
|
24
|
-
return `# ${mark} generated by mrm`;
|
|
25
|
-
},
|
|
23
|
+
marker = (mark) => `# ${mark} generated by mrm`,
|
|
26
24
|
path,
|
|
27
25
|
block: blockName,
|
|
28
|
-
//
|
|
29
|
-
insertBefore = 'begin',
|
|
26
|
+
// insertBefore = 'begin',
|
|
30
27
|
insertAfter,
|
|
31
28
|
}) {
|
|
32
29
|
const EOL = '\n';
|
|
@@ -56,7 +53,7 @@ function block({
|
|
|
56
53
|
const replaceBlock = beginBlock + EOL + blockContent + EOL + endBlock;
|
|
57
54
|
|
|
58
55
|
if (found.exists) {
|
|
59
|
-
return fullContent.
|
|
56
|
+
return fullContent.slice(0, Math.max(0, found.startIndex)) + replaceBlock + fullContent.slice(found.endIndex);
|
|
60
57
|
}
|
|
61
58
|
|
|
62
59
|
// insert
|
|
@@ -11,6 +11,7 @@ module.exports = {
|
|
|
11
11
|
yarn-debug.log*
|
|
12
12
|
yarn-error.log*
|
|
13
13
|
lerna-debug.log*
|
|
14
|
+
.pnpm-debug.log*
|
|
14
15
|
|
|
15
16
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
16
17
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
@@ -47,8 +48,8 @@ module.exports = {
|
|
|
47
48
|
node_modules/
|
|
48
49
|
jspm_packages/
|
|
49
50
|
|
|
50
|
-
#
|
|
51
|
-
|
|
51
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
|
52
|
+
web_modules/
|
|
52
53
|
|
|
53
54
|
# TypeScript cache
|
|
54
55
|
*.tsbuildinfo
|
|
@@ -59,6 +60,9 @@ module.exports = {
|
|
|
59
60
|
# Optional eslint cache
|
|
60
61
|
.eslintcache
|
|
61
62
|
|
|
63
|
+
# Optional stylelint cache
|
|
64
|
+
.stylelintcache
|
|
65
|
+
|
|
62
66
|
# Microbundle cache
|
|
63
67
|
.rpt2_cache/
|
|
64
68
|
.rts2_cache_cjs/
|
|
@@ -74,15 +78,20 @@ module.exports = {
|
|
|
74
78
|
# Yarn Integrity file
|
|
75
79
|
.yarn-integrity
|
|
76
80
|
|
|
77
|
-
# dotenv environment
|
|
81
|
+
# dotenv environment variable files
|
|
78
82
|
.env
|
|
79
|
-
.env.
|
|
83
|
+
.env.development.local
|
|
84
|
+
.env.test.local
|
|
85
|
+
.env.production.local
|
|
86
|
+
.env.local
|
|
80
87
|
|
|
81
88
|
# parcel-bundler cache (https://parceljs.org/)
|
|
82
89
|
.cache
|
|
90
|
+
.parcel-cache
|
|
83
91
|
|
|
84
92
|
# Next.js build output
|
|
85
93
|
.next
|
|
94
|
+
out
|
|
86
95
|
|
|
87
96
|
# Nuxt.js build / generate output
|
|
88
97
|
.nuxt
|
|
@@ -92,11 +101,18 @@ module.exports = {
|
|
|
92
101
|
.cache/
|
|
93
102
|
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
94
103
|
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
95
|
-
public
|
|
104
|
+
# public
|
|
96
105
|
|
|
97
106
|
# vuepress build output
|
|
98
107
|
.vuepress/dist
|
|
99
108
|
|
|
109
|
+
# vuepress v2.x temp and cache directory
|
|
110
|
+
.temp
|
|
111
|
+
.cache
|
|
112
|
+
|
|
113
|
+
# Docusaurus cache and generated files
|
|
114
|
+
.docusaurus
|
|
115
|
+
|
|
100
116
|
# Serverless directories
|
|
101
117
|
.serverless/
|
|
102
118
|
|
|
@@ -107,7 +123,17 @@ module.exports = {
|
|
|
107
123
|
.dynamodb/
|
|
108
124
|
|
|
109
125
|
# TernJS port file
|
|
110
|
-
.tern-port
|
|
126
|
+
.tern-port
|
|
127
|
+
|
|
128
|
+
# Stores VSCode versions used for testing VSCode extensions
|
|
129
|
+
.vscode-test
|
|
130
|
+
|
|
131
|
+
# yarn v2
|
|
132
|
+
.yarn/cache
|
|
133
|
+
.yarn/unplugged
|
|
134
|
+
.yarn/build-state.yml
|
|
135
|
+
.yarn/install-state.gz
|
|
136
|
+
.pnp.*`,
|
|
111
137
|
VisualStudioCode: `
|
|
112
138
|
.vscode/*
|
|
113
139
|
!.vscode/settings.json
|
package/core/git.js
CHANGED
|
@@ -13,23 +13,19 @@ function remoteSync() {
|
|
|
13
13
|
? [
|
|
14
14
|
/**
|
|
15
15
|
* 1. filter github URL
|
|
16
|
+
*
|
|
16
17
|
* @param {string} returnValue
|
|
17
18
|
*/
|
|
18
|
-
(returnValue) =>
|
|
19
|
-
return returnValue.replace(/^git@github.com:/, 'https://github.com/');
|
|
20
|
-
},
|
|
19
|
+
(returnValue) => returnValue.replace(/^git@github.com:/, 'https://github.com/'),
|
|
21
20
|
/**
|
|
22
21
|
* 2. filter gitlab URL
|
|
22
|
+
*
|
|
23
23
|
* @param {string} returnValue
|
|
24
24
|
*/
|
|
25
|
-
(returnValue) =>
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
].reduce((returnValue, filter) => {
|
|
29
|
-
return filter(returnValue);
|
|
30
|
-
}, remoteURL)
|
|
25
|
+
(returnValue) => returnValue.replace(/^git@gitlab.com:/, 'https://gitlab.com/'),
|
|
26
|
+
].reduce((returnValue, filter) => filter(returnValue), remoteURL)
|
|
31
27
|
: remoteURL;
|
|
32
|
-
} catch
|
|
28
|
+
} catch {
|
|
33
29
|
// ignore error
|
|
34
30
|
}
|
|
35
31
|
|
|
@@ -48,9 +44,7 @@ exports.hasGit = hasGit;
|
|
|
48
44
|
function trimStartLine(content) {
|
|
49
45
|
return content
|
|
50
46
|
.split(/\n/)
|
|
51
|
-
.map((line) =>
|
|
52
|
-
return line.replace(/^\s+/, '');
|
|
53
|
-
})
|
|
47
|
+
.map((line) => line.replace(/^\s+/, ''))
|
|
54
48
|
.filter((_) => _.length > 0)
|
|
55
49
|
.join('\n');
|
|
56
50
|
}
|
|
@@ -64,10 +58,25 @@ function gitIgnore(section, sectionContent) {
|
|
|
64
58
|
|
|
65
59
|
return block({
|
|
66
60
|
block: Array.isArray(sectionContent) ? sectionContent.join(EOL) : trimStartLine(sectionContent),
|
|
67
|
-
marker: (mark) => {
|
|
68
|
-
return `# ${mark} ### ${section} ###`;
|
|
69
|
-
},
|
|
61
|
+
marker: (mark) => `# ${mark} ### ${section} ###`,
|
|
70
62
|
path: '.gitignore',
|
|
71
63
|
});
|
|
72
64
|
}
|
|
73
65
|
exports.gitIgnore = gitIgnore;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @param {string[]} flags
|
|
69
|
+
*/
|
|
70
|
+
function gitIgnoreTemplate(flags) {
|
|
71
|
+
// eslint-disable-next-line global-require, import/no-dynamic-require
|
|
72
|
+
const templateMap = require('./git.ignore');
|
|
73
|
+
|
|
74
|
+
flags.forEach((flag) => {
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
if (templateMap[flag]) {
|
|
77
|
+
// @ts-ignore
|
|
78
|
+
gitIgnore(flag, templateMap[flag]);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
exports.gitIgnoreTemplate = gitIgnoreTemplate;
|
package/core/githooks.js
CHANGED
|
@@ -44,7 +44,8 @@ function husky({ state }) {
|
|
|
44
44
|
* }} options
|
|
45
45
|
*/
|
|
46
46
|
function gitHook({ name, state, content }) {
|
|
47
|
-
const
|
|
47
|
+
const packageFileDefault = packageJson();
|
|
48
|
+
const hasHusky = pkg.hasDependency(packageFileDefault, 'husky', 'dev');
|
|
48
49
|
const hasGitHook = hasHusky && state === 'present';
|
|
49
50
|
const hookDirectory = '.husky';
|
|
50
51
|
const hookFileName = path.join(hookDirectory, name);
|