Skip to content

Commit aca017a

Browse files
authored
[Blazor] Remove checked-in JS files (#53209)
* [Blazor] Remove checked-in JS files * Update .gitignore and fix paths * Update images to Centos8 * Update ubuntu images * Make sure NPM scripts build inside sourcebuild * Disable running Firefox on Mac OS
1 parent dc11a2a commit aca017a

File tree

13 files changed

+60
-44
lines changed

13 files changed

+60
-44
lines changed

.azure/pipelines/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ stages:
562562
jobDisplayName: "Build: Linux Musl ARM"
563563
agentOs: Linux
564564
useHostedUbuntu: false
565-
container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm-alpine
565+
container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm-alpine
566566
buildArgs:
567567
--arch arm
568568
--os-name linux-musl
@@ -594,7 +594,7 @@ stages:
594594
jobDisplayName: "Build: Linux Musl ARM64"
595595
agentOs: Linux
596596
useHostedUbuntu: false
597-
container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm64-alpine
597+
container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm64-alpine
598598
buildArgs:
599599
--arch arm64
600600
--os-name linux-musl
@@ -721,7 +721,7 @@ stages:
721721
parameters:
722722
platform:
723723
name: 'Managed'
724-
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8'
724+
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8-20240104210103-4893224'
725725
buildScript: './eng/build.sh $(_PublishArgs) --no-build-repo-tasks $(_InternalRuntimeDownloadArgs)'
726726
skipPublishValidation: true
727727
jobProperties:

eng/Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<ProjectToBuild Condition=" $(BuildNative) " Include="@(NativeProjects)" Exclude="@(ProjectToExclude)" />
125125
<ProjectToExclude Condition=" !$(BuildNative) " Include="@(NativeProjects)" />
126126

127-
<NodeJsProjects Condition="'$(TargetArchitecture)' == 'x64'"
127+
<NodeJsProjects
128128
Include="$(RepoRoot)eng\Npm.Workspace.nodeproj;
129129
$(RepoRoot)eng\Npm.Workspace.FunctionalTests.nodeproj;"
130130
AdditionalProperties="BuildInParallel=false"

eng/Npm.Workspace.nodeproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.props" />
55

66
<PropertyGroup>
7+
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
78
<IsTestProject>true</IsTestProject>
89
<IsUnitTestProject>true</IsUnitTestProject>
910
<TestDependsOnAspNetPackages>false</TestDependsOnAspNetPackages>

eng/SourceBuild.props

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,35 @@
8383
</ItemGroup>
8484
</Target>
8585

86+
<Target Name="RestoreNpmPackages"
87+
BeforeTargets="RunInnerSourceBuildCommand">
88+
89+
<Message Text="Checking node version..." Importance="high" />
90+
<Exec
91+
Command="node --version"
92+
WorkingDirectory="$(InnerSourceBuildRepoRoot)" />
93+
94+
<Message Text="Checking npm version..." Importance="high" />
95+
<Exec
96+
Command="npm --version"
97+
WorkingDirectory="$(InnerSourceBuildRepoRoot)" />
98+
99+
<Exec
100+
Command="npm ci"
101+
WorkingDirectory="$(InnerSourceBuildRepoRoot)" />
102+
103+
</Target>
104+
105+
<Target Name="BuildNpmFiles"
106+
DependsOnTargets="RestoreNpmPackages"
107+
BeforeTargets="RunInnerSourceBuildCommand">
108+
109+
<Message Text="Building Node JS files..." Importance="high" />
110+
111+
<Exec
112+
Command="npm run build"
113+
WorkingDirectory="$(InnerSourceBuildRepoRoot)" />
114+
115+
</Target>
116+
86117
</Project>

eng/common/templates/jobs/source-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parameters:
1414
# This is the default platform provided by Arcade, intended for use by a managed-only repo.
1515
defaultManagedPlatform:
1616
name: 'Managed'
17-
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8'
17+
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8-20240104210103-4893224'
1818

1919
# Defines the platforms on which to run build jobs. One job is created for each platform, and the
2020
# object in this array is sent to the job template as 'platform'. If no platforms are specified,

src/Components/Endpoints/src/Microsoft.AspNetCore.Components.Endpoints.csproj

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,15 @@
5757
<Reference Include="Microsoft.Extensions.FileProviders.Embedded" />
5858
</ItemGroup>
5959

60-
<PropertyGroup>
61-
<BlazorWebJSFilename>blazor.web.js</BlazorWebJSFilename>
62-
<BlazorWebJSFile Condition=" '$(Configuration)' == 'Debug' ">..\..\Web.JS\dist\Debug\$(BlazorWebJSFilename)</BlazorWebJSFile>
63-
<BlazorWebJSFile Condition=" '$(Configuration)' != 'Debug' ">..\..\Web.JS\dist\Release\$(BlazorWebJSFilename)</BlazorWebJSFile>
64-
</PropertyGroup>
65-
66-
<Target Name="_CheckBlazorWebJSPath" AfterTargets="ResolveProjectReferences" Condition=" !EXISTS('$(BlazorWebJSFile)') ">
67-
<Warning Text="'$(BlazorWebJSFile)' does not exist. Falling back to checked-in copy." />
60+
<Target Name="_AddEmbeddedBlazorWebJS" BeforeTargets="_CalculateEmbeddedFilesManifestInputs">
6861
<PropertyGroup>
69-
<BlazorWebJSFile>..\..\Web.JS\dist\Release\$(BlazorWebJSFilename)</BlazorWebJSFile>
62+
<BlazorWebJSFilename>blazor.web.js</BlazorWebJSFilename>
63+
<BlazorWebJSFile Condition=" '$(Configuration)' == 'Debug' ">$(MSBuildThisFileDirectory)..\..\Web.JS\dist\Debug\$(BlazorWebJSFilename)</BlazorWebJSFile>
64+
<BlazorWebJSFile Condition=" '$(Configuration)' != 'Debug' ">$(MSBuildThisFileDirectory)..\..\Web.JS\dist\Release\$(BlazorWebJSFilename)</BlazorWebJSFile>
7065
</PropertyGroup>
71-
</Target>
7266

73-
<Target Name="_AddEmbeddedBlazorWebJS" AfterTargets="_CheckBlazorWebJSPath">
67+
<Warning Condition="!Exists('$(BlazorWebJSFile)')" Text="'$(BlazorWebJSFile)' does not exist. Ensure the JS assets have been build by running 'npm run build' from the repository root." />
68+
7469
<ItemGroup>
7570
<EmbeddedResource Include="$(BlazorWebJSFile)" LogicalName="_framework/$(BlazorWebJSFilename)" />
7671
<EmbeddedResource Include="$(BlazorWebJSFile).map" LogicalName="_framework/$(BlazorWebJSFilename).map" Condition="Exists('$(BlazorWebJSFile).map')" />

src/Components/Server/src/Microsoft.AspNetCore.Components.Server.csproj

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,20 +98,15 @@
9898
<Compile Include="$(RepoRoot)src\Shared\Components\ProtectedPrerenderComponentApplicationStore.cs" />
9999
</ItemGroup>
100100

101-
<PropertyGroup>
102-
<BlazorServerJSFilename>blazor.server.js</BlazorServerJSFilename>
103-
<BlazorServerJSFile Condition=" '$(Configuration)' == 'Debug' ">..\..\Web.JS\dist\Debug\$(BlazorServerJSFilename)</BlazorServerJSFile>
104-
<BlazorServerJSFile Condition=" '$(Configuration)' != 'Debug' ">..\..\Web.JS\dist\Release\$(BlazorServerJSFilename)</BlazorServerJSFile>
105-
</PropertyGroup>
106-
107-
<Target Name="_CheckBlazorServerJSPath" AfterTargets="ResolveProjectReferences" Condition=" !EXISTS('$(BlazorServerJSFile)') ">
108-
<Warning Text="'$(BlazorServerJSFile)' does not exist. Falling back to checked-in copy." />
101+
<Target Name="_AddEmbeddedBlazor" BeforeTargets="_CalculateEmbeddedFilesManifestInputs">
109102
<PropertyGroup>
110-
<BlazorServerJSFile>..\..\Web.JS\dist\Release\$(BlazorServerJSFilename)</BlazorServerJSFile>
103+
<BlazorServerJSFilename>blazor.server.js</BlazorServerJSFilename>
104+
<BlazorServerJSFile Condition=" '$(Configuration)' == 'Debug' ">$(MSBuildThisFileDirectory)..\..\Web.JS\dist\Debug\$(BlazorServerJSFilename)</BlazorServerJSFile>
105+
<BlazorServerJSFile Condition=" '$(Configuration)' != 'Debug' ">$(MSBuildThisFileDirectory)..\..\Web.JS\dist\Release\$(BlazorServerJSFilename)</BlazorServerJSFile>
111106
</PropertyGroup>
112-
</Target>
113107

114-
<Target Name="_AddEmbeddedBlazor" AfterTargets="_CheckBlazorServerJSPath">
108+
<Warning Condition="!Exists('$(BlazorServerJSFile)')" Text="'$(BlazorServerJSFile)' does not exist. Ensure the JS assets have been build by running 'npm run build' from the repository root." />
109+
115110
<ItemGroup>
116111
<EmbeddedResource Include="$(BlazorServerJSFile)" LogicalName="_framework/$(BlazorServerJSFilename)" />
117112
<EmbeddedResource Include="$(BlazorServerJSFile).map" LogicalName="_framework/$(BlazorServerJSFilename).map" Condition="Exists('$(BlazorServerJSFile).map')" />

src/Components/Web.JS/.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
node_modules/
2-
dist/Debug/
3-
dist/Release/blazor.webassembly.js
4-
dist/Release/blazor.webview.js
2+
dist/
3+
dist/

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Components/Web.JS/dist/Release/blazor.web.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Components/Web.JS/dist/Release/blazor.webview.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,16 @@
5656

5757
<UsingTask AssemblyFile="$(_FileProviderTaskAssembly)" TaskName="Microsoft.Extensions.FileProviders.Embedded.Manifest.Task.GenerateEmbeddedResourcesManifest" />
5858

59-
<PropertyGroup>
60-
<BlazorWebViewJSFilename>blazor.webview.js</BlazorWebViewJSFilename>
61-
<BlazorWebViewJSFile Condition=" '$(Configuration)' == 'Debug' ">..\..\..\Web.JS\dist\Debug\$(BlazorWebViewJSFilename)</BlazorWebViewJSFile>
62-
<BlazorWebViewJSFile Condition=" '$(Configuration)' != 'Debug' ">..\..\..\Web.JS\dist\Release\$(BlazorWebViewJSFilename)</BlazorWebViewJSFile>
63-
</PropertyGroup>
59+
<Target Name="_AddEmbeddedBlazorWebView" BeforeTargets="_CalculateEmbeddedFilesManifestInputs">
6460

65-
<Target Name="_CheckBlazorWebViewJSPath" AfterTargets="ResolveProjectReferences" Condition=" !EXISTS('$(BlazorWebViewJSFile)') ">
66-
<Warning Text="'$(BlazorWebViewJSFile)' does not exist. Falling back to checked-in copy." />
6761
<PropertyGroup>
68-
<BlazorWebViewJSFile>..\..\..\Web.JS\dist\Release\$(BlazorWebViewJSFilename)</BlazorWebViewJSFile>
62+
<BlazorWebViewJSFilename>blazor.webview.js</BlazorWebViewJSFilename>
63+
<BlazorWebViewJSFile Condition=" '$(Configuration)' == 'Debug' ">$(MSBuildThisFileDirectory)..\..\..\Web.JS\dist\Debug\$(BlazorWebViewJSFilename)</BlazorWebViewJSFile>
64+
<BlazorWebViewJSFile Condition=" '$(Configuration)' != 'Debug' ">$(MSBuildThisFileDirectory)..\..\..\Web.JS\dist\Release\$(BlazorWebViewJSFilename)</BlazorWebViewJSFile>
6965
</PropertyGroup>
70-
</Target>
7166

72-
<Target Name="_AddEmbeddedBlazorWebView" BeforeTargets="_CalculateEmbeddedFilesManifestInputs" DependsOnTargets="_CheckBlazorWebViewJSPath">
67+
<Warning Condition="!Exists('$(BlazorWebViewJSFile)')" Text="'$(BlazorWebViewJSFile)' does not exist. Ensure the JS assets have been build by running 'npm run build' from the repository root." />
68+
7369
<ItemGroup>
7470
<EmbeddedResource Include="blazor.modules.json" LogicalName="_framework/blazor.modules.json" />
7571
<EmbeddedResource Include="$(BlazorWebViewJSFile)" LogicalName="_framework/$(BlazorWebViewJSFilename)" />

src/SignalR/clients/ts/FunctionalTests/scripts/karma.local.conf.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const os = require('os');
2+
13
try {
24
// Karma configuration for a local run (the default)
35
const createKarmaConfig = require("./karma.base.conf");
@@ -45,7 +47,7 @@ try {
4547
// We use the launchers themselves to figure out if the browser exists. It's a bit sneaky, but it works.
4648
tryAddBrowser("ChromeHeadlessNoSandbox", ChromeHeadlessBrowser.prototype);
4749
tryAddBrowser("ChromiumHeadlessIgnoreCert", ChromiumHeadlessBrowser.prototype);
48-
if (!tryAddBrowser("FirefoxHeadless", FirefoxHeadlessBrowser.prototype)) {
50+
if (os.platform() !== 'darwin' && !tryAddBrowser("FirefoxHeadless", FirefoxHeadlessBrowser.prototype)) {
4951
tryAddBrowser("FirefoxDeveloperHeadless", FirefoxDeveloperHeadlessBrowser.prototype);
5052
}
5153

0 commit comments

Comments
 (0)