Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for v1 #22

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .lune/build.luau
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ local function build()
run("find", { project.BUILD_PATH, "-name", "*.spec.luau", "-type", "f", "-delete" })
run("rm", { "-rf", `{project.BUILD_PATH}/test-utils` })
run("rm", { "-rf", `{project.BUILD_PATH}/e2e` })
run("rm", { "-rf", `{project.BUILD_PATH}/jest.config.luau` })
end

run("rojo", { "build", "-o", output })
Expand Down
31 changes: 0 additions & 31 deletions docs/docs/contributing.md

This file was deleted.

42 changes: 42 additions & 0 deletions docs/docs/contributing/creating-releases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Creating releases

Once ready to cut a new release, bump the version in `wally.toml` and merge it to the main branch.

After this point, to publish the new version you must create a new GitHub release, matching the tag to the version bump.

From there, our GitHub Actions will handle building Storyteller to an rbxm, attaching it to the release under the "Assets" list, and publish it to the Wally registry for consumption.

Check out the [Actions](https://github.com/flipbook-labs/storyteller/actions) tab after publishing the release to check the status of the deployment.

## Logging in to Wally registry in CI

In the event that publishing our Wally packages starts to fail this section shows how to update the login token.

:::warning
Your GitHub account must have permission to publish to the flipbook-labs org. To add a new account, update [owners.json](https://github.com/UpliftGames/wally-index/blob/main/flipbook-labs/owners.json) with your GitHub user ID.
:::

First run `wally login` locally and authenticate with your GitHub account.

```sh
wally login
[INFO ] Updating package index https://github.com/UpliftGames/wally-index...

Go to https://github.com/login/device
And enter the code: XXXX-XXXX

Awaiting authorization...
Authorization successful!
```

Open `~/.wally/auth.toml` and copy the generated GitHub token.

```toml
# This is where Wally stores details for authenticating with registries.
# It can be updated using `wally login` and `wally logout`.

[tokens]
"https://api.wally.run/" = "gho_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
```

Then navigate to the organization's [secrets settings](https://github.com/organizations/flipbook-labs/settings/secrets/actions) and update `WALLY_REGISTRY_TOKEN` to use the new token to allow all flipbook-labs repos to publish to our scope.
53 changes: 53 additions & 0 deletions docs/docs/contributing/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Contributing

Thank you for your interest in contributing to Storyteller! This guide will help you get your environment setup so you can have the best possible development experience.

## First-time setup

We use [Visual Studio Code](https://code.visualstudio.com/) to work on this project, so you'll get the best mileage from using it too. We also have several [recommended extensions](https://github.com/flipbook-labs/flipbook/blob/main/.vscode/extensions.json) that should be installed.

You will also need [Rokit](https://github.com/rojo-rbx/rokit/) for installing the various command-line tools we use.

With the above requirements satisfied, run the following commands from your clone of the repo to start developing:

```sh
# Install command-line tools (like Lune)
$ rokit install

# Setup lune with VSCode
$ lune setup

# Install packages
$ lune run wally-install
```

## Testing

Run the following to run all unit tests for the project:

```sh
$ lune run test
```

We use jsdotlua's [Jest](https://github.com/jsdotlua/jest-lua) fork for authoring and executing unit tests. [Read the docs](https://jsdotlua.github.io/jest-lua/) and look to our existing `.spec.luau` modules for how to write tests.

:::tip
If your code is not properly tested, maintainers will let you know and offer suggestions on how to improve your tests so you can get your pull request merged.
:::

## Building

Part of our build process uses [darklua](https://github.com/seaofvoices/darklua) to compile our Luau source code for Roblox. This is largely to support string requires so our Storyteller source code can use the same syntax as our Lune scripts.

Run the following to build the project:

```sh
$ lune run build
```

By default, the project is built for a production environment, so all development files like our unit tests are pruned from the resulting build. To keep development files, pass the `--target` flag to set the environment to build for:

```sh
$ lune run build -- --target dev
```

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Story Renderers Spec
# Story Renderers

The render API allows any UI library to be supported as the renderer for a Storyteller story.

Expand All @@ -20,7 +20,7 @@ Future:
- [Blend](https://quenty.github.io/NevermoreEngine/api/Blend/)
- Developer Storybook (Roblox internal)

## Implementing a renderer
## Adding new renderers

All renderers live here: https://github.com/flipbook-labs/storyteller/tree/main/src/renderers.

Expand Down
36 changes: 35 additions & 1 deletion docs/docs/intro.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# Getting Started
# Introduction

Storyteller is a package for the discovery and rendering of UI stories and powers our storybook plugin [Flipbook](https://github.com/flipbook-labs/flipbook).

## Features

* Discover Storybooks and their Story modules
* Render stories written in [React](https://github.com/jsdotlua/react-lua), [Fusion](https://elttob.uk/Fusion/), [Roact](https://github.com/Roblox/roact/), and any generic Roblox Gui.
* Light compatibility with [UI Labs](https://pepeeltoro41.github.io/ui-labs/) and [Hoarcekat](https://github.com/Kampfkarren/hoarcekat/)


## Installation

### Wally

```toml
[dependencies]
Storyteller = "flipbook-labs/[email protected]"
```

### Roblox Model

Download a copy of the rbxm from the [latest release](https://github.com/flipbook-labs/storyteller/releases/latest) under the Assets section, then drag and drop the file into Roblox Studio to add it to your experience.

## Resources

API documentation is available on [the official documentation website](https://flipbook-labs.github.io/storyteller).

## Contributing

Contributions welcome! Proper steps on how to get started will come later but feel free to poke around in the meantime.

## License

The contents of this repository are available under the MIT License. For full license text, see [LICENSE](LICENSE).
17 changes: 0 additions & 17 deletions docs/docs/migration-guide.md

This file was deleted.

File renamed without changes.
1 change: 0 additions & 1 deletion docs/docs/tech-specs/intro.md

This file was deleted.

133 changes: 0 additions & 133 deletions docs/docs/writing-stories.md

This file was deleted.

11 changes: 3 additions & 8 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,15 @@ const config: Config = {
items: [
{
type: 'docSidebar',
sidebarId: 'docs',
sidebarId: 'primary',
position: 'left',
label: 'Docs',
label: 'Home',
},
{
to: "/api/",
label: "API",
position: "left"
},
{
type: 'docSidebar',
sidebarId: 'specs',
label: "Specs",
position: "left"
},
{
href: REPO_URL,
label: 'GitHub',
Expand Down Expand Up @@ -142,6 +136,7 @@ const config: Config = {
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
additionalLanguages: ['lua', 'bash', 'toml'],
},
} satisfies Preset.ThemeConfig,
};
Expand Down
Loading
Loading