@w5s/mrm-preset 3.5.7 → 3.5.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.
Files changed (46) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +12 -14
  3. package/.turbo/turbo-test.log +23 -258
  4. package/CHANGELOG.md +4 -0
  5. package/asdf/{index.js → index.cjs} +1 -1
  6. package/bootstrap/{index.js → index.cjs} +11 -10
  7. package/ci/_gitlab/Renovate.gitlab-ci.yml +1 -1
  8. package/ci/{github.js → github.cjs} +10 -10
  9. package/ci/{gitlab.js → gitlab.cjs} +1 -2
  10. package/ci/{index.js → index.cjs} +4 -4
  11. package/commitlint/{index.js → index.cjs} +3 -3
  12. package/core/{commitlint.js → commitlint.cjs} +5 -5
  13. package/core/{cspell.js → cspell.cjs} +5 -4
  14. package/core/{eslint.js → eslint.cjs} +5 -4
  15. package/core/{git.js → git.cjs} +4 -3
  16. package/core/{githooks.js → githooks.cjs} +3 -3
  17. package/core/{jest.js → jest.cjs} +11 -10
  18. package/core/{jsonFile.js → jsonFile.cjs} +1 -1
  19. package/core/{lintStaged.js → lintStaged.cjs} +4 -4
  20. package/core/{npm.js → npm.cjs} +204 -205
  21. package/core/{pkg.js → pkg.cjs} +70 -69
  22. package/core/{semanticRelease.js → semanticRelease.cjs} +7 -7
  23. package/core/{turbo.js → turbo.cjs} +5 -4
  24. package/core/{typedoc.js → typedoc.cjs} +9 -8
  25. package/core/{vitest.js → vitest.cjs} +8 -7
  26. package/core/{vscode.js → vscode.cjs} +1 -1
  27. package/cspell/{index.js → index.cjs} +7 -7
  28. package/editorconfig/{index.js → index.cjs} +4 -3
  29. package/eslint/{index.js → index.cjs} +10 -9
  30. package/githooks/{index.js → index.cjs} +12 -11
  31. package/gitignore/{index.js → index.cjs} +1 -1
  32. package/lang/{index.js → index.cjs} +4 -4
  33. package/licenses/{index.js → index.cjs} +5 -4
  34. package/package.json +4 -4
  35. package/package.json.backup +9 -9
  36. package/post-configure/{index.js → index.cjs} +5 -4
  37. package/project/{index.js → index.cjs} +64 -63
  38. package/release/{index.js → index.cjs} +6 -5
  39. package/renovate/{index.js → index.cjs} +3 -2
  40. package/vitest/{index.js → index.cjs} +1 -1
  41. package/contributing/{index.js → index.cjs} +1 -1
  42. package/core/{asdf.js → asdf.cjs} +0 -0
  43. package/core/{git.ignore.js → git.ignore.cjs} +27 -27
  44. package/core/{githubCI.js → githubCI.cjs} +2 -2
  45. package/core/{gitlabCI.js → gitlabCI.cjs} +0 -0
  46. package/core/{project.js → project.cjs} +8 -8
@@ -1,13 +1,14 @@
1
+ const { json, makeDirs, packageJson } = require('mrm-core');
1
2
  const nodePath = require('node:path');
2
- const { packageJson, json, makeDirs } = require('mrm-core');
3
- const git = require('../core/git.js');
4
- const pkg = require('../core/pkg.js');
5
- const jsonFile = require('../core/pkg.js');
6
- const npm = require('../core/npm.js');
7
- const { vscodeTask } = require('../core/vscode.js');
8
- const project = require('../core/project.js');
3
+
4
+ const git = require('../core/git.cjs');
5
+ const npm = require('../core/npm.cjs');
6
+ const pkg = require('../core/pkg.cjs');
7
+ const jsonFile = require('../core/pkg.cjs');
8
+ const project = require('../core/project.cjs');
9
+ const { turbo } = require('../core/turbo.cjs');
10
+ const { vscodeTask } = require('../core/vscode.cjs');
9
11
  const mrmPackageJson = require('../package.json');
10
- const { turbo } = require('../core/turbo.js');
11
12
 
12
13
  /**
13
14
  *
@@ -37,9 +38,9 @@ function task() {
37
38
  const rootEngineMinVersion = {
38
39
  // @ts-ignore
39
40
  node: '>=12.x',
40
- yarn: '>=1.x',
41
- pnpm: '>=10.x',
42
41
  npm: '>=6.x',
42
+ pnpm: '>=10.x',
43
+ yarn: '>=1.x',
43
44
  ...mrmPackageJson.engines,
44
45
  };
45
46
  const gitSupported = git.hasGit();
@@ -62,14 +63,14 @@ function task() {
62
63
 
63
64
  const setDefault = (/** @type {import("mrm-core").Json} */ currentPackageFile, /** @type {boolean} */ root) => {
64
65
  jsonFile.value(currentPackageFile, {
66
+ default: 'module',
65
67
  path: 'type',
66
68
  state: 'present',
67
- default: 'module',
68
69
  });
69
70
  jsonFile.value(currentPackageFile, {
71
+ default: false,
70
72
  path: 'sideEffect',
71
73
  state: 'present',
72
- default: false,
73
74
  });
74
75
  jsonFile.value(currentPackageFile, {
75
76
  path: 'license',
@@ -77,9 +78,9 @@ function task() {
77
78
  update: (_) => _ ?? (root && rootUseWorkspace ? 'UNLICENSED' : undefined),
78
79
  });
79
80
  jsonFile.value(currentPackageFile, {
81
+ default: '1.0.0-alpha.0',
80
82
  path: 'version',
81
83
  state: root && rootUseWorkspace ? 'absent' : 'present',
82
- default: '1.0.0-alpha.0',
83
84
  });
84
85
  jsonFile.value(currentPackageFile, {
85
86
  path: 'description',
@@ -93,20 +94,20 @@ function task() {
93
94
  // build
94
95
  pkg.script(currentPackageFile, {
95
96
  name: project.build,
96
- update: useWorkspace ? turboRun(project.build) : npmRunAll(project.build, true),
97
97
  state: 'present',
98
+ update: useWorkspace ? turboRun(project.build) : npmRunAll(project.build, true),
98
99
  });
99
100
 
100
101
  // lint
101
102
  pkg.script(currentPackageFile, {
102
103
  name: project.lint,
103
- update: useWorkspace ? turboRun(project.lint) : npmRunAll(project.lint, true),
104
104
  state: 'present',
105
+ update: useWorkspace ? turboRun(project.lint) : npmRunAll(project.lint, true),
105
106
  });
106
107
  pkg.script(currentPackageFile, {
107
108
  name: project.format,
108
- update: useWorkspace ? `${turboRun(project.format)} --continue` : npmRunAll(project.format, true),
109
109
  state: 'present',
110
+ update: useWorkspace ? `${turboRun(project.format)} --continue` : npmRunAll(project.format, true),
110
111
  });
111
112
 
112
113
  // test
@@ -116,30 +117,30 @@ function task() {
116
117
  // state: 'default',
117
118
  // });
118
119
  pkg.script(currentPackageFile, {
120
+ default: pkg.emptyScript,
119
121
  name: project.test,
120
- update: useWorkspace ? turboRun(project.test) : npmRunAll(project.test, true),
121
122
  state: 'present',
122
- default: pkg.emptyScript,
123
+ update: useWorkspace ? turboRun(project.test) : npmRunAll(project.test, true),
123
124
  });
124
125
  pkg.script(currentPackageFile, {
126
+ default: pkg.emptyScript,
125
127
  name: project.typecheck,
126
- update: useWorkspace ? turboRun(project.typecheck) : npmRunAll(project.typecheck, true),
127
128
  state: 'present',
128
- default: pkg.emptyScript,
129
+ update: useWorkspace ? turboRun(project.typecheck) : npmRunAll(project.typecheck, true),
129
130
  });
130
131
 
131
132
  // prepare
132
133
  pkg.script(currentPackageFile, {
133
134
  name: project.prepare,
134
- update: npmRunAll(project.prepare, true),
135
135
  state: 'present',
136
+ update: npmRunAll(project.prepare, true),
136
137
  });
137
138
 
138
139
  // clean
139
140
  pkg.script(currentPackageFile, {
140
141
  name: project.clean,
141
- update: useWorkspace ? turboRun(project.clean) : npmRunAll(project.clean, true),
142
142
  state: 'present',
143
+ update: useWorkspace ? turboRun(project.clean) : npmRunAll(project.clean, true),
143
144
  });
144
145
 
145
146
  // Root
@@ -147,28 +148,28 @@ function task() {
147
148
  // rescue
148
149
  pkg.script(currentPackageFile, {
149
150
  name: project.rescue,
150
- update: `${gitSupported ? 'git clean -fdx' : ''};${packageManager} install`,
151
151
  state: root ? 'present' : 'absent',
152
+ update: `${gitSupported ? 'git clean -fdx' : ''};${packageManager} install`,
152
153
  });
153
154
 
154
155
  // release
155
156
  pkg.script(currentPackageFile, {
156
- name: project.release,
157
157
  default: pkg.emptyScript,
158
+ name: project.release,
158
159
  state: root ? 'present' : 'absent',
159
160
  });
160
161
 
161
162
  // code analysis
162
163
  pkg.script(currentPackageFile, {
163
- name: project.codeAnalysis,
164
164
  default: pkg.emptyScript,
165
+ name: project.codeAnalysis,
165
166
  state: root ? 'present' : 'absent',
166
167
  });
167
168
 
168
169
  // develop & auto build & load
169
170
  pkg.script(currentPackageFile, {
170
- name: project.develop,
171
171
  default: pkg.emptyScript,
172
+ name: project.develop,
172
173
  state: root ? 'present' : 'absent',
173
174
  });
174
175
 
@@ -205,8 +206,8 @@ function task() {
205
206
 
206
207
  pkg.script(packageFile, {
207
208
  name: project.validate,
208
- update: turboRun([project.build, project.lint, project.test, project.typecheck, project.spellcheck].join(' ')),
209
209
  state: 'present',
210
+ update: turboRun([project.build, project.lint, project.test, project.typecheck, project.spellcheck].join(' ')),
210
211
  });
211
212
 
212
213
  // Engine
@@ -219,9 +220,9 @@ function task() {
219
220
  update: () =>
220
221
  (gitRepository
221
222
  ? {
223
+ directory: workspace.projectDir,
222
224
  type: 'git',
223
225
  url: gitRepository,
224
- directory: workspace.projectDir,
225
226
  }
226
227
  : undefined),
227
228
  });
@@ -234,8 +235,8 @@ function task() {
234
235
 
235
236
  // workspace
236
237
  npm.dependency({
237
- state: rootUseWorkspace ? 'present' : 'absent',
238
238
  name: ['@lerna-lite/publish'],
239
+ state: rootUseWorkspace ? 'present' : 'absent',
239
240
  });
240
241
  const lernaConfig = json('lerna.json', {
241
242
  version: rootPackageFile.get('version'),
@@ -246,6 +247,7 @@ function task() {
246
247
 
247
248
  lernaConfig.merge({
248
249
  $schema: 'https://json.schemastore.org/lerna.json',
250
+ changelogPreset: '@w5s/conventional-changelog',
249
251
  command: {
250
252
  publish: {
251
253
  conventionalCommits: true,
@@ -258,7 +260,6 @@ function task() {
258
260
  },
259
261
  },
260
262
  npmClient: packageManager,
261
- changelogPreset: '@w5s/conventional-changelog',
262
263
  });
263
264
  lernaConfig.save();
264
265
  } else {
@@ -280,64 +281,64 @@ function task() {
280
281
  state: 'present',
281
282
  update: (_) => ({
282
283
  ..._,
284
+ globalDependencies: ['.tool-versions', 'tsconfig.settings.json', '**/.env.*local', '.env'],
283
285
  // eslint-disable-next-line unicorn/no-array-sort
284
286
  globalEnv: [...new Set([...(_.globalEnv ?? []), 'ASDF_*', 'CI', 'DATABASE_URL', 'NODE_ENV'])].sort((left, right) => left.localeCompare(right)),
285
- globalDependencies: ['.tool-versions', 'tsconfig.settings.json', '**/.env.*local', '.env'],
286
287
  tasks: {
287
288
  ..._.tasks,
288
- [project.build]: {
289
- dependsOn: [`^${project.build}`, `//#${project.build}:root`],
290
- inputs: packageInputs,
291
- outputs: ['dist/**', '.next/**', '!.next/cache/**'],
292
- },
293
289
  [`//#${project.build}:root`]: {
294
290
  inputs: rootInputs,
295
291
  },
296
- [project.test]: {
297
- dependsOn: [`^${project.build}`, `//#${project.test}:root`],
292
+ [`//#${project.clean}:root`]: {
293
+ cache: false,
298
294
  },
299
- [`//#${project.test}:root`]: {
295
+ [`//#${project.docs}:root`]: {
300
296
  inputs: rootInputs,
301
297
  },
302
- [project.typecheck]: {
303
- dependsOn: [project.build, `^${project.build}`],
304
- },
305
- [project.lint]: {
306
- dependsOn: [`^${project.build}`, `//#${project.lint}:root`],
298
+ [`//#${project.format}:root`]: {
299
+ inputs: rootInputs,
307
300
  },
308
301
  [`//#${project.lint}:root`]: {
309
302
  inputs: rootInputs,
310
303
  },
311
- [project.prepare]: {},
312
- [project.format]: {
313
- dependsOn: [`//#${project.format}:root`],
314
- },
315
- [`//#${project.format}:root`]: {
304
+ [`//#${project.spellcheck}:root`]: {
316
305
  inputs: rootInputs,
317
306
  },
318
- [project.docs]: {
319
- dependsOn: [`//#${project.docs}:root`],
320
- cache: false,
321
- },
322
- [`//#${project.docs}:root`]: {
307
+ [`//#${project.test}:root`]: {
323
308
  inputs: rootInputs,
324
309
  },
325
- [project.spellcheck]: {
326
- dependsOn: [`//#${project.spellcheck}:root`],
327
- },
328
- [`//#${project.spellcheck}:root`]: {
329
- inputs: rootInputs,
310
+ [project.build]: {
311
+ dependsOn: [`^${project.build}`, `//#${project.build}:root`],
312
+ inputs: packageInputs,
313
+ outputs: ['dist/**', '.next/**', '!.next/cache/**'],
330
314
  },
331
315
  [project.clean]: {
332
- dependsOn: [`//#${project.clean}:root`],
333
- cache: false,
334
- },
335
- [`//#${project.clean}:root`]: {
336
316
  cache: false,
317
+ dependsOn: [`//#${project.clean}:root`],
337
318
  },
338
319
  [project.develop]: {
320
+ cache: false,
339
321
  persistent: true,
322
+ },
323
+ [project.docs]: {
340
324
  cache: false,
325
+ dependsOn: [`//#${project.docs}:root`],
326
+ },
327
+ [project.format]: {
328
+ dependsOn: [`//#${project.format}:root`],
329
+ },
330
+ [project.lint]: {
331
+ dependsOn: [`^${project.build}`, `//#${project.lint}:root`],
332
+ },
333
+ [project.prepare]: {},
334
+ [project.spellcheck]: {
335
+ dependsOn: [`//#${project.spellcheck}:root`],
336
+ },
337
+ [project.test]: {
338
+ dependsOn: [`^${project.build}`, `//#${project.test}:root`],
339
+ },
340
+ [project.typecheck]: {
341
+ dependsOn: [project.build, `^${project.build}`],
341
342
  },
342
343
  },
343
344
  }),
@@ -1,7 +1,8 @@
1
1
  const { packageJson } = require('mrm-core');
2
- const pkg = require('../core/pkg.js');
3
- const project = require('../core/project.js');
4
- const { semanticRelease } = require('../core/semanticRelease.js');
2
+
3
+ const pkg = require('../core/pkg.cjs');
4
+ const project = require('../core/project.cjs');
5
+ const { semanticRelease } = require('../core/semanticRelease.cjs');
5
6
 
6
7
  function task() {
7
8
  const useWorkspace = pkg.hasWorkspaces(packageJson());
@@ -10,17 +11,17 @@ function task() {
10
11
  /* eslint-disable no-template-curly-in-string */
11
12
  pkg.script(packageFile, {
12
13
  name: project.release,
14
+ state: 'present',
13
15
  update: useWorkspace
14
16
  ? '[ -n "${CI:-}" ] && npx lerna publish --yes || npx lerna publish'
15
17
  : semanticRelease.command(),
16
- state: 'present',
17
18
  });
18
19
  });
19
20
 
20
21
  // Dependencies
21
22
  semanticRelease({
22
- state: useWorkspace ? 'absent' : 'present',
23
23
  preset: '@semantic-release/gitlab-config', // TODO: cherry pick plugins depending on context (github, gitlab, etc)
24
+ state: useWorkspace ? 'absent' : 'present',
24
25
  });
25
26
  }
26
27
 
@@ -1,6 +1,7 @@
1
1
  const { json, packageJson } = require('mrm-core');
2
- const { hasGit } = require('../core/git.js');
3
- const pkg = require('../core/pkg.js');
2
+
3
+ const { hasGit } = require('../core/git.cjs');
4
+ const pkg = require('../core/pkg.cjs');
4
5
 
5
6
  /**
6
7
  *
@@ -1,4 +1,4 @@
1
- const { vitest } = require('../core/vitest.js');
1
+ const { vitest } = require('../core/vitest.cjs');
2
2
 
3
3
  /**
4
4
  *
@@ -1,5 +1,5 @@
1
- const path = require('node:path');
2
1
  const { file } = require('mrm-core');
2
+ const path = require('node:path');
3
3
 
4
4
  function task() {
5
5
  // code of conduct
File without changes
@@ -4,6 +4,33 @@
4
4
  // A dictionary of { tool: git_ignore_section}
5
5
 
6
6
  module.exports = {
7
+ macOS: `
8
+ # General
9
+ .DS_Store
10
+ .AppleDouble
11
+ .LSOverride
12
+
13
+ # Icon must end with two \\r
14
+ Icon
15
+
16
+ # Thumbnails
17
+ ._*
18
+
19
+ # Files that might appear in the root of a volume
20
+ .DocumentRevisions-V100
21
+ .fseventsd
22
+ .Spotlight-V100
23
+ .TemporaryItems
24
+ .Trashes
25
+ .VolumeIcon.icns
26
+ .com.apple.timemachine.donotpresent
27
+
28
+ # Directories potentially created on remote AFP share
29
+ .AppleDB
30
+ .AppleDesktop
31
+ Network Trash Folder
32
+ Temporary Items
33
+ .apdisk`,
7
34
  NodeJS: `
8
35
  # Logs
9
36
  logs
@@ -148,31 +175,4 @@ module.exports = {
148
175
  !.vscode/launch.json
149
176
  !.vscode/extensions.json
150
177
  !.vscode/*.code-snippets`,
151
- macOS: `
152
- # General
153
- .DS_Store
154
- .AppleDouble
155
- .LSOverride
156
-
157
- # Icon must end with two \\r
158
- Icon
159
-
160
- # Thumbnails
161
- ._*
162
-
163
- # Files that might appear in the root of a volume
164
- .DocumentRevisions-V100
165
- .fseventsd
166
- .Spotlight-V100
167
- .TemporaryItems
168
- .Trashes
169
- .VolumeIcon.icns
170
- .com.apple.timemachine.donotpresent
171
-
172
- # Directories potentially created on remote AFP share
173
- .AppleDB
174
- .AppleDesktop
175
- Network Trash Folder
176
- Temporary Items
177
- .apdisk`,
178
178
  };
@@ -1,6 +1,6 @@
1
- const path = require('node:path');
2
- const fs = require('node:fs');
3
1
  const { yaml } = require('mrm-core');
2
+ const fs = require('node:fs');
3
+ const path = require('node:path');
4
4
 
5
5
  const FILE_PATH = '.github/workflows';
6
6
 
File without changes
@@ -34,34 +34,34 @@ const spellcheck = 'spellcheck';
34
34
  /**
35
35
  * @param {string} taskName
36
36
  */
37
- function pre(taskName) {
38
- return `pre${taskName}`;
37
+ function post(taskName) {
38
+ return `post${taskName}`;
39
39
  }
40
40
 
41
41
  /**
42
42
  * @param {string} taskName
43
43
  */
44
- function post(taskName) {
45
- return `post${taskName}`;
44
+ function pre(taskName) {
45
+ return `pre${taskName}`;
46
46
  }
47
47
 
48
48
  module.exports = {
49
49
  build,
50
- docs,
51
- prepare,
52
- develop,
53
50
  clean,
54
51
  codeAnalysis,
55
52
  coverage,
53
+ develop,
54
+ docs,
56
55
  format,
57
56
  install,
58
57
  lint,
59
58
  post,
60
59
  pre,
60
+ prepare,
61
61
  release,
62
62
  rescue,
63
+ spellcheck,
63
64
  test,
64
65
  typecheck,
65
66
  validate,
66
- spellcheck,
67
67
  };