Skip to content

Commit 4cf220a

Browse files
author
Jarosław Żołnowski
authored
chore: migrate to npm and improve the setup around front-end dependencies (#3)
- Migrate to npm for front-end dependencies. - Remove `Scripts/` folder. - Update `engines` fields in `package.json` (Node.js v16, npm v8) and generate lockfile with new versions. - Add `switch-to-lts-packages` npm script to easily switch to LTS packages. - Update `README.md`.
1 parent b0fea29 commit 4cf220a

22 files changed

+224
-63265
lines changed

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@xlts.dev:registry=https://registry.xlts.dev/
2+
//registry.xlts.dev/:always-auth=true

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16

App_Start/BundleConfig.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public static void RegisterBundles(BundleCollection bundles)
1010
{
1111
// Bundle JavaScript files.
1212
bundles.Add(new ScriptBundle("~/bundles/scripts")
13-
.Include("~/Scripts/jquery-{version}.js")
14-
.Include("~/Scripts/angular.min.js")
13+
.Include("~/node_modules/jquery/dist/jquery.min.js")
14+
.Include("~/node_modules/angular/angular.min.js")
1515
.IncludeDirectory("~/WebApp", "*.js", false)
1616
.IncludeDirectory("~/WebApp/Components", "*.js", true)
1717
.IncludeDirectory("~/WebApp/Directives", "*.js", true));

Properties/AssemblyInfo.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Runtime.CompilerServices;
33
using System.Runtime.InteropServices;
44

5-
// General Information about an assembly is controlled through the following
5+
// General Information about an assembly is controlled through the following
66
// set of attributes. Change these attribute values to modify the information
77
// associated with an assembly.
88
[assembly: AssemblyTitle("asp_net_angularjs")]
@@ -14,22 +14,19 @@
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

17-
// Setting ComVisible to false makes the types in this assembly not visible
18-
// to COM components. If you need to access a type in this assembly from
17+
// Setting ComVisible to false makes the types in this assembly not visible
18+
// to COM components. If you need to access a type in this assembly from
1919
// COM, set the ComVisible attribute to true on that type.
2020
[assembly: ComVisible(false)]
2121

2222
// The following GUID is for the ID of the typelib if this project is exposed to COM
2323
[assembly: Guid("43046e18-f0d2-4443-98d5-4650bdcb3a8b")]
2424

2525
// Version information for an assembly consists of the following four values:
26-
//
27-
// Major Version
28-
// Minor Version
29-
// Build Number
30-
// Revision
31-
//
32-
// You can specify all the values or you can default the Revision and Build Numbers
33-
// by using the '*' as shown below:
26+
// Major Version
27+
// Minor Version
28+
// Build Number
29+
// Revision
30+
3431
[assembly: AssemblyVersion("1.0.0.0")]
3532
[assembly: AssemblyFileVersion("1.0.0.0")]

README.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# AngularJS with .NET Framework
2-
A project using AngularJS, .NET Framework 4.8, and ASP.NET MVC 5.
2+
A demo project using AngularJS, .NET Framework 4.8, and ASP.NET MVC 5.
33

44
## Features
55

6-
- AngularJS 1.8.2 LTS - installed using NuGet
7-
- jQuery 3.6.0 - installed using NuGet
6+
- XLTS for AngularJS - installed using npm
7+
- jQuery 3.6.3 - installed using npm
88
- .NET Framework 4.8
99
- ASP.NET MVC 5
1010
- Bundling using [Microsoft.AspNet.Web.Optimization](https://docs.microsoft.com/en-us/aspnet/mvc/overview/performance/bundling-and-minification)
@@ -18,8 +18,17 @@ Older versions of Visual Studio may work but have not been tested.
1818
as part of the Visual Studio 2022 installation as well.
1919

2020
## Getting Started
21+
- Make sure you have configured your authentication with the XLTS.dev registry by supplying your token in the `.npmrc` file in your user home directory.
2122

22-
- Clone this repository: `git clone https://github.com/xlts-dev/angularjs-asp-net48-mvc5.git`.
23-
- Ensure packages are up to date by running `Update-Package -reinstall` from the *Package Manager Console*.
23+
> **Note**
24+
> If you don't have a token for the XLTS.dev registry, you can use the LTS AngularJS packages - see the next section.
25+
26+
- Clone repository: `git clone https://github.com/xlts-dev/angularjs-asp-net48-mvc5.git`.
27+
- Switch to the project's directory: `cd angularjs-asp-net48-mvc5`.
28+
- Install npm packages: `npm install`.
29+
- Open the project in Visual Studio.
2430
- Run the project by pressing the `F5` key or using the green start button in the toolbar. This will launch your web
25-
browser and display the web application.
31+
browser and display the web application.
32+
33+
## AngularJS LTS packages
34+
If you want to use the LTS packages, you have to run `npm run switch-to-lts-packages` script instead of `npm install`.

0 commit comments

Comments
 (0)