initial add

This commit is contained in:
Jonathan Ouellette
2022-09-27 14:10:30 -07:00
parent 91fd8a50a9
commit 580e90f6a2
3941 changed files with 954648 additions and 19 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,20 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Modernizr</id>
<version>2.6.2</version>
<title>Modernizr</title>
<authors>Faruk Ateş,Paul Irish,Alex Sexton</authors>
<owners>Faruk Ateş,Paul Irish,Alex Sexton</owners>
<licenseUrl>http://www.modernizr.com/license/</licenseUrl>
<projectUrl>http://www.modernizr.com/</projectUrl>
<iconUrl>http://www.modernizr.com/i/logo.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Modernizr adds classes to the &lt;html&gt; element which allow you to target specific browser functionality in your stylesheet. You don't actually need to write any Javascript to use it.
Modernizr is a small and simple JavaScript library that helps you take advantage of emerging web technologies (CSS3, HTML5) while still maintaining a fine level of control over older browsers that may not yet support these new technologies.
NOTE: This package is maintained on behalf of the library owners by the NuGet Community Packages project at http://nugetpackages.codeplex.com/</description>
<summary>Modernizr is a small and simple JavaScript library that helps you take advantage of emerging web technologies (CSS3, HTML 5) while still maintaining a fine level of control over older browsers that may not yet support these new technologies.</summary>
<language>en-US</language>
<tags>JavaScript HTML HTML5 CSS CSS3 SVG</tags>
</metadata>
</package>

View File

@ -0,0 +1,75 @@
function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProjectItem -eq $null) {
# _references.js file not found
return
}
$referencesFilePath = $referencesFileProjectItem.FileNames(1)
$referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 0) {
# File has no existing matching reference line
# Add the full reference line to the beginning of the file
"/// <reference path=""$newFileName"" />" | Add-Content $referencesTempFilePath -Encoding UTF8
Get-Content $referencesFilePath | Add-Content $referencesTempFilePath
}
else {
# Loop through file and replace old file name with new file name
Get-Content $referencesFilePath | ForEach-Object { $_ -replace $fileNamePattern, $newFileName } > $referencesTempFilePath
}
# Copy over the new _references.js file
Copy-Item $referencesTempFilePath $referencesFilePath -Force
Remove-Item $referencesTempFilePath -Force
}
function Remove-Reference($scriptsFolderProjectItem, $fileNamePattern) {
try {
$referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js")
}
catch {
# _references.js file not found
return
}
if ($referencesFileProjectItem -eq $null) {
return
}
$referencesFilePath = $referencesFileProjectItem.FileNames(1)
$referencesTempFilePath = Join-Path $env:TEMP "_references.tmp.js"
if ((Select-String $referencesFilePath -pattern $fileNamePattern).Length -eq 1) {
# Delete the line referencing the file
Get-Content $referencesFilePath | ForEach-Object { if (-not ($_ -match $fileNamePattern)) { $_ } } > $referencesTempFilePath
# Copy over the new _references.js file
Copy-Item $referencesTempFilePath $referencesFilePath -Force
Remove-Item $referencesTempFilePath -Force
}
}
# Extract the version number from the file in the package's content\scripts folder
$packageScriptsFolder = Join-Path $installPath Content\Scripts
$modernizrFileName = Join-Path $packageScriptsFolder "modernizr-*.js" | Get-ChildItem -Exclude "*.min.js","*-vsdoc.js" | Split-Path -Leaf
$modernizrFileNameRegEx = "modernizr-((?:\d+\.)?(?:\d+\.)?(?:\d+\.)?(?:\d+)).js"
$modernizrFileName -match $modernizrFileNameRegEx
$ver = $matches[1]
# Get the project item for the scripts folder
try {
$scriptsFolderProjectItem = $project.ProjectItems.Item("Scripts")
$projectScriptsFolderPath = $scriptsFolderProjectItem.FileNames(1)
}
catch {
# No Scripts folder
Write-Host "No scripts folder found"
}

View File

@ -0,0 +1,12 @@
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
if ($scriptsFolderProjectItem -eq $null) {
# No Scripts folder
Write-Host "No Scripts folder found"
exit
}
# Update the _references.js file
AddOrUpdate-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx $modernizrFileName

View File

@ -0,0 +1,6 @@
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Update the _references.js file
Remove-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx