@halospv3/hce.shared-config 2.1.1 → 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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## [2.2.0](https://github.com/halospv3/hce.shared/compare/v2.1.2...v2.2.0) (2024-03-29)
2
+
3
+
4
+ ### Features
5
+
6
+ * **dotnet:** add GitVersion 6.0 config ([3784c72](https://github.com/halospv3/hce.shared/commit/3784c72ea2e37dcced13ccc322476f0d93d2bd9b))
7
+ * **dotnet:** add global "RepoRoot", "RepoRootPublishDir", and placeholder properties ([23d330a](https://github.com/halospv3/hce.shared/commit/23d330a2ca4769fcd14fe8f1a409f6801a7a1ea3))
8
+ * **dotnet:** rework ZipPublishDir ([618ba95](https://github.com/halospv3/hce.shared/commit/618ba95b3d731dc1b560e91757aa02e947b09e03))
9
+ * move commitlint config to shared file ([66efb30](https://github.com/halospv3/hce.shared/commit/66efb30a9e4351d02a761edf3a49722bc8a0f111))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **dotnet:** trim variant args; undefine if parentheses would be empty ([10414ff](https://github.com/halospv3/hce.shared/commit/10414ffc58950bae4d582d2263cbf9d7a51235eb)), closes [#356](https://github.com/halospv3/hce.shared/issues/356)
15
+
16
+ ## [2.1.2](https://github.com/halospv3/hce.shared/compare/v2.1.1...v2.1.2) (2024-03-26)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **deps:** update dependency @semantic-release/release-notes-generator to v13 ([0758bc9](https://github.com/halospv3/hce.shared/commit/0758bc9c9bb8338855880218e4c1086e25384baa))
22
+
1
23
  ## [2.1.1](https://github.com/halospv3/hce.shared/compare/v2.1.0...v2.1.1) (2024-03-26)
2
24
 
3
25
  ## [2.1.0](https://github.com/halospv3/hce.shared/compare/v2.0.1...v2.1.0) (2024-03-18)
package/README.md CHANGED
@@ -15,6 +15,17 @@ npm install --save-dev @halospv3/hce.shared-config
15
15
 
16
16
  ### 2. Customize Semantic Release
17
17
 
18
+ ```json
19
+ // package.json
20
+ {
21
+ "release": {
22
+ "extends": [
23
+ "@halospv3/hce.shared-config"
24
+ ]
25
+ }
26
+ }
27
+ ```
28
+
18
29
  WARNING! Defining a property will *overwrite* the previous value. Arrays and objects are *not* merged. You can...
19
30
  - Assign to top-level variables to avoid modifying the plugins array.
20
31
  - Write your config in CJS and manually merge objects and arrays.
@@ -46,19 +57,11 @@ WARNING! Defining a property will *overwrite* the previous value. Arrays and obj
46
57
 
47
58
  ```json
48
59
  // package.json
49
- // body-max-line-length is now a Warning instead of an Error.
50
60
  {
51
61
  "commitlint": {
52
62
  "extends": [
53
- "@commitlint/config-conventional"
54
- ],
55
- "rules": {
56
- "body-max-line-length": [
57
- 1,
58
- "always",
59
- 100
60
- ]
61
- }
63
+ "./node_modules/@halospv3/hce.shared-config/commitlint.config.ts"
64
+ ]
62
65
  }
63
66
  }
64
67
  ```
@@ -70,10 +73,35 @@ npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
70
73
 
71
74
  ### 4. (dotnet) Add/Edit Directory.Build.props
72
75
 
76
+
77
+ > Example Directory.Build.props from [BinToss/GroupBox.Avalonia](https://github.com/BinToss/GroupBox.Avalonia)
78
+
79
+ ```xml
80
+ <Project>
81
+ <PropertyGroup>
82
+ <RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), '.git/index'))</RepoRoot>
83
+ <HCESharedDir Condition="'$(HCESharedDir)' == ''">$(RepoRoot)node_modules/@halospv3/hce.shared-config/</HCESharedDir>
84
+ <GitVersion_Path Condition="'$(GitVersion_Path)' == ''">$(HCESharedDir)GitVersion.yml</GitVersion_Path>
85
+ <AvaloniaVersion>11.0.10</AvaloniaVersion>
86
+ </PropertyGroup>
87
+
88
+ <PropertyGroup Condition="'$(CI)' == 'true'">
89
+ <Configuration>Release</Configuration>
90
+ <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
91
+ <Deterministic>true</Deterministic>
92
+ </PropertyGroup>
93
+
94
+ <Import Project="$(HCESharedDir)/dotnet/ZipPublishDir.targets" />
95
+ </Project>
96
+ ```
97
+
98
+ ----
99
+
73
100
  Add the file `Directory.Build.props` to your repository's root directory or solution directory if you haven't already.
74
101
  Then, add the following properties:
75
102
  ```xml
76
- <Project>
103
+ <Project> <!-- Minimal requirements for dotnet/msbuild integration -->
104
+ <Import Project="./node_modules/@halospv3/hce.shared-config/dotnet/ZipPublishDir.targets" />
77
105
  <PropertyGroup>
78
106
  <ProjectRootDir>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), '.git/index'))</ProjectRootDir>
79
107
  <HCESharedDir>$(ProjectRootDir)/node_modules/@halospv3/hce.shared-config/</HCESharedDir>
@@ -1,3 +1,4 @@
1
+ # yaml-language-server: $schema=https://raw.githubusercontent.com/GitTools/GitVersion/main/schemas/5.12/GitVersion.configuration.json
1
2
  # https://gitversion.net/docs/reference/configuration
2
3
  mode: Mainline
3
4
  major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
@@ -0,0 +1,6 @@
1
+ # yaml-language-server: $schema=https://raw.githubusercontent.com/GitTools/GitVersion/main/schemas/6.0/GitVersion.configuration.json
2
+ # https://gitversion.net/docs/reference/configuration
3
+ workflow: TrunkBased/v1
4
+ major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
5
+ minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:"
6
+ patch-version-bump-message: "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:"
@@ -1,23 +1,75 @@
1
1
  <Project>
2
- <!-- todo: refactor to Task so users can configure input variables e.g. ZipPublishDir_AppendVariantArgs -->
3
- <Target Name="ZipPublishDir" AfterTargets="Publish">
2
+ <Target Name="ZipPublishDir" AfterTargets="Publish"
3
+ Outputs="$(DestinationFile)">
4
4
  <PropertyGroup>
5
- <!-- <ZipPublishDir_AppendVariantArgs>true</ZipPublishDir_AppendVariantArgs> -->
6
- <!-- "C:/Repos/HaloSPV3/HXE" -->
7
- <RepoRoot>$([System.IO.Path]::GetDirectoryName($([MSBuild]::GetPathOfFileAbove('.gitignore', '$(MSBuildProjectDirectory)'))))</RepoRoot>
8
- <!-- " (net6.0 win7-x86)" -->
9
- <!-- <PART_VariantArgs Condition="$(ZipPublishDir_AppendVariantArgs)"> ($([System.String]::Join(' ', $(TargetFramework), $(RuntimeIdentifier))))</PART_VariantArgs> -->
10
- <PART_VariantArgs> ($([System.String]::Join(' ', $(TargetFramework), $(RuntimeIdentifier))))</PART_VariantArgs>
5
+ <!-- Required Parameters -->
6
+ <RepoRoot Condition="'$(RepoRoot)' == '' And '$(ProjectRootDir)' != ''">$(ProjectRootDir)</RepoRoot>
7
+ <RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), '.git/index'))</RepoRoot>
8
+
9
+ <!-- Optional Parameters
10
+ - AssemblyName
11
+ - Version
12
+ - VariantArgs (default: Configuration;TargetFramework;RuntimeIdentifier)
13
+ - Configuration
14
+ - TargetFramework
15
+ - RuntimeIdentifier
16
+ -->
17
+ <AppendVariantArgs Condition="'$(AppendVariantArgs)' == ''">true</AppendVariantArgs>
18
+
19
+ <appendVarArgs>$(AppendVariantArgs)</appendVarArgs>
20
+ <repoRootPublishDir>$(RepoRoot)/publish</repoRootPublishDir>
11
21
 
12
- <!-- e.g. "C:/Repos/HaloSPV3/HXE/publish/HXE 1.2.3-preview.4 (net6.0 win7-x86).zip" -->
13
- <Destination>$(RepoRoot)/publish/$(AssemblyName) $(Version)$(PART_VariantArgs).zip</Destination>
22
+ <!-- Only add Configuration when Debug -->
23
+ <dbgCfg Condition="'$(Configuration)' == 'Debug'">$(Configuration)</dbgCfg>
24
+ <!-- "net6.0 win7-x86"
25
+ "Debug net6.0 win7-x86" -->
26
+ <spaceArgs Condition="'$(VariantArgs)' != ''">$(VariantArgs.Replace(";"," ").Trim())</spaceArgs>
27
+ <spaceArgs Condition="'$(spaceArgs)' == ''">$([System.String]::Join(' ',$(dbgCfg), $(TargetFramework), $(RuntimeIdentifier)).Trim())</spaceArgs>
28
+ <!-- " (Debug net6.0 win7-x86)"
29
+ " (net6.0 win7-x86)"
30
+ "" -->
31
+ <enclosedVArgs Condition="$(appendVarArgs) And '$(spaceArgs)' != ''"> ($(spaceArgs))</enclosedVArgs>
32
+ <!-- " 1.2.3-preview.4"
33
+ "" -->
34
+ <version Condition="'$(Version)' != ''"> $(Version)</version>
35
+ <!-- "C:\Repos\HaloSPV3\HXE\publish\HXE 1.2.3-preview.4 (net6.0 win7-x86).zip" -->
36
+ <DestinationFile>$(repoRootPublishDir)/$(AssemblyName)$(version)$(enclosedVArgs).zip</DestinationFile>
37
+ <!-- todo: look into .NET 8 SDK's Artifacts feature -->
14
38
  </PropertyGroup>
15
39
 
16
- <MakeDir Directories="$(RepoRoot)/publish/"/>
17
-
40
+ <MakeDir Condition="!Exists('$(repoRootPublishDir)')" Directories="$(repoRootPublishDir)"/>
18
41
  <ZipDirectory
19
42
  SourceDirectory="$(PublishDir)"
20
- DestinationFile="$(Destination)"
43
+ DestinationFile="$(DestinationFile)"
21
44
  Overwrite="true" />
45
+
46
+ <Message Text="Publish assets zipped to '$(DestinationFile)'." Importance="high"/>
22
47
  </Target>
48
+
49
+ <!-- placeholder values for HCE.Shared ONLY -->
50
+ <PropertyGroup Condition="$([System.String]::Copy($(MSBuildProjectDirectory)).ToLowerInvariant().Contains('hce.shared'))">
51
+ <Configuration>Release</Configuration>
52
+ <TargetFramework>net6.0</TargetFramework>
53
+ <RuntimeIdentifier>win7-x86</RuntimeIdentifier>
54
+ <RuntimeIdentifiers>;;;win7-x86;win7-x64;;;</RuntimeIdentifiers>
55
+ <ZipPublishDir_AppendVariantArgs>true</ZipPublishDir_AppendVariantArgs>
56
+ <!-- <VariantArgs>$(MSBuildProjectName);$(Configuration)</VariantArgs> -->
57
+
58
+ <!-- -->
59
+
60
+ <appendVarArgs>$(ZipPublishDir_AppendVariantArgs)</appendVarArgs>
61
+ <dbgCfg Condition="'$(Configuration)' == 'Debug'">$(Configuration)</dbgCfg>
62
+ <!-- "net6.0 win7-x86" -->
63
+ <spaceArgs Condition="'$(VariantArgs)' != ''">$(VariantArgs.Replace(";"," ").Trim())</spaceArgs>
64
+ <spaceArgs Condition="'$(spaceArgs)' == ''">$([System.String]::Join(' ',$(dbgCfg), $(TargetFramework), $(RuntimeIdentifier)).Trim())</spaceArgs>
65
+ <!-- " (net6.0 win7-x86)" -->
66
+ <enclosedVArgs Condition="$(appendVarArgs) And '$(spaceArgs)' != ''"> ($(spaceArgs))</enclosedVArgs>
67
+ <!-- "win7-x86 win7-x64" -->
68
+ <spaceSeparatedRIDs Condition="$(RuntimeIdentifiers) != ''">$(RuntimeIdentifiers.ToString().Replace(";"," ").Trim())</spaceSeparatedRIDs>
69
+ <!-- " (win7-x86 win7-x64)" -->
70
+ <enclosedRIDs Condition="$(appendVarArgs) And '$(spaceSeparatedRIDs)' != ''"> ($(spaceSeparatedRIDs))</enclosedRIDs>
71
+ <Version>1.0.0</Version>
72
+ <version Condition="'$(Version)' != ''"> $(Version)</version>
73
+
74
+ </PropertyGroup>
23
75
  </Project>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halospv3/hce.shared-config",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "Automate commit message quality, changelogs, and CI/CD releases. Exports a semantic-release shareable configuration deserialized from this package's '.releaserc.yml'. Shared resources for .NET projects are also distributed with this package.",
5
5
  "keywords": [
6
6
  "halo",
@@ -41,15 +41,16 @@
41
41
  "watch": "packemon watch"
42
42
  },
43
43
  "dependencies": {
44
- "@commitlint/cli": "^19.2.0",
44
+ "@commitlint/cli": "^19.2.1",
45
45
  "@commitlint/config-conventional": "^19.1.0",
46
+ "@commitlint/types": "^19.0.3",
46
47
  "@semantic-release/changelog": "^6.0.3",
47
48
  "@semantic-release/commit-analyzer": "^12.0.0",
48
49
  "@semantic-release/exec": "^6.0.3",
49
50
  "@semantic-release/git": "^10.0.1",
50
51
  "@semantic-release/github": "^10.0.2",
51
52
  "@semantic-release/npm": "^12.0.0",
52
- "@semantic-release/release-notes-generator": "^12.1.0",
53
+ "@semantic-release/release-notes-generator": "^13.0.0",
53
54
  "conventional-changelog-conventionalcommits": "^7.0.2",
54
55
  "husky": "^9.0.11",
55
56
  "js-yaml": "^4.1.0",
@@ -60,7 +61,7 @@
60
61
  "devDependencies": {
61
62
  "@babel/cli": "^7.23.9",
62
63
  "@halospv3/hce.shared-config": "./",
63
- "@tsconfig/node-lts": "^20.1.1",
64
+ "@tsconfig/node-lts": "^20.1.2",
64
65
  "@types/debug": "^4.1.12",
65
66
  "@types/js-yaml": "^4.0.9",
66
67
  "@types/node": "^20.11.28",
@@ -80,7 +81,7 @@
80
81
  "tsconfig-moon": "^1.3.0",
81
82
  "tslib": "^2.6.2",
82
83
  "tsx": "^4.7.1",
83
- "typescript": "^5.4.2"
84
+ "typescript": "^5.4.3"
84
85
  },
85
86
  "engines": {
86
87
  "node": ">=18.12.0",
@@ -101,18 +102,6 @@
101
102
  "./static/.releaserc.yml": "./static/.releaserc.yml"
102
103
  },
103
104
  "types": "./cjs/index.d.ts",
104
- "commitlint": {
105
- "extends": [
106
- "@commitlint/config-conventional"
107
- ],
108
- "rules": {
109
- "body-max-line-length": [
110
- 1,
111
- "always",
112
- 100
113
- ]
114
- }
115
- },
116
105
  "packemon": {
117
106
  "format": "cjs",
118
107
  "platform": "node"