@w5s/mrm-preset 2.1.1 → 2.2.1

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.1.0 build:tsc
3
+ [tsc] > @w5s/mrm-preset@2.2.0 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.2.0 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,6 @@
1
1
  [1] : exited with code 0
2
2
  [script]
3
- [script] > @w5s/mrm-preset@2.1.0 test:script
3
+ [script] > @w5s/mrm-preset@2.2.0 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
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.1](https://github.com/w5s/project-config/compare/@w5s/mrm-preset@2.2.0...@w5s/mrm-preset@2.2.1) (2023-10-24)
7
+
8
+ **Note:** Version bump only for package @w5s/mrm-preset
9
+
10
+ # [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)
11
+
12
+ ### ✨ Features
13
+
14
+ - Improve editorconfig file ([443848c](https://github.com/w5s/project-config/commit/443848c))
15
+ - Improve gitignore generation ([f180f40](https://github.com/w5s/project-config/commit/f180f40))
16
+
17
+ ### 🐛 Bug Fixes
18
+
19
+ - Move editorconfig managed to beginning of file ([174d200](https://github.com/w5s/project-config/commit/174d200))
20
+ - Remove trailing new end line ([68edf14](https://github.com/w5s/project-config/commit/68edf14))
21
+ - Use checkout@v4 action ([e6ab4a7](https://github.com/w5s/project-config/commit/e6ab4a7))
22
+
23
+ **Note:** Version bump only for package @w5s/mrm-preset
24
+
6
25
  ## [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)
7
26
 
8
27
  **Note:** Version bump only for package @w5s/mrm-preset
@@ -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,3 +1,15 @@
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
+
1
13
  # http://editorconfig.org
2
14
  root = true
3
15
 
@@ -57,3 +69,7 @@ indent_style = space
57
69
 
58
70
  [{Makefile,**.mk,**.make}]
59
71
  indent_style = tab
72
+
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.1",
3
+ "version": "2.2.1",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -24,7 +24,7 @@
24
24
  "postpack": "npx clean-package restore"
25
25
  },
26
26
  "dependencies": {
27
- "@w5s/dev": "^2.0.1",
27
+ "@w5s/dev": "^2.0.2",
28
28
  "debug": "^4.3.3",
29
29
  "glob": "^10.0.0",
30
30
  "mrm-core": "^7.0.0",
@@ -37,5 +37,5 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "e7a31018a843da7bbcc5ddac2a32a7fd2630c951"
40
+ "gitHead": "22f1d858d15347cd0dd6bb6b6569df0803bf2441"
41
41
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/mrm-preset",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "Mrm configuration presets",
5
5
  "keywords": [
6
6
  "mrm",
@@ -37,7 +37,7 @@
37
37
  "test:script": "mkdir _tester; cd _tester; mrm bootstrap --dir ..; mrm configure --dir .."
38
38
  },
39
39
  "dependencies": {
40
- "@w5s/dev": "^2.0.1",
40
+ "@w5s/dev": "^2.0.2",
41
41
  "debug": "^4.3.3",
42
42
  "glob": "^10.0.0",
43
43
  "mrm-core": "^7.0.0",
@@ -45,7 +45,7 @@
45
45
  "sync-directory": "^6.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@types/debug": "4.1.9",
48
+ "@types/debug": "4.1.10",
49
49
  "mrm": "4.1.22",
50
50
  "mrm-preset-default": "4.1.11"
51
51
  },
@@ -56,5 +56,5 @@
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "e7a31018a843da7bbcc5ddac2a32a7fd2630c951"
59
+ "gitHead": "22f1d858d15347cd0dd6bb6b6569df0803bf2441"
60
60
  }