Skip to content

Commit

Permalink
switch over to functional vitepress theme (#31)
Browse files Browse the repository at this point in the history
* switch over to functional vitepress theme

* switch over to functional vitepress theme part 2

* update theme and fix ci

* rework docs

* update to latest theme and attempt full package usage

* alright alright alright\?

* update to latest theme and attempt full package usage

* fix gitignores

* fix linting to cover both file extensions

* correctly name docs build test job

* update to beta.21 and add plugin TOMLz

* todo patterns

* fix linx 1

* fix linx 2

* fix linx 3

* fix linx 4

* update theme

* Correct plugin name in team desc.

* update theme things to latest

* update theme

* linx

---------

Co-authored-by: Alec Reynolds <[email protected]>
  • Loading branch information
pirog and reynoldsalec authored Feb 9, 2024
1 parent b283f56 commit ccaa777
Show file tree
Hide file tree
Showing 26 changed files with 1,280 additions and 3,007 deletions.
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.temp
.cache
temp
cache
dist
_site
!.vitepress
4 changes: 2 additions & 2 deletions .github/workflows/pr-docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:

jobs:
unit-tests:
docs-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -26,6 +26,6 @@ jobs:

# Run tests
- name: Run linter
run: npm run docs:lint
run: npm run lint
- name: Test build
run: npm run docs:build
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ dist
.nyc_output
coverage/

# Vuepress
# docs
.temp
.cache
_site
docs/.vuepress/.cache
docs/.vuepress/.temp
docs/.vuepress/dist
dist
cache
temp
config.*.timestamp-*-*.*

# YARN
yarn.lock
9 changes: 9 additions & 0 deletions docs/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
"max-len": ["error", {
"code": 12000,
"ignoreComments": true
}],
"require-jsdoc": ["error", {
"require": {
"FunctionDeclaration": false,
"MethodDefinition": false,
"ClassDeclaration": false,
"ArrowFunctionExpression": false,
"FunctionExpression": false
}
}]
}
}
56 changes: 56 additions & 0 deletions docs/.vitepress/config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import {createRequire} from 'module';

import {defineConfig} from '@lando/vitepress-theme-default-plus/config';

const require = createRequire(import.meta.url);

const {name, version} = require('../../package.json');
const landoPlugin = name.replace('@lando/', '');

export default defineConfig({
title: 'Lando Dotnet Plugin',
description: 'The offical Lando plugin for Dotnet.',
landoDocs: 3,
landoPlugin,
version,
head: [
['meta', {name: 'viewport', content: 'width=device-width, initial-scale=1'}],
['link', {rel: 'icon', href: '/dotnet/favicon.ico', size: 'any'}],
['link', {rel: 'icon', href: '/dotnet/favicon.svg', type: 'image/svg+xml'}],
],
themeConfig: {
sidebar: sidebar(),
},
});

function sidebar() {
return [
{
text: 'Overview',
collapsed: false,
items: [
{text: 'Introduction', link: '/'},
{text: 'Installation', link: '/install'},
{text: 'Configuration', link: '/config'},
],
},
{
text: 'Contribution',
collapsed: false,
items: [
{text: 'Development', link: '/development'},
{text: 'Team', link: '/team'},
],
},
{
text: 'Help & Support',
collapsed: false,
items: [
{text: 'GitHub', link: 'https://github.com/lando/dotnet/issues/new/choose'},
{text: 'Slack', link: 'https://www.launchpass.com/devwithlando'},
{text: 'Contact Us', link: '/support'},
],
},
{text: 'Examples', link: 'https://github.com/lando/dotnet/tree/main/examples'},
];
};
3 changes: 3 additions & 0 deletions docs/.vitepress/theme/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import VPLTheme from '@lando/vitepress-theme-default-plus';

export default VPLTheme;
40 changes: 0 additions & 40 deletions docs/.vuepress/config.js

This file was deleted.

72 changes: 0 additions & 72 deletions docs/README.md

This file was deleted.

14 changes: 7 additions & 7 deletions docs/config.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
title: Configuration
title: Usage
description: Learn how to configure the Lando Dotnet service.
---

# Configuration
# Usage

Here are the configuration options, set to the default values, for this service. If you are unsure about where this goes or what this means, we *highly recommend* scanning the [services documentation](https://docs.lando.dev/config/services.html) to get a good handle on how the magicks work.
Here are the configuration options, set to the default values, for this service. If you are unsure about where this goes or what this means, we *highly recommend* scanning the [services documentation](https://docs.lando.dev/core/v3/services.html) to get a good handle on how the magicks work.

Also note that options, in addition to the [build steps](https://docs.lando.dev/config/services.html#build-steps) and [overrides](https://docs.lando.dev/config/services.html#overrides) that are available to every service, are shown below:
Also note that options, in addition to the [build steps](https://docs.lando.dev/core/v3/lando-service.html#build-steps) and [overrides](https://docs.lando.dev/core/v3/lando-service.html#overrides) that are available to every service, are shown below:

```yaml
services:
Expand All @@ -33,7 +33,7 @@ services:

## Using SSL

Also note that `ssl: true` will only generate certs in the [default locations](https://docs.lando.dev/config/security.html) and expose port `443`. It is up to the user to use the certs and secure port correctly in their application like as in [this article](https://asp.net-hacker.rocks/2018/07/05/aspnetcore-ssl.html).
Also note that `ssl: true` will only generate certs in the [default locations](https://docs.lando.dev/core/v3/security.html) and expose port `443`. It is up to the user to use the certs and secure port correctly in their application like as in [this article](https://asp.net-hacker.rocks/2018/07/05/aspnetcore-ssl.html).

## Setting a port

Expand Down Expand Up @@ -63,7 +63,7 @@ You can then invoke them on the command line.
lando dotnet
```

Lando tooling is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/config/tooling.html) of its cool features.
Lando tooling is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/core/v3/tooling.html) of its cool features.

## Adding routing

Expand All @@ -76,5 +76,5 @@ proxy:
- something.else.local
```

Lando proxying is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/config/proxy.html) of its cool features.
Lando proxying is actually pretty powerful so definitely check out [the rest](https://docs.lando.dev/core/v3/proxy.html) of its cool features.

48 changes: 20 additions & 28 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,23 @@ description: Learn how to develop and contribute to the Lando Dotnet service

# Development

This guide contains information to help onboard developers to work on the [dotnet](https://dotnet.microsoft.com/en-us/) integration, hereafter referred to as "the plugin".
This guide contains information to help onboard developers to work on the [dotnet](https://dotnet.microsoft.com/en-us/) integration, hereafter referred to as *the plugin*.

## Requirements

At the very least you will need to have the following installed:

* [Lando 3.5.0+](https://docs.lando.dev/basics/installation.html), preferably installed [from source](https://docs.lando.dev/basics/installation.html#from-source).
* [Lando 3.21.0+](https://docs.lando.dev/getting-started/installation.html) preferably installed [from source](hhttps://docs.lando.dev/install/source.html).
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)

While not a hard requirement it's also probably a good idea to install `node` 18
* [Node 18](https://nodejs.org/dist/latest-v18.x/)

## Installation

```bash
```sh
# Clone this repo
git clone https://github.com/lando/dotnet.git && cd dotnet

# Install dependencies with lando
lando start

# Or install them with npm
# Install deps
npm install
```

Expand All @@ -38,7 +33,7 @@ Note that each one of these examples contains the following section in its Lando

```yaml
plugins:
"@lando/dotnet": ./../../
"@lando/dotnet": ../..
```
This tells Lando that _this_ app should use the source version of the `@lando/dotnet` plugin you cloned down in the installation. This is useful because it allows you to isolate development within this repo without interferring with any other apps using the stable and global version of the plugin.
Expand All @@ -62,21 +57,24 @@ npm run docs:dev
# build docs locally
npm run docs:build
# preview built docs locally
npm run docs:build
```

If you are more interested in the internals of the docs they use [VuePress2](https://v2.vuepress.vuejs.org/) and our [Special theme](https://vuepress-theme-default-plus.lando.dev).
If you are more interested in the internals of the docs they use [VitePress](https://vitepress.dev/) and our [SPECIAL THEME](https://vitepress-theme-default-plus.lando.dev).

## Testing

It's best to familiarize yourself with how Lando [does testing](https://docs.lando.dev/contrib/contrib-testing.html) in general before proceeding.
It's best to familiarize yourself with how Lando [does testing](https://docs.lando.dev/contrib/coder.html) in general before proceeding.

### Unit Tests

Generally, unit testable code should be placed in `lib` and then the associated test in `tests` in the form `FILE-BEING-TESTED.spec.js`. Here is an example:
Generally, unit testable code should be placed in `utils` and then the associated test in `tests` in the form `FILE-BEING-TESTED.spec.js`. Here is an example:

```bash
./
|-- lib
|-- utils
|-- stuff.js
|-- test
|-- stuff.spec.js
Expand Down Expand Up @@ -113,21 +111,18 @@ Destroy tests
lando destroy -y
```

Note that the headers here are important and are defined in our `npm run generate:tests` script. The _Start up tests_ header specifies things that should run before the main series of tests. _Verification commands_ is the main body of tests and is required. _Destroy tests_ specifies any needed clean up commands to run.
Note that the headers here are important. The _Start up tests_ header specifies things that should run before the main series of tests. _Verification commands_ is the main body of tests and is required. _Destroy tests_ specifies any needed clean up commands to run.

If you check out the various READMEs in our [examples](https://github.com/lando/dotnet/tree/main/examples) you will notice that they are all Leia tests.

Before running all or some of the tests you will need to generate them.

```bash
# Generate tests
npm run generate:tests
# Run ALL the tests, this will likely take a long time
npm run test:leia
# Run the tests for a single example
npm run leia examples/mariadb-10.2/README.md -c 'Destroy tests'
npx leia examples/mariadb-10.2/README.md -c 'Destroy tests'
```

If you've created new testable examples then you will also need to let GitHub Actions know so they can run on pull requests.
Expand All @@ -140,15 +135,12 @@ To add the new tests to the workflow just modify `jobs.leia-tests.strategy.matri
jobs:
leia-tests:
strategy:
fail-fast: false
matrix:
leia-tests:
# This should be the filename, without .leia.js extension in the test directory
# NOTE that you will need to run npm run generate:tests to see these
- test: platform-sh-maria-db-10-1-example
# This should be the directory that the test was generated from
source: examples/mariadb-10.2
- test: platform-sh-maria-db-10-2-example
source: examples/mariadb-10.2
leia-test:
- examples/2.1
- examples/2.2
```

Now open a pull request and the new tests should run!
Expand All @@ -170,4 +162,4 @@ npm install @lando/dotnet@edge

## Contribution

If you want to contribute code then just follow [this flow](https://guides.github.com/introduction/flow/).
If you want to contribute code then just follow [this flow](https://docs.github.com/en/get-started/using-github/github-flow).
Loading

0 comments on commit ccaa777

Please sign in to comment.