scaffold: add project structure, schema, and gitignore
This commit is contained in:
16
.gitignore
vendored
Normal file
16
.gitignore
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# SQLite database (local state)
|
||||||
|
porting.db
|
||||||
|
porting.db-journal
|
||||||
|
porting.db-wal
|
||||||
|
porting.db-shm
|
||||||
|
|
||||||
|
# .NET build output
|
||||||
|
tools/NatsNet.PortTracker/bin/
|
||||||
|
tools/NatsNet.PortTracker/obj/
|
||||||
|
|
||||||
|
# Go build output
|
||||||
|
tools/go-analyzer/go-analyzer
|
||||||
|
|
||||||
|
# OS files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
121
porting-schema.sql
Normal file
121
porting-schema.sql
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
-- porting-schema.sql
|
||||||
|
-- Schema for NATS server Go-to-.NET porting tracker
|
||||||
|
|
||||||
|
PRAGMA journal_mode=WAL;
|
||||||
|
PRAGMA foreign_keys=ON;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS modules (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
name TEXT NOT NULL,
|
||||||
|
description TEXT,
|
||||||
|
go_package TEXT,
|
||||||
|
go_file TEXT,
|
||||||
|
go_line_start INTEGER,
|
||||||
|
go_line_count INTEGER,
|
||||||
|
status TEXT NOT NULL DEFAULT 'not_started'
|
||||||
|
CHECK (status IN ('not_started', 'stub', 'complete', 'verified', 'n_a')),
|
||||||
|
dotnet_project TEXT,
|
||||||
|
dotnet_namespace TEXT,
|
||||||
|
dotnet_class TEXT,
|
||||||
|
notes TEXT,
|
||||||
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS features (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
module_id INTEGER NOT NULL REFERENCES modules(id) ON DELETE CASCADE,
|
||||||
|
name TEXT NOT NULL,
|
||||||
|
description TEXT,
|
||||||
|
go_file TEXT,
|
||||||
|
go_class TEXT,
|
||||||
|
go_method TEXT,
|
||||||
|
go_line_number INTEGER,
|
||||||
|
go_line_count INTEGER,
|
||||||
|
status TEXT NOT NULL DEFAULT 'not_started'
|
||||||
|
CHECK (status IN ('not_started', 'stub', 'complete', 'verified', 'n_a')),
|
||||||
|
dotnet_project TEXT,
|
||||||
|
dotnet_class TEXT,
|
||||||
|
dotnet_method TEXT,
|
||||||
|
notes TEXT,
|
||||||
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS unit_tests (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
module_id INTEGER NOT NULL REFERENCES modules(id) ON DELETE CASCADE,
|
||||||
|
feature_id INTEGER REFERENCES features(id) ON DELETE SET NULL,
|
||||||
|
name TEXT NOT NULL,
|
||||||
|
description TEXT,
|
||||||
|
go_file TEXT,
|
||||||
|
go_class TEXT,
|
||||||
|
go_method TEXT,
|
||||||
|
go_line_number INTEGER,
|
||||||
|
go_line_count INTEGER,
|
||||||
|
status TEXT NOT NULL DEFAULT 'not_started'
|
||||||
|
CHECK (status IN ('not_started', 'stub', 'complete', 'verified', 'n_a')),
|
||||||
|
dotnet_project TEXT,
|
||||||
|
dotnet_class TEXT,
|
||||||
|
dotnet_method TEXT,
|
||||||
|
notes TEXT,
|
||||||
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS dependencies (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
source_type TEXT NOT NULL CHECK (source_type IN ('module', 'feature', 'unit_test')),
|
||||||
|
source_id INTEGER NOT NULL,
|
||||||
|
target_type TEXT NOT NULL CHECK (target_type IN ('module', 'feature', 'unit_test')),
|
||||||
|
target_id INTEGER NOT NULL,
|
||||||
|
dependency_kind TEXT DEFAULT 'calls',
|
||||||
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
UNIQUE (source_type, source_id, target_type, target_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS library_mappings (
|
||||||
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
|
go_import_path TEXT NOT NULL UNIQUE,
|
||||||
|
go_library_name TEXT,
|
||||||
|
go_usage_description TEXT,
|
||||||
|
dotnet_package TEXT,
|
||||||
|
dotnet_namespace TEXT,
|
||||||
|
dotnet_usage_notes TEXT,
|
||||||
|
status TEXT NOT NULL DEFAULT 'not_mapped'
|
||||||
|
CHECK (status IN ('not_mapped', 'mapped', 'verified')),
|
||||||
|
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
|
||||||
|
-- Indexes
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_features_module ON features(module_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_features_status ON features(status);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_unit_tests_module ON unit_tests(module_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_unit_tests_feature ON unit_tests(feature_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_unit_tests_status ON unit_tests(status);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_deps_source ON dependencies(source_type, source_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_deps_target ON dependencies(target_type, target_id);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_library_status ON library_mappings(status);
|
||||||
|
CREATE INDEX IF NOT EXISTS idx_modules_status ON modules(status);
|
||||||
|
|
||||||
|
-- Triggers to auto-update updated_at
|
||||||
|
CREATE TRIGGER IF NOT EXISTS trg_modules_updated AFTER UPDATE ON modules
|
||||||
|
BEGIN
|
||||||
|
UPDATE modules SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id;
|
||||||
|
END;
|
||||||
|
|
||||||
|
CREATE TRIGGER IF NOT EXISTS trg_features_updated AFTER UPDATE ON features
|
||||||
|
BEGIN
|
||||||
|
UPDATE features SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id;
|
||||||
|
END;
|
||||||
|
|
||||||
|
CREATE TRIGGER IF NOT EXISTS trg_unit_tests_updated AFTER UPDATE ON unit_tests
|
||||||
|
BEGIN
|
||||||
|
UPDATE unit_tests SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id;
|
||||||
|
END;
|
||||||
|
|
||||||
|
CREATE TRIGGER IF NOT EXISTS trg_library_mappings_updated AFTER UPDATE ON library_mappings
|
||||||
|
BEGIN
|
||||||
|
UPDATE library_mappings SET updated_at = CURRENT_TIMESTAMP WHERE id = NEW.id;
|
||||||
|
END;
|
||||||
15
tools/NatsNet.PortTracker/NatsNet.PortTracker.csproj
Normal file
15
tools/NatsNet.PortTracker/NatsNet.PortTracker.csproj
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.3" />
|
||||||
|
<PackageReference Include="System.CommandLine" Version="3.0.0-preview.1.26104.118" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
2
tools/NatsNet.PortTracker/Program.cs
Normal file
2
tools/NatsNet.PortTracker/Program.cs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// See https://aka.ms/new-console-template for more information
|
||||||
|
Console.WriteLine("Hello, World!");
|
||||||
3
tools/go-analyzer/go.mod
Normal file
3
tools/go-analyzer/go.mod
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
module github.com/natsnet/go-analyzer
|
||||||
|
|
||||||
|
go 1.25.5
|
||||||
Reference in New Issue
Block a user