You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DEVELOPER_README.md
+28-64Lines changed: 28 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,12 @@ Notes for working on this repo.
5
5
## Prerequisites
6
6
7
7
- .NET SDK 10 or newer
8
-
- PowerShell 5.1+ on Windows; PowerShell 7+ on Linux/macOS (install: <https://learn.microsoft.com/powershell/scripting/install/installing-powershell>). The build scripts (`build/pack-dev.ps1`, `build/pack-release.ps1`) are pwsh-only.
8
+
- PowerShell 5.1+ on Windows; PowerShell 7+ on Linux/macOS (install: <https://learn.microsoft.com/powershell/scripting/install/installing-powershell>). The build scripts (`build/pack-dev.ps1`, `build/pack-release.ps1`) use PowerShell.
9
9
10
10
## Repo layout assumption
11
11
12
-
The dev workflow assumes you have this repo cloned alongside its sibling
13
-
repos (most importantly [Rezoom](https://github.com/rspeele/Rezoom)) under a
14
-
common parent directory. The parent's name doesn't matter, but the
12
+
The dev workflow assumes you have this repo cloned alongside its sibling repos (most importantly
13
+
[Rezoom](https://github.com/rspeele/Rezoom)) under a common parent directory. The parent's name doesn't matter, but the
15
14
siblings need to be together.
16
15
17
16
```
@@ -38,39 +37,22 @@ You need a `NuGet.config` at the parent level so package restore finds
38
37
</configuration>
39
38
```
40
39
41
-
If you're only working on Rezoom.SQL and don't need to iterate on Rezoom,
42
-
you can use the latest published Rezoom from nuget.org. If you're changing
43
-
both, pack Rezoom into the same `.localfeed` first using whatever script that
44
-
repo provides.
40
+
This allows pushing local "updates" to the NuGet packages so the TypeProviderUser tests can reference them just like a
41
+
real downstream user.
45
42
46
-
## Why the unusual setup
47
-
48
-
Rezoom.SQL has two artifacts that interact awkwardly during dev:
49
-
50
-
- The **type provider** (`Rezoom.SQL.Provider`) is loaded by `fsc` at compile
51
-
time, not at the consumer's runtime. To test a TP change, a project has to
52
-
reference a NuGet-installed version of the provider, not a project-reference
53
-
to its source. (Project references don't trigger the same TP loading path.)
54
-
55
-
- The **TP user smoke tests** (in `src/TypeProviderUsers/`) exercise the TP
56
-
exactly the way a consumer would — they `PackageReference` the wrapper
57
-
meta-packages (e.g. `Rezoom.SQL.Provider.SQLite`) which transitively bring
58
-
in `Rezoom.SQL.Provider`. So testing a TP change means packing your changes,
59
-
then letting the TPUs restore the new package and rebuild.
60
-
61
-
The local feed + version-bump dance encodes this. Run `build/pack-dev.ps1`
62
-
after a Provider change; the TPUs (and any consumer in the repo) automatically
63
-
restore the new version on their next build.
43
+
If you're only working on Rezoom.SQL and don't need to make changes to Rezoom, you can use the latest published Rezoom
44
+
from nuget.org. If you're changing both, pack Rezoom into the same `.localfeed` first using whatever script that repo
45
+
provides.
64
46
65
47
## Versioning during dev
66
48
67
-
All Rezoom.SQL packages share a single version. Two files compose it:
49
+
All Rezoom.SQL packages share a single version. Two files define it:
68
50
69
51
-`version.props` (committed): `RezoomSqlVersion = 0.13.0`, represents the upcoming or
70
52
current release version. Bumped only at actual releases.
71
53
-`version.local.props` (gitignored): written by `pack-dev.ps1`, contains
72
54
`RezoomSqlVersionSuffix = dev.N`. The combined version becomes
73
-
`0.13.0-dev.N`. Bumped extremely frequently during development, every time we have to smoke-test the TPUs.
55
+
`0.13.0-dev.N`. Bumped extremely frequently during development, every time we have to "pack-dev.ps1" and smoke-test the TPUs.
74
56
75
57
Every package and consumer reads these via `Directory.Build.props`. Wrapper
76
58
csprojs and TPU / demo fsprojs reference our packages as
@@ -81,85 +63,67 @@ release version automatically.
81
63
82
64
### `build/pack-dev.ps1`
83
65
84
-
Bumps the dev counter (one above the highest existing prerelease in the local
85
-
feed), writes `version.local.props`, packs all six packages. Run after any
86
-
change you want the TPUs or demos to see.
66
+
Bumps the dev counter (one above the highest existing prerelease in the local feed), writes `version.local.props`, packs
67
+
all six packages. Run after any change you want the TPUs or demos to see.
87
68
88
69
```powershell
89
70
./build/pack-dev.ps1
90
71
```
91
72
92
73
### `build/pack-release.ps1`
93
74
94
-
Deletes `version.local.props` so the build has no prerelease suffix, then
95
-
packs all six packages at the release version. Errors out if the working
96
-
tree is dirty (override with `-Force`). After it succeeds, tag and push:
75
+
Deletes `version.local.props` so the build has no prerelease suffix, then packs all six packages at the release version.
76
+
Errors out if the working tree is dirty (override with `-Force`). After it succeeds, tag and push:
97
77
98
78
```powershell
99
79
./build/pack-release.ps1
100
80
git tag v1.0.0
101
81
git push origin v1.0.0
102
82
```
103
83
104
-
Drop the `.nupkg`s into wherever your nuget.org push lives.
105
-
106
84
### `build/pack-parents.ps1`
107
85
108
-
Packs the three parent libs (FParsec-Pipes, LicenseToCIL, Rezoom) from
109
-
their sibling repos at the versions declared in each fsproj. Use this when
110
-
you've edited a parent and want Rezoom.SQL to pick up the fresh bits.
86
+
Packs the three parent libs (FParsec-Pipes, LicenseToCIL, Rezoom) from their sibling repos at the versions declared in
87
+
each fsproj. Use this when you've edited a parent and want Rezoom.SQL to pick up the new dev version.
111
88
112
89
```powershell
113
90
./build/pack-parents.ps1 # all three
114
91
./build/pack-parents.ps1 -Only Rezoom # one at a time
115
92
```
116
93
117
-
The parents don't participate in the centralized `version.props` mechanism
118
-
(they change rarely; their versions are bumped manually). If you're
119
-
publishing parent changes, bump the parent's `<Version>` first, then run
120
-
this script.
94
+
The parents don't participate in the centralized `version.props` mechanism (they change rarely; their versions are
95
+
bumped manually). If you're publishing parent changes, bump the parent's `<Version>` first, then run this script.
121
96
122
97
### `build/regen-doc-nav.ps1`
123
98
124
-
Rewrites the breadcrumb + prev/next nav blocks at the top and bottom of
125
-
every doc page listed in `SUMMARY.md`. Run after editing `SUMMARY.md`
126
-
(adding pages, reordering, renaming) to bring all nav links back into sync.
99
+
Rewrites the breadcrumb + prev/next nav blocks at the top and bottom of every doc page listed in `SUMMARY.md`. Run after
100
+
editing `SUMMARY.md` (adding pages, reordering, renaming) to bring all nav links back into sync.
127
101
128
102
```powershell
129
103
./build/regen-doc-nav.ps1
130
104
```
131
105
132
-
Each rewritten block is fenced by HTML comment markers (`<!-- nav-top -->` /
133
-
`<!-- nav-bottom -->`) so the script can rerun cleanly.
134
-
135
106
### `src/TypeProviderUsers/test-tp-users.ps1`
136
107
137
108
Runs `dotnet test` on both TPU projects. SQLite can make its own DB file, but Postgres auto-
138
109
skips when no server is reachable. Either set up your local Postgres like mine, with an
139
110
`rz` user and password `testtest`, or use `REZOOM_TPU_POSTGRES` to override the
140
111
connection string.
141
112
142
-
## Why the TPUs aren't in the main sln
143
-
144
-
The TPUs reference the wrapper packages via NuGet, not via project reference.
145
-
Putting them in the same sln as `Rezoom.SQL.Provider` is confusing: opening
146
-
the sln in VS suggests project-ref semantics, but the TPUs actually consume
147
-
whatever's currently packed into `.localfeed`. Changing Provider source
148
-
without running `pack-dev.ps1` would silently leave the TPUs on the old
149
-
version.
113
+
### `src/TypeProviderUsers/test-vs-build.ps1`
150
114
151
-
They live as standalone fsprojs under `src/TypeProviderUsers/`. Open them
152
-
individually (or via the test runner script) when you need to verify TP
153
-
behavior end-to-end.
115
+
Confirms the build still works in VS/MSBuild. It's very easy to write generative TP code that works in `dotnet build`
116
+
but breaks in MSBuild.
154
117
155
118
## Edit-rebuild loop for TP work
156
119
157
120
1. Edit something in `src/Rezoom.SQL.Provider/`, `Rezoom.SQL.Compiler/`, or
158
121
`Rezoom.SQL.Mapping/`.
159
-
2. Run `./build/pack-dev.ps1`. New version is `0.13.0-dev.<N+1>`.
160
-
3. Run `./src/TypeProviderUsers/test-tp-users.ps1` (or `dotnet test` the specific one
122
+
2. Make sure it passes the easy tests in Rezoom.SQL.Test and Rezoom.SQL.Provider.Test.
123
+
3. Run `./build/pack-dev.ps1` to generate local dev packages.
124
+
4. Run `./src/TypeProviderUsers/test-tp-users.ps1` (or `dotnet test` the specific one
161
125
you care about). Restore picks up the new dev version automatically.
162
-
4. Iterate.
126
+
5. Also run `./src/TypeProviderUsers/test-vs-build.ps1` to confirm the TP works in a VS/msbuild environment too.
163
127
164
128
If something doesn't update as expected, the usual suspect is a stale entry
165
129
in `~/.nuget/packages/<pkg>/<version>/`. `pack-dev.ps1` clears those for the
@@ -173,5 +137,5 @@ the feed, you may need to clear by hand.
173
137
3. Update `CHANGELOG.md` (when one exists) and any docs that mention versions.
174
138
4. Commit. Working tree should be clean.
175
139
5. Run `./build/pack-release.ps1`. Verify the resulting `.nupkg`s in the feed.
0 commit comments