diff --git a/.eslintrc.json b/.eslintrc.json index 18ddef1..635beae 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,7 +1,8 @@ { "env": { "node": true, - "mocha": true + "mocha": true, + "es2021": true }, "parser": "@babel/eslint-parser", "parserOptions": { @@ -9,15 +10,27 @@ "ecmaVersion": 8, "requireConfigFile": false }, - "extends": "google", + "extends": [ + "eslint:recommended", + "google" + ], "rules": { "arrow-parens": ["error", "as-needed" ], "max-len": ["error", { - "code": 120, + "code": 140, "ignoreComments": true }], + "no-empty": ["error", { + "allowEmptyCatch": true + }], + "no-unused-vars": ["error", { + "vars": "all", + "args": "after-used", + "ignoreRestSiblings": false + }], + "require-jsdoc": ["error", { "require": { "FunctionDeclaration": true, diff --git a/.node-version b/.node-version index 3c03207..209e3ef 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -18 +20 diff --git a/.npmignore b/.npmignore index 4a071d5..2330742 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,6 @@ .github +.nyc_output +coverage docs examples guides diff --git a/CHANGELOG.md b/CHANGELOG.md index f272b56..ffc836d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }}) +* Optimized for `midcore` + ## v1.6.2 - [December 6, 2024](https://github.com/lando/php/releases/tag/v1.6.2) * Updated the version index.md to get Docuverse page to build correctly. diff --git a/builders/php-nginx.js b/builders/php-nginx.js index 7237c85..ffb61ec 100644 --- a/builders/php-nginx.js +++ b/builders/php-nginx.js @@ -7,9 +7,9 @@ const LandoNginx = require('@lando/nginx/builders/nginx.js'); module.exports = { name: 'php-nginx', parent: '_webserver', - builder: (parent, config) => class PhpNginx extends LandoNginx.builder(parent, LandoNginx.config) { + builder: parent => class PhpNginx extends LandoNginx.builder(parent, LandoNginx.config) { constructor(id, options = {}) { super(id, options, {services: _.set({}, options.name)}); - }; + } }, }; diff --git a/builders/php.js b/builders/php.js index 2942255..20f5223 100644 --- a/builders/php.js +++ b/builders/php.js @@ -215,6 +215,6 @@ module.exports = { // Add in the php service and push downstream options.sources.push({services: _.set({}, options.name, php)}); super(id, options, ..._.flatten(options.sources)); - }; + } }, }; diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index b9e60ea..ce7c252 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -20,7 +20,7 @@ export default defineConfig({ ], themeConfig: { multiVersionBuild: { - satisfies: '>=1.0.0', + satisfies: '>=1.6.0', }, sidebar: sidebar(), }, diff --git a/docs/development.md b/docs/development.md index bfb9dc0..d1becb1 100644 --- a/docs/development.md +++ b/docs/development.md @@ -91,25 +91,31 @@ npm run test:unit We do end to end testing with our made-just-for-Lando testing framework [Leia](https://github.com/lando/leia). Leia allows us to define tests as a series of commented shell commands in human readable markdown files. Here is a simple example: -```md -Start up tests --------------- +````md +## Start up tests +```bash # Should start up successfully lando start +``` -Verification commands ---------------------- +## Verification commands +```bash # Should be able to connect to all mariadb relationships lando mariadb main -e "show tables;" -Destroy tests -------------- +# Should do something else +lando exec appserver -- some-command +``` + +## Destroy tests +```bash # Should be able to destroy our app lando destroy -y ``` +```` 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. diff --git a/index.js b/index.js index 4b6e364..529aa95 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ 'use strict'; -module.exports = lando => {}; +module.exports = () => {}; diff --git a/package-lock.json b/package-lock.json index 891d925..5d496ff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,10 +6,10 @@ "packages": { "": { "name": "@lando/php", - "version": "1.6.1", + "version": "1.6.2", "license": "GPL-3.0", "dependencies": { - "@lando/nginx": "^1.4.1", + "@lando/nginx": "^1.4.4", "lodash": "^4.17.21", "semver": "^7.6.3" }, @@ -1569,9 +1569,9 @@ } }, "node_modules/@lando/nginx": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@lando/nginx/-/nginx-1.4.1.tgz", - "integrity": "sha512-9wY/dp9mYTQvQIMBFUdVQN7pC3uP0oLfVITF5W9sPqGytVPDZYZl2UescD74+Omy9A2h+AfUW87YXJDLCNNh2A==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@lando/nginx/-/nginx-1.4.4.tgz", + "integrity": "sha512-UCdwU7Nwe/o0wrH1MWpzqFQTnaFZElXK9Qtjjp3eMETIQu3vj9RPxdafl/bdooeqeZpf/CFZi8Z+dd/pHYINpQ==", "bundleDependencies": [ "lodash" ], @@ -5495,7 +5495,8 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" }, "node_modules/lodash-es": { "version": "4.17.21", @@ -7225,6 +7226,7 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, diff --git a/package.json b/package.json index 0b38019..cc4b5a3 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "test": "npm run lint && npm run test:unit" }, "dependencies": { - "@lando/nginx": "^1.4.1", + "@lando/nginx": "^1.4.4", "lodash": "^4.17.21", "semver": "^7.6.3" },