Skip to content
Open
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,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetDatabaseName>Database</TargetDatabaseName>
<DeployScriptFileName>Database.sql</DeployScriptFileName>
<BlockOnPossibleDataLoss>False</BlockOnPossibleDataLoss>
<ProfileVersionNumber>1</ProfileVersionNumber>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { createBuilder } from './.modules/aspire.js';

const builder = await createBuilder();
const appHostDirectory = path.dirname(fileURLToPath(import.meta.url));
const projectPath = path.join(appHostDirectory, '..', 'SdkProject', 'SdkProject.csproj');
const publishProfilePath = path.join(appHostDirectory, '..', 'SdkProject', 'Database.publish.xml');

const sqlServer = await builder.addSqlServer('sql');
const database = await sqlServer.addDatabase('TargetDatabase');
const existingConnection = await builder.addConnectionString('Aspire');

const databaseProject = await builder.addSqlProject('database-project');
await databaseProject.withDacpac(projectPath);
await databaseProject.withDacDeployOptions(publishProfilePath);
await databaseProject.withSkipWhenDeployed();
await databaseProject.withReference(database);

const connectionProject = await builder.addSqlProject('connection-project');
await connectionProject.withDacpac(projectPath);
await connectionProject.withConnectionReference(existingConnection);

const _databaseProjectDacpacPath: string | null = await databaseProject.dacpacPath.get();
const _databaseProjectDacDeployOptionsPath: string | null = await databaseProject.dacDeployOptionsPath.get();
const _databaseProjectSkipWhenDeployed: boolean = await databaseProject.skipWhenDeployed.get();
const _connectionProjectDacpacPath: string | null = await connectionProject.dacpacPath.get();

await builder.build().run();
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"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": {
"Aspire.Hosting.SqlServer": "",
"CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects": "13.2.1-polyglot.local"
}
}
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