Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/backend-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,11 @@ jobs:
- name: Build
run: dotnet build ScriptBee.slnx --no-restore

- name: Restore .NET local tools
run: dotnet tool restore

- name: Run CSharpier format check
run: dotnet tool run csharpier check .

- name: Test
run: dotnet test ScriptBee.slnx --no-build --verbosity normal
4 changes: 1 addition & 3 deletions DxWorks.ScriptBee.Plugin.Api/HelperFunctions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
namespace DxWorks.ScriptBee.Plugin.Api;

public static partial class HelperFunctions
{
}
public static partial class HelperFunctions { }
7 changes: 5 additions & 2 deletions DxWorks.ScriptBee.Plugin.Api/IModelLinker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

public interface IModelLinker : IPlugin
{
public Task LinkModel(Dictionary<Tuple<string, string>, Dictionary<string, ScriptBeeModel>> context,
Dictionary<string, object>? configuration = default, CancellationToken cancellationToken = default);
public Task LinkModel(
Dictionary<Tuple<string, string>, Dictionary<string, ScriptBeeModel>> context,
Dictionary<string, object>? configuration = default,
CancellationToken cancellationToken = default
);

public string GetName();
}
23 changes: 17 additions & 6 deletions DxWorks.ScriptBee.Plugin.Api/IModelLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,26 @@

public interface IModelLoader : IPlugin
{
[Obsolete("Use LoadModel(IEnumerable<NamedFileStream> fileStreams, Dictionary<string, object>? configuration = default, CancellationToken cancellationToken = default) instead")]
public Task<Dictionary<string, Dictionary<string, ScriptBeeModel>>> LoadModel(List<Stream> fileStreams,
Dictionary<string, object>? configuration = default, CancellationToken cancellationToken = default);
[Obsolete(
"Use LoadModel(IEnumerable<NamedFileStream> fileStreams, Dictionary<string, object>? configuration = default, CancellationToken cancellationToken = default) instead"
)]
public Task<Dictionary<string, Dictionary<string, ScriptBeeModel>>> LoadModel(
List<Stream> fileStreams,
Dictionary<string, object>? configuration = default,
CancellationToken cancellationToken = default
);

public Task<Dictionary<string, Dictionary<string, ScriptBeeModel>>> LoadModel(
IEnumerable<NamedFileStream> fileStreams, Dictionary<string, object>? configuration = default,
CancellationToken cancellationToken = default)
IEnumerable<NamedFileStream> fileStreams,
Dictionary<string, object>? configuration = default,
CancellationToken cancellationToken = default
)
{
return LoadModel(fileStreams.Select(x => x.Stream).ToList(), configuration, cancellationToken);
return LoadModel(

Check warning on line 22 in DxWorks.ScriptBee.Plugin.Api/IModelLoader.cs

View workflow job for this annotation

GitHub Actions / Build and Test

'IModelLoader.LoadModel(List<Stream>, Dictionary<string, object>?, CancellationToken)' is obsolete: 'Use LoadModel(IEnumerable<NamedFileStream> fileStreams, Dictionary<string, object>? configuration = default, CancellationToken cancellationToken = default) instead'

Check warning on line 22 in DxWorks.ScriptBee.Plugin.Api/IModelLoader.cs

View workflow job for this annotation

GitHub Actions / Build and Test

'IModelLoader.LoadModel(List<Stream>, Dictionary<string, object>?, CancellationToken)' is obsolete: 'Use LoadModel(IEnumerable<NamedFileStream> fileStreams, Dictionary<string, object>? configuration = default, CancellationToken cancellationToken = default) instead'

Check warning on line 22 in DxWorks.ScriptBee.Plugin.Api/IModelLoader.cs

View workflow job for this annotation

GitHub Actions / Build and Test

'IModelLoader.LoadModel(List<Stream>, Dictionary<string, object>?, CancellationToken)' is obsolete: 'Use LoadModel(IEnumerable<NamedFileStream> fileStreams, Dictionary<string, object>? configuration = default, CancellationToken cancellationToken = default) instead'

Check warning on line 22 in DxWorks.ScriptBee.Plugin.Api/IModelLoader.cs

View workflow job for this annotation

GitHub Actions / Build and Test

'IModelLoader.LoadModel(List<Stream>, Dictionary<string, object>?, CancellationToken)' is obsolete: 'Use LoadModel(IEnumerable<NamedFileStream> fileStreams, Dictionary<string, object>? configuration = default, CancellationToken cancellationToken = default) instead'
fileStreams.Select(x => x.Stream).ToList(),
configuration,
cancellationToken
);
}

public string GetName();
Expand Down
4 changes: 1 addition & 3 deletions DxWorks.ScriptBee.Plugin.Api/IPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
namespace DxWorks.ScriptBee.Plugin.Api;

public interface IPlugin
{
}
public interface IPlugin { }
35 changes: 26 additions & 9 deletions DxWorks.ScriptBee.Plugin.Api/IScriptGeneratorStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,37 @@ public interface IScriptGeneratorStrategy : IPlugin

public string GenerateClassName(Type classType);

public string GenerateClassName(Type classType, Type baseClassType, out HashSet<Type> baseClassGenericTypes);
public string GenerateClassName(
Type classType,
Type baseClassType,
out HashSet<Type> baseClassGenericTypes
);

public string GenerateClassStart();

public string GenerateClassEnd();

public string GenerateField(string fieldModifier, Type fieldType, string fieldName,
out HashSet<Type> genericTypes);

public string GenerateProperty(string propertyModifier, Type propertyType, string propertyName,
out HashSet<Type> genericTypes);

public string GenerateMethod(string methodModifier, Type methodType, string methodName,
List<Tuple<Type, string>> methodParams, out HashSet<Type> genericTypes);
public string GenerateField(
string fieldModifier,
Type fieldType,
string fieldName,
out HashSet<Type> genericTypes
);

public string GenerateProperty(
string propertyModifier,
Type propertyType,
string propertyName,
out HashSet<Type> genericTypes
);

public string GenerateMethod(
string methodModifier,
Type methodType,
string methodName,
List<Tuple<Type, string>> methodParams,
out HashSet<Type> genericTypes
);

public string GenerateModelDeclaration(string modelType);

Expand Down
9 changes: 7 additions & 2 deletions DxWorks.ScriptBee.Plugin.Api/IScriptRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ public interface IScriptRunner : IPlugin
{
public string Language { get; } // todo move in manifest.yaml

public Task RunAsync(IProject project, IHelperFunctionsContainer helperFunctionsContainer,
IEnumerable<ScriptParameter> parameters, string scriptContent, CancellationToken cancellationToken = default);
public Task RunAsync(
IProject project,
IHelperFunctionsContainer helperFunctionsContainer,
IEnumerable<ScriptParameter> parameters,
string scriptContent,
CancellationToken cancellationToken = default
);
}
10 changes: 8 additions & 2 deletions DxWorks.ScriptBee.Plugin.Api/Model/IContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

public interface IContext
{
public Dictionary<Tuple<string, string>, Dictionary<string, ScriptBeeModel>> Models { get; set; }
public Dictionary<
Tuple<string, string>,
Dictionary<string, ScriptBeeModel>
> Models { get; set; }

public Dictionary<Tuple<string, string>, Dictionary<string, string>> Tags { get; set; }

public void SetModel(Tuple<string, string> tuple, Dictionary<string, ScriptBeeModel> objectsDictionary);
public void SetModel(
Tuple<string, string> tuple,
Dictionary<string, ScriptBeeModel> objectsDictionary
);
public void RemoveLoaderEntries(string sourceName);

public List<object> GetClasses();
Expand Down
2 changes: 1 addition & 1 deletion DxWorks.ScriptBee.Plugin.Api/ScriptBeeModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ namespace DxWorks.ScriptBee.Plugin.Api;
public class ScriptBeeModel : Expando
{
public bool Ignored { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

public interface IHelperFunctionsResultService
{
Task UploadResultAsync(string fileName, string type, string content, CancellationToken cancellationToken = default);
Task UploadResultAsync(
string fileName,
string type,
string content,
CancellationToken cancellationToken = default
);

Task UploadResultAsync(string fileName, string type, Stream content, CancellationToken cancellationToken = default);
Task UploadResultAsync(
string fileName,
string type,
Stream content,
CancellationToken cancellationToken = default
);

void UploadResult(string fileName, string type, string content);

Expand Down
2 changes: 1 addition & 1 deletion Plugins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Changed

- update `Jint` to 4.16.0
- update `Jint` to 4.16.1
- update `Microsoft.CodeAnalysis` to 5.9.0
- update `@angular/common` to 22.1.2
- update `@angular/compiler` to 22.1.2
Expand Down
Loading