Skip to content

Commit 7e7a04a

Browse files
authored
Initial vitepress migration. (#26)
* Initial vitepress migration. * Checklinks + add caveats. * Make sure vitepress deps are devDeps. * Update vitepress and theme to latest versions. * Update netlify.toml patterns. * Update path to from source install insructions and update vitepress-theme-default-plus. * Test commit.
1 parent b563cfd commit 7e7a04a

27 files changed

+1387
-3038
lines changed

.eslintignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.temp
2-
.cache
1+
temp
2+
cache
33
dist
44
_site
5+
!.vitepress

.github/workflows/pr-docs-tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55

66
jobs:
7-
unit-tests:
7+
docs-tests:
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
@@ -26,6 +26,6 @@ jobs:
2626

2727
# Run tests
2828
- name: Run linter
29-
run: npm run docs:lint
29+
run: npm run lint
3030
- name: Test build
3131
run: npm run docs:build

.gitignore

+8-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ dist
3333
.nyc_output
3434
coverage/
3535

36-
# Vuepress
36+
# docs
3737
.temp
3838
.cache
3939
_site
40-
docs/.vuepress/.cache
41-
docs/.vuepress/.temp
42-
docs/.vuepress/distyarn.lock
40+
dist
41+
cache
42+
temp
43+
config.*.timestamp-*-*.*
44+
45+
# YARN
46+
yarn.lock

docs/.eslintrc.json

+9
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818
"max-len": ["error", {
1919
"code": 12000,
2020
"ignoreComments": true
21+
}],
22+
"require-jsdoc": ["error", {
23+
"require": {
24+
"FunctionDeclaration": false,
25+
"MethodDefinition": false,
26+
"ClassDeclaration": false,
27+
"ArrowFunctionExpression": false,
28+
"FunctionExpression": false
29+
}
2130
}]
2231
}
2332
}

docs/.vitepress/config.mjs

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import {createRequire} from 'module';
2+
3+
import {defineConfig} from '@lando/vitepress-theme-default-plus/config';
4+
5+
const require = createRequire(import.meta.url);
6+
7+
const {name, version} = require('../../package.json');
8+
const landoPlugin = name.replace('@lando/', '');
9+
10+
export default defineConfig({
11+
title: 'Lando Ruby Plugin',
12+
description: 'The offical Lando plugin for Ruby.',
13+
landoDocs: 3,
14+
landoPlugin,
15+
version,
16+
head: [
17+
['meta', {name: 'viewport', content: 'width=device-width, initial-scale=1'}],
18+
['link', {rel: 'icon', href: '/ruby/favicon.ico', size: 'any'}],
19+
['link', {rel: 'icon', href: '/ruby/favicon.svg', type: 'image/svg+xml'}],
20+
],
21+
themeConfig: {
22+
sidebar: sidebar(),
23+
},
24+
});
25+
26+
function sidebar() {
27+
return [
28+
{
29+
text: 'Introduction',
30+
collapsed: false,
31+
items: [
32+
{text: 'Overview', link: '/'},
33+
{text: 'Installation', link: '/install'},
34+
{text: 'Usage', link: '/config'},
35+
{text: 'Caveats', link: '/caveats'},
36+
],
37+
},
38+
{
39+
text: 'Contribution',
40+
collapsed: false,
41+
items: [
42+
{text: 'Development', link: '/development'},
43+
{text: 'Team', link: '/team'},
44+
],
45+
},
46+
{
47+
text: 'Help & Support',
48+
collapsed: false,
49+
items: [
50+
{text: 'GitHub', link: 'https://github.com/lando/ruby/issues/new/choose'},
51+
{text: 'Slack', link: 'https://www.launchpass.com/devwithlando'},
52+
{text: 'Contact Us', link: '/support'},
53+
],
54+
},
55+
{text: 'Examples', link: 'https://github.com/lando/ruby/tree/main/examples'},
56+
];
57+
};

docs/.vitepress/theme/index.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import VPLTheme from '@lando/vitepress-theme-default-plus';
2+
3+
export default VPLTheme;

docs/.vuepress/config.js

-41
This file was deleted.

docs/caveats.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ Lando will set the `PATH` hierarchy for this service as follows:
2020
]
2121
```
2222

23-
This is useful to note if you are not using absolute paths in any [tooling routes](https://docs.lando.dev/config/tooling.html) and are getting the unexpected version of a particular utility.
23+
This is useful to note if you are not using absolute paths in any [tooling routes](https://docs.lando.dev/core/v3/tooling.html) and are getting the unexpected version of a particular utility.

docs/config.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ description: Learn how to configure the Lando Ruby service.
55

66
# Configuration
77

8-
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.
8+
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/lando-service.html) to get a good handle on how the magicks work.
99

10-
Also note that the 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:
10+
Also note that the 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:
1111

1212
```yaml
1313
services:
@@ -57,7 +57,7 @@ You can then invoke them on the command line.
5757
lando dotnet
5858
```
5959

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

6262
## Adding routing
6363

@@ -70,4 +70,4 @@ proxy:
7070
- something.else.local
7171
```
7272

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

docs/development.md

+20-28
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,23 @@ description: Learn how to develop and contribute to the Lando Ruby service
55

66
# Development
77

8-
This guide contains information to help onboard developers to work on the [Ruby](https://ruby.net) integration, hereafter referred to as "the plugin".
8+
This guide contains information to help onboard developers to work on the [ruby](https://www.ruby-lang.org/en/) integration, hereafter referred to as *the plugin*.
99

1010
## Requirements
1111

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

14-
* [Lando 3.5.0+](https://docs.lando.dev/basics/installation.html), preferably installed [from source](https://docs.lando.dev/basics/installation.html#from-source).
14+
* [Lando 3.21.0+](https://docs.lando.dev/getting-started/installation.html) preferably installed [from source](https://docs.lando.dev/install/source.html).
1515
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
16-
17-
While not a hard requirement it's also probably a good idea to install `node` 18
1816
* [Node 18](https://nodejs.org/dist/latest-v18.x/)
1917

2018
## Installation
2119

22-
```bash
20+
```sh
2321
# Clone this repo
2422
git clone https://github.com/lando/ruby.git && cd ruby
2523

26-
# Install dependencies with lando
27-
lando start
28-
29-
# Or install them with npm
24+
# Install deps
3025
npm install
3126
```
3227

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

3934
```yaml
4035
plugins:
41-
"@lando/ruby": ./../../
36+
"@lando/ruby": ../..
4237
```
4338
4439
This tells Lando that _this_ app should use the source version of the `@lando/ruby` 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.
@@ -62,21 +57,24 @@ npm run docs:dev
6257
6358
# build docs locally
6459
npm run docs:build
60+
61+
# preview built docs locally
62+
npm run docs:build
6563
```
6664

67-
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).
65+
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).
6866

6967
## Testing
7068

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

7371
### Unit Tests
7472

75-
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:
73+
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:
7674

7775
```bash
7876
./
79-
|-- lib
77+
|-- utils
8078
|-- stuff.js
8179
|-- test
8280
|-- stuff.spec.js
@@ -113,21 +111,18 @@ Destroy tests
113111
lando destroy -y
114112
```
115113

116-
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.
114+
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.
117115

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

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

122120
```bash
123-
# Generate tests
124-
npm run generate:tests
125-
126121
# Run ALL the tests, this will likely take a long time
127122
npm run test:leia
128123
129124
# Run the tests for a single example
130-
npm run leia examples/mariadb-10.2/README.md -c 'Destroy tests'
125+
npx leia examples/mariadb-10.2/README.md -c 'Destroy tests'
131126
```
132127

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

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

171163
## Contribution
172164

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

0 commit comments

Comments
 (0)