@w5s/mrm-preset 1.0.0-alpha.7 → 1.0.0-alpha.8

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 +1 @@
1
- @w5s/mrm-preset:build: cache hit, replaying output 65d77d6fca114214
1
+ @w5s/mrm-preset:build: cache hit, replaying output 5afc39bc33a830a1
@@ -1,43 +1,43 @@
1
- @w5s/mrm-preset:docs: cache hit, replaying output f34cf75e082653a5
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: 
1
+ @w5s/mrm-preset:docs: cache hit, replaying output 739feda9201bbfc3
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,52 @@
1
+ @w5s/mrm-preset:lint: cache hit, replaying output dd62d06a650bdfa1
2
+ @w5s/mrm-preset:lint: 
3
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/ci/gitlab.js
4
+ @w5s/mrm-preset:lint:  5:0 warning Syntax error in type: typeof import('sync-directory')['default'] jsdoc/valid-types
5
+ @w5s/mrm-preset:lint: 
6
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/core/commitlint.js
7
+ @w5s/mrm-preset:lint:  6:0 warning Syntax error in type: {state: 'present'|'absent',preset: string,} jsdoc/valid-types
8
+ @w5s/mrm-preset:lint: 
9
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/core/cspell.js
10
+ @w5s/mrm-preset:lint:  5:0 warning Syntax error in type: {version: '0.2',language: string,words?: string[],flagWords?: string[],ignorePaths?: string[],ignoreWords?: string[],ignoreRegExpList?: string[],import?: string[]} jsdoc/valid-types
11
+ @w5s/mrm-preset:lint:  17:0 warning Syntax error in type: {state: 'present'|'absent'update?: (config: CSpellConfig) => CSpellConfig} jsdoc/valid-types
12
+ @w5s/mrm-preset:lint: 
13
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/core/file.js
14
+ @w5s/mrm-preset:lint:  5:0 warning Syntax error in type: {path: string,state: 'file'|'absent',update?: (content: string) => string | undefined,} jsdoc/valid-types
15
+ @w5s/mrm-preset:lint: 
16
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/core/githooks.js
17
+ @w5s/mrm-preset:lint:  10:0 warning Syntax error in type: {state: 'present'|'absent',} jsdoc/valid-types
18
+ @w5s/mrm-preset:lint: 
19
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/core/jsonFile.js
20
+ @w5s/mrm-preset:lint:  35:0 warning Syntax error in type: {path: undefined | string | string[],state: 'present'|'absent',update?: T | ((previousValue: T) => T)default?: T | (() => T)} jsdoc/valid-types
21
+ @w5s/mrm-preset:lint: 
22
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/core/npm.js
23
+ @w5s/mrm-preset:lint:  28:0 warning Missing JSDoc @property "dev" description jsdoc/require-property-description
24
+ @w5s/mrm-preset:lint:  29:0 warning Missing JSDoc @property "yarn" description jsdoc/require-property-description
25
+ @w5s/mrm-preset:lint:  30:0 warning Missing JSDoc @property "versions" description jsdoc/require-property-description
26
+ @w5s/mrm-preset:lint:  35:0 warning Missing JSDoc @property "dev" description jsdoc/require-property-description
27
+ @w5s/mrm-preset:lint:  36:0 warning Missing JSDoc @property "remove" description jsdoc/require-property-description
28
+ @w5s/mrm-preset:lint:  37:0 warning Missing JSDoc @property "stdio" description jsdoc/require-property-description
29
+ @w5s/mrm-preset:lint:  38:0 warning Missing JSDoc @property "cwd" description jsdoc/require-property-description
30
+ @w5s/mrm-preset:lint:  56:0 warning Tag @type must have a type jsdoc/valid-types
31
+ @w5s/mrm-preset:lint:  169:0 warning Missing JSDoc @returns description jsdoc/require-returns-description
32
+ @w5s/mrm-preset:lint:  184:0 warning Missing JSDoc @returns description jsdoc/require-returns-description
33
+ @w5s/mrm-preset:lint:  197:0 warning Missing JSDoc @returns description jsdoc/require-returns-description
34
+ @w5s/mrm-preset:lint:  256:0 warning Syntax error in type: 'npm'|`yarn@${'classic'|'berry'}` jsdoc/valid-types
35
+ @w5s/mrm-preset:lint:  284:0 warning Syntax error in type: {name: string|string[]|Record<string, string>,state: 'present'|'absent',dev?: boolean,yarn?: boolean,} jsdoc/valid-types
36
+ @w5s/mrm-preset:lint: 
37
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/core/pkg.js
38
+ @w5s/mrm-preset:lint:  25:0 warning Syntax error in type: {name: string,state: 'present'|'absent'|'default',script: string,} jsdoc/valid-types
39
+ @w5s/mrm-preset:lint:  43:0 warning Missing JSDoc @returns description jsdoc/require-returns-description
40
+ @w5s/mrm-preset:lint: 
41
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/core/typedoc.js
42
+ @w5s/mrm-preset:lint:  7:0 warning Syntax error in type: {out?: string,tsconfig?: string,exclude?: Array<string>,excludePrivate?: boolean,excludeExternals?: boolean,readme?: string,theme?: string,} jsdoc/valid-types
43
+ @w5s/mrm-preset:lint: 
44
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/core/vscode.js
45
+ @w5s/mrm-preset:lint:  47:0 warning Syntax error in type: {name: string,state: 'present'|'absent',snippets: {[key: string]: {scope: string,prefix: string,body: string|string[],description?: string,}}} jsdoc/valid-types
46
+ @w5s/mrm-preset:lint: 
47
+ @w5s/mrm-preset:lint: /Users/jpolo/Workspace/w5s/project-config/packages/mrm-preset/editorconfig/index.js
48
+ @w5s/mrm-preset:lint:  7:0 warning Syntax error in type: Record<string, Partial<{charset: string,continuation_indent_size: number,curly_bracket_next_line: boolean,end_of_line: 'lf'|'crlf',indent_brace_style: 'Stroustrup',indent_size: number,indent_style: 'tab'|'space',insert_final_newline: boolean|'ignore',max_line_length: number,quote_type: 'single'|'double',root: boolean,spaces_around_brackets: 'outside',spaces_around_operators: boolean,trim_trailing_whitespace: boolean,}>> jsdoc/valid-types
49
+ @w5s/mrm-preset:lint:  29:0 warning Missing JSDoc @param "existing" type jsdoc/require-param-type
50
+ @w5s/mrm-preset:lint: 
51
+ @w5s/mrm-preset:lint: ✖ 26 problems (0 errors, 26 warnings)
52
+ @w5s/mrm-preset:lint: 
@@ -1,20 +1,21 @@
1
- @w5s/mrm-preset:test: cache hit, replaying output 6b4f5273625c6ddf
2
- @w5s/mrm-preset:test: mkdir: _tester: File exists
3
- @w5s/mrm-preset:test: Running bootstrap...
4
- @w5s/mrm-preset:test: Running alias configure...
5
- @w5s/mrm-preset:test: Running gitignore...
6
- @w5s/mrm-preset:test: Running project...
7
- @w5s/mrm-preset:test: Update package.json
8
- @w5s/mrm-preset:test: Running contributing...
9
- @w5s/mrm-preset:test: Running release...
10
- @w5s/mrm-preset:test: Running ci...
11
- @w5s/mrm-preset:test: Running lang...
12
- @w5s/mrm-preset:test: Running commitlint...
13
- @w5s/mrm-preset:test: Running editorconfig...
14
- @w5s/mrm-preset:test: Running eslint...
15
- @w5s/mrm-preset:test: Running cspell...
16
- @w5s/mrm-preset:test: Running jest...
17
- @w5s/mrm-preset:test: Update package.json
18
- @w5s/mrm-preset:test: Running renovate...
19
- @w5s/mrm-preset:test: Running githooks...
20
- @w5s/mrm-preset:test: Running postconfigure...
1
+ @w5s/mrm-preset:test: cache hit, replaying output b355f87af4d1ba14
2
+ @w5s/mrm-preset:test: mkdir: _tester: File exists
3
+ @w5s/mrm-preset:test: Running bootstrap...
4
+ @w5s/mrm-preset:test: Running alias configure...
5
+ @w5s/mrm-preset:test: Running gitignore...
6
+ @w5s/mrm-preset:test: Running project...
7
+ @w5s/mrm-preset:test: Update package.json
8
+ @w5s/mrm-preset:test: Running contributing...
9
+ @w5s/mrm-preset:test: Running release...
10
+ @w5s/mrm-preset:test: Running ci...
11
+ @w5s/mrm-preset:test: Running lang...
12
+ @w5s/mrm-preset:test: Update tsconfig.settings.json
13
+ @w5s/mrm-preset:test: Running commitlint...
14
+ @w5s/mrm-preset:test: Running editorconfig...
15
+ @w5s/mrm-preset:test: Running eslint...
16
+ @w5s/mrm-preset:test: Running cspell...
17
+ @w5s/mrm-preset:test: Running jest...
18
+ @w5s/mrm-preset:test: Update package.json
19
+ @w5s/mrm-preset:test: Running renovate...
20
+ @w5s/mrm-preset:test: Running githooks...
21
+ @w5s/mrm-preset:test: Running postconfigure...
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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.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)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * add missing $schema for tsconfig ([c33c7ae](https://github.com/w5s/project-config/commit/c33c7aeba405d651eba19187436724780dd90aff))
12
+ * remove unused typedoc script ([51238f0](https://github.com/w5s/project-config/commit/51238f04b8f3d95baac7f0a367ba1c07061d2ce4))
13
+
14
+
15
+
16
+
17
+
6
18
  # [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)
7
19
 
8
20
 
package/core/block.js CHANGED
@@ -53,7 +53,7 @@ function block({
53
53
  const replaceBlock = beginBlock + EOL + blockContent + EOL + endBlock;
54
54
 
55
55
  if (found.exists) {
56
- return fullContent.substr(0, found.startIndex) + replaceBlock + fullContent.substr(found.endIndex);
56
+ return fullContent.slice(0, Math.max(0, found.startIndex)) + replaceBlock + fullContent.slice(found.endIndex);
57
57
  }
58
58
 
59
59
  // insert
package/core/git.js CHANGED
@@ -13,17 +13,19 @@ function remoteSync() {
13
13
  ? [
14
14
  /**
15
15
  * 1. filter github URL
16
+ *
16
17
  * @param {string} returnValue
17
18
  */
18
19
  (returnValue) => returnValue.replace(/^git@github.com:/, 'https://github.com/'),
19
20
  /**
20
21
  * 2. filter gitlab URL
22
+ *
21
23
  * @param {string} returnValue
22
24
  */
23
25
  (returnValue) => returnValue.replace(/^git@gitlab.com:/, 'https://gitlab.com/'),
24
26
  ].reduce((returnValue, filter) => filter(returnValue), remoteURL)
25
27
  : remoteURL;
26
- } catch (error) {
28
+ } catch {
27
29
  // ignore error
28
30
  }
29
31
 
package/core/npm.js CHANGED
@@ -249,7 +249,7 @@ function isUsingWorkspaces() {
249
249
 
250
250
  function isYarnBerry() {
251
251
  const yamlRC = yaml('.yarnrc.yml');
252
- return yamlRC.exists() && (yamlRC.get('yarnPath') || '').indexOf('.yarn/releases/yarn-1.') < 0;
252
+ return yamlRC.exists() && !(yamlRC.get('yarnPath') || '').includes('.yarn/releases/yarn-1.');
253
253
  }
254
254
 
255
255
  /**
@@ -258,18 +258,16 @@ function isYarnBerry() {
258
258
  function bootstrap(defaultPackageManager) {
259
259
  const packageFile = json(`./package.json`);
260
260
  const isYarn = isUsingYarn() || defaultPackageManager.startsWith('yarn@');
261
- if (!packageFile.get('packageManager')) {
262
- if (isYarn) {
263
- execCommand(undefined, 'yarn', ['set', 'version', 'berry']);
264
- yaml('.yarnrc.yml')
265
- .merge({
266
- nodeLinker: 'node-modules',
267
- })
268
- .save();
269
- // Downgrade
270
- if (defaultPackageManager.endsWith('@classic')) {
271
- execCommand(undefined, 'yarn', ['set', 'version', 'classic']);
272
- }
261
+ if (!packageFile.get('packageManager') && isYarn) {
262
+ execCommand(undefined, 'yarn', ['set', 'version', 'berry']);
263
+ yaml('.yarnrc.yml')
264
+ .merge({
265
+ nodeLinker: 'node-modules',
266
+ })
267
+ .save();
268
+ // Downgrade
269
+ if (defaultPackageManager.endsWith('@classic')) {
270
+ execCommand(undefined, 'yarn', ['set', 'version', 'classic']);
273
271
  }
274
272
  }
275
273
 
package/core/pkg.js CHANGED
@@ -100,18 +100,14 @@ function engineMinVersion(packageFile, engineVersionMap) {
100
100
  const currentVersion = packageFile.get(`engines.${engineName}`, defaultVersion);
101
101
  try {
102
102
  return intersect(currentVersion, defaultVersion);
103
- } catch (_) {
103
+ } catch {
104
104
  return currentVersion; // leave unchanged
105
105
  }
106
106
  };
107
107
 
108
108
  packageFile.merge({
109
- engines: Object.keys(engineVersionMap).reduce(
110
- (acc, engineName) => ({
111
- ...acc,
112
- [engineName]: engineConstraint(engineName),
113
- }),
114
- {}
109
+ engines: Object.fromEntries(
110
+ Object.keys(engineVersionMap).map((engineName) => [engineName, engineConstraint(engineName)])
115
111
  ),
116
112
  });
117
113
  }
package/core/typedoc.js CHANGED
@@ -26,14 +26,6 @@ function typedoc({ state, update }) {
26
26
  const hasWorkspaces = pkg.hasWorkspaces(packageFileDefault);
27
27
  const hasTypedoc = state === 'present';
28
28
 
29
- pkg.withPackageJson((packageFile) => {
30
- pkg.script(packageFile, {
31
- name: 'typedoc',
32
- script: 'typedoc',
33
- state: !hasTypedoc || hasWorkspaces ? 'absent' : 'present',
34
- });
35
- });
36
-
37
29
  const typedocFile = json('typedoc.json');
38
30
 
39
31
  if (hasTypedoc) {
@@ -44,11 +36,11 @@ function typedoc({ state, update }) {
44
36
  ...update(config),
45
37
  ...(hasWorkspaces
46
38
  ? {
47
- 'external-modulemap': '.*packages/([^/]+)/.*',
48
- entryPoints: ['packages/'],
39
+ entryPointStrategy: 'packages',
40
+ entryPoints: undefined,
49
41
  }
50
42
  : {
51
- 'external-modulemap': undefined,
43
+ entryPointStrategy: undefined,
52
44
  entryPoints: ['src/index.ts'],
53
45
  }),
54
46
  }),
@@ -70,11 +62,6 @@ function typedoc({ state, update }) {
70
62
  name: ['typedoc'],
71
63
  state: hasTypedoc ? 'present' : 'absent',
72
64
  });
73
- npm.dependency({
74
- dev: true,
75
- name: ['@strictsoftware/typedoc-plugin-monorepo'],
76
- state: hasTypedoc && hasWorkspaces ? 'present' : 'absent',
77
- });
78
65
  }
79
66
 
80
67
  module.exports = {
package/core/vscode.js CHANGED
@@ -31,7 +31,7 @@ function vscodeTask(newTask) {
31
31
  * @type {Array<any>}
32
32
  */
33
33
  const tasks = vscodeTaskFile.get('tasks', []);
34
- if (tasks.find((task) => task.script === newTask.script)) {
34
+ if (tasks.some((task) => task.script === newTask.script)) {
35
35
  vscodeTaskFile.set(
36
36
  'tasks',
37
37
  tasks.map((task) => (task.script === newTask.script ? newTask : task))
@@ -26,6 +26,7 @@ function createEditorConfig(defaults) {
26
26
 
27
27
  /**
28
28
  * @param {string} section
29
+ * @param existing
29
30
  */
30
31
  function mergeSection(section, existing = {}) {
31
32
  return Object.assign(existing, defaults[section] || {});
@@ -52,6 +53,7 @@ function createEditorConfig(defaults) {
52
53
 
53
54
  module.exports = createEditorConfig({
54
55
  '*': {
56
+ // eslint-disable-next-line unicorn/text-encoding-identifier-case
55
57
  charset: 'utf-8',
56
58
  continuation_indent_size: 4,
57
59
  curly_bracket_next_line: false,
package/githooks/index.js CHANGED
@@ -7,48 +7,44 @@ const { gitHook, husky } = require('../core/githooks');
7
7
  const { lintStaged } = require('../core/lintStaged');
8
8
  const { file } = require('../core/file');
9
9
 
10
- function createGitHooks() {
11
- function task() {
12
- const gitSupported = hasGit();
13
- const packageFile = packageJson();
14
- const hasESLint = pkg.hasDependency(packageFile, 'eslint', 'dev');
15
- const hasTsc = pkg.hasDependency(packageFile, 'typescript', 'dev');
10
+ function task() {
11
+ const gitSupported = hasGit();
12
+ const packageFile = packageJson();
13
+ const hasESLint = pkg.hasDependency(packageFile, 'eslint', 'dev');
14
+ const hasTsc = pkg.hasDependency(packageFile, 'typescript', 'dev');
16
15
 
17
- husky({
18
- state: gitSupported ? 'present' : 'absent',
19
- });
20
- lintStaged({
21
- state: gitSupported ? 'present' : 'absent',
22
- update: (config) => ({
23
- ...config,
24
- '*.json': [...(hasESLint ? ['eslint'] : [])],
25
- '*.js?(x)': [...(hasTsc ? ["bash -c 'tsc --noEmit'"] : []), ...(hasESLint ? ['eslint'] : [])],
26
- '*.ts?(x)': [...(hasTsc ? ["bash -c 'tsc --noEmit'"] : []), ...(hasESLint ? ['eslint'] : [])],
27
- }),
28
- });
29
- gitHook({
30
- name: 'pre-commit',
31
- content: `npm exec --no -- lint-staged`,
32
- state: gitSupported ? 'present' : 'absent',
33
- });
34
- gitHook({
35
- name: 'pre-push',
36
- content: `npm run ${project.validate}`,
37
- state: gitSupported ? 'present' : 'absent',
38
- });
16
+ husky({
17
+ state: gitSupported ? 'present' : 'absent',
18
+ });
19
+ lintStaged({
20
+ state: gitSupported ? 'present' : 'absent',
21
+ update: (config) => ({
22
+ ...config,
23
+ '*.json': [...(hasESLint ? ['eslint'] : [])],
24
+ '*.js?(x)': [...(hasTsc ? ["bash -c 'tsc --noEmit'"] : []), ...(hasESLint ? ['eslint'] : [])],
25
+ '*.ts?(x)': [...(hasTsc ? ["bash -c 'tsc --noEmit'"] : []), ...(hasESLint ? ['eslint'] : [])],
26
+ }),
27
+ });
28
+ gitHook({
29
+ name: 'pre-commit',
30
+ content: `npm exec --no -- lint-staged`,
31
+ state: gitSupported ? 'present' : 'absent',
32
+ });
33
+ gitHook({
34
+ name: 'pre-push',
35
+ content: `npm run ${project.validate}`,
36
+ state: gitSupported ? 'present' : 'absent',
37
+ });
39
38
 
40
- file({
41
- path: 'CODEOWNERS',
42
- state: gitSupported ? 'file' : 'absent',
43
- update: (content) =>
44
- content.length === 0 ? template('', path.join(__dirname, 'templates', 'CODEOWNERS')).apply().get() : undefined,
45
- });
46
- }
47
-
48
- task.description = 'Setup Git hooks';
49
- task.parameters = {};
50
-
51
- return task;
39
+ file({
40
+ path: 'CODEOWNERS',
41
+ state: gitSupported ? 'file' : 'absent',
42
+ update: (content) =>
43
+ content.length === 0 ? template('', path.join(__dirname, 'templates', 'CODEOWNERS')).apply().get() : undefined,
44
+ });
52
45
  }
53
46
 
54
- module.exports = createGitHooks();
47
+ task.description = 'Setup Git hooks';
48
+ task.parameters = {};
49
+
50
+ module.exports = task;
package/jest/index.js CHANGED
@@ -1,19 +1,15 @@
1
1
  const { jest } = require('../core/jest');
2
2
 
3
- function createJest() {
4
- /**
5
- *
6
- */
7
- function task() {
8
- jest({
9
- state: 'present',
10
- });
11
- }
12
-
13
- task.description = 'Setup Jest';
14
- task.parameters = {};
15
-
16
- return task;
3
+ /**
4
+ *
5
+ */
6
+ function task() {
7
+ jest({
8
+ state: 'present',
9
+ });
17
10
  }
18
11
 
19
- module.exports = createJest();
12
+ task.description = 'Setup Jest';
13
+ task.parameters = {};
14
+
15
+ module.exports = task;
@@ -4,5 +4,8 @@
4
4
  "@typescript-eslint/no-unsafe-call": "off",
5
5
  "@typescript-eslint/no-unsafe-assignment": "off",
6
6
  "@typescript-eslint/no-unsafe-member-access": "off"
7
- }
7
+ },
8
+ "ignorePatterns": [
9
+ "**/templates/*.ts"
10
+ ]
8
11
  }
package/lang/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const { join } = require('path');
1
+ const path = require('path');
2
2
  const { json, file, template, packageJson } = require('mrm-core');
3
3
  const npm = require('../core/npm');
4
4
  const { gitIgnore } = require('../core/git');
@@ -11,14 +11,14 @@ const pkg = require('../core/pkg');
11
11
  *
12
12
  * @param {{
13
13
  * language: 'typescript',
14
- * tsConfig: string,
14
+ * tsConfig: string
15
15
  * }} config
16
16
  */
17
17
  function createLang({ language: languageDefault = 'typescript', tsConfig: tsConfigDefault }) {
18
18
  /**
19
19
  *
20
20
  * @param {{
21
- * language: 'typescript',
21
+ * language: 'typescript'
22
22
  * }} config
23
23
  */
24
24
  function task({ language }) {
@@ -43,6 +43,7 @@ function createLang({ language: languageDefault = 'typescript', tsConfig: tsConf
43
43
  .unset('compilerOptions.outDir')
44
44
  .unset('include')
45
45
  .merge({
46
+ $schema: 'https://json.schemastore.org/tsconfig',
46
47
  extends: `./${tsConfigSettingsName}`,
47
48
  })
48
49
  .save();
@@ -52,6 +53,7 @@ function createLang({ language: languageDefault = 'typescript', tsConfig: tsConf
52
53
  } else {
53
54
  tsConfigSettings
54
55
  .merge({
56
+ $schema: 'https://json.schemastore.org/tsconfig',
55
57
  compilerOptions: {},
56
58
  extends: tsConfigPreset,
57
59
  })
@@ -68,12 +70,12 @@ function createLang({ language: languageDefault = 'typescript', tsConfig: tsConf
68
70
  .save();
69
71
 
70
72
  // Create default index
71
- const templateDir = join(__dirname, 'templates');
73
+ const templateDir = path.join(__dirname, 'templates');
72
74
  if (!file('src/index.ts').exists()) {
73
- template('src/index.ts', join(templateDir, 'index.ts')).apply().save();
75
+ template('src/index.ts', path.join(templateDir, 'index.ts')).apply().save();
74
76
  }
75
77
  if (!file('src/index.spec.ts').exists()) {
76
- template('src/index.spec.ts', join(templateDir, 'index.spec.ts')).apply().save();
78
+ template('src/index.spec.ts', path.join(templateDir, 'index.spec.ts')).apply().save();
77
79
  }
78
80
  }
79
81
  // Application setup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/mrm-preset",
3
- "version": "1.0.0-alpha.7",
3
+ "version": "1.0.0-alpha.8",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "791ae3e63ac1278f1299c4e8af2a88786b2b6683"
48
+ "gitHead": "468c38fd7cd2690ee860d222d360cc10b840dcfd"
49
49
  }
package/project/index.js CHANGED
@@ -6,37 +6,36 @@ const { vscodeTask } = require('../core/vscode');
6
6
  const project = require('../core/project');
7
7
  const mrmPackageJson = require('../package.json');
8
8
 
9
+ /**
10
+ *
11
+ * @param {string} script
12
+ */
13
+ const npmRun = (script) => {
14
+ switch (script) {
15
+ case project.install:
16
+ case project.test:
17
+ return `npm ${script}`;
18
+ default:
19
+ return `npm run ${script}`;
20
+ }
21
+ };
22
+ /**
23
+ *
24
+ * @param {string} script
25
+ */
26
+ const turboRun = (script) => `turbo run ${script}`;
27
+
28
+ /**
29
+ *
30
+ * @param {string} script
31
+ */
32
+ const npmRunAll = (script) => `npm-run-all -p "${script}:*"`;
9
33
  function task() {
10
34
  const packageFile = packageJson();
11
35
  const gitSupported = git.hasGit();
12
36
  const useWorkspace = packageFile.get('mrmConfig.packageArchetype') === 'workspace';
13
37
  const packageManager = pkg.manager(packageFile);
14
38
 
15
- /**
16
- *
17
- * @param {string} script
18
- */
19
- const npmRun = (script) => {
20
- switch (script) {
21
- case project.install:
22
- case project.test:
23
- return `npm ${script}`;
24
- default:
25
- return `npm run ${script}`;
26
- }
27
- };
28
- /**
29
- *
30
- * @param {string} script
31
- */
32
- const turboRun = (script) => `turbo run ${script}`;
33
-
34
- /**
35
- *
36
- * @param {string} script
37
- */
38
- const npmRunAll = (script) => `npm-run-all -p "${script}:*"`;
39
-
40
39
  // Detect git repository
41
40
  pkg.value(packageFile, {
42
41
  path: 'repository',
package/renovate/index.js CHANGED
@@ -4,7 +4,7 @@ const { hasGit } = require('../core/git');
4
4
  /**
5
5
  *
6
6
  * @param {{
7
- * renovatePresetApplication: string
7
+ * renovatePresetApplication: string,
8
8
  * renovatePresetLibrary: string
9
9
  * }} config
10
10
  */
package/tsconfig.json CHANGED
@@ -1,4 +1,5 @@
1
1
  {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
2
3
  "extends": "../../tsconfig.json",
3
4
  "compilerOptions": {
4
5
  "allowJs": true,