@w5s/mrm-preset 1.0.0-alpha.41 → 1.0.0-alpha.43
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 +14 -0
- package/bootstrap/index.js +6 -6
- package/core/commitlint.js +2 -2
- package/core/githooks.js +7 -15
- package/githooks/index.js +1 -1
- package/lang/index.js +38 -0
- package/package.json +4 -3
- package/postconfigure/index.js +8 -0
- package/project/index.js +6 -1
- package/release/index.js +2 -1
- package/renovate/index.js +0 -1
- package/.turbo/turbo-build.log +0 -6
- package/.turbo/turbo-docs.log +0 -63
- package/.turbo/turbo-format.log +0 -6
- package/.turbo/turbo-lint.log +0 -6
- package/.turbo/turbo-spellcheck.log +0 -1
- package/.turbo/turbo-test.log +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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.43 (2023-02-23)
|
|
7
|
+
|
|
8
|
+
- ✨ Improve mrm bootstrap script ([0445277](https://github.com/w5s/project-config/commit/0445277))
|
|
9
|
+
- ➖ Remove is-ci, lint-staged, commitlint dependency (used through npx) ([ae39f34](https://github.com/w5s/project-config/commit/ae39f34))
|
|
10
|
+
- ➖ Remove mrm dependency ([7ee3d94](https://github.com/w5s/project-config/commit/7ee3d94))
|
|
11
|
+
- 🐛 Fix unbound variable error ([d2aa040](https://github.com/w5s/project-config/commit/d2aa040))
|
|
12
|
+
- 💚 Fix ci ([cded057](https://github.com/w5s/project-config/commit/cded057))
|
|
13
|
+
|
|
14
|
+
## 1.0.0-alpha.42 (2023-02-10)
|
|
15
|
+
|
|
16
|
+
- ✨ Configure @w5s/conventional-changelog ([b19e437](https://github.com/w5s/project-config/commit/b19e437))
|
|
17
|
+
- ✨ Improve typescript support for monorepo packages ([0a13a68](https://github.com/w5s/project-config/commit/0a13a68))
|
|
18
|
+
- 🗑️ Remove unneeded code ([ee9410e](https://github.com/w5s/project-config/commit/ee9410e))
|
|
19
|
+
|
|
6
20
|
## 1.0.0-alpha.41 (2023-02-06)
|
|
7
21
|
|
|
8
22
|
- 📝 Update documentation ([8cd1934](https://github.com/w5s/project-config/commit/8cd1934))
|
package/bootstrap/index.js
CHANGED
|
@@ -29,11 +29,11 @@ function task({ mrmPreset, mrmTask, packageManager }) {
|
|
|
29
29
|
|
|
30
30
|
npm.bootstrap(packageManager);
|
|
31
31
|
|
|
32
|
-
npm.dependency({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
32
|
+
// npm.dependency({
|
|
33
|
+
// dev: true,
|
|
34
|
+
// name: ['mrm', mrmPreset],
|
|
35
|
+
// state: 'present',
|
|
36
|
+
// });
|
|
37
37
|
|
|
38
38
|
pkg.withPackageJson((packageFile) => {
|
|
39
39
|
const currentPackageManager = pkg.manager(packageFile);
|
|
@@ -47,7 +47,7 @@ function task({ mrmPreset, mrmTask, packageManager }) {
|
|
|
47
47
|
pkg.script(packageFile, {
|
|
48
48
|
name: 'mrm',
|
|
49
49
|
state: 'present',
|
|
50
|
-
default: `mrm --preset ${mrmPreset}`,
|
|
50
|
+
default: `npm exec --package=mrm --package=${mrmPreset} -- mrm --preset ${mrmPreset}`,
|
|
51
51
|
});
|
|
52
52
|
});
|
|
53
53
|
}
|
package/core/commitlint.js
CHANGED
|
@@ -23,13 +23,13 @@ function commitlint({ state, preset }) {
|
|
|
23
23
|
|
|
24
24
|
gitHook({
|
|
25
25
|
name: 'commit-msg',
|
|
26
|
-
content: 'npm exec --
|
|
26
|
+
content: 'npm exec -- commitlint --edit $1',
|
|
27
27
|
state,
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
npm.dependency({
|
|
31
31
|
dev: true,
|
|
32
|
-
name: [
|
|
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,
|
|
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:
|
|
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}:
|
|
27
|
+
name: `${project.prepare}:githooks`,
|
|
33
28
|
state: hasHusky ? 'present' : 'absent',
|
|
34
|
-
update:
|
|
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
|
|
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
package/lang/index.js
CHANGED
|
@@ -49,6 +49,44 @@ function createLang({ language: languageDefault = 'typescript', tsConfig: tsConf
|
|
|
49
49
|
|
|
50
50
|
file('src/index.ts').delete();
|
|
51
51
|
file('src/index.spec.ts').delete();
|
|
52
|
+
|
|
53
|
+
pkg.forEachWorkspace(({ projectDir, packageFile: projectPackageFile }) => {
|
|
54
|
+
const projectTsConfig = json(`${projectDir}/tsconfig.json`);
|
|
55
|
+
const projectTsConfigBuild = json(`${projectDir}/tsconfig.build.json`);
|
|
56
|
+
const hasTypecript = projectTsConfig.exists();
|
|
57
|
+
pkg.script(projectPackageFile, {
|
|
58
|
+
name: 'build:tsc',
|
|
59
|
+
state: hasTypecript ? 'present' : 'absent',
|
|
60
|
+
update: () => 'tsc -b tsconfig.build.json',
|
|
61
|
+
});
|
|
62
|
+
pkg.script(projectPackageFile, {
|
|
63
|
+
name: 'clean:tsc',
|
|
64
|
+
state: hasTypecript ? 'present' : 'absent',
|
|
65
|
+
update: () => 'rm -rf lib',
|
|
66
|
+
});
|
|
67
|
+
if (hasTypecript && projectPackageFile.get('name') !== '@w5s/ts-config') {
|
|
68
|
+
projectTsConfig
|
|
69
|
+
.merge({
|
|
70
|
+
$schema: 'https://json.schemastore.org/tsconfig.json',
|
|
71
|
+
extends: '../../tsconfig.settings.json',
|
|
72
|
+
})
|
|
73
|
+
.save();
|
|
74
|
+
|
|
75
|
+
projectTsConfigBuild
|
|
76
|
+
.merge({
|
|
77
|
+
$schema: 'https://json.schemastore.org/tsconfig.json',
|
|
78
|
+
extends: './tsconfig.json',
|
|
79
|
+
compilerOptions: {
|
|
80
|
+
noEmit: false,
|
|
81
|
+
outDir: 'lib',
|
|
82
|
+
},
|
|
83
|
+
include: ['src'],
|
|
84
|
+
})
|
|
85
|
+
.save();
|
|
86
|
+
} else {
|
|
87
|
+
projectTsConfigBuild.delete();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
52
90
|
} else {
|
|
53
91
|
tsConfigSettings
|
|
54
92
|
.merge({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/mrm-preset",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.43",
|
|
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": "
|
|
55
|
+
"gitHead": "ace7dcdd3244c34b38de66da80347ca16e59838d"
|
|
55
56
|
}
|
package/postconfigure/index.js
CHANGED
|
@@ -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/project/index.js
CHANGED
|
@@ -240,7 +240,7 @@ function task() {
|
|
|
240
240
|
},
|
|
241
241
|
npmClient: packageManager,
|
|
242
242
|
useWorkspaces: rootUseWorkspace,
|
|
243
|
-
changelogPreset: '
|
|
243
|
+
changelogPreset: '@w5s/conventional-changelog',
|
|
244
244
|
});
|
|
245
245
|
lernaConfig.save();
|
|
246
246
|
} else {
|
|
@@ -310,6 +310,11 @@ function task() {
|
|
|
310
310
|
name: ['lerna'],
|
|
311
311
|
state: rootUseWorkspace ? 'present' : 'absent',
|
|
312
312
|
});
|
|
313
|
+
npm.dependency({
|
|
314
|
+
dev: true,
|
|
315
|
+
name: ['@w5s/conventional-changelog'],
|
|
316
|
+
state: 'present',
|
|
317
|
+
});
|
|
313
318
|
|
|
314
319
|
// VSCode
|
|
315
320
|
vscodeTask({
|
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
|
-
|
|
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
|
});
|
package/renovate/index.js
CHANGED
|
@@ -27,7 +27,6 @@ function createRenovate({ renovatePresetApplication, renovatePresetLibrary }) {
|
|
|
27
27
|
const renovateFile = json('renovate.json');
|
|
28
28
|
renovateFile.merge({
|
|
29
29
|
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
|
|
30
|
-
ignorePaths: ['**/node_modules/**'],
|
|
31
30
|
});
|
|
32
31
|
renovateFile.set(
|
|
33
32
|
'extends',
|
package/.turbo/turbo-build.log
DELETED
package/.turbo/turbo-docs.log
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
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
|
-
|
|
10
|
-
✔ _tester/node_modules/@w5s/mrm-preset/README.md Updated
|
|
11
|
-
Transforms run
|
|
12
|
-
⁕ PKG_JSON:template=# W5s Mrm Preset _(${name})_
|
|
13
|
-
⁕ PKG_JSON:template=> ${description}&unknownTxt=
|
|
14
|
-
⁕ PKG_JSON:template=[${license}][license-url] © ${author}
|
|
15
|
-
⁕ PKG_JSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
|
|
16
|
-
⁕ PKG_JSON:template=[package-url]: https://www.npmjs.com/package/${name}
|
|
17
|
-
⁕ PKG_JSON:template=[license-image]: https://img.shields.io/badge/license-${license}-green.svg?style=flat-square
|
|
18
|
-
|
|
19
|
-
✔ _tester/node_modules/@w5s/eslint-config/README.md Updated
|
|
20
|
-
Transforms run
|
|
21
|
-
⁕ PKG_JSON:template=# W5s ESLint configuration _(${name})_
|
|
22
|
-
⁕ PKG_JSON:template=> ${description}&unknownTxt=
|
|
23
|
-
⁕ PKG_JSON:template=```console\nnpm install --save-dev ${name}\n```
|
|
24
|
-
⁕ PKG_JSON:template=[${license}][license-url] © ${author}
|
|
25
|
-
⁕ PKG_JSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
|
|
26
|
-
⁕ PKG_JSON:template=[package-url]: https://www.npmjs.com/package/${name}
|
|
27
|
-
⁕ PKG_JSON:template=[license-image]: https://img.shields.io/badge/license-${license}-green.svg?style=flat-square
|
|
28
|
-
|
|
29
|
-
✔ _tester/node_modules/@w5s/cspell-config/README.md Updated
|
|
30
|
-
Transforms run
|
|
31
|
-
⁕ PKG_JSON:template=# W5s CSpell configuration _(${name})_
|
|
32
|
-
⁕ PKG_JSON:template=> ${description}&unknownTxt=
|
|
33
|
-
⁕ PKG_JSON:template=```console\nnpm install --save-dev ${name} cspell\n```
|
|
34
|
-
⁕ PKG_JSON:template=```json\n{\n "import": ["${name}"]\n}\n```
|
|
35
|
-
⁕ PKG_JSON:template=[${license}][license-url] © ${author}
|
|
36
|
-
⁕ PKG_JSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
|
|
37
|
-
⁕ PKG_JSON:template=[package-url]: https://www.npmjs.com/package/${name}
|
|
38
|
-
⁕ PKG_JSON:template=[license-image]: https://img.shields.io/badge/license-${license}-green.svg?style=flat-square
|
|
39
|
-
|
|
40
|
-
✔ _tester/node_modules/@w5s/ts-config/README.md Updated
|
|
41
|
-
Transforms run
|
|
42
|
-
⁕ PKG_JSON:template=# W5s Typescript configuration _(${name})_
|
|
43
|
-
⁕ PKG_JSON:template=> ${description}&unknownTxt=
|
|
44
|
-
⁕ PKG_JSON:template=```console\nnpm install --save-dev ${name}\n```
|
|
45
|
-
⁕ PKG_JSON:template=Typescript: ${peerDependencies.typescript}&unknownTxt=
|
|
46
|
-
⁕ PKG_JSON:template=[${license}][license-url] © ${author}
|
|
47
|
-
⁕ PKG_JSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
|
|
48
|
-
⁕ PKG_JSON:template=[package-url]: https://www.npmjs.com/package/${name}
|
|
49
|
-
⁕ PKG_JSON:template=[license-image]: https://img.shields.io/badge/license-${license}-green.svg?style=flat-square
|
|
50
|
-
|
|
51
|
-
✔ _tester/node_modules/@w5s/prettier-config/README.md Updated
|
|
52
|
-
Transforms run
|
|
53
|
-
⁕ PKG_JSON:template=# W5s Prettier configuration _(${name})_
|
|
54
|
-
⁕ PKG_JSON:template=> ${description}&unknownTxt=
|
|
55
|
-
⁕ PKG_JSON:template=```console\nnpm install --save-dev ${name}\n```
|
|
56
|
-
⁕ PKG_JSON:template=```json\n"${name}"\n```
|
|
57
|
-
⁕ PKG_JSON:template=```js\nmodule.exports = {\n ...require('${name}'),\n // Override rules\n};\n```
|
|
58
|
-
⁕ PKG_JSON:template=Prettier: ${peerDependencies.prettier}&unknownTxt=
|
|
59
|
-
⁕ PKG_JSON:template=[${license}][license-url] © ${author}
|
|
60
|
-
⁕ PKG_JSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
|
|
61
|
-
⁕ PKG_JSON:template=[package-url]: https://www.npmjs.com/package/${name}
|
|
62
|
-
⁕ PKG_JSON:template=[license-image]: https://img.shields.io/badge/license-${license}-green.svg?style=flat-square
|
|
63
|
-
|
package/.turbo/turbo-format.log
DELETED
package/.turbo/turbo-lint.log
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
CSpell: Files checked: 51, Issues found: 0 in 0 files
|
package/.turbo/turbo-test.log
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
[src]
|
|
2
|
-
[src] > @w5s/mrm-preset@1.0.0-alpha.40 test:src
|
|
3
|
-
[src] > mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir ..
|
|
4
|
-
[src]
|
|
5
|
-
[src] mkdir: _tester: File exists
|
|
6
|
-
[src] [36mRunning bootstrap...[39m
|
|
7
|
-
[src] [33mRunning alias configure...[39m
|
|
8
|
-
[src] [36mRunning gitignore...[39m
|
|
9
|
-
[src] [36mRunning project...[39m
|
|
10
|
-
[src] [32mUpdate turbo.json[39m
|
|
11
|
-
[src] [36mRunning contributing...[39m
|
|
12
|
-
[src] [36mRunning licenses...[39m
|
|
13
|
-
[src] [36mRunning release...[39m
|
|
14
|
-
[src] [36mRunning ci...[39m
|
|
15
|
-
[src] [36mRunning lang...[39m
|
|
16
|
-
[src] [32mUpdate tsconfig.json[39m
|
|
17
|
-
[src] [36mRunning commitlint...[39m
|
|
18
|
-
[src] [32mUpdate .vscode/extensions.json[39m
|
|
19
|
-
[src] [36mRunning editorconfig...[39m
|
|
20
|
-
[src] [36mRunning eslint...[39m
|
|
21
|
-
[src] [36mRunning cspell...[39m
|
|
22
|
-
[src] [32mUpdate .cspell.json[39m
|
|
23
|
-
[src] [36mRunning jest...[39m
|
|
24
|
-
[src] [36mRunning renovate...[39m
|
|
25
|
-
[src] [36mRunning githooks...[39m
|
|
26
|
-
[src] [36mRunning postconfigure...[39m
|
|
27
|
-
[src] npm run test:src exited with code 0
|