Skip to content

Commit 7c0a998

Browse files
committed
Update to .NET 5.0 & ESLint
Closes #51 and #46 Also includes latest code from VueCLI generated project and all ESLint issues resolved. VS Code works with debugging both C# and Vue, and Vetur & ESLint both function properly.
1 parent 18065bb commit 7c0a998

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+4222
-2842
lines changed

.eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
root: true,
3+
'extends': [
4+
'./ClientApp/.eslintrc.js'
5+
]
6+
}

.vscode/launch.json

+20-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
2+
// Use IntelliSense to find out which attributes exist for C# debugging
3+
// Use hover for the description of the existing attributes
4+
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
55
"version": "0.2.0",
66
"configurations": [
77
{
88
"name": ".NET Core Launch (web)",
99
"type": "coreclr",
1010
"request": "launch",
1111
"preLaunchTask": "build",
12-
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/AspNetCoreVueStarter.dll",
12+
// If you have changed target frameworks, make sure to update the program path.
13+
"program": "${workspaceFolder}/bin/Debug/net5.0/AspNetCoreVueStarter.dll",
1314
"args": [],
1415
"cwd": "${workspaceFolder}",
1516
"stopAtEntry": false,
17+
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
1618
"serverReadyAction": {
1719
"action": "openExternally",
18-
"pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"
20+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
1921
},
2022
"env": {
2123
"ASPNETCORE_ENVIRONMENT": "Development"
@@ -41,31 +43,37 @@
4143
"sourceMapPathOverrides": {
4244
"webpack:///*": "${webRoot}/*",
4345
"webpack:///./*": "${webRoot}/*",
44-
"webpack:///src/*": "${webRoot}/src/*"
46+
"webpack:///src/*": "${webRoot}/*"
4547
}
4648
},
4749
{
4850
"name": "Launch Firefox",
51+
"type": "firefox",
4952
"request": "launch",
5053
"url": "http://localhost:5000",
51-
"type": "firefox",
5254
"webRoot": "${workspaceFolder}/ClientApp",
5355
"pathMappings": [
5456
{
55-
"url": "webpack:///src",
56-
"path": "${webRoot}/src"
57+
"url": "webpack:///src/",
58+
"path": "${webRoot}/"
5759
}
5860
]
5961
}
6062
],
6163
"compounds": [
6264
{
6365
"name": "Debug SPA and API (Chrome)",
64-
"configurations": [".NET Core Launch (web)", "Launch Chrome"]
66+
"configurations": [
67+
".NET Core Launch (web)",
68+
"Launch Chrome"
69+
]
6570
},
6671
{
6772
"name": "Debug SPA and API (Firefox)",
68-
"configurations": [".NET Core Launch (web)", "Launch Firefox"]
73+
"configurations": [
74+
".NET Core Launch (web)",
75+
"Launch Firefox"
76+
]
6977
}
7078
]
71-
}
79+
}

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.workingDirectories": [{ "mode": "auto" }]
3+
}

.vscode/tasks.json

-10
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,6 @@
3737
"/consoleloggerparameters:NoSummary"
3838
],
3939
"problemMatcher": "$msCompile"
40-
},
41-
{
42-
"label": "build",
43-
"command": "dotnet",
44-
"type": "process",
45-
"args": [
46-
"build",
47-
"${workspaceFolder}/AspNetCoreVueStarter.csproj"
48-
],
49-
"problemMatcher": "$msCompile"
5040
}
5141
]
5242
}

AspNetCoreVueStarter.csproj

+9-23
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
66
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
77
<IsPackable>false</IsPackable>
@@ -13,38 +13,23 @@
1313
<Copyright>MIT 2020 Software Ateliers</Copyright>
1414
<AssemblyName>AspNetCoreVueStarter</AssemblyName>
1515
<RootNamespace>AspNetCoreVueStarter</RootNamespace>
16-
<Version>2.6.0</Version>
17-
<AssemblyVersion>2.6.0.0</AssemblyVersion>
18-
<FileVersion>2.6.0.0</FileVersion>
16+
<Version>2.7.0</Version>
17+
<AssemblyVersion>2.7.0.0</AssemblyVersion>
18+
<FileVersion>2.7.0.0</FileVersion>
1919
</PropertyGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.9" />
22+
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="5.0.1" />
2323
<PackageReference Include="VueCliMiddleware" Version="3.1.2" />
2424
</ItemGroup>
2525

2626
<ItemGroup>
2727
<!-- Don't publish the SPA source files, but do show them in the project files list -->
2828
<Content Remove="$(SpaRoot)**" />
29+
<None Remove="$(SpaRoot)**" />
2930
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
3031
</ItemGroup>
3132

32-
<ItemGroup>
33-
<None Remove="ClientApp\src\plugins\axios.ts" />
34-
</ItemGroup>
35-
36-
<ItemGroup>
37-
<Content Include="ClientApp\tsconfig.json" />
38-
</ItemGroup>
39-
40-
<ItemGroup>
41-
<None Include="README.md" />
42-
</ItemGroup>
43-
44-
<ItemGroup>
45-
<TypeScriptCompile Include="ClientApp\src\plugins\axios.ts" />
46-
</ItemGroup>
47-
4833
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
4934
<!-- Ensure Node.js is installed -->
5035
<Exec Command="node --version" ContinueOnError="true">
@@ -63,9 +48,10 @@
6348
<!-- Include the newly-built files in the publish output -->
6449
<ItemGroup>
6550
<DistFiles Include="$(SpaRoot)dist\**" />
66-
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
51+
<ResolvedFileToPublish Include="@(DistFiles-&gt;'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
6752
<RelativePath>%(DistFiles.Identity)</RelativePath>
6853
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
54+
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
6955
</ResolvedFileToPublish>
7056
</ItemGroup>
7157
</Target>

ClientApp/.browserslistrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
> 1%
22
last 2 versions
3-
not ie <= 8
3+
not dead

ClientApp/.eslintrc.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
env: {
3+
node: true
4+
},
5+
'extends': [
6+
'plugin:vue/essential',
7+
'@vue/standard',
8+
'@vue/typescript/recommended'
9+
],
10+
parserOptions: {
11+
ecmaVersion: 2020
12+
},
13+
rules: {
14+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
15+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
16+
}
17+
}

ClientApp/.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
node_modules
33
/dist
44

5+
56
# local env files
67
.env.local
78
.env.*.local
@@ -10,6 +11,7 @@ node_modules
1011
npm-debug.log*
1112
yarn-debug.log*
1213
yarn-error.log*
14+
pnpm-debug.log*
1315

1416
# Editor directories and files
1517
.idea
@@ -18,4 +20,4 @@ yarn-error.log*
1820
*.ntvs*
1921
*.njsproj
2022
*.sln
21-
*.sw*
23+
*.sw?

ClientApp/.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true

ClientApp/README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
# ASP.NET Core Vue Starter
1+
# clientapp
22

33
## Project setup
44
```
5-
npm install
5+
pnpm install
66
```
77

88
### Compiles and hot-reloads for development
99
```
10-
npm run serve
10+
pnpm run serve
1111
```
1212

1313
### Compiles and minifies for production
1414
```
15-
npm run build
15+
pnpm run build
1616
```
1717

1818
### Lints and fixes files
1919
```
20-
npm run lint
20+
pnpm run lint
2121
```
22+
23+
### Customize configuration
24+
See [Configuration Reference](https://cli.vuejs.org/config/).

ClientApp/babel.config.js

+2-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
11
module.exports = {
2-
"presets": [
3-
[
4-
"@vue/cli-plugin-babel/preset",
5-
{
6-
"useBuiltIns": "entry"
7-
}
8-
]
9-
],
10-
"plugins": [
11-
[
12-
"transform-imports",
13-
{
14-
"vuetify": {
15-
"transform": "vuetify/es5/components/${member}",
16-
"preventFullImport": true
17-
}
18-
}
19-
]
20-
]
21-
}
2+
presets: ['@vue/cli-plugin-babel/preset']
3+
};

0 commit comments

Comments
 (0)