From a7947f6fbf29b3cfa009c48eac3d6336cb9f6acd Mon Sep 17 00:00:00 2001 From: daimond113 <72147841+daimond113@users.noreply.github.com> Date: Thu, 28 Mar 2024 19:49:46 +0100 Subject: [PATCH] feat(website): add documentation --- website/src/lib/Codeblock.svelte | 2 +- website/src/routes/+layout.svelte | 1 + website/src/routes/docs/+page.svelte | 240 +++++++++++++++++++++++++++ website/src/routes/docs/Note.svelte | 10 ++ 4 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 website/src/routes/docs/+page.svelte create mode 100644 website/src/routes/docs/Note.svelte diff --git a/website/src/lib/Codeblock.svelte b/website/src/lib/Codeblock.svelte index cf223d5..ab19d56 100644 --- a/website/src/lib/Codeblock.svelte +++ b/website/src/lib/Codeblock.svelte @@ -8,7 +8,7 @@ {#await codeToHtml(code, { theme: 'vesper', lang, transformers: [{ pre(node) { - this.addClassToHast(node, 'not-prose'); + this.addClassToHast(node, 'not-prose overflow-x-auto'); } }] }) then highlightedCode} {@html highlightedCode} {/await} diff --git a/website/src/routes/+layout.svelte b/website/src/routes/+layout.svelte index 13009eb..d58891a 100644 --- a/website/src/routes/+layout.svelte +++ b/website/src/routes/+layout.svelte @@ -74,6 +74,7 @@ > GitHub Repository Policies + Documentation diff --git a/website/src/routes/docs/+page.svelte b/website/src/routes/docs/+page.svelte new file mode 100644 index 0000000..ffba1bb --- /dev/null +++ b/website/src/routes/docs/+page.svelte @@ -0,0 +1,240 @@ + + +
+

Using pesde

+ +
+

Initializing a package

+

+ Even if you're not making a package, but something else such as a game, you will still need to + initialize package. +

+ +

This will prompt you questions, after which it will create a pesde.yaml file.

+ + If you are using pesde with the `wally` feature enabled (true on releases from the GitHub + repository) then you can use to convert your wally.toml file + to pesde.yaml. This will leave you with an empty default index, so you will need to add a URL (such + as the default `https://github.com/daimond113/pesde-index`) yourself. + +
+ +
+

Adding dependencies

+

+ You can use the `add` command to add dependencies to your project. With the `wally` feature + enabled, you can add Wally dependencies. +

+

+ If you are making a package, you can use the `--peer` argument to add a package as a peer + dependency. Peer dependencies are not installed when the package is installed, but are + required to be installed by the user of the package. This is useful for things like framework + plugins. +

+

+ If you want to declare the dependency as server or development only, you can use the `--realm + server` or `--realm development` arguments respectively. The `shared` realm is the default. +

+ +
+ +
+

Overriding dependencies

+

+ Dependency overrides allow you to use a different version of a dependency than the one + specified in the package. This is useful for sharing 1 version of a dependency. +

+

+ Dependency overrides use the keys in the format of desired names separated with `>`, and + optionally other paths separated with `,`. The value is a dependency specifier. +

+ + Dependency overrides do not have a command. You will need to edit the pesde.yaml file + yourself. + + +
+ +
+

Removing dependencies

+

You can use the `remove` command to remove dependencies from your project.

+ +
+ +
+

Outdated dependencies

+

+ You can list outdated dependencies with the `outdated` command. This will list all + dependencies that have a newer version available. +

+ + This command only supports pesde registries, so neither Git nor Wally dependencies will be + listed. + + +
+ +
+

Installing a project

+

The `install` command will install all dependencies of a project.

+

+ You can use the `--locked` argument to skip resolving and read the dependencies from the + lockfile. If any changes were made from the time the lockfile was generated this will error. +

+ +
+ +
+

Running a bin dependency

+

+ Dependencies may export a bin script. You can run this script with the `run` command. The + script will be executed with Lune. You can use the `--` argument to pass arguments to the + script. +

+ + This does not support Wally dependencies. + + +
+ +
+

Patching dependencies

+

+ You can use the `patch` command to patch a dependency. This will output a directory in which + you can edit the dependency. After you are done, run the `patch-commit` command with the + directory as an argument to commit the changes. +

+ +
+ +
+

Publishing a package

+

+ You can publish a package with the `publish` command. This will upload the package to the + registry. This will publish to the `default` index. +

+ The official pesde registry does not support publishing packages with Wally or Git + dependencies. Dependency overrides and patches of your package as a dependency will be + ignored. + +
+ +
+

Searching for packages

+

+ You can search for packages with the `search` command. This will list all packages that match + the query. It will search by name and description. +

+ +
+ +
+

Manifest format cheat sheet

+

+ Here is a cheat sheet for the manifest format. This is the format of the pesde.yaml file. The + `name` and `version` fields are required. All other fields are optional. +

+

A description of each type:

+ + +

+ If the realm field is not specified, it will default to `shared`. If it is another value, and + the package is to be installed in a different realm, pesde will error. +

+

+ The sourcemap generator command is only used for Wally and Git packages. It will be ran in a + package's directory, and must output a sourcemap file. This is used to generate a sourcemap + for the package so that types may be found and re-exported. +

+
+
diff --git a/website/src/routes/docs/Note.svelte b/website/src/routes/docs/Note.svelte new file mode 100644 index 0000000..c0a15d9 --- /dev/null +++ b/website/src/routes/docs/Note.svelte @@ -0,0 +1,10 @@ + + +
+
Note
+ +