@fossa-app/bridge 0.1.0 → 0.1.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.
- package/.build.ps1 +25 -17
- package/README.md +38 -1
- package/package.json +1 -1
- package/src/Fossa.Bridge/bin/Release/net8.0/Fossa.Bridge.deps.json +2 -2
- package/src/Fossa.Bridge/obj/Release/{Fossa.Bridge.0.1.0.nuspec → Fossa.Bridge.0.1.1.nuspec} +2 -2
- package/src/Fossa.Bridge/obj/Release/net8.0/Fossa.Bridge.AssemblyInfo.fs +3 -3
- package/src/Fossa.Bridge/obj/Release/net8.0/Fossa.Bridge.fable-temp.AssemblyInfo.cs +1 -1
- package/src/Fossa.Bridge/obj/Release/net8.0/Fossa.Bridge.sourcelink.json +1 -1
- package/tests/Fossa.Bridge.Tests/obj/Release/net8.0/Fossa.Bridge.Tests.AssemblyInfo.fs +1 -1
- package/tests/Fossa.Bridge.Tests/obj/Release/net8.0/Fossa.Bridge.Tests.sourcelink.json +1 -1
package/.build.ps1
CHANGED
|
@@ -76,11 +76,13 @@ Task EnsureCentralPackageVersions Clean, {
|
|
|
76
76
|
|
|
77
77
|
$violations = @()
|
|
78
78
|
|
|
79
|
-
foreach ($projectFile in $projectFiles)
|
|
80
|
-
|
|
79
|
+
foreach ($projectFile in $projectFiles)
|
|
80
|
+
{
|
|
81
|
+
try
|
|
82
|
+
{
|
|
81
83
|
[xml]$xml = Get-Content $projectFile.FullName -Raw
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
+
} catch
|
|
85
|
+
{
|
|
84
86
|
throw "Failed to parse XML: $($projectFile.FullName)"
|
|
85
87
|
}
|
|
86
88
|
|
|
@@ -89,7 +91,8 @@ Task EnsureCentralPackageVersions Clean, {
|
|
|
89
91
|
|
|
90
92
|
$nodes = $xml.SelectNodes('//*[@VersionOverride]', $ns)
|
|
91
93
|
|
|
92
|
-
foreach ($node in $nodes)
|
|
94
|
+
foreach ($node in $nodes)
|
|
95
|
+
{
|
|
93
96
|
$violations += [PSCustomObject]@{
|
|
94
97
|
File = $projectFile.FullName
|
|
95
98
|
Node = $node.Name
|
|
@@ -98,7 +101,8 @@ Task EnsureCentralPackageVersions Clean, {
|
|
|
98
101
|
}
|
|
99
102
|
}
|
|
100
103
|
|
|
101
|
-
if ($violations.Count -gt 0)
|
|
104
|
+
if ($violations.Count -gt 0)
|
|
105
|
+
{
|
|
102
106
|
throw "VersionOverride attributes are not allowed. File: $($violations[0].File) Node: <$($violations[0].Node)>"
|
|
103
107
|
}
|
|
104
108
|
}
|
|
@@ -160,10 +164,11 @@ Task Format Restore, FormatXmlFiles, FormatFantomas
|
|
|
160
164
|
# Synopsis: Estimate Next Version
|
|
161
165
|
Task EstimateVersion Restore, {
|
|
162
166
|
$state = Import-Clixml -Path ".\.trash\$Instance\state.clixml"
|
|
163
|
-
if ($Version)
|
|
167
|
+
if ($Version)
|
|
168
|
+
{
|
|
164
169
|
$state.NextVersion = [System.Management.Automation.SemanticVersion]$Version
|
|
165
|
-
}
|
|
166
|
-
|
|
170
|
+
} else
|
|
171
|
+
{
|
|
167
172
|
$gitversion = Exec { dotnet tool run dotnet-gitversion } | ConvertFrom-Json
|
|
168
173
|
$state.NextVersion = [System.Management.Automation.SemanticVersion]::Parse($gitversion.SemVer)
|
|
169
174
|
}
|
|
@@ -200,7 +205,8 @@ Task FunctionalTest Build, {
|
|
|
200
205
|
|
|
201
206
|
# Synopsis: Integration Test
|
|
202
207
|
Task IntegrationTest Build, {
|
|
203
|
-
if (-not $env:CI)
|
|
208
|
+
if (-not $env:CI)
|
|
209
|
+
{
|
|
204
210
|
}
|
|
205
211
|
}
|
|
206
212
|
|
|
@@ -275,15 +281,16 @@ Task PublishNuGet PackNuGet, {
|
|
|
275
281
|
$state = Import-Clixml -Path ".\.trash\$Instance\state.clixml"
|
|
276
282
|
$nugetPackagePath = $state.NuGetPackagePath
|
|
277
283
|
|
|
278
|
-
if ($null -eq $env:NUGET_API_KEY)
|
|
284
|
+
if ($null -eq $env:NUGET_API_KEY)
|
|
285
|
+
{
|
|
279
286
|
Import-Module -Name Microsoft.PowerShell.SecretManagement
|
|
280
287
|
$apiKey = Get-Secret -Name 'Fossa-Bridge-NuGet-API-Key' -AsPlainText
|
|
281
|
-
}
|
|
282
|
-
|
|
288
|
+
} else
|
|
289
|
+
{
|
|
283
290
|
$apiKey = $env:NUGET_API_KEY
|
|
284
291
|
}
|
|
285
292
|
|
|
286
|
-
Exec { dotnet nuget push $nugetPackagePath --source https://api.nuget.org/v3/index.json --api-key $apiKey }
|
|
293
|
+
# Exec { dotnet nuget push $nugetPackagePath --source https://api.nuget.org/v3/index.json --api-key $apiKey }
|
|
287
294
|
}
|
|
288
295
|
|
|
289
296
|
# Synopsis: Publish NPM package
|
|
@@ -291,11 +298,12 @@ Task PublishNPM PackNPM, {
|
|
|
291
298
|
$state = Import-Clixml -Path ".\.trash\$Instance\state.clixml"
|
|
292
299
|
$npmPackagePath = $state.NPMPackagePath
|
|
293
300
|
|
|
294
|
-
if ($null -eq $env:NPM_TOKEN)
|
|
301
|
+
if ($null -eq $env:NPM_TOKEN)
|
|
302
|
+
{
|
|
295
303
|
Import-Module -Name Microsoft.PowerShell.SecretManagement
|
|
296
304
|
$token = Get-Secret -Name 'Fossa-Bridge-NPM-Token' -AsPlainText
|
|
297
|
-
}
|
|
298
|
-
|
|
305
|
+
} else
|
|
306
|
+
{
|
|
299
307
|
$token = $env:NPM_TOKEN
|
|
300
308
|
}
|
|
301
309
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# FossaApp Bridge
|
|
2
|
+
[](https://www.nuget.org/packages/Fossa.Bridge/)
|
|
3
|
+
[](https://www.npmjs.com/package/@fossa-app/bridge)
|
|
2
4
|
[](https://tiksn.com/)
|
|
3
5
|
[](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
|
|
4
6
|
|
|
5
|
-
The FossaApp Bridge provides shared
|
|
7
|
+
The FossaApp Bridge provides shared frontend and backend functionality.
|
|
8
|
+
|
|
9
|
+
## Project Purpose
|
|
10
|
+
The Fossa.Bridge project is a shared F# library designed to encapsulate logic, validation, and domain models that are common to both the .NET backend and the TypeScript/JavaScript frontend. By using [Fable](https://fable.io/), the F# code is transpiled into JavaScript/TypeScript for the frontend environment while simultaneously being compiled into a standard .NET library for the backend. This ensures a single source of truth for core business logic, API models, and data validation rules, reducing duplication and preventing synchronization issues between the client and server.
|
|
11
|
+
|
|
12
|
+
## Package Usage
|
|
13
|
+
|
|
14
|
+
### For .NET Backends (C# / F#)
|
|
15
|
+
Install the NuGet package:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
dotnet add package Fossa.Bridge
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### For JavaScript / TypeScript Frontends
|
|
22
|
+
Install the NPM package:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @fossa-app/bridge
|
|
26
|
+
```
|
|
27
|
+
or using Yarn:
|
|
28
|
+
```bash
|
|
29
|
+
yarn add @fossa-app/bridge
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
- Shared API domain models.
|
|
34
|
+
- Common validation and helper logic.
|
|
35
|
+
- Consistent behavior across client and server.
|
|
36
|
+
|
|
37
|
+
## Building and Packaging
|
|
38
|
+
To build both NPM and NuGet packages locally, run the included PowerShell script:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
.\pack.ps1
|
|
42
|
+
```
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"compilationOptions": {},
|
|
7
7
|
"targets": {
|
|
8
8
|
".NETCoreApp,Version=v8.0": {
|
|
9
|
-
"Fossa.Bridge/0.1.
|
|
9
|
+
"Fossa.Bridge/0.1.1": {
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"FSharp.Core": "10.0.103",
|
|
12
12
|
"Fable.Core": "4.5.0"
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"libraries": {
|
|
78
|
-
"Fossa.Bridge/0.1.
|
|
78
|
+
"Fossa.Bridge/0.1.1": {
|
|
79
79
|
"type": "project",
|
|
80
80
|
"serviceable": false,
|
|
81
81
|
"sha512": ""
|
package/src/Fossa.Bridge/obj/Release/{Fossa.Bridge.0.1.0.nuspec → Fossa.Bridge.0.1.1.nuspec}
RENAMED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
|
3
3
|
<metadata>
|
|
4
4
|
<id>Fossa.Bridge</id>
|
|
5
|
-
<version>0.1.
|
|
5
|
+
<version>0.1.1</version>
|
|
6
6
|
<authors>TIKSN</authors>
|
|
7
7
|
<description>Shared Domain Models and DTOs for Fossa UI and API</description>
|
|
8
|
-
<repository type="git" commit="
|
|
8
|
+
<repository type="git" commit="45a2ba54d0b46c1d793d2a6b37a90cd9633f546b" />
|
|
9
9
|
<dependencies>
|
|
10
10
|
<group targetFramework="net8.0">
|
|
11
11
|
<dependency id="FSharp.Core" version="10.0.103" exclude="Build,Analyzers" />
|
|
@@ -10,9 +10,9 @@ open System.Reflection
|
|
|
10
10
|
[<assembly: System.Reflection.AssemblyCompanyAttribute("TIKSN")>]
|
|
11
11
|
[<assembly: System.Reflection.AssemblyConfigurationAttribute("Release")>]
|
|
12
12
|
[<assembly: System.Reflection.AssemblyDescriptionAttribute("Shared Domain Models and DTOs for Fossa UI and API")>]
|
|
13
|
-
[<assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.
|
|
14
|
-
[<assembly: System.Reflection.AssemblyInformationalVersionAttribute("0.1.
|
|
13
|
+
[<assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.1.0")>]
|
|
14
|
+
[<assembly: System.Reflection.AssemblyInformationalVersionAttribute("0.1.1+45a2ba54d0b46c1d793d2a6b37a90cd9633f546b")>]
|
|
15
15
|
[<assembly: System.Reflection.AssemblyProductAttribute("Fossa.Bridge")>]
|
|
16
16
|
[<assembly: System.Reflection.AssemblyTitleAttribute("Fossa.Bridge")>]
|
|
17
|
-
[<assembly: System.Reflection.AssemblyVersionAttribute("0.1.
|
|
17
|
+
[<assembly: System.Reflection.AssemblyVersionAttribute("0.1.1.0")>]
|
|
18
18
|
do()
|
|
@@ -14,7 +14,7 @@ using System.Reflection;
|
|
|
14
14
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
|
|
15
15
|
[assembly: System.Reflection.AssemblyDescriptionAttribute("Shared Domain Models and DTOs for Fossa UI and API")]
|
|
16
16
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
|
17
|
-
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+
|
|
17
|
+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+45a2ba54d0b46c1d793d2a6b37a90cd9633f546b")]
|
|
18
18
|
[assembly: System.Reflection.AssemblyProductAttribute("Fossa.Bridge.fable-temp")]
|
|
19
19
|
[assembly: System.Reflection.AssemblyTitleAttribute("Fossa.Bridge.fable-temp")]
|
|
20
20
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"documents":{"D:\\GitHub\\fossa-app\\Bridge\\*":"https://raw.githubusercontent.com/fossa-app/Bridge/
|
|
1
|
+
{"documents":{"D:\\GitHub\\fossa-app\\Bridge\\*":"https://raw.githubusercontent.com/fossa-app/Bridge/45a2ba54d0b46c1d793d2a6b37a90cd9633f546b/*"}}
|
|
@@ -10,7 +10,7 @@ open System.Reflection
|
|
|
10
10
|
[<assembly: System.Reflection.AssemblyCompanyAttribute("Fossa.Bridge.Tests")>]
|
|
11
11
|
[<assembly: System.Reflection.AssemblyConfigurationAttribute("Release")>]
|
|
12
12
|
[<assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")>]
|
|
13
|
-
[<assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+
|
|
13
|
+
[<assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+45a2ba54d0b46c1d793d2a6b37a90cd9633f546b")>]
|
|
14
14
|
[<assembly: System.Reflection.AssemblyProductAttribute("Fossa.Bridge.Tests")>]
|
|
15
15
|
[<assembly: System.Reflection.AssemblyTitleAttribute("Fossa.Bridge.Tests")>]
|
|
16
16
|
[<assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")>]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"documents":{"D:\\GitHub\\fossa-app\\Bridge\\*":"https://raw.githubusercontent.com/fossa-app/Bridge/
|
|
1
|
+
{"documents":{"D:\\GitHub\\fossa-app\\Bridge\\*":"https://raw.githubusercontent.com/fossa-app/Bridge/45a2ba54d0b46c1d793d2a6b37a90cd9633f546b/*"}}
|