Update README.md
This commit is contained in:
@ -7,8 +7,7 @@ namespace PMF
|
|||||||
{
|
{
|
||||||
public static class Config
|
public static class Config
|
||||||
{
|
{
|
||||||
// This is project manifest, not package manifests, those are handled automagically
|
public static string ManifestFileName = "manifest.json";
|
||||||
public static string ManifestFileName { get; set; }
|
|
||||||
|
|
||||||
public static string PackageInstallationFolder { get; set; }
|
public static string PackageInstallationFolder { get; set; }
|
||||||
|
|
||||||
|
|||||||
143
README.md
143
README.md
@ -1,2 +1,141 @@
|
|||||||
# PMF
|
# PMF - Package Management Framework
|
||||||
Package Management Framework
|
|
||||||
|
PMF is a barebones C# library that provides basic support for package management
|
||||||
|
|
||||||
|
# Features
|
||||||
|
|
||||||
|
- Install
|
||||||
|
- Update
|
||||||
|
- Uninstall
|
||||||
|
|
||||||
|
# Planned features
|
||||||
|
|
||||||
|
- Abstract Package, Asset and Dependency class
|
||||||
|
- Multithreading
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# API
|
||||||
|
|
||||||
|
## Initialization
|
||||||
|
|
||||||
|
These functions need to be called at the beggining of the program and at the end, respectively, they handle the manifest.json file that is saved with information regarding packages installed
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
LocalPackageManager.Start();
|
||||||
|
|
||||||
|
// Do stuff
|
||||||
|
|
||||||
|
LocalPackageManager.Stop();
|
||||||
|
```
|
||||||
|
|
||||||
|
### Install
|
||||||
|
|
||||||
|
Installs selected version of a package
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public static PackageState Install(string id, Version version, out Package package)
|
||||||
|
```
|
||||||
|
|
||||||
|
Installs latest version of a package
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public static PackageState InstallLatest(string id, out Package package)
|
||||||
|
```
|
||||||
|
|
||||||
|
Installs by SDK version provided by software
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public static PackageState InstallBySdkVersion(string id, out Package package)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Uninstall
|
||||||
|
|
||||||
|
Uninstalls a package
|
||||||
|
|
||||||
|
```
|
||||||
|
public static bool Uninstall(string id)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Update
|
||||||
|
|
||||||
|
Updates a package to the most recent version, ignoring SDK version
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public static PackageState UpdateLatest(string id, out Package package)
|
||||||
|
```
|
||||||
|
|
||||||
|
Updates a package to a specified version
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public static PackageState UpdatePackage(string id, Version version, out Package package)
|
||||||
|
```
|
||||||
|
|
||||||
|
Updates a package to the most recent version provided an SDK version
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
public static PackageState UpdateBySdkVersion(string id, out Package package, bool dontAsk = false)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
Defines the manifest file name, by default is manifest.json
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
string Config.ManifestFileName
|
||||||
|
```
|
||||||
|
|
||||||
|
Defines the folder where packages are to be installed
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
string Config.PackageInstallationFolder
|
||||||
|
```
|
||||||
|
|
||||||
|
The http server where you will be sending information about the packages
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
string Config.RepositoryEndpoint
|
||||||
|
```
|
||||||
|
|
||||||
|
Current SDK version, if you are not using this just use null
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
Version Config.CurrentSdkVersion
|
||||||
|
```
|
||||||
|
|
||||||
|
Temporary folder where zip files will be downloaded to, gets deleted at the end of execution
|
||||||
|
|
||||||
|
```csharp
|
||||||
|
string Config.TemporaryFolder
|
||||||
|
```
|
||||||
|
|
||||||
|
## JSON
|
||||||
|
|
||||||
|
This is the basic information a package would have
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ID": "something_cool",
|
||||||
|
"Type": 1,
|
||||||
|
"Name": "Im Something cool",
|
||||||
|
"Description": "This is a package that makes you cool and awesome",
|
||||||
|
"Assets": [{
|
||||||
|
"Version": "0.0.1",
|
||||||
|
"SdkVersion": "0.0.5",
|
||||||
|
"Checksum": "somethingCoolWithLettersAndNumbers",
|
||||||
|
"FileName": "name.zip",
|
||||||
|
"Url": "somewhereElseDoesntNeedToBeYourServer.zip",
|
||||||
|
"Dependencies": [{
|
||||||
|
"ID": "Inner Spirit",
|
||||||
|
"Checksum": "somethingHere",
|
||||||
|
"FileName": "zipped.zip",
|
||||||
|
"Url": "somewhereElseDoesntNeedToBeYourServer.zip"
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Building for source
|
||||||
|
|
||||||
|
To build from source, clone or fork the repository and open with Visual Studio.
|
||||||
@ -28,7 +28,6 @@ app.get('/package/:id', async (req, res) =>
|
|||||||
|
|
||||||
// don't need this anymore
|
// don't need this anymore
|
||||||
delete assets[i]["id_asset"]
|
delete assets[i]["id_asset"]
|
||||||
delete assets[i]["meta"]
|
|
||||||
|
|
||||||
assets[i]["Dependencies"] = dependencies
|
assets[i]["Dependencies"] = dependencies
|
||||||
}
|
}
|
||||||
@ -37,7 +36,7 @@ app.get('/package/:id', async (req, res) =>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await res.json(package)
|
res.json(package)
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(port, () => console.log(`http://localhost:${port}`));
|
app.listen(port, () => console.log(`http://localhost:${port}`));
|
||||||
Reference in New Issue
Block a user