Skip to content

Commit

Permalink
Merge pull request #53 from Automattic/remove/experimental
Browse files Browse the repository at this point in the history
refactor: remove experimental features
  • Loading branch information
sjinks authored Mar 28, 2024
2 parents 2f920b1 + 83ecfa1 commit e412bc5
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 100 deletions.
22 changes: 0 additions & 22 deletions core/art.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,28 +161,6 @@ exports.crash = () => [
chalk.green('For more details check out https://docs.lando.dev/privacy/'),
].join(os.EOL);

/*
* Helper to show status of experimental toggle
*/
exports.experimental = (on = false) => {
switch (on) {
case true:
return [
'',
chalk.green(niceFont('Activated!!!', 'Small Slant')),
chalk.magenta('Experimental features are now ON'),
'',
].join(os.EOL);
case false:
return [
'',
chalk.red(niceFont('Deactivated!', 'Small Slant')),
chalk.grey('Experimental features are now OFF'),
'',
].join(os.EOL);
}
};

/*
* Helper to show init header
*/
Expand Down
7 changes: 0 additions & 7 deletions examples/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ lando version
lando --clear
ls -lsa ~/.lando/cache | grep _.tasks.cache || echo $? | grep 1

# Should not load the lando-alliance plugin when secret-toggle is on and packaged
lando config | grep "disablePlugins" | grep "lando-alliance"

# Should not allow the secret toggle when run packaged
lando --secret-toggle || echo $? | grep 1

Expand All @@ -183,10 +180,6 @@ lando config | grep "channel" | grep "stable"
# Should not allow bogus release channels
lando --channel orange || echo $? | grep 1

# Should load experimental plugins if toggled on
lando --experimental
lando config | grep experimentalPluginLoadTest | grep true

# Should load plugins from pluginDirs
lando stuff | grep "I WORKED"
```
Expand Down
7 changes: 0 additions & 7 deletions experimental/lando-experimental/index.js

This file was deleted.

22 changes: 0 additions & 22 deletions lib/art.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,28 +161,6 @@ exports.crash = () => [
chalk.green('For more details check out https://docs.lando.dev/privacy/'),
].join(os.EOL);

/*
* Helper to show status of experimental toggle
*/
exports.experimental = (on = false) => {
switch (on) {
case true:
return [
'',
chalk.green(niceFont('Activated!!!', 'Small Slant')),
chalk.magenta('Experimental features are now ON'),
'',
].join(os.EOL);
case false:
return [
'',
chalk.red(niceFont('Deactivated!', 'Small Slant')),
chalk.grey('Experimental features are now OFF'),
'',
].join(os.EOL);
}
};

/*
* Helper to show init header
*/
Expand Down
17 changes: 2 additions & 15 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ const globalOptions = {
global: true,
type: 'boolean',
},
experimental: {
describe: 'Activates experimental features',
global: true,
type: 'boolean',
},
help: {
describe: 'Shows lando or delegated command help if applicable',
type: 'boolean',
Expand Down Expand Up @@ -206,9 +201,6 @@ module.exports = class Cli {
// Define usage
const cmd = !_.has(process, 'pkg') ? '$0' : path.basename(_.get(process, 'execPath', 'lando'));
const usage = [`Usage: ${cmd} <command> [args] [options]`];
if (userConfig.experimental) {
usage.push(`${this.makeArt('print', {text: '(experimental mode)', color: 'magenta'})}`);
}

// Yargs!
yargs.usage(usage.join(' '))
Expand All @@ -224,7 +216,6 @@ module.exports = class Cli {
.wrap(yargs.terminalWidth() * 0.70)
.option('channel', globalOptions.channel)
.option('clear', globalOptions.clear)
.option('experimental', globalOptions.experimental)
.help(false)
.option('lando', globalOptions.lando)
.option('help', globalOptions.help)
Expand Down Expand Up @@ -384,7 +375,7 @@ module.exports = class Cli {
const yargonaut = require('yargonaut');
yargonaut.style('green').errorsStyle('red');
const yargs = require('yargs');
const {clear, channel, experimental, secretToggle} = yargs.argv;
const {clear, channel, secretToggle} = yargs.argv;

// Handle global flag error conditions first
if (secretToggle && this.defaultConfig().packaged) {
Expand All @@ -405,15 +396,11 @@ module.exports = class Cli {
if (fs.existsSync(updateFile)) fs.unlinkSync(updateFile);
console.log(this.makeArt('releaseChannel', channel));
}
if (experimental) {
this.updateUserConfig({experimental: !userConfig.experimental});
console.log(this.makeArt('experimental', !userConfig.experimental));
}
if (secretToggle) {
this.updateUserConfig({alliance: !userConfig.alliance});
console.log(this.makeArt('secretToggle', !userConfig.alliance));
}
if (clear || channel || experimental || secretToggle) {
if (clear || channel || secretToggle) {
this.clearTaskCaches();
process.exit(0);
}
Expand Down
7 changes: 0 additions & 7 deletions lib/lando.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ const bootstrapConfig = lando => {
const Plugins = require('./plugins');
lando.plugins = new Plugins(lando.log);
lando.versions = _.merge({}, DEFAULT_VERSIONS, lando.cache.get('versions'));
// Disable the alliance plugin unless certain conditions are met
if (lando.config.packaged || !lando.config.alliance) lando.config.disablePlugins.push('lando-alliance');
// Load in experimental features
if (lando.config.experimental) {
const experimentalPluginPath = path.join(__dirname, '..', 'experimental');
lando.config.pluginDirs.push({path: experimentalPluginPath, subdir: '.'});
}
// Find the plugins
return lando.plugins.find(lando.config.pluginDirs, lando.config)
// Init the plugins
Expand Down
22 changes: 2 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"nyc": {
"include": [
"lib/**/*.js",
"experimental/**/lib/*.js",
"plugins/**/lib/*.js",
"scripts/util.js"
],
Expand All @@ -41,40 +40,23 @@
"coverage": "nyc report --reporter=text-lcov | coveralls",
"generate:api": "node ./scripts/yaml2json.js ./sponsors.yml ./contributors.yml --output-dir docs/.vuepress/public/api",
"generate:tests": "leia \"examples/**/README.md\" test -r 2 -s 'Start up tests' -t 'Verification commands' -c 'Destroy tests' --split-file --spawn --stdin",
"lint": "eslint --quiet --no-ignore bin experimental lib plugins scripts test",
"lint": "eslint --quiet --no-ignore bin lib plugins scripts test",
"release": "bump --prompt --tag --all --push",
"test:unit": "nyc --reporter=html --reporter=text mocha --timeout 5000 test/**/*.spec.js experimental/**/test/*.spec.js plugins/**/test/**/*.spec.js",
"test:unit": "nyc --reporter=html --reporter=text mocha --timeout 5000 test/**/*.spec.js plugins/**/test/**/*.spec.js",
"test:functional": "mocha --timeout 900000 test/**/*.func.js",
"test": "yarn lint && yarn test:unit"
},
"pkg": {
"outputPath": "dist",
"scripts": [
"bin/*.js",
"experimental/**/*.js",
"lib/**/*.js",
"node_modules/@lando/**/*.js",
"plugins/**/*.js"
],
"assets": [
"config.yml",
"package.json",
"experimental/**/fastcgi_params",
"experimental/**/*.cnf",
"experimental/**/*.conf",
"experimental/**/*.ini",
"experimental/**/*.inc",
"experimental/**/*.json",
"experimental/**/*.php",
"experimental/**/*.py",
"experimental/**/*.sh",
"experimental/**/*.toml",
"experimental/**/*.tpl",
"experimental/**/*.tmpl",
"experimental/**/*.vcl",
"experimental/**/*.xml",
"experimental/**/*.yaml",
"experimental/**/*.yml",
"node_modules/@lando/**/fastcgi_params",
"node_modules/@lando/**/*.cnf",
"node_modules/@lando/**/*.conf",
Expand Down

0 comments on commit e412bc5

Please sign in to comment.