From 1b4ab9757189d19c0a4c8a588d477a41a6ba89d3 Mon Sep 17 00:00:00 2001 From: Cubxity Date: Fri, 17 Sep 2021 08:29:17 +0200 Subject: [PATCH 1/6] draft: added instance.multifold.json spec --- specification/0001-instance.multifold.json.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 specification/0001-instance.multifold.json.md diff --git a/specification/0001-instance.multifold.json.md b/specification/0001-instance.multifold.json.md new file mode 100644 index 0000000..27de378 --- /dev/null +++ b/specification/0001-instance.multifold.json.md @@ -0,0 +1,174 @@ +# multifold.instance.json + +## Summary + +This document acts as a Request for Comments (RPC) on the topic of how a MultiFold instance metadata is formatted. + +## Motivation + +This RFC describes a scalable, portable, and more powerful format for the instance that defines what an instance's +definition should look like. MultiFold offers users the ability install mod loaders and mods seamlessly, without manual +configuration. + +## Explanation + +The following is the schema for instance metadata. The primary format is JSON, however it can be represented in other +formats such as YAML. + +
+apiVersion: string + +Represents the API version being used. Current supported API versions: `v1alpha1`. +
+ +
+kind: string + +Represents the kind of the API object being used. In this instance, `Instance`. +
+ +
+metadata: InstanceMetadata + +Contains metadata for the current instance, such as display name and group name. +
+ +
+spec: InstanceSpec + +Contains spec for the current instance, such as Minecraft version, mod loader, and mods. +
+ +### InstanceMetadata + +
+name: string + +The display name to use for the instance. +
+ +
+group: string? + +The group name to group the instance with. +
+ +### InstanceSpec + +
+components: InstanceComponent[] + +Array of "components" in the instance. This is used to describe the launching pipeline, and is order-sensitive. +
+ +
+mods: InstanceMod[] + +Array of mods in the instance. This is used to automatically update mods in the instance and compatibility checks. +
+ +## InstanceComponent + +
+id: string + +The id of the component. This must match a component in MultiFold, otherwise the instance will not launch. +
+ +
+version: string + +The required version of the component. It is recommended to follow [semver](https://semver.org/) specs. It should be +possible to define a "version range", similar to dependencies in `package.json`. Read more about version +ranges [here](https://docs.npmjs.com/cli/v6/using-npm/semver). +
+ +
+settings: Record<string, string>? + +Record or a map of settings. This is optional and can be freely defined. The options will be passed to the component +upon initialization. +
+ +## InstanceMod + +
+id: string + +The id of the mod **from the provider**. This is not to be confused with the mod id defined in mcmod.info or +fabric.mod.json. +
+ +
+provider: string + +The provider id of the mod. This is the source that MultiFold retrieves the mod from. This should match a content +provider id registered in MultiFold, otherwise the instance will not launch. +
+ +
+version: string + +The required version of the mod. It is recommended to follow [semver](https://semver.org/) specs. It should be possible +to define a "version range", similar to dependencies in `package.json`. Read more about version +ranges [here](https://docs.npmjs.com/cli/v6/using-npm/semver). +
+ +## Example + +```json +{ + "apiVersion": "v1alpha1", + "kind": "Instance", + "metadata": { + "name": "Fabric 1.17.1", + "group": "Fabric" + }, + "spec": { + "components": [ + { + "id": "java", + "version": "^16", + "settings": { + "memoryInit": "1G", + "memoryMax": "1G" + } + }, + { + "id": "net.minecraft.client", + "version": "1.17.1" + }, + { + "id": "net.fabricmc", + "version": "0.11.6" + } + ], + "mods": [ + { + "id": "sodium", + "provider": "com.modrinth", + "version": "mc1.17.1-0.3.2" + } + ] + } +} +``` + +## Drawbacks + +The primary drawback of the proposed format is that it has not been adopted by other launchers (such as MultiMC and +GDLauncher). Creating a custom format will require a migration tool for the best possible user experience. + +## Rationale and Alternatives + +There is no good alternatives to creating a custom format, due to the nature of how MultiFold is designed. + +## Prior Art + +The specification is inspired by MultiMC's `mmc-pack.json` format. + +The object design is inspired by Kubernetes' object format. + +## Unresolved Questions + +- How will MultiFold handle "unmanaged" mods? \ No newline at end of file From 8ecfd4b626aeeede4041974487b23e71c67b64ac Mon Sep 17 00:00:00 2001 From: Cubxity Date: Fri, 17 Sep 2021 14:46:30 +0200 Subject: [PATCH 2/6] refactor: rename instance.multifold.json to multifold.instance.json --- ...instance.multifold.json.md => 0001-multifold.instance.json.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename specification/{0001-instance.multifold.json.md => 0001-multifold.instance.json.md} (100%) diff --git a/specification/0001-instance.multifold.json.md b/specification/0001-multifold.instance.json.md similarity index 100% rename from specification/0001-instance.multifold.json.md rename to specification/0001-multifold.instance.json.md From 7e8af33378ccf6d1963ac17e9ff79ef714799725 Mon Sep 17 00:00:00 2001 From: Cubxity Date: Fri, 17 Sep 2021 15:12:44 +0200 Subject: [PATCH 3/6] draft: use "inspiration" instead of "prior art" --- specification/0001-multifold.instance.json.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/0001-multifold.instance.json.md b/specification/0001-multifold.instance.json.md index 27de378..96c1191 100644 --- a/specification/0001-multifold.instance.json.md +++ b/specification/0001-multifold.instance.json.md @@ -163,7 +163,7 @@ GDLauncher). Creating a custom format will require a migration tool for the best There is no good alternatives to creating a custom format, due to the nature of how MultiFold is designed. -## Prior Art +## Inspiration The specification is inspired by MultiMC's `mmc-pack.json` format. From 15e75ce1a503353ee82e7081ce7682b2dd8c0ac5 Mon Sep 17 00:00:00 2001 From: Cubxity Date: Mon, 20 Sep 2021 09:04:50 +0200 Subject: [PATCH 4/6] draft: improved clarity --- specification/0001-multifold.instance.json.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/0001-multifold.instance.json.md b/specification/0001-multifold.instance.json.md index 96c1191..07afbc3 100644 --- a/specification/0001-multifold.instance.json.md +++ b/specification/0001-multifold.instance.json.md @@ -6,9 +6,8 @@ This document acts as a Request for Comments (RPC) on the topic of how a MultiFo ## Motivation -This RFC describes a scalable, portable, and more powerful format for the instance that defines what an instance's -definition should look like. MultiFold offers users the ability install mod loaders and mods seamlessly, without manual -configuration. +This RFC describes a scalable, portable, and more powerful format that defines an instance. MultiFold offers users the +ability install mod loaders and mods seamlessly, without manual configuration. ## Explanation @@ -96,7 +95,8 @@ upon initialization. id: string The id of the mod **from the provider**. This is not to be confused with the mod id defined in mcmod.info or -fabric.mod.json. +fabric.mod.json. An example of this is the `mod_id` returned +from [Modrinth's API](https://github.com/modrinth/labrinth/wiki/API-Documentation).
From 32edad255705b1faaebc8727bb5141f868497a51 Mon Sep 17 00:00:00 2001 From: Cubxity Date: Sat, 25 Sep 2021 08:45:01 +0200 Subject: [PATCH 5/6] draft: fix grammar --- specification/0001-multifold.instance.json.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/0001-multifold.instance.json.md b/specification/0001-multifold.instance.json.md index 07afbc3..cd88363 100644 --- a/specification/0001-multifold.instance.json.md +++ b/specification/0001-multifold.instance.json.md @@ -12,7 +12,7 @@ ability install mod loaders and mods seamlessly, without manual configuration. ## Explanation The following is the schema for instance metadata. The primary format is JSON, however it can be represented in other -formats such as YAML. +formats, such as YAML.
apiVersion: string @@ -161,7 +161,7 @@ GDLauncher). Creating a custom format will require a migration tool for the best ## Rationale and Alternatives -There is no good alternatives to creating a custom format, due to the nature of how MultiFold is designed. +There are no good alternatives to creating a custom format, due to the nature of how MultiFold is designed. ## Inspiration From e90b1e421d1ba38235b3ebd923d9b600c1e4a556 Mon Sep 17 00:00:00 2001 From: Cubxity Date: Sat, 6 Nov 2021 11:41:57 +0100 Subject: [PATCH 6/6] refactor: change version to int Changed apiVersion in instance manifest to int. This allows for easier version comparison and migration. --- specification/0001-multifold.instance.json.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/0001-multifold.instance.json.md b/specification/0001-multifold.instance.json.md index cd88363..35b7569 100644 --- a/specification/0001-multifold.instance.json.md +++ b/specification/0001-multifold.instance.json.md @@ -15,9 +15,9 @@ The following is the schema for instance metadata. The primary format is JSON, h formats, such as YAML.
-apiVersion: string +version: number -Represents the API version being used. Current supported API versions: `v1alpha1`. +Represents the API version being used. Current supported API version: `1`.