Skip to content

Commit bbe3f51

Browse files
authored
Merge pull request #8851 from NuGet/main
[ReleasePrep][2021.10.15]FI of main into dev
2 parents 78357e1 + 790313d commit bbe3f51

4 files changed

Lines changed: 83 additions & 41 deletions

File tree

README.md

Lines changed: 29 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,30 @@
1-
[NuGet Gallery](http://nuget.org/) — Where packages are found
1+
[NuGet Gallery](https://www.nuget.org/) — Where packages are found
22
=======================================================================
33

4-
This is an implementation of the NuGet Gallery and API. This serves as the back-end and community
5-
website for the NuGet client. For information about the NuGet project, visit the [Home repository](https://github.com/nuget/home).
4+
This project powers [nuget.org](https://www.nuget.org), the home for .NET's open-source ecosystem. For information about NuGet, visit the [Home repository](https://github.com/nuget/home).
65

76
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
87

9-
## Build and Run the Gallery in (arbitrary number) easy steps
8+
## Getting started
109

11-
1. Prerequisites:
12-
1. Visual Studio 2019 - Install the following `Workloads`:
13-
* ASP.NET and web development
14-
* Azure development
15-
2. PowerShell 4.0
16-
3. SQL Server 2016
17-
* For development purposes connection strings point to `(localdb)\mssqllocaldb`, make sure that the DB engine version 13.0 or greater is being used (check by running `sqllocaldb info mssqllocaldb` in the command line).
18-
2. Clone it!
19-
20-
```PS C:\Code> git clone https://github.com/NuGet/NuGetGallery.git```
21-
3. Build it!
22-
23-
```
24-
PS C:\Code> cd NuGetGallery
25-
PS C:\Code\NuGetGallery> .\build
26-
```
27-
4. Set up the website!
10+
First install prerequisites:
2811

29-
```PS C:\Code\NuGetGallery> .\tools\Setup-DevEnvironment.ps1```
30-
31-
5. If you would like to configure your gallery instance to use MSA/AAD, please follow the steps listed [here](https://github.com/NuGet/NuGetGallery/wiki/Configuring-MSA-AAD-for-your-on-prem-gallery-instance).
12+
1. Visual Studio 2019 - Install the following [`Workloads`](https://docs.microsoft.com/visualstudio/install/modify-visual-studio):
13+
* ASP.NET and web development
14+
* Azure development
15+
2. PowerShell 4.0
16+
3. SQL Server 2016 (with DB engine version 13.0 or greater)
3217

33-
6. Ensure the `NugetGallery` project is the StartUp Project and press `F5` to run the site! That's it!
18+
Now run the NuGet Gallery:
3419

35-
When working with the gallery, e-mail messages are saved to the file system (under `~/App_Data`).
36-
You can use an SMTP server instead by editing `src\NuGetGallery\Web.Config` and adding a `Gallery.SmtpUri`
37-
setting. Its value should be an SMTP connection string, such as: `smtp://user:password@smtpservername:25`.
38-
You can also turn off e-email confirmations by changing the value of `Gallery.ConfirmEmailAddresses` to `false`
39-
in the `src\NugetGallery\Web.Config` file.
20+
1. Clone the repository with `git clone https://github.com/NuGet/NuGetGallery.git`
21+
2. Navigate to `.\NuGetGallery`
22+
3. Build with `.\build.ps1`
23+
4. Create the database and enable HTTPS with `.\tools\Setup-DevEnvironment.ps1`
24+
5. Open `.\NuGetGallery.sln` using Visual Studio
25+
6. Ensure the `NuGetGallery` project is the StartUp Project and [press `F5` to run the site](https://docs.microsoft.com/visualstudio/get-started/csharp/run-program)
4026

41-
Visual Studio may modify the `applicationhost.config` file. You can force git to ignore changes to this file
42-
with:
43-
44-
git update-index --assume-unchanged .vs/config/applicationhost.config
45-
46-
You can undo this with this command:
47-
48-
git update-index --no-assume-unchanged .vs/config/applicationhost.config
49-
50-
This should help prevent unwanted file commits.
27+
Refer to [our documentation](./docs/) for information on how to develop the frontend, use AAD, and more.
5128

5229
## Deploy
5330

@@ -94,6 +71,17 @@ This is the Git workflow we're currently using:
9471

9572
Clone and checkout the `dev` branch.
9673

74+
Visual Studio may modify the `applicationhost.config` file. You can force git to ignore changes to this file
75+
with:
76+
77+
git update-index --assume-unchanged .vs/config/applicationhost.config
78+
79+
You can undo this with this command:
80+
81+
git update-index --no-assume-unchanged .vs/config/applicationhost.config
82+
83+
This should help prevent unwanted file commits.
84+
9785
### When starting a new feature/unit of work.
9886

9987
1. __Pull the latest.__
@@ -146,3 +134,4 @@ Clone and checkout the `dev` branch.
146134

147135
6. __Be ready to guide your change through QA, Staging and Prod__
148136
Your change will make its way through the QA, Staging and finally Prod branches as it's deployed to the various environments. Be prepared to fix additional bugs!
137+

docs/Emails.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Emails
2+
3+
By default, the Gallery saves e-mail messages to the file system under `src\NuGetGallery\App_Data`.
4+
5+
You can use an SMTP server instead by editing `src\NuGetGallery\Web.config` and adding a `Gallery.SmtpUri`
6+
setting. Its value should be an SMTP connection string, such as `smtp://user:password@smtpservername:25`.
7+
8+
You can require new accounts confirm their e-mail adddress by changing the value of `Gallery.ConfirmEmailAddresses`
9+
to `true` in the `src\NuGetGallery\Web.config` file.

docs/Frontend.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Updating NuGet Gallery's frontend
2+
3+
## Styling
4+
5+
We use [Bootstrap 3](https://getbootstrap.com/docs/3.3/) as our base CSS framework.
6+
This provides a grid layout, CSS normalization, and some common styles.
7+
8+
Changes to our styles should be made to [LESS](https://lesscss.org/) files and not to a CSS file directly.
9+
LESS is a syntax that itself is not usable by a browser but is compiled to CSS. It provides niceties that CSS
10+
does not offer such as rule nesting, mixins, variables, and arithmetic (calculated values).
11+
12+
Each page may have its own set of specific styles. These page-specific styles are in a `page-*.less` file
13+
in the `src\Bootstrap\less\theme\` directory.
14+
15+
### Prerequisites
16+
17+
To compile LESS files:
18+
19+
1. Install node: https://nodejs.org/en/download/
20+
1. Install Grunt: `npm install -g grunt`
21+
1. Navigate to `.\src\Bootstrap`
22+
1. Install NPM dependencies: `npm install`
23+
24+
### Updating styling
25+
26+
1. Update one or more `.less` files in the `src\Bootstrap\less` directory
27+
1. Navigate to `.\src\Bootstrap`
28+
1. Run `grunt`
29+
30+
### Adding a new page
31+
32+
1. Create a new `page-X.less` file in the `src\Bootstrap\less\theme\` directory
33+
1. Add the new page in `src\Bootstrap\less\theme\all.less`
34+
35+
## JavaScript
36+
37+
We use [jQuery](https://jquery.com/) and [Knockout.js](https://knockoutjs.com/).
38+
39+
Common JavaScript should be added to `src\NuGetGallery\Scripts\gallery\common.js`.
40+
41+
Each page may have its own custom logic. These page-specific scripts are in a `page-*.js` file
42+
in the `src\NuGetGallery\Scripts\gallery\` directory.

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22

33
You can find documentation for:
44

5+
1. [Updating NuGet Gallery's frontend](Frontend.md)
56
1. [Building, deploying, and managing a NuGet Gallery instance](Deploying/README.md)
6-
1. [Using Azure Active Directory authentication](Using-AAD.md)
7+
1. [Email configuration](Emails.md)
8+
1. [Using Azure Active Directory authentication](Using-AAD.md)

0 commit comments

Comments
 (0)