Skip to content

Commit 1570d92

Browse files
authored
Additional doc updates for clarity in prep for release (#50)
* Updated docs (public/internal) * Corrected typo in error message for script module Co-authored-by: smaillet <[email protected]>
1 parent ad0a5be commit 1570d92

File tree

8 files changed

+138
-84
lines changed

8 files changed

+138
-84
lines changed

PsModules/CommonBuild/Private/Get-VsArchitecture.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ function Get-VsArchitecture()
66
X64 {'x64'}
77
Arm {'ARM'}
88
Arm64 {'ARM64'}
9-
default { throw 'Usupported runtime architecture for MSVC'}
9+
default { throw 'Unsupported runtime architecture for MSVC'}
1010
}
1111
}

PsModules/RepoBuild/Public/Initialize-BuildEnvironment.ps1

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ function Initialize-BuildEnvironment
3232
values. In essence, the result is like a derived type from the common base. The
3333
additional properties added are:
3434
35-
| Name | Description |
36-
|----------------------------|--------------------------------------------------------------------------------------------------------|
37-
| OfficialGitRemoteUrl | GIT Remote URL for ***this*** repository |
35+
| Name | Description |
36+
|----------------------------|------------------------------------------|
37+
| OfficialGitRemoteUrl | GIT Remote URL for ***this*** repository |
3838
#>
3939
# support common parameters
4040
[cmdletbinding()]
@@ -67,11 +67,6 @@ function Initialize-BuildEnvironment
6767
New-Item -ItemType Directory -Path $buildInfo['PackagesRoot'] -ErrorAction SilentlyContinue | Out-Null
6868
New-Item -ItemType Directory $buildInfo['NuGetOutputPath'] -ErrorAction SilentlyContinue | Out-Null
6969

70-
# Disable the default "terminal logger" support as it's a breaking change that should NEVER
71-
# have been anything but OPT-IN. It's a terrible experience that ends up hiding/overwriting
72-
# information and generally makes it HARDER to see what's going on, not easier as it claims.
73-
$env:MSBUILDTERMINALLOGGER='off'
74-
7570
return $buildInfo
7671
}
7772
catch

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ of the last one released publicly.
5050
>
5151
> ***This implementation is making no assumptions and simply does NOT support the short form.***
5252
> That may seem like a hard stance but given the ambiguities of the spec, documenting the behavior
53-
> is difficult. Addditionally, handling all the potential variations makes for extremely complex
53+
> is difficult. Additionally, handling all the potential variations makes for extremely complex
5454
> implementation code. All of that for a feature in support of a NuGet client that is now obsolete.
5555
> (NuGet v3 can handle the full name just fine!). Thus, the lack of support in this library.
5656
5757
## End User Documentation
5858
Full documentation on the tasks is available in the project's [docs site](https://ubiquitydotnet.github.io/CSemVer.GitBuild/)
5959

6060
## Building the tasks
61-
Documentation on building and general maintencance of this repo are provided in the [Wiki](https://github.com/UbiquityDotNET/CSemVer.GitBuild/wiki).
61+
Documentation on building and general maintenance of this repo are provided in the [Wiki](https://github.com/UbiquityDotNET/CSemVer.GitBuild/wiki).
6262

6363
----
6464
<sup><a id="footnote_1">1</a></sup>See: [This issue](https://github.com/CK-Build/csemver.org/issues/2) which was reported upon

docfx/ReadMe.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ There are a few folders containing input for the site generation.
5454

5555
#### api-*
5656
These folders contain the Generated contents for each project as (YAML) metadata files
57-
parsed and generated from the source.
57+
parsed and generated from the source. Since most of these files are generated they are
58+
excluded from git in the [.gitignore](#gitignore) file.
5859

5960
##### api-*/Index.md
6061
This contains the main landing page for a given library it has the top bar navigation
@@ -68,8 +69,54 @@ set of namespaces, types, enums etc... Each library project generates it's own v
6869
of this file. Since this is generated it is listed in the [.gitignore](#gitignore) file.
6970

7071
#### Library Content
71-
These folders (named after the `*` portion of the [api-*](#api-*) folder names contains
72+
These folders (named after the `*` portion of the [api-*](#api) folder names contains
7273
manually written additional files, articles, samples etc... related to a given library.
7374
>NOTE
7475
> The TOC.YML file format used in these topics is DIFFERENT from what is auto generated.
7576
>
77+
78+
#### namespaces
79+
The `namespaces` folder contains overrides markdown files to allow documenting whole
80+
namespaces. .NET doc comments do not allow namespace documentation comments. However,
81+
docfx, when leveraged properly can. These files, when they include the correct YAML
82+
header are merged to the contents for the docs before generation of the final static
83+
site. This is enabled by adding the namespace content to the `overwrite` section of the
84+
docfx.json file:
85+
``` JSON
86+
{
87+
"build":{
88+
"content":[
89+
"files":[
90+
"<project dir>.**.{md,yml}"
91+
],
92+
// Exclude the namespace overwrites as they are listed explicitly elsewhere
93+
"exclude": [
94+
"**/namespaces/**.md"
95+
]
96+
],
97+
"overwrite": [
98+
{
99+
"files": [
100+
"**/apidocs/**.md",
101+
"**/namespaces/**.md"
102+
]
103+
}
104+
],
105+
}
106+
}
107+
```
108+
109+
The YAML header should include the following:
110+
``` YAML
111+
---
112+
uid: <namespace UID>
113+
remarks: *content
114+
---
115+
```
116+
117+
The `<namespace UID>` is usually just the full name of the namespace but is verifiable
118+
by examining the generated YML files in the [api-*](#api) folder. The `remarks` entry
119+
causes the contents of the file to merge to the contents of the remarks section. This
120+
will order the content ahead of the normally generated list of members. It is generally
121+
recommended to finish all such documents with a horizontal rule (`---` in markdown) to
122+
allow separation of the namespace remarks from the generated content.

docfx/build-tasks/index.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ $currentBuildKind = Get-CurrentBuildKind
238238
$env:IsAutomatedBuild = $currentBuildKind -ne [BuildKind]::LocalBuild
239239
$env:IsPullRequestBuild = $currentBuildKind -eq [BuildKind]::PullRequestBuild
240240
$env:IsReleaseBuild = $currentBuildKind -eq [BuildKind]::ReleaseBuild
241-
242241
```
243242

244243
## BuildVersion.xml
@@ -343,15 +342,18 @@ section of this document.
343342
| CSM204 | XML format of file specified by `$(BuildVersionXml)' is invalid |
344343

345344
----
346-
<sup><a id="footnote_1">1</a></sup> CSemVer-CI uses a latest build format and therefore all version numbers for a CI
347-
build, including local builds use a `Patch+1` pattern as defined by CSemVer-CI. This ensures
348-
that all forms of CI builds have a higher precedence than any release they are based on. To
349-
simplify that, a CI build contains everything in a given release and then some more. What
350-
release that will eventually become is intentionally undefined.
351-
352-
353-
<sup><a id="footnote_2">2</a></sup> CSM106 is essentially an internal sanity test. The props/targets files ensure that
354-
`$(CiBuildIndex)` and `$(CiBuildName)` have a value unless $(IsReleaseBuild) is set. In that case
355-
the targets file will force them to empty. So, there's no way to test for or hit this condition
356-
without completely replacing/bypassing the props/targets files for the task. Which is obviously,
357-
an unsupported scenario :grin:.
345+
<sup><a id="footnote_1">1</a></sup> CSemVer-CI uses a latest build format and therefore all
346+
version numbers for a CI build, including local builds use a `Patch+1` pattern as defined by
347+
CSemVer-CI. This ensures that all forms of CI builds have a higher precedence than any release
348+
they are based on. To clarify the understanding of that, a CI build contains everything in a
349+
given release and then some more. How much more, or what release that will eventually become
350+
is intentionally undefined. This allows selection of the final release version based on the
351+
contents of the actual changes. CI builds are understood unstable and subject to complete
352+
changes or even abandoned lines of thought.
353+
354+
355+
<sup><a id="footnote_2">2</a></sup> CSM106 is essentially an internal sanity test. The
356+
props/targets files ensure that `$(CiBuildIndex)` and `$(CiBuildName)` have a value unless
357+
$(IsReleaseBuild) is set. In that case the targets file will force them to empty. So, there's
358+
no way to test for or hit this condition without completely replacing/bypassing the props/targets
359+
files for the task. Which is obviously, an unsupported scenario :grin:.

docfx/index.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ but the primary focus is automated build versioning that embraces the principal
44
while conforming to the syntax of CSemVer and CSemVer-CI
55

66
## The Libraries in this repository
7-
(At least the ones generating docs at this point anyway! :grin:)
87

98
| Library | Description |
109
|---------|-------------|
@@ -13,12 +12,16 @@ while conforming to the syntax of CSemVer and CSemVer-CI
1312

1413
>[!IMPORTANT]
1514
> There is confusion on the ordering of a CI build with relation to a release build with
16-
> CSemVer. A CI Build is either an initial build of an unreleased version with
17-
> [Major.Minor.Patch] == [0.0.0]. Or, it is based on the previously released version and is
18-
> [Major.Minor.Patch+1]. That is, a CI build is ordered BEFORE all release builds, or it
19-
> is ordered AFTER a specific release it is based on! In particular a CI build version does
20-
> ***NOT*** indicate what it will become when it is finally released, but what release it was
21-
> based on (If any).
15+
> CSemVer-CI. A CI Build is either an initial build of an unreleased version with
16+
> [Major.Minor.Patch] == [0.0.0]. Or, it is based on the previously released version and
17+
is [Major.Minor.Patch+1]. That is, a CI build is ordered BEFORE all release builds, or it
18+
> is ordered AFTER the specific release it is based on! In particular a CI build version
19+
> does ***NOT*** indicate what it will become when it is finally released, but what
20+
> release it was based on (If any). To simplify that, for clarity, a CI build contains
21+
> everything in the release it was based on and additional changes (that might remove
22+
> things). CI builds are, by definition NOT stable and consumers cannot rely on them for
23+
> predictions of future stability. A given CI build may even represent an abandoned
24+
> approach that never becomes a release!
2225
2326
---
2427
[Attributions](Attributions.md)

docfx/versioning-lib/index.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ The Ubiquity.NET.Versioning library provides types to support use of versioning
44
2) [Constrained Semantic Versioning](https://csemver.org)
55
- Including Continuous Integration (CI) via CSemVer-CI
66

7-
It is viable as a standalone package to allow validation of or comparisons to versions reported
8-
at runtime. (Especially from native interop that does not support package dependencies or
9-
versioning at runtime.)
7+
It is viable as a standalone package to allow validation of or comparisons to versions
8+
reported at runtime. (Especially from native interop that does not support package
9+
dependencies or versioning at runtime.)
1010

1111
## Example
1212
``` C#
@@ -30,22 +30,26 @@ The library contains support for parsing of strings based on the rules of a
3030
SemVer, CSemVer, and CSemVer-CI
3131

3232
## Ordering
33-
The types all support `IComparable<T>`<sup>[1](#footnote_1)</sup> and properly handle correct sort ordering of the
34-
versions according to the rules of SemVer (Which, CSemVer and CSemVer-CI follow)
33+
The types all support `IComparable<T>`<sup>[1](#footnote_1)</sup> and properly handle
34+
correct sort ordering of the versions according to the rules of SemVer (Which, CSemVer
35+
and CSemVer-CI follow)
3536

3637
>[!WARNING]
37-
> The formal 'spec' for [CSemVer](https://csemver.org) remains mostly silent on the point of
38-
> the short format. See this [known issue](https://github.com/CK-Build/csemver.org/issues/2).
38+
> The formal 'spec' for [CSemVer](https://csemver.org) remains mostly silent on the point
39+
> of the short format. See this [known issue](https://github.com/CK-Build/csemver.org/issues/2).
3940
> Since, the existence of that form was to support NuGet V2, which is now obsolete, this
40-
> library does not support the short form at all. (This choice keeps documentation clarity
41-
> [NOT SUPPORTED] and implementation simplicity)
41+
> library does not support the short form at all. (This choice keeps documentation
42+
> clarity [NOT SUPPORTED] and implementation simplicity)
4243
4344
------
44-
<sup><a id="footnote_1">1</a></sup> The `SemVer` class does NOT support `IComparable<T>` as
45-
the spec is not explicit on case sensitive comparison of AlphaNumeric Identifiers.
46-
Unfortunately, major repositories using SemVer have chosen to use different comparisons. Thus,
47-
a consumer is required to know a-priori if the version is compared insensitive or not.
48-
`IComparer<SemVer>` instances are available for both cases via the static class
49-
[SemVerComparer](xref:Ubiquity.NET.Versioning.SemVerComparer) and
50-
[CSmeVerComparer.CaseSensitive](xref:Ubiquity.NET.Versioning.SemVerComparer.CaseSensitive).
45+
<sup><a id="footnote_1">1</a></sup> The `SemVer` class does NOT support [`IComparable<T>`](xref:System.IComparable`1)
46+
as the spec is not explicit<sup>[2](#footnote_2)</sup> on case sensitive comparison of AlphaNumeric Identifiers.
47+
48+
<sup><a id="footnote_2">2</a></sup>Technically the spec says that pre-release identifiers
49+
are compared lexicographically, which would mean they are case sensitive. Unfortunately,
50+
that was not made explicit and major repositories using SemVer have chosen to use
51+
different rules of comparison and ordering. Thus, a consumer is required to know a-priori
52+
if the version is compared insensitive or not. [`IComparer<SemVer>`](xref:System.Collections.Generic.IComparer{Ubiquity.NET.Versioning.SemVer})
53+
instances are available for both cases via the static class [SemVerComparer](xref:Ubiquity.NET.Versioning.SemVerComparer)
54+
and [CSmeVerComparer.CaseSensitive](xref:Ubiquity.NET.Versioning.SemVerComparer.CaseSensitive).
5155

docfx/versioning-lib/namespaces/Ubiquit.NET.Versioning.md

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
uid: Ubiquity.NET.Versioning
33
remarks: *content
44
---
5-
This namespace contains the stand alone versioning support for the different forms of version
6-
information supported.
5+
This namespace contains the stand alone versioning support for the different forms of
6+
version information supported.
77

88
### Class Diagram
99
The following diagram serves to illustrates the primary relationships between the various
@@ -55,32 +55,35 @@ classDiagram
5555
CSemVerCI "1" *-- CSemVer:BaseVersion
5656
```
5757
>[!IMPORTANT]
58-
> There is no inheritance between a `SemVer`, `CSemVer`, and `CSemVerCI`. While conversion does
59-
> exist they are not completely compatible due the constraints of ALWAYS comparing case
60-
> insensitive for `CSemVer` and `CSemVerCI`
58+
> There is no inheritance between a `SemVer`, `CSemVer`, and `CSemVerCI`. While
59+
> conversion is possible in many cases they are not completely compatible due the
60+
> constraints on ranges and rules of ALWAYS comparing case insensitive for `CSemVer`
61+
> and `CSemVerCI`
6162
6263
The primary differences between a generic SemVer, a CSemVer and CSemVerCI is in how the
63-
sequence of pre-release versioning components is handled and the constraints placed on the
64-
Major, Minor and Patch version numbers.
64+
sequence of pre-release versioning components is handled and the constraints placed on
65+
the Major, Minor and Patch version numbers.
6566

6667
>[!NOTE]
67-
> A SemVer technically has no constraints on the range of the integral components and thus
68-
> a `BigInteger` is used. Though, in practical terms, if any of the components exceeds the
69-
> size of `UInt64` there's probably something wrong with how the thing the version applies
70-
> to is versioned :confused:. More realistically, CSemVer[-CI] constrains the integral
71-
> components to specific ranges to allow conversion to an ordered version and `FileVersionQuad`.
68+
> A SemVer technically has no constraints on the range of the integral components and
69+
> thus a `BigInteger` is used. Though, in practical terms, if any of the components
70+
> exceeds the size of `UInt64` there's probably something wrong with how the thing the
71+
> version applies to is versioned :confused:. More realistically, CSemVer[-CI]
72+
> constrains the integral components to specific ranges to allow conversion to an ordered
73+
> version and `FileVersionQuad`.
7274
7375

7476
>[!IMPORTANT]
75-
> A CSemVer[-CI] is ***ALWAYS*** ordered using a case-insensitive comparison for AlphaNumeric
76-
> Identifiers in the version. Sadly, the SemVer spec is not explicit on the point of case
77-
> sensitivity and various major implementations for popular frameworks have chosen different
78-
> approaches. Thus a consumer of a pure SemVer needs to know which kind of comparison to use
79-
> in order to get correct results.
80-
> Due to the ambiguity of case sensitivity in ordering, it is recommended that all uses of
81-
> SemVer in the real world use ALL the same case (All *UPPER* or all *lower*). This avoids
82-
> the confusion and produces correct ordering no matter what variant of comparison a consumer
83-
> uses. Problems come when the version uses a *Mixed* case format.
77+
> A CSemVer[-CI] is ***ALWAYS*** ordered using a case-insensitive comparison for
78+
> AlphaNumeric Identifiers in the version. Sadly, the SemVer spec is not explicit on the
79+
> point of case sensitivity and various major implementations for popular frameworks have
80+
> chosen different approaches. Thus a consumer of a pure SemVer needs to know which kind
81+
> of comparison to use in order to get correct results.
82+
>
83+
> Due to the ambiguity of case sensitivity in ordering, it is recommended that all uses
84+
> of SemVer in the real world use ALL the same case (All *UPPER* or all *lower*). This
85+
> avoids the confusion and produces correct ordering no matter what variant of comparison
86+
> a consumer uses. Problems come when the version uses a *Mixed* case format.
8487
8588
### CSemVer Constraints on the integral components
8689
In particular the values are constrained
@@ -93,11 +96,11 @@ as follows:
9396
| Patch | [0-9999] |
9497

9598
## CSemVer constraints on the release sequence
96-
Technically, SemVer does not limit the number of components to a pre-release value. It could
97-
be ANY finite set. This is, of course unreasonable in the real world so CSemVer places
98-
constraints on the number of components AND attributes particular meaning to each part. A
99-
CSemVer may have up to three pre-release components that are interpreted according to the
100-
following table:
99+
Technically, SemVer does not limit the number of components to a pre-release value. It
100+
could be ANY finite set. This is, of course unreasonable in the real world so CSemVer
101+
places constraints on the number of components AND attributes particular meaning to each
102+
part. A CSemVer may have up to three pre-release components that are interpreted
103+
according to the following table:
101104

102105
| Index | Name | Description |
103106
|-------|------|-------------|
@@ -121,14 +124,14 @@ The names of a pre-release are constrained in CSemVer[-CI] to the following:<sup
121124

122125
------
123126
<sup><a id="footnote_1">1</a></sup> This library does NOT support the short form of names in a
124-
CSemVer. The exact string representation of the short form of a CSemVer as specified is not
125-
entirely clear. (see:[this issue](https://github.com/CK-Build/csemver.org/issues/2)) This
126-
implementation has chosen to ignore the short form completely. Based on what little is said
127-
about it int the spec, it was created to support a limitation in NuGet v2, which is now
128-
obsolete. Thus, the libraries do not support producing strings using the short form, nor do
129-
they recognize one when parsing.
130-
131-
<sup><a id="footnote_2">2</a></sup> `prerelease` is always considered valid as well. Internally
132-
it is automatically converted to the shorter `pre` form.
127+
CSemVer. The exact string representation of the short form of a CSemVer as specified is
128+
not entirely clear. (see:[this issue](https://github.com/CK-Build/csemver.org/issues/2))
129+
This implementation has chosen to ignore the short form completely. Based on what little
130+
is said about it in the spec, it was created to support a limitation in NuGet v2, which
131+
is now obsolete. Thus, the libraries do not support producing strings using the short
132+
form, nor do they recognize one when parsing.
133+
134+
<sup><a id="footnote_2">2</a></sup> `prerelease` is always considered valid as well.
135+
Internally it is automatically converted to the shorter `pre` form.
133136

134137
----

0 commit comments

Comments
 (0)