@w5s/mrm-preset 2.1.0 → 2.2.0

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,6 +1,6 @@
1
1
  [1] : exited with code 0
2
2
  [tsc]
3
- [tsc] > @w5s/mrm-preset@2.0.0 build:tsc
3
+ [tsc] > @w5s/mrm-preset@2.1.1 build:tsc
4
4
  [tsc] > tsc --noEmit --skipLibCheck
5
5
  [tsc]
6
6
  [tsc] npm run build:tsc exited with code 0
@@ -1,6 +1,6 @@
1
1
  [1] : exited with code 0
2
2
  [src]
3
- [src] > @w5s/mrm-preset@2.0.0 format:src
3
+ [src] > @w5s/mrm-preset@2.1.1 format:src
4
4
  [src] > eslint . --fix --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml
5
5
  [src]
6
6
  [src] npm run format:src exited with code 0
@@ -1,6 +1,6 @@
1
1
  [1] : exited with code 0
2
2
  [src]
3
- [src] > @w5s/mrm-preset@2.0.0 lint:src
3
+ [src] > @w5s/mrm-preset@2.1.1 lint:src
4
4
  [src] > eslint . --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml
5
5
  [src]
6
6
  [src] npm run lint:src exited with code 0
@@ -1,6 +1 @@
1
- [1] : exited with code 0
2
- [template]
3
- [template] > @w5s/mrm-preset@2.1.0 prepare:template
4
- [template] > cp ../../.editorconfig editorconfig/_editorconfig
5
- [template]
6
- [template] npm run prepare:template exited with code 0
1
+ [0] : exited with code 0
@@ -1,6 +1,6 @@
1
1
  [1] : exited with code 0
2
2
  [script]
3
- [script] > @w5s/mrm-preset@2.0.0 test:script
3
+ [script] > @w5s/mrm-preset@2.1.1 test:script
4
4
  [script] > mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir ..
5
5
  [script]
6
6
  [script] mkdir: _tester: File exists
@@ -8,20 +8,16 @@
8
8
  [script] Running alias configure...
9
9
  [script] Running gitignore...
10
10
  [script] Running project...
11
- [script] Update turbo.json
12
11
  [script] Running contributing...
13
12
  [script] Running licenses...
14
13
  [script] Running asdf...
15
14
  [script] Running release...
16
15
  [script] Running ci...
17
16
  [script] Running lang...
18
- [script] Update tsconfig.json
19
17
  [script] Running commitlint...
20
- [script] Update .vscode/extensions.json
21
18
  [script] Running editorconfig...
22
19
  [script] Running eslint...
23
20
  [script] Running cspell...
24
- [script] Update .cspell.json
25
21
  [script] Running vitest...
26
22
  [script] Running renovate...
27
23
  [script] Running githooks...
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
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
+ # [2.2.0](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@2.1.1...@w5s/mrm-preset@2.2.0) (2023-10-15)
7
+
8
+ ### ✨ Features
9
+
10
+ - Improve editorconfig file ([443848c](https://github.com/w5s/project-config/commit/443848c))
11
+ - Improve gitignore generation ([f180f40](https://github.com/w5s/project-config/commit/f180f40))
12
+
13
+ ### 🐛 Bug Fixes
14
+
15
+ - Move editorconfig managed to beginning of file ([174d200](https://github.com/w5s/project-config/commit/174d200))
16
+ - Remove trailing new end line ([68edf14](https://github.com/w5s/project-config/commit/68edf14))
17
+ - Use checkout@v4 action ([e6ab4a7](https://github.com/w5s/project-config/commit/e6ab4a7))
18
+
19
+ **Note:** Version bump only for package @w5s/mrm-preset
20
+
21
+ ## [2.1.1](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@2.1.0...@w5s/mrm-preset@2.1.1) (2023-10-15)
22
+
23
+ **Note:** Version bump only for package @w5s/mrm-preset
24
+
6
25
  # [2.1.0](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@2.0.0...@w5s/mrm-preset@2.1.0) (2023-10-15)
7
26
 
8
27
  ### ✨ Features
@@ -2,7 +2,7 @@ const path = require('node:path');
2
2
  const { packageJson } = require('mrm-core');
3
3
  const npm = require('../core/npm.js');
4
4
  const pkg = require('../core/pkg.js');
5
- const { gitIgnoreTemplate } = require('../core/git.js');
5
+ const { gitIgnore } = require('../core/git.js');
6
6
 
7
7
  /**
8
8
  * @param {{
@@ -25,7 +25,7 @@ function task({ mrmPreset, mrmTask, packageManager }) {
25
25
  license: 'UNLICENSED',
26
26
  description: '',
27
27
  }).save();
28
- gitIgnoreTemplate(['macOS', 'NodeJS', 'VisualStudioCode']);
28
+ gitIgnore(['macOS', 'NodeJS', 'VisualStudioCode']);
29
29
 
30
30
  npm.bootstrap(packageManager);
31
31
 
package/ci/github.js CHANGED
@@ -32,7 +32,7 @@ function task() {
32
32
  build: {
33
33
  'runs-on': 'ubuntu-latest',
34
34
  steps: [
35
- { uses: 'actions/checkout@v3' },
35
+ { uses: 'actions/checkout@v4' },
36
36
  { uses: 'dtinth/setup-github-actions-caching-for-turbo@v1' },
37
37
  {
38
38
  uses: 'actions/setup-node@v3',
package/core/git.js CHANGED
@@ -33,31 +33,36 @@ function trimStartLine(content) {
33
33
  .join('\n');
34
34
  }
35
35
 
36
- /**
37
- * @param {string} section
38
- * @param {string|Array<string>} sectionContent
39
- */
40
- function gitIgnore(section, sectionContent) {
41
- const EOL = '\n';
36
+ const header = `
37
+ #==================================================================================================
38
+ # ┓ ┏┏━┏┓
39
+ # ┃┃┃┗┓┗┓
40
+ # ┗┻┛┗┛┗┛
41
+ #
42
+ # W5s default gitignore
43
+ #
44
+ # ⚠️ THIS IS A GENERATED FILE, SEE THE END OF FILE FOR EDITION
45
+ #
46
+ #==================================================================================================
47
+ `.slice(1, -1);
42
48
 
43
- return blockSync({
44
- block: Array.isArray(sectionContent) ? sectionContent.join(EOL) : trimStartLine(sectionContent),
45
- marker: (mark) => `# ${mark.toUpperCase()} ### ${section} ###`,
46
- path: '.gitignore',
47
- });
48
- }
49
- exports.gitIgnore = gitIgnore;
49
+ const footer = `
50
+ #==================================================================================================
51
+ # ⬇ Add Project specific rules below
52
+ #==================================================================================================
53
+ `.slice(1, -1);
50
54
 
51
55
  /**
52
56
  * @param {string[]} flags
53
57
  */
54
- function gitIgnoreTemplate(flags) {
55
- flags.forEach((flag) => {
56
- // @ts-ignore
57
- if (templateMap[flag]) {
58
- // @ts-ignore
59
- gitIgnore(flag, templateMap[flag]);
60
- }
58
+ function gitIgnore(flags) {
59
+ // @ts-ignore
60
+ const templateContent = [header, ...flags.map((flag) => trimStartLine(templateMap[flag] ?? '')), footer].join('\n');
61
+
62
+ blockSync({
63
+ block: templateContent,
64
+ path: '.gitignore',
65
+ insertPosition: ['before', 'BeginningOfFile'],
61
66
  });
62
67
  }
63
- exports.gitIgnoreTemplate = gitIgnoreTemplate;
68
+ exports.gitIgnore = gitIgnore;
@@ -1,4 +1,15 @@
1
- # BEGIN MANAGED BLOCK
1
+ #==================================================================================================
2
+ # ┓ ┏┏━┏┓
3
+ # ┃┃┃┗┓┗┓
4
+ # ┗┻┛┗┛┗┛
5
+ #
6
+ # W5s default editorconfig
7
+ #
8
+ # ⚠️ THIS IS A GENERATED FILE, SEE THE END OF FILE FOR EDITION
9
+ #
10
+ # Generated from https://github.com/w5s/project-config/blob/main/packages/mrm-preset/editorconfig/_editorconfig
11
+ #==================================================================================================
12
+
2
13
  # http://editorconfig.org
3
14
  root = true
4
15
 
@@ -59,4 +70,6 @@ indent_style = space
59
70
  [{Makefile,**.mk,**.make}]
60
71
  indent_style = tab
61
72
 
62
- # END MANAGED BLOCK
73
+ #==================================================================================================
74
+ # ⬇ Add Project specific rules below ⬇
75
+ #==================================================================================================
@@ -3,12 +3,12 @@ const { blockSync } = require('@w5s/dev');
3
3
  const { vscodeRecommendedExtension } = require('../core/vscode.js');
4
4
 
5
5
  function task() {
6
- const templateContent = readFileSync(require.resolve('./_editorconfig'), 'utf8');
6
+ const templateContent = readFileSync(require.resolve('./_editorconfig'), 'utf8').slice(0, -1);
7
7
 
8
8
  blockSync({
9
9
  block: templateContent,
10
10
  path: '.editorconfig',
11
- insertPosition: ['after', 'EndOfFile'],
11
+ insertPosition: ['before', 'BeginningOfFile'],
12
12
  });
13
13
 
14
14
  vscodeRecommendedExtension({
package/eslint/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  const { packageJson } = require('mrm-core');
2
2
  const pkg = require('../core/pkg.js');
3
3
  const npm = require('../core/npm.js');
4
- const { gitIgnore } = require('../core/git.js');
5
4
  const { eslintConfig } = require('../core/eslint.js');
6
5
  const project = require('../core/project.js');
7
6
  const { vscodeSettings, vscodeRecommendedExtension } = require('../core/vscode.js');
@@ -21,9 +20,6 @@ function createESLint({ eslintPreset: eslintPresetDefault = 'eslint:recommended'
21
20
  const hasJSON = true;
22
21
  const hasYAML = true;
23
22
 
24
- // Should be added first
25
- gitIgnore('ESLint', ['.eslintcache']);
26
-
27
23
  // Dependencies
28
24
  npm.dependency({
29
25
  dev: true,
@@ -1,7 +1,7 @@
1
- const { gitIgnoreTemplate } = require('../core/git.js');
1
+ const { gitIgnore } = require('../core/git.js');
2
2
 
3
3
  function task() {
4
- gitIgnoreTemplate(['macOS', 'NodeJS', 'VisualStudioCode']);
4
+ gitIgnore(['macOS', 'NodeJS', 'VisualStudioCode']);
5
5
  }
6
6
  task.description = 'Adds Gitignore file';
7
7
 
package/lang/index.js CHANGED
@@ -1,7 +1,6 @@
1
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
- const { gitIgnore } = require('../core/git.js');
5
4
  const project = require('../core/project.js');
6
5
  // const { typedoc } = require('../core/typedoc.js');
7
6
  const pkg = require('../core/pkg.js');
@@ -32,9 +31,6 @@ function createLang({ language: languageDefault = 'typescript', tsConfig: tsConf
32
31
  const tsConfigSettings = json(tsConfigSettingsName);
33
32
  const tsConfig = json('tsconfig.json');
34
33
 
35
- // Should be run first
36
- gitIgnore('Typescript', ['lib/', 'dist/', '*.tsbuildinfo', 'typings/']);
37
-
38
34
  // const excludeList = ['**/*.test.*', '**/*.spec.*', '**/__tests__/**'];
39
35
  if (hasWorkspaces) {
40
36
  tsConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/mrm-preset",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "47a30a8316d1991e5afff4356b377b34f8f33043"
40
+ "gitHead": "b6025c8720d5f700b477d5d144dc6865a29f9f15"
41
41
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/mrm-preset",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -32,7 +32,6 @@
32
32
  "postpack": "npx clean-package restore",
33
33
  "prepack": "npx clean-package",
34
34
  "prepare": "concurrently \"npm:prepare:*\" \":\"",
35
- "prepare:template": "cp ../../.editorconfig editorconfig/_editorconfig",
36
35
  "spellcheck": "cspell --no-progress '**'",
37
36
  "test": "concurrently \"npm:test:*\" \":\"",
38
37
  "test:script": "mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir .."
@@ -57,5 +56,5 @@
57
56
  "publishConfig": {
58
57
  "access": "public"
59
58
  },
60
- "gitHead": "47a30a8316d1991e5afff4356b377b34f8f33043"
59
+ "gitHead": "b6025c8720d5f700b477d5d144dc6865a29f9f15"
61
60
  }