@w5s/mrm-preset 1.0.0-alpha.19 → 1.0.0-alpha.22

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,11 +1,11 @@
1
- @w5s/mrm-preset:build: cache hit, replaying output b2674e19e9d29ff6
2
- @w5s/mrm-preset:build: [build:*tsc]
3
- @w5s/mrm-preset:build: [build:*tsc] > @w5s/mrm-preset@1.0.0-alpha.18 build:tsc
4
- @w5s/mrm-preset:build: [build:*tsc] > tsc --noEmit --skipLibCheck
5
- @w5s/mrm-preset:build: [build:*tsc]
6
- @w5s/mrm-preset:build: [build:*empty]
7
- @w5s/mrm-preset:build: [build:*empty] > @w5s/mrm-preset@1.0.0-alpha.18 build:empty
8
- @w5s/mrm-preset:build: [build:*empty] > :
9
- @w5s/mrm-preset:build: [build:*empty]
10
- @w5s/mrm-preset:build: [build:*empty] npm run build:empty exited with code 0
11
- @w5s/mrm-preset:build: [build:*tsc] npm run build:tsc exited with code 0
1
+ @w5s/mrm-preset:build: cache hit, replaying output 17a19af6413482f1
2
+ @w5s/mrm-preset:build: [build:*empty]
3
+ @w5s/mrm-preset:build: [build:*empty] > @w5s/mrm-preset@1.0.0-alpha.21 build:empty
4
+ @w5s/mrm-preset:build: [build:*empty] > :
5
+ @w5s/mrm-preset:build: [build:*empty]
6
+ @w5s/mrm-preset:build: [build:*tsc]
7
+ @w5s/mrm-preset:build: [build:*tsc] > @w5s/mrm-preset@1.0.0-alpha.21 build:tsc
8
+ @w5s/mrm-preset:build: [build:*tsc] > tsc --noEmit --skipLibCheck
9
+ @w5s/mrm-preset:build: [build:*tsc]
10
+ @w5s/mrm-preset:build: [build:*empty] npm run build:empty exited with code 0
11
+ @w5s/mrm-preset:build: [build:*tsc] npm run build:tsc exited with code 0
@@ -1,4 +1,4 @@
1
- @w5s/mrm-preset:docs: cache hit, replaying output 7929426e31db918c
1
+ @w5s/mrm-preset:docs: cache hit, replaying output 9310052946be99ff
2
2
  @w5s/mrm-preset:docs: Starting markdown-magic [ '**/*.md', '!node_modules/**' ]
3
3
  @w5s/mrm-preset:docs: ℹ Notice:
4
4
  @w5s/mrm-preset:docs:  Missing transforms "BASIC_RULES","JSX_RULES" in _tester/node_modules/eslint-plugin-react/README.md
@@ -36,6 +36,7 @@
36
36
  @w5s/mrm-preset:docs:  ⁕ PKGJSON:template=# W5s Typescript configuration _(${name})_
37
37
  @w5s/mrm-preset:docs:  ⁕ PKGJSON:template=> ${description}&unknownTxt=
38
38
  @w5s/mrm-preset:docs:  ⁕ PKGJSON:template=```console\nnpm install --save-dev ${name}\n```
39
+ @w5s/mrm-preset:docs:  ⁕ PKGJSON:template=Typescript: ${peerDependencies.typescript}&unknownTxt=
39
40
  @w5s/mrm-preset:docs:  ⁕ PKGJSON:template=[${license}][license-url] © ${author}
40
41
  @w5s/mrm-preset:docs:  ⁕ PKGJSON:template=[package-version-svg]: https://img.shields.io/npm/v/${name}.svg?style=flat-square
41
42
  @w5s/mrm-preset:docs:  ⁕ PKGJSON:template=[package-url]: https://www.npmjs.com/package/${name}
@@ -1,7 +1,39 @@
1
- @w5s/mrm-preset:format: cache hit, replaying output 2ccea371b5ea23ec
1
+ @w5s/mrm-preset:format: cache hit, replaying output 04a98d2ee4410b2f
2
2
  @w5s/mrm-preset:format: [1] : exited with code 0
3
3
  @w5s/mrm-preset:format: [format:*src]
4
- @w5s/mrm-preset:format: [format:*src] > @w5s/mrm-preset@1.0.0-alpha.18 format:src
4
+ @w5s/mrm-preset:format: [format:*src] > @w5s/mrm-preset@1.0.0-alpha.21 format:src
5
5
  @w5s/mrm-preset:format: [format:*src] > eslint . --fix --ext=mjs,cjs,js,jsx,ts,tsx,json
6
6
  @w5s/mrm-preset:format: [format:*src]
7
- @w5s/mrm-preset:format: [format:*src] npm run format:src exited with code 0
7
+ @w5s/mrm-preset:format: [format:*src]
8
+ @w5s/mrm-preset:format: [format:*src] Oops! Something went wrong! :(
9
+ @w5s/mrm-preset:format: [format:*src]
10
+ @w5s/mrm-preset:format: [format:*src] ESLint: 8.23.0
11
+ @w5s/mrm-preset:format: [format:*src]
12
+ @w5s/mrm-preset:format: [format:*src] Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/jpolo/Workspace/w5s/project-config/packages/eslint-config/index.js from /Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs not supported.
13
+ @w5s/mrm-preset:format: [format:*src] index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
14
+ @w5s/mrm-preset:format: [format:*src] Instead rename index.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /Users/jpolo/Workspace/w5s/project-config/packages/eslint-config/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
15
+ @w5s/mrm-preset:format: [format:*src]
16
+ @w5s/mrm-preset:format: [format:*src] at Object.module.exports [as default] (/Users/jpolo/Workspace/w5s/project-config/node_modules/import-fresh/index.js:32:59)
17
+ @w5s/mrm-preset:format: [format:*src] at loadJSConfigFile (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2559:47)
18
+ @w5s/mrm-preset:format: [format:*src] at loadConfigFile (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2643:20)
19
+ @w5s/mrm-preset:format: [format:*src] at ConfigArrayFactory._loadConfigData (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2947:42)
20
+ @w5s/mrm-preset:format: [format:*src] at ConfigArrayFactory._loadExtendedShareableConfig (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3248:21)
21
+ @w5s/mrm-preset:format: [format:*src] at ConfigArrayFactory._loadExtends (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3119:25)
22
+ @w5s/mrm-preset:format: [format:*src] at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3058:25)
23
+ @w5s/mrm-preset:format: [format:*src] at _normalizeObjectConfigDataBody.next (<anonymous>)
24
+ @w5s/mrm-preset:format: [format:*src] at ConfigArrayFactory._normalizeObjectConfigData (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3003:20)
25
+ @w5s/mrm-preset:format: [format:*src] at _normalizeObjectConfigData.next (<anonymous>)
26
+ @w5s/mrm-preset:format: [format:*src] at ConfigArrayFactory.loadInDirectory (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2849:28)
27
+ @w5s/mrm-preset:format: [format:*src] at CascadingConfigArrayFactory._loadConfigInAncestors (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3833:46)
28
+ @w5s/mrm-preset:format: [format:*src] at CascadingConfigArrayFactory._loadConfigInAncestors (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3852:20)
29
+ @w5s/mrm-preset:format: [format:*src] at CascadingConfigArrayFactory._loadConfigInAncestors (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3852:20)
30
+ @w5s/mrm-preset:format: [format:*src] at CascadingConfigArrayFactory.getConfigArrayForFile (/Users/jpolo/Workspace/w5s/project-config/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3754:18)
31
+ @w5s/mrm-preset:format: [format:*src] at FileEnumerator._iterateFilesRecursive (/Users/jpolo/Workspace/w5s/project-config/node_modules/eslint/lib/cli-engine/file-enumerator.js:446:49)
32
+ @w5s/mrm-preset:format: [format:*src] at _iterateFilesRecursive.next (<anonymous>)
33
+ @w5s/mrm-preset:format: [format:*src] at FileEnumerator.iterateFiles (/Users/jpolo/Workspace/w5s/project-config/node_modules/eslint/lib/cli-engine/file-enumerator.js:297:49)
34
+ @w5s/mrm-preset:format: [format:*src] at iterateFiles.next (<anonymous>)
35
+ @w5s/mrm-preset:format: [format:*src] at CLIEngine.executeOnFiles (/Users/jpolo/Workspace/w5s/project-config/node_modules/eslint/lib/cli-engine/cli-engine.js:786:48)
36
+ @w5s/mrm-preset:format: [format:*src] at ESLint.lintFiles (/Users/jpolo/Workspace/w5s/project-config/node_modules/eslint/lib/eslint/eslint.js:550:23)
37
+ @w5s/mrm-preset:format: [format:*src] at Object.execute (/Users/jpolo/Workspace/w5s/project-config/node_modules/eslint/lib/cli.js:395:36)
38
+ @w5s/mrm-preset:format: [format:*src] at async main (/Users/jpolo/Workspace/w5s/project-config/node_modules/eslint/bin/eslint.js:135:24)
39
+ @w5s/mrm-preset:format: [format:*src] npm run format:src exited with code SIGINT
@@ -1,7 +1,7 @@
1
- @w5s/mrm-preset:lint: cache hit, replaying output 22fed320b23e49fa
2
- @w5s/mrm-preset:lint: [1] : exited with code 0
3
- @w5s/mrm-preset:lint: [lint:*src]
4
- @w5s/mrm-preset:lint: [lint:*src] > @w5s/mrm-preset@1.0.0-alpha.18 lint:src
5
- @w5s/mrm-preset:lint: [lint:*src] > eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json
6
- @w5s/mrm-preset:lint: [lint:*src]
7
- @w5s/mrm-preset:lint: [lint:*src] npm run lint:src exited with code 0
1
+ @w5s/mrm-preset:lint: cache hit, replaying output 59b9e0a41d10b062
2
+ @w5s/mrm-preset:lint: [1] : exited with code 0
3
+ @w5s/mrm-preset:lint: [lint:*src]
4
+ @w5s/mrm-preset:lint: [lint:*src] > @w5s/mrm-preset@1.0.0-alpha.21 lint:src
5
+ @w5s/mrm-preset:lint: [lint:*src] > eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json
6
+ @w5s/mrm-preset:lint: [lint:*src]
7
+ @w5s/mrm-preset:lint: [lint:*src] npm run lint:src exited with code 0
@@ -1,2 +1,2 @@
1
- @w5s/mrm-preset:prepare: cache hit, replaying output 2a953d2da4d297c9
2
- @w5s/mrm-preset:prepare: [0] : exited with code 0
1
+ @w5s/mrm-preset:prepare: cache hit, replaying output 860bf65f3e79fa8d
2
+ @w5s/mrm-preset:prepare: [0] : exited with code 0
@@ -1,38 +1,12 @@
1
- @w5s/mrm-preset:test: cache hit, replaying output 52d5e4f6637d08e9
1
+ @w5s/mrm-preset:test: cache hit, replaying output e3db7c613f4cc625
2
2
  @w5s/mrm-preset:test: mkdir: _tester: File exists
3
3
  @w5s/mrm-preset:test: Running bootstrap...
4
4
  @w5s/mrm-preset:test: Running alias configure...
5
5
  @w5s/mrm-preset:test: Running gitignore...
6
6
  @w5s/mrm-preset:test: Running project...
7
7
  @w5s/mrm-preset:test: Update package.json
8
- @w5s/mrm-preset:test: Uninstalling npm-run-all...
9
- @w5s/mrm-preset:test: 
10
- @w5s/mrm-preset:test: removed 19 packages, and audited 1391 packages in 3s
11
- @w5s/mrm-preset:test: 
12
- @w5s/mrm-preset:test: 143 packages are looking for funding
13
- @w5s/mrm-preset:test:  run `npm fund` for details
14
- @w5s/mrm-preset:test: 
15
- @w5s/mrm-preset:test: 6 moderate severity vulnerabilities
16
- @w5s/mrm-preset:test: 
17
- @w5s/mrm-preset:test: To address all issues (including breaking changes), run:
18
- @w5s/mrm-preset:test:  npm audit fix --force
19
- @w5s/mrm-preset:test: 
20
- @w5s/mrm-preset:test: Run `npm audit` for details.
21
- @w5s/mrm-preset:test: Installing concurrently...
22
- @w5s/mrm-preset:test: 
23
- @w5s/mrm-preset:test: added 12 packages, and audited 1403 packages in 7s
24
- @w5s/mrm-preset:test: 
25
- @w5s/mrm-preset:test: 144 packages are looking for funding
26
- @w5s/mrm-preset:test:  run `npm fund` for details
27
- @w5s/mrm-preset:test: 
28
- @w5s/mrm-preset:test: 6 moderate severity vulnerabilities
29
- @w5s/mrm-preset:test: 
30
- @w5s/mrm-preset:test: To address all issues (including breaking changes), run:
31
- @w5s/mrm-preset:test:  npm audit fix --force
32
- @w5s/mrm-preset:test: 
33
- @w5s/mrm-preset:test: Run `npm audit` for details.
34
8
  @w5s/mrm-preset:test: Running contributing...
35
- @w5s/mrm-preset:test: Running license...
9
+ @w5s/mrm-preset:test: Running licenses...
36
10
  @w5s/mrm-preset:test: Running release...
37
11
  @w5s/mrm-preset:test: Running ci...
38
12
  @w5s/mrm-preset:test: Running lang...
package/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
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.22](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.21...@w5s/mrm-preset@1.0.0-alpha.22) (2022-08-29)
7
+
8
+ **Note:** Version bump only for package @w5s/mrm-preset
9
+
10
+
11
+
12
+
13
+
14
+ # [1.0.0-alpha.21](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.20...@w5s/mrm-preset@1.0.0-alpha.21) (2022-08-09)
15
+
16
+ **Note:** Version bump only for package @w5s/mrm-preset
17
+
18
+
19
+
20
+
21
+
22
+ # [1.0.0-alpha.20](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.19...@w5s/mrm-preset@1.0.0-alpha.20) (2022-08-09)
23
+
24
+ **Note:** Version bump only for package @w5s/mrm-preset
25
+
26
+
27
+
28
+
29
+
6
30
  # [1.0.0-alpha.19](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@1.0.0-alpha.18...@w5s/mrm-preset@1.0.0-alpha.19) (2022-06-28)
7
31
 
8
32
  **Note:** Version bump only for package @w5s/mrm-preset
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 --package=@w5s/mrm-preset -- mrm bootstrap --preset @w5s/mrm-preset
22
+ npm exec --package=@w5s/mrm-preset --package=mrm -- mrm bootstrap --preset @w5s/mrm-preset
23
23
  ```
24
24
 
25
25
  This will install in `package.json` the npm scripts
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable sort-keys-fix/sort-keys-fix */
2
- const path = require('path');
3
- const { packageJson, file } = require('mrm-core');
2
+ const path = require('node:path');
3
+ const { packageJson } = require('mrm-core');
4
4
  const npm = require('../core/npm.js');
5
5
  const pkg = require('../core/pkg.js');
6
6
  const { gitIgnoreTemplate } = require('../core/git.js');
@@ -14,7 +14,7 @@ const { gitIgnoreTemplate } = require('../core/git.js');
14
14
  * }} config
15
15
  * @returns {void}
16
16
  */
17
- function task({ mrmPreset, mrmTask, packageArchetype, packageManager }) {
17
+ function task({ mrmPreset, mrmTask, packageManager }) {
18
18
  /**
19
19
  * setup package.json from following object
20
20
  */
@@ -51,21 +51,6 @@ function task({ mrmPreset, mrmTask, packageArchetype, packageManager }) {
51
51
  script: `mrm --preset ${mrmPreset}`,
52
52
  });
53
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
- });
69
54
  }
70
55
 
71
56
  task.description = 'Bootstrap a new project.';
@@ -81,12 +66,6 @@ task.parameters = {
81
66
  message: 'Default MRM task name ?',
82
67
  type: 'input',
83
68
  },
84
- packageArchetype: {
85
- choices: ['library', 'application', 'workspace'],
86
- message: 'What Archetype of package ?',
87
- name: 'packageArchetype',
88
- type: 'input',
89
- },
90
69
  packageManager: {
91
70
  default: 'yarn@berry',
92
71
  choices: ['yarn@berry', 'yarn@classic', 'npm'],
package/ci/github.js CHANGED
@@ -6,6 +6,13 @@ const pkg = require('../core/pkg.js');
6
6
  function task() {
7
7
  const state = 'present';
8
8
  const packageManager = pkg.manager(packageJson());
9
+ const baseBranch = 'main';
10
+ const packageInstall =
11
+ packageManager === 'npm'
12
+ ? `${packageManager} ci`
13
+ : packageManager === 'yarn'
14
+ ? `${packageManager} install --frozen-lockfile`
15
+ : `${packageManager} install`;
9
16
  githubCI.workflow({
10
17
  name: 'node.js.yml',
11
18
  state,
@@ -14,10 +21,10 @@ function task() {
14
21
  ...config,
15
22
  on: {
16
23
  push: {
17
- branches: ['main'],
24
+ branches: [baseBranch],
18
25
  },
19
26
  pull_request: {
20
- branches: ['main'],
27
+ branches: [baseBranch],
21
28
  },
22
29
  },
23
30
  jobs: {
@@ -34,7 +41,7 @@ function task() {
34
41
  cache: packageManager,
35
42
  },
36
43
  },
37
- { run: `${packageManager} install` },
44
+ { run: packageInstall },
38
45
  { run: `${packageManager} run build` },
39
46
  { run: `${packageManager} validate` },
40
47
  ],
package/ci/gitlab.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable global-require, sort-keys-fix/sort-keys-fix */
2
- const path = require('path');
2
+ const path = require('node:path');
3
3
  const { yaml } = require('mrm-core');
4
4
 
5
5
  /** @type {typeof import('sync-directory')['default']} */
@@ -23,7 +23,10 @@ function createCommitLint({ commitLintPreset: commitLintPresetDefault }) {
23
23
  state: gitPresent ? 'present' : 'absent',
24
24
  });
25
25
 
26
- vscodeRecommendedExtension(['seatonjiang.gitmoji-vscode']);
26
+ vscodeRecommendedExtension({
27
+ name: 'seatonjiang.gitmoji-vscode',
28
+ state: gitPresent ? 'present' : 'absent',
29
+ });
27
30
  }
28
31
 
29
32
  task.description = 'Setup CommitLint';
package/config.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "gitignore",
5
5
  "project",
6
6
  "contributing",
7
- "license",
7
+ "licenses",
8
8
  "release",
9
9
  "ci",
10
10
  "lang",
@@ -1,4 +1,4 @@
1
- const path = require('path');
1
+ const path = require('node:path');
2
2
  const { file } = require('mrm-core');
3
3
 
4
4
  function task() {
package/core/githooks.js CHANGED
@@ -1,5 +1,5 @@
1
- const { execSync } = require('child_process');
2
- const path = require('path');
1
+ const { execSync } = require('node:child_process');
2
+ const path = require('node:path');
3
3
  const { file, packageJson, makeDirs } = require('mrm-core');
4
4
  const project = require('./project.js');
5
5
  const npm = require('./npm.js');
package/core/githubCI.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const { yaml } = require('mrm-core');
2
- const path = require('path');
3
- const fs = require('fs');
2
+ const path = require('node:path');
3
+ const fs = require('node:fs');
4
4
 
5
5
  const FILE_PATH = '.github/workflows';
6
6
 
package/core/pkg.js CHANGED
@@ -5,7 +5,7 @@
5
5
  const { intersect } = require('semver-intersect');
6
6
  const { packageJson, file, json } = require('mrm-core');
7
7
  const glob = require('glob');
8
- const path = require('path');
8
+ const path = require('node:path');
9
9
  const jsonFile = require('./jsonFile.js');
10
10
 
11
11
  /**
@@ -136,7 +136,7 @@ function hasDependency(packageFile, packageName, dependencyType) {
136
136
 
137
137
  /**
138
138
  *
139
- * @param {import('mrm-core').PackageJson} packageFile
139
+ * @param {import('mrm-core').Json} packageFile
140
140
  * @param {Record<string, string>} engineVersionMap
141
141
  */
142
142
  function engineMinVersion(packageFile, engineVersionMap) {
package/core/vscode.js CHANGED
@@ -1,13 +1,23 @@
1
1
  const { json } = require('mrm-core');
2
2
 
3
3
  /**
4
- * @param {Array<string>} recommendations
4
+ * @param {{
5
+ * name: string,
6
+ * state: 'present'|'absent',
7
+ * }} recommendation
5
8
  */
6
- function vscodeRecommendedExtension(recommendations) {
9
+ function vscodeRecommendedExtension(recommendation) {
7
10
  const packageFile = json('.vscode/extensions.json');
8
- packageFile.merge({
9
- recommendations,
10
- });
11
+ if (recommendation.state === 'present') {
12
+ packageFile.merge({
13
+ recommendations: [recommendation.name],
14
+ });
15
+ } else {
16
+ packageFile.set(
17
+ 'recommendations',
18
+ packageFile.get('recommendations', []).filter((/** @type {string} */ _) => _ !== recommendation.name)
19
+ );
20
+ }
11
21
  packageFile.save();
12
22
  }
13
23
  exports.vscodeRecommendedExtension = vscodeRecommendedExtension;
@@ -43,7 +43,10 @@ function createEditorConfig(defaults) {
43
43
 
44
44
  editorConfigFile.save();
45
45
 
46
- vscodeRecommendedExtension(['editorconfig.editorconfig']);
46
+ vscodeRecommendedExtension({
47
+ name: 'editorconfig.editorconfig',
48
+ state: 'present',
49
+ });
47
50
  }
48
51
 
49
52
  task.description = 'Adds EditorConfig file';
package/eslint/index.js CHANGED
@@ -4,7 +4,7 @@ const npm = require('../core/npm.js');
4
4
  const { gitIgnore } = require('../core/git.js');
5
5
  const { eslintIgnore, eslintConfig } = require('../core/eslint.js');
6
6
  const project = require('../core/project.js');
7
- const { vscodeSettings } = require('../core/vscode.js');
7
+ const { vscodeSettings, vscodeRecommendedExtension } = require('../core/vscode.js');
8
8
 
9
9
  function createESLint({ eslintPreset: eslintPresetDefault = 'eslint:recommended' }) {
10
10
  /**
@@ -28,7 +28,6 @@ function createESLint({ eslintPreset: eslintPresetDefault = 'eslint:recommended'
28
28
  'coverage/',
29
29
  'build/',
30
30
  '.cache/',
31
- '**/tsconfig.json',
32
31
  '.vscode/**',
33
32
  'public/',
34
33
  ]);
@@ -131,6 +130,10 @@ function createESLint({ eslintPreset: eslintPresetDefault = 'eslint:recommended'
131
130
  });
132
131
 
133
132
  // VSCode support
133
+ vscodeRecommendedExtension({
134
+ name: 'dbaeumer.vscode-eslint',
135
+ state: 'present',
136
+ });
134
137
  vscodeSettings({
135
138
  state: 'present',
136
139
  update: (settings) => ({
package/githooks/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const path = require('path');
1
+ const path = require('node:path');
2
2
  const { packageJson, template } = require('mrm-core');
3
3
  const project = require('../core/project.js');
4
4
  const pkg = require('../core/pkg.js');
package/lang/index.js CHANGED
@@ -1,10 +1,10 @@
1
- const path = require('path');
1
+ const path = require('node:path');
2
2
  const { json, file, template, packageJson } = require('mrm-core');
3
3
  const npm = require('../core/npm.js');
4
4
  const { gitIgnore } = require('../core/git.js');
5
5
  const project = require('../core/project.js');
6
6
  const { eslintIgnore } = require('../core/eslint.js');
7
- const { typedoc } = require('../core/typedoc.js');
7
+ // const { typedoc } = require('../core/typedoc.js');
8
8
  const pkg = require('../core/pkg.js');
9
9
 
10
10
  /**
@@ -66,7 +66,7 @@ function createLang({ language: languageDefault = 'typescript', tsConfig: tsConf
66
66
  rootDir: './src',
67
67
  },
68
68
  extends: `./${tsConfigSettingsName}`,
69
- include: ['./src'],
69
+ include: ['src'],
70
70
  })
71
71
  .save();
72
72
 
@@ -103,29 +103,29 @@ function createLang({ language: languageDefault = 'typescript', tsConfig: tsConf
103
103
  state: 'present',
104
104
  });
105
105
 
106
- typedoc({
107
- state: 'present',
108
- update: (config) => ({
109
- // Default values
110
- tsconfig: 'tsconfig.json',
111
- excludePrivate: true,
112
- excludeExternals: true,
113
- readme: 'README.md',
114
- theme: 'default',
115
- // Inherits current
116
- ...config,
117
- // Force values
118
- out: 'public',
119
- exclude: [
120
- '**/build/**/*',
121
- '**/example/**/*',
122
- '**/lib/**/*',
123
- '**/node_modules/**',
124
- '**/__tests__/*.(ts|tsx)',
125
- '**/*.(spec|test).(ts|tsx)',
126
- ],
127
- }),
128
- });
106
+ // typedoc({
107
+ // state: isApplication ? 'absent' : 'present',
108
+ // update: (config) => ({
109
+ // // Default values
110
+ // tsconfig: 'tsconfig.json',
111
+ // excludePrivate: true,
112
+ // excludeExternals: true,
113
+ // readme: 'README.md',
114
+ // theme: 'default',
115
+ // // Inherits current
116
+ // ...config,
117
+ // // Force values
118
+ // out: 'public',
119
+ // exclude: [
120
+ // '**/build/**/*',
121
+ // '**/example/**/*',
122
+ // '**/lib/**/*',
123
+ // '**/node_modules/**',
124
+ // '**/__tests__/*.(ts|tsx)',
125
+ // '**/*.(spec|test).(ts|tsx)',
126
+ // ],
127
+ // }),
128
+ // });
129
129
  };
130
130
 
131
131
  task.description = 'Setup Programming Language';
@@ -1,3 +1,4 @@
1
+ import { describe, test, expect } from '@jest/globals'
1
2
  import { main } from '.';
2
3
 
3
4
  describe('index', () => {
@@ -2,5 +2,4 @@ export async function main(): Promise<void> {
2
2
  // TODO
3
3
  }
4
4
 
5
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
6
- main();
5
+ await main();
@@ -0,0 +1,26 @@
1
+ const { packageJson } = require('mrm-core');
2
+ const pkg = require('../core/pkg.js');
3
+ const jsonFile = require('../core/jsonFile.js');
4
+
5
+ function task() {
6
+ pkg.withPackageJson((packageFile) => {
7
+ jsonFile.value(packageFile, {
8
+ path: 'license',
9
+ state: 'present',
10
+ default: 'UNLICENSED',
11
+ });
12
+ });
13
+ const license = packageJson().get('license');
14
+
15
+ pkg.forEachWorkspace(({ packageFile }) => {
16
+ jsonFile.value(packageFile, {
17
+ path: 'license',
18
+ state: 'present',
19
+ default: license,
20
+ });
21
+ });
22
+ }
23
+
24
+ task.description = 'Setup License';
25
+ task.parameters = {};
26
+ module.exports = task;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/mrm-preset",
3
- "version": "1.0.0-alpha.19",
3
+ "version": "1.0.0-alpha.22",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "license": "MIT",
20
20
  "author": "Julien Polo <julien.polo@gmail.com>",
21
+ "type": "commonjs",
21
22
  "main": "config.json",
22
23
  "scripts": {
23
24
  "build": "concurrently \"npm:build:*\" ",
@@ -41,15 +42,14 @@
41
42
  "sync-directory": "^5.0.0"
42
43
  },
43
44
  "devDependencies": {
44
- "@types/debug": "^4.1.7",
45
- "mrm": "4.0.0"
45
+ "@types/debug": "4.1.7",
46
+ "mrm": "4.1.0"
46
47
  },
47
48
  "engines": {
48
- "node": ">=16.x",
49
- "yarn": ">=1.x"
49
+ "node": ">=16.0.0"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public"
53
53
  },
54
- "gitHead": "f83a12bd102dc01498ec2ea00344a0fef14f9d69"
54
+ "gitHead": "75cfedc045da9b86c0009201f837e2d200bd19f0"
55
55
  }
@@ -1,4 +1,4 @@
1
- const { spawnSync } = require('child_process');
1
+ 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');
package/project/index.js CHANGED
@@ -2,6 +2,7 @@ const { dirname } = require('node:path');
2
2
  const { packageJson, json, makeDirs } = require('mrm-core');
3
3
  const git = require('../core/git.js');
4
4
  const pkg = require('../core/pkg.js');
5
+ const jsonFile = require('../core/pkg.js');
5
6
  const npm = require('../core/npm.js');
6
7
  const { vscodeTask } = require('../core/vscode.js');
7
8
  const project = require('../core/project.js');
@@ -54,6 +55,20 @@ function task() {
54
55
  makeDirs(dirs);
55
56
  }
56
57
 
58
+ const setDefault = (/** @type {import("mrm-core").Json} */ currentPackageFile, /** @type {boolean} */ _root) => {
59
+ jsonFile.value(currentPackageFile, {
60
+ path: undefined,
61
+ state: 'present',
62
+ update: (content) => ({
63
+ type: 'module',
64
+ license: 'UNLICENSED',
65
+ version: '1.0.0-alpha.0',
66
+ description: '',
67
+ ...content,
68
+ }),
69
+ default: {},
70
+ });
71
+ };
57
72
  const addScripts = (/** @type {import("mrm-core").Json} */ currentPackageFile, /** @type {boolean} */ root) => {
58
73
  const useWorkspace = pkg.hasWorkspaces(currentPackageFile);
59
74
 
@@ -157,6 +172,7 @@ function task() {
157
172
  : undefined,
158
173
  });
159
174
 
175
+ setDefault(packageFile, false);
160
176
  addScripts(packageFile, true);
161
177
 
162
178
  pkg.script(packageFile, {
@@ -181,7 +197,11 @@ function task() {
181
197
  }
182
198
  : undefined,
183
199
  });
200
+ setDefault(workspace.packageFile, false);
184
201
  addScripts(workspace.packageFile, false);
202
+
203
+ // Engine
204
+ pkg.engineMinVersion(workspace.packageFile, { node: rootEngineMinVersion.node });
185
205
  });
186
206
 
187
207
  // workspace