-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To summarize the changes made in this commit:
- Added `.vscode/launch.json` file. - Added `.vscode/tasks.json` file. - Modified `NuGetPush.nuproj` to include the `ProjectGuid` property. - Modified `NuGetPush.sln` to include the `ProjectGuid` property. - Modified `.npmignore` to include the `node_modules/` directory. - Deleted `Scripts/delete-github-package-version` file. - Added `Scripts/delete-github-package-version` file as a symlink to `./bin/delete-github-package-version`. - Modified `Scripts/delete-github-package-version.ps1` to use PowerShell instead of Zsh. - Modified `Scripts/package-lock.json` to update various dependencies. - Modified `Scripts/package.json` to update various dependencies and add a `homepage` field. - Modified `Scripts/ts/constants.ts` to update the `GITHUB_API_VERSION` constant. - Modified `Scripts/ts/delete-github-package-version.ts` to use `yargs` for command-line argument parsing and added type annotations. - Modified `Scripts/ts/github-cli-types.ts` to add the `PackageType` type. - Modified `Scripts/ts/github-cli.ts` to update the `deletePackageVersionAsync` and `deletePackageAsync` functions. - Modified `Scripts/ts/index.ts` to update the import statements. - Modified `Scripts/tsconfig.json` to update the `compilerOptions` section.
- Loading branch information
Showing
14 changed files
with
261 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schena": "https://json.schemastore.org/task.json", | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "build", | ||
"path": "Scripts", | ||
"group": "build", | ||
"problemMatcher": [], | ||
"label": "npm: build - Scripts", | ||
"detail": "npm install --repository https://repository.npmjs.org; tsc" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<!-- | ||
* NuGetPush.nuproj | ||
* | ||
* | ||
* Created: 2022-11-27-04:36:43 | ||
* Modified: 2022-11-27-04:36:44 | ||
* | ||
* | ||
* Author: David G. Moore, Jr. <[email protected]> | ||
* | ||
* | ||
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved | ||
* License: MIT (https://opensource.org/licenses/MIT) | ||
--> | ||
|
@@ -17,6 +17,7 @@ | |
<Description>This is a simple MSBuild task that allows you to push a NuGet package to a NuGet server.</Description> | ||
<MinVerTagPrefix>v</MinVerTagPrefix> | ||
<GitHubOrg>dgmjr-io</GitHubOrg> | ||
<ProjectGuid>2498EED9-9158-41BD-9D4A-246A70A1D9E2</ProjectGuid> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Content Include="./Sdk/*" PackagePath="Sdk/%(Filename)%(Extension)" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
login.txt | ||
.npmrc | ||
node_modules/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./bin/delete-github-package-version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
#!/usr/bin/env pwsh | ||
|
||
# // ts-node "$( cd ${0%/*} && pwd -P )/ts/delete-github-package-version.ts" $ 1 $2 $3 $4 $5 $6 $7 $8 $9 | ||
[CmdletBinding()] | ||
[Alias("Delete-GitHubPackageVersion")] | ||
param( | ||
[Parameter(Mandatory)] | ||
[Alias("pkg", "p")] | ||
[string]$PackageId, | ||
[Parameter(Mandatory)] | ||
[Alias("ver", "v")] | ||
[string]$PackageVersion, | ||
[Alias("t", "gh")] | ||
[string]$GitHubToken, | ||
[string]$GitHubToken = $env:GITHUB_TOKEN, | ||
[Parameter(Mandatory)] | ||
[Alias("org")] | ||
[string]$GitHubOrganization | ||
[string]$GitHubOrganization, | ||
[Alias("type")] | ||
[ValidateSet("npm", "maven", "rubygems", "docker", "nuget", "container", IgnoreCase, ErrorMessage = "The package type must be one of the following: npm, maven, rubygems, docker, nuget, container")] | ||
[string]$PackageType = "nuget" | ||
) | ||
|
||
node "$PSScriptRoot/js/delete-github-package-version.js" $GitHubOrganization $PackageId $PackageVersion ($GitHubToken ?? $env:GITHUB_TOKEN) | ||
process { | ||
Write-Output "node '$PSScriptRoot/js/delete-github-package-version.js' $GitHubOrganization $PackageId $PackageVersion $PackageType $GitHubToken" | ||
node "$PSScriptRoot/js/delete-github-package-version.js" $GitHubOrganization $PackageId $PackageVersion $PackageType $GitHubToken | ||
Write-Output "" | ||
Write-Output "ts-node '$PSScriptRoot/ts/delete-github-package-version.ts' -o $GitHubOrganization -i $PackageId -v "$PackageVersion" -t $PackageType -k $GitHubToken" | ||
ts-node $PSScriptRoot/ts/delete-github-package-version.ts -o $GitHubOrganization -i $PackageId -v "$PackageVersion" -t $PackageType -k $GitHubToken | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/package.json", | ||
"homepage": "https://github.com/dgmjr-io/NuGetPush.git", | ||
"author": { | ||
"email": "[email protected]", | ||
"name": "David G. Moore, Jr.", | ||
"url": "https://github.com/dgmjr" | ||
"url": "https://github.com/dgmjr", | ||
"gthubusername": "dgmjr" | ||
}, | ||
"type": "module", | ||
"description": "A TypeScript library, which allows deleting from GitHub packages", | ||
"devDependencies": { | ||
"@tsconfig/node16": "^1.0.3" | ||
"@tsconfig/node16": "^1.0.3", | ||
"@types/semver": "^7.5.3", | ||
"@types/yargs": "^17.0.28" | ||
}, | ||
"keywords": [ | ||
"github", | ||
|
@@ -20,7 +26,7 @@ | |
"url": "https://github.com/dgmjr-io/NuGetPush.git" | ||
}, | ||
"scripts": { | ||
"build-ts": "tsc", | ||
"build": "npm install --registry https://registry.npmjs.org; tsc", | ||
"uninstall": "npm uninstall github-packages-push", | ||
"watch-ts": "tsc --watch", | ||
"clean": "rm -rf node_modules;rm -rf js;rm -rf **/*.js" | ||
|
@@ -31,6 +37,6 @@ | |
"form-data": "^4.0.0", | ||
"npm-cli-login": "^1.0.0", | ||
"octokit": "^2.0.14", | ||
"yargs": "^17.6.2" | ||
"yargs": "^17.7.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
/* | ||
/* | ||
* constants.ts | ||
* | ||
* | ||
* Created: 2023-03-28-11:52:17 | ||
* Modified: 2023-03-28-11:52:17 | ||
* | ||
* | ||
* Author: David G. Moore, Jr. <[email protected]> | ||
* | ||
* | ||
* Copyright © 2022 - 2023 David G. Moore, Jr., All Rights Reserved | ||
* License: MIT (https://opensource.org/licenses/MIT) | ||
*/ | ||
*/ | ||
|
||
export const GITHUB_API_URL = "https://api.github.com"; | ||
export const GITHUB_API_VERSION = '2022-11-28'; | ||
export const GITHUB_API_VERSION_HEADER_NAME = "X-GitHub-Api-Version" | ||
export const GITHUB_API_RESPONSE_CONTENT_TYPE = "application/vnd.github.v3+json"; | ||
export const GITHUB_API_VERSION_HEADER = { [GITHUB_API_VERSION_HEADER_NAME]: GITHUB_API_VERSION }; | ||
export const GITHUB_API_ACCEPT_HEADER = { Accept: GITHUB_API_RESPONSE_CONTENT_TYPE }; | ||
export const GITHUB_API_STANDARD_HEADERS = { | ||
[GITHUB_API_VERSION_HEADER_NAME]: GITHUB_API_VERSION, | ||
Accept: GITHUB_API_RESPONSE_CONTENT_TYPE | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,33 @@ | ||
/* | ||
/* | ||
* github-cli-types.ts | ||
* | ||
* | ||
* Created: 2022-11-27-05:39:27 | ||
* Modified: 2022-12-05-04:14:47 | ||
* | ||
* | ||
* Author: David G. Moore, Jr. <[email protected]> | ||
* | ||
* | ||
* Copyright © 2022-2023 David G. Moore, Jr., All Rights Reserved | ||
* License: MIT (https://opensource.org/licenses/MIT) | ||
*/ | ||
*/ | ||
|
||
export interface PackageVersion { | ||
id: number; | ||
name: string; | ||
package_html_url: string; | ||
url: string; | ||
created_at: string; | ||
updated_at: string; | ||
visibility: string; | ||
package_type: string; | ||
downloads_count: number; | ||
description: string; | ||
html_url: string; | ||
license: string; | ||
id: number; | ||
name: string; | ||
package_html_url: string; | ||
url: string; | ||
created_at: string; | ||
updated_at: string; | ||
visibility: string; | ||
package_type: string; | ||
downloads_count: number; | ||
description: string; | ||
html_url: string; | ||
license: string; | ||
} | ||
|
||
export interface ApiMessage { | ||
message: string; | ||
documentation_url: string; | ||
message: string; | ||
documentation_url: string; | ||
} | ||
|
||
export type PackageType = "nuget" | "npm" | "docker" | "maven" | "rubygems" | "container"; |
Oops, something went wrong.