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
2 changes: 1 addition & 1 deletion .github/actions/setup-runtimes-caching/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:
- name: Install Aspire CLI
uses: timheuer/setup-aspire@v0.1.0
with:
quality: release # temp workaround until url is fixed
quality: release

- name: Set up Python
uses: actions/setup-python@v5
Expand Down
5 changes: 2 additions & 3 deletions eng/testing/validate-typescript-apphost.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ param(
[Parameter(Mandatory = $true)]
[string]$PackageName,

[Parameter(Mandatory = $true)]
[string[]]$WaitForResources,
[string[]]$WaitForResources = @(),

[string[]]$RequiredCommands = @(),

Expand Down Expand Up @@ -87,7 +86,7 @@ if ([string]::IsNullOrWhiteSpace($PackageVersion)) {
$PackageVersion = "$versionPrefix-polyglot.local"
}

if ($WaitForResources.Count -eq 1) {
if ($WaitForResources.Count -eq 1 -and -not [string]::IsNullOrWhiteSpace($WaitForResources[0])) {
$splitOptions = [System.StringSplitOptions]::RemoveEmptyEntries -bor [System.StringSplitOptions]::TrimEntries
$WaitForResources = $WaitForResources[0].Split(",", $splitOptions)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { createBuilder } from './.modules/aspire.js';

const builder = await createBuilder();

let primary = await builder.addSurrealServer('primary', {
port: 18000,
path: 'memory',
strictMode: true,
});

primary = await primary.withDataVolume({ name: 'surreal-primary-data' });
primary = await primary.withLogLevel('Information');
primary = await primary.withSurrealist({ containerName: 'surrealist-primary' });
primary = await primary.withSurrealDbOtlpExporter();

let appNamespace = await primary.addNamespace('appns', { namespaceName: 'polyglotNs' });
appNamespace = await appNamespace.withCreationScript('DEFINE NAMESPACE IF NOT EXISTS `polyglotNs`;');

let appDatabase = await appNamespace.addDatabase('appdb', { databaseName: 'polyglotDb' });
appDatabase = await appDatabase.withCreationScript('DEFINE DATABASE IF NOT EXISTS `polyglotDb`;');

let mounted = await builder.addSurrealServer('mounted', {
port: 18001,
path: 'memory',
});
mounted = await mounted.withDataBindMount('./data');
mounted = await mounted.withInitFiles('./seed.surql');

const primaryResource = await primary;
const _primaryEndpoint = await primaryResource.primaryEndpoint.get();
const _primaryHost = await primaryResource.host.get();
const _primaryPort = await primaryResource.port.get();
const _primaryPasswordParameter = await primaryResource.passwordParameter.get();
const _primaryUri = await primaryResource.uriExpression.get();
const _primaryConnectionString = await primaryResource.connectionStringExpression.get();

const namespaceResource = await appNamespace;
const _namespaceParent = await namespaceResource.parent.get();
const _namespaceConnectionString = await namespaceResource.connectionStringExpression.get();
const _namespaceName = await namespaceResource.namespaceName.get();
const _namespaceParentName = await _namespaceParent.name.get();

if (false) {
const _primaryNamespace = await primaryResource.namespaces.get('appns');
const _namespaceDatabase = await namespaceResource.databases.get('appdb');
}

const databaseResource = await appDatabase;
const _databaseParent = await databaseResource.parent.get();
const _databaseConnectionString = await databaseResource.connectionStringExpression.get();
const _databaseName = await databaseResource.databaseName.get();
const _databaseParentName = await _databaseParent.name.get();
const _databaseServerName = await (await _databaseParent.parent.get()).name.get();

const mountedResource = await mounted;
const _mountedEndpoint = await mountedResource.primaryEndpoint.get();
const _mountedHost = await mountedResource.host.get();
const _mountedPort = await mountedResource.port.get();
const _mountedUri = await mountedResource.uriExpression.get();
const _mountedConnectionString = await mountedResource.connectionStringExpression.get();

await builder.build().run();
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"appHost": {
"path": "apphost.ts",
"language": "typescript/nodejs"
},
"profiles": {
"https": {
"applicationUrl": "https://localhost:29750;http://localhost:28931",
"environmentVariables": {
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:10975",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:13319"
}
}
},
"packages": {
"CommunityToolkit.Aspire.Hosting.SurrealDb": ""
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @ts-check

import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';

export default defineConfig({
files: ['apphost.ts'],
extends: [tseslint.configs.base],
languageOptions: {
parserOptions: {
projectService: true,
},
},
rules: {
'@typescript-eslint/no-floating-promises': ['error', { checkThenables: true }],
},
});
Loading
Loading