Skip to content

Commit 9500116

Browse files
reynoldsalecpirog
andauthored
Dial fully for lando update (#24)
* Dial fully for `lando update` * Update to node 18 * isolate riff 1 * isolate riff 1 * isolate riff 2 --------- Co-authored-by: Mike Pirog <[email protected]>
1 parent ee08424 commit 9500116

24 files changed

+16130
-4470
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
os:
1212
- ubuntu-22.04
1313
node-version:
14-
- '16'
14+
- '18'
1515
steps:
1616
# Install deps and cache
1717
- name: Checkout code
@@ -20,12 +20,12 @@ jobs:
2020
uses: actions/setup-node@v3
2121
with:
2222
node-version: ${{ matrix.node-version }}
23-
cache: yarn
24-
- name: Install Yarn dependencies
25-
run: yarn install --prefer-offline --frozen-lockfile
23+
cache: npm
24+
- name: Install dependencies
25+
run: npm clean-install --prefer-offline --frozen-lockfile
2626

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

.github/workflows/pr-linter.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
os:
1212
- ubuntu-22.04
1313
node-version:
14-
- '16'
14+
- '18'
1515
steps:
1616
# Install deps and cache
1717
- name: Checkout code
@@ -20,10 +20,10 @@ jobs:
2020
uses: actions/setup-node@v3
2121
with:
2222
node-version: ${{ matrix.node-version }}
23-
cache: yarn
24-
- name: Install Yarn dependencies
25-
run: yarn install --prefer-offline --frozen-lockfile
23+
cache: npm
24+
- name: Install dependencies
25+
run: npm clean-install --prefer-offline --frozen-lockfile
2626

2727
# Run the linter
2828
- name: Run code linter
29-
run: yarn lint
29+
run: npm run lint

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

+15-12
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,36 @@ jobs:
1414
leia-test:
1515
- examples/mailhog
1616
lando-version:
17-
- 3-dev
17+
- 3-dev-slim
1818
os:
1919
- ubuntu-22.04
2020
node-version:
21-
- '16'
21+
- '18'
2222
steps:
2323
- name: Checkout code
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v3
2525
- name: Install node ${{ matrix.node-version }}
26-
uses: actions/setup-node@v2
26+
uses: actions/setup-node@v3
2727
with:
2828
node-version: ${{ matrix.node-version }}
2929
registry-url: https://registry.npmjs.org
30-
cache: yarn
31-
- name: Install Yarn dependencies
32-
run: yarn install --prefer-offline --frozen-lockfile
30+
cache: npm
31+
- name: Install dependencies
32+
run: npm clean-install --prefer-offline --frozen-lockfile
33+
- name: Bundle Deps
34+
uses: lando/prepare-release-action@v3
35+
with:
36+
lando-plugin: true
37+
version: dev
38+
sync: false
3339
- name: Setup lando ${{ matrix.lando-version }}
3440
uses: lando/setup-lando@v2
3541
with:
3642
lando-version: ${{ matrix.lando-version }}
3743
config: |
38-
plugins.@lando/mailhog=/home/runner/work/mailhog/mailhog
44+
setup.skipCommonPlugins=true
45+
setup.plugins.@lando/mailhog=/home/runner/work/mailhog/mailhog
3946
telemetry: false
40-
- name: Verify Lando works and we are dogfooding this plugin for tests
41-
run: |
42-
lando version
43-
lando config --path plugins | grep mailhog | grep /home/runner/work/mailhog/mailhog || (echo "::error:: Not dogfooding this plugin correctly!" && exit 1)
4447
- name: Run Leia Tests
4548
uses: lando/run-leia-action@v2
4649
with:

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- ubuntu-22.04
1515
- macos-12
1616
node-version:
17-
- '16'
17+
- '18'
1818
steps:
1919
# Install deps and cache
2020
- name: Checkout code
@@ -23,10 +23,10 @@ jobs:
2323
uses: actions/setup-node@v3
2424
with:
2525
node-version: ${{ matrix.node-version }}
26-
cache: yarn
27-
- name: Install Yarn dependencies
28-
run: yarn install --prefer-offline --frozen-lockfile
26+
cache: npm
27+
- name: Install dependencies
28+
run: npm clean-install --prefer-offline --frozen-lockfile
2929

3030
# Run unit tests
3131
- name: Run unit tests
32-
run: yarn test:unit
32+
run: npm run test:unit

.github/workflows/release.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
os:
1818
- ubuntu-22.04
1919
node-version:
20-
- '16'
20+
- '18'
2121
steps:
2222
# Install deps and cache
2323
- name: Checkout code
@@ -27,19 +27,19 @@ jobs:
2727
with:
2828
node-version: ${{ matrix.node-version }}
2929
registry-url: https://registry.npmjs.org
30-
cache: yarn
31-
- name: Install Yarn dependencies
32-
run: yarn install --prefer-offline --frozen-lockfile
30+
cache: npm
31+
- name: Install dependencies
32+
run: npm clean-install --prefer-offline --frozen-lockfile
3333

3434
# Let's do tests rq just to make sure we dont push something that is fundamentally broken
3535
- name: Lint code
36-
run: yarn lint
36+
run: npm run lint
3737
- name: Run unit tests
38-
run: yarn test:unit
38+
run: npm run test:unit
3939

4040
# Prepare release.
4141
- name: Prepare release
42-
uses: lando/prepare-release-action@v2
42+
uses: lando/prepare-release-action@v3
4343
with:
4444
lando-plugin: true
4545

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ coverage/
3939
_site
4040
docs/.vuepress/.cache
4141
docs/.vuepress/.temp
42-
docs/.vuepress/dist
42+
docs/.vuepress/dist
43+
44+
# YARN
45+
yarn.lock

.lando.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ services:
33
node:
44
type: node:14
55
build:
6-
- yarn install
6+
- npm install
77
scanner: false
88
ssl: false
99
sslExpose: false
1010
tooling:
1111
node:
1212
service: node
13-
yarn:
13+
npm:
1414
service: node

.node-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
18

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.github
2+
.nyc_output
3+
coverage
24
docs
35
examples
46
guides

CHANGELOG.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
## v0.8.0 - [July 3, 2023](https://github.com/lando/mailhog/releases/tag/v0.8.0)
2-
* Removed bundle-dependencies and version-bump-prompt from plugin.
3-
* Updated package to use prepare-release-action.
4-
* Updated documentation to reflect new release process.
1+
## v1.0.0 - [December 7, 2023](https://github.com/lando/mailhog/releases/tag/v1.0.0)
52

6-
## v0.7.0 - [December 12, 2022](https://github.com/lando/mailhog/releases/tag/v0.7.0)
7-
* Added bundle-dependencies to release process.
8-
* Fixed bug in plugin dogfooding test.
3+
* Dialed fully for `lando update`
94

10-
## IN DEVELOPMENT
5+
## v0.8.0 - [July 3, 2023](https://github.com/lando/mailhog/releases/tag/v0.8.0)
116

12-
## v0.6.0 - [September 8, 2022](https://github.com/lando/mailhog/releases/tag/v0.6.0)
7+
* Removed bundle-dependencies and version-bump-prompt from plugin.
8+
* Updated package to use prepare-release-action.
9+
* Updated documentation to reflect new release process.
10+
11+
## v0.7.0 - [December 12, 2022](https://github.com/lando/mailhog/releases/tag/v0.7.0)
1312

14-
* HYPERDRIVED
13+
* Added bundle-dependencies to release process.
14+
* Fixed bug in plugin dogfooding test.
1515

1616
## v0.5.0 - [January 5, 2022](https://github.com/lando/mailhog/releases/tag/v0.5.0)
1717

services/mailhog/builder.js renamed to builders/mailhog.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Modules
44
const _ = require('lodash');
5-
const utils = require('./../../lib/utils');
5+
const path = require('path');
66

77
// Cmdz
88
const amd64dlUrl = 'https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64';
@@ -16,7 +16,7 @@ module.exports = {
1616
config: {
1717
version: 'v1.0.1',
1818
supported: ['v1.0.0', 'v1.0.1'],
19-
confSrc: __dirname,
19+
confSrc: path.resolve(__dirname, '..', 'config'),
2020
hogfrom: [],
2121
port: '1025',
2222
sources: [],
@@ -59,7 +59,8 @@ module.exports = {
5959
// Get download URL based on ARCH
6060
const mhsendmailURL = (isArmed) ? arm64dlUrl : amd64dlUrl;
6161
// Add some build tazk
62-
utils.addBuildStep([downloadCmd(mhsendmailURL), chmodCmd], options._app, hog, 'build_as_root_internal');
62+
const dlc = downloadCmd(mhsendmailURL);
63+
require('../utils/add-build-step')([dlc, chmodCmd], options._app, hog, 'build_as_root_internal');
6364
// Set the hogfrom with some extra things
6465
options.sources.push({services: _.set({}, hog, {
6566
environment: {MH_SENDMAIL_SMTP_ADDR: 'sendmailhog:1025'},
File renamed without changes.

docs/.vuepress/public/.!78608!favicon.ico

Whitespace-only changes.

docs/development.md

+14-16
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ At the very least you will need to have the following installed:
1414
* [Lando 3.5.0+](https://docs.lando.dev/basics/installation.html), preferably installed [from source](https://docs.lando.dev/basics/installation.html#from-source).
1515
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
1616

17-
While not a hard requirement it's also probably a good idea to install both `node` 14 and `yarn`
18-
19-
* [Node 14](https://nodejs.org/dist/latest-v14.x/)
20-
* [Yarn](https://classic.yarnpkg.com/lang/en/docs/install)
17+
While not a hard requirement it's also probably a good idea to install `node` 18
18+
* [Node 18](https://nodejs.org/dist/latest-v18.x/)
2119

2220
## Installation
2321

@@ -28,8 +26,8 @@ git clone https://github.com/lando/mailhog.git && cd mailhog
2826
# Install dependencies with lando
2927
lando start
3028

31-
# Or install them with yarn
32-
yarn
29+
# Or install them with npm
30+
npm install
3331
```
3432

3533
## Working
@@ -60,10 +58,10 @@ If you want to help with contributing documentation here are some useful command
6058

6159
```bash
6260
# launch local docs site
63-
yarn docs:dev
61+
npm run docs:dev
6462
6563
# build docs locally
66-
yarn docs:build
64+
npm run docs:build
6765
```
6866

6967
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).
@@ -88,7 +86,7 @@ And then you can run the tests with the below.
8886

8987
```bash
9088
# Run unit tests
91-
yarn test:unit
89+
npm run test:unit
9290
```
9391

9492
### Leia Tests
@@ -115,21 +113,21 @@ Destroy tests
115113
lando destroy -y
116114
```
117115

118-
Note that the headers here are important and are defined in our `yarn 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.
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.
119117

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

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

124122
```bash
125123
# Generate tests
126-
yarn generate:tests
124+
npm run generate:tests
127125
128126
# Run ALL the tests, this will likely take a long time
129-
yarn test:leia
127+
npm run test:leia
130128
131129
# Run the tests for a single example
132-
yarn leia examples/mariadb-10.2/README.md -c 'Destroy tests'
130+
npm run leia examples/mariadb-10.2/README.md -c 'Destroy tests'
133131
```
134132

135133
If you've created new testable examples then you will also need to let GitHub Actions know so they can run on pull requests.
@@ -145,7 +143,7 @@ jobs:
145143
matrix:
146144
leia-tests:
147145
# This should be the filename, without .leia.js extension in the test directory
148-
# NOTE that you will need to run yarn generate:tests to see these
146+
# NOTE that you will need to run npm run generate:tests to see these
149147
- test: platform-sh-maria-db-10-1-example
150148
# This should be the directory that the test was generated from
151149
source: examples/mariadb-10.2
@@ -165,9 +163,9 @@ Also note that if you create a "pre-release" it will tag the `npm` package with
165163

166164
```bash
167165
# Will pull the most recent GitHub release
168-
yarn add @lando/mailhog
166+
npm install @lando/mailhog
169167
# Will pull the most recent GitHub pre-release
170-
yarn add @lando/mailhog@edge
168+
npm install @lando/mailhog@edge
171169
```
172170

173171
## Contribution

docs/index.md

+18-12
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,37 @@ This plugin is included with Lando by default. That means if you have Lando vers
3333
However if you would like to manually install the plugin, update it to the bleeding edge or install a particular version then use the below. Note that this installation method requires Lando `3.5.0+`.
3434

3535
:::: code-group
36+
::: code-group-item LANDO 3.21+
37+
```bash:no-line-numbers
38+
lando plugin-add @lando/mailhog
39+
```
40+
:::
41+
::: code-group-item HYPERDRIVE
42+
```bash:no-line-numbers
43+
# @TODO
44+
# @NOTE: This doesn't actaully work yet
45+
hyperdrive install @lando/mailhog
46+
```
47+
:::
3648
::: code-group-item DOCKER
3749
```bash:no-line-numbers
3850
# Ensure you have a global plugins directory
3951
mkdir -p ~/.lando/plugins
4052
4153
# Install plugin
42-
# NOTE: Modify the "yarn add @lando/mailhog" line to install a particular version eg
43-
# yarn add @lando/[email protected]
44-
docker run --rm -it -v ${HOME}/.lando/plugins:/plugins -w /tmp node:14-alpine sh -c \
45-
"yarn init -y \
46-
&& yarn add @lando/mailhog --production --flat --no-default-rc --no-lockfile --link-duplicates \
47-
&& yarn install --production --cwd /tmp/node_modules/@lando/mailhog \
54+
# NOTE: Modify the "npm install @lando/mailhog" line to install a particular version eg
55+
# npm install @lando/[email protected]
56+
docker run --rm -it -v ${HOME}/.lando/plugins:/plugins -w /tmp node:18-alpine sh -c \
57+
"npm init -y \
58+
&& npm install @lando/mailhog --production --flat --no-default-rc --no-lockfile --link-duplicates \
59+
&& npm install --production --cwd /tmp/node_modules/@lando/mailhog \
4860
&& mkdir -p /plugins/@lando \
4961
&& mv --force /tmp/node_modules/@lando/mailhog /plugins/@lando/mailhog"
5062
5163
# Rebuild the plugin cache
5264
lando --clear
5365
```
5466
:::
55-
::: code-group-item HYPERDRIVE
56-
```bash:no-line-numbers
57-
# @TODO
58-
# @NOTE: This doesn't actaully work yet
59-
hyperdrive install @lando/mailhog
60-
```
6167
::::
6268

6369
You should be able to verify the plugin is installed by running `lando config --path plugins` and checking for `@lando/mailhog`. This command will also show you _where_ the plugin is being loaded from.

0 commit comments

Comments
 (0)