Skip to content

Commit

Permalink
#25: Move non-hyperdrive libs into utils, eventually we should move t…
Browse files Browse the repository at this point in the history
…hese to @lando/utils
  • Loading branch information
pirog committed Sep 22, 2021
1 parent 9425cb7 commit ceffeed
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
28 changes: 22 additions & 6 deletions cli/hooks/init.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

// @NOTE: We use LET so we can rename the debugger as needed
const createDebugger = require('./../../lib/debug');
const createDebugger = require('../../utils/debug');
const path = require('path');
const Ministrapper = require('./../../lib/ministrapper');
const Ministrapper = require('../../utils/ministrapper');

module.exports = async({id, argv, config}) => {
let debug = createDebugger(config.dirname, 'hooks', 'init');
Expand All @@ -21,7 +21,7 @@ module.exports = async({id, argv, config}) => {
const ENV_SEPARATOR = process.env.HYPERDRIVE_BOOTSTRAP_ENV_SEPARATOR || '_';

// Build up hyperdrive/product config from various sources
const bootstrapConf = new Ministrapper([config.name, 'lib', 'ministrapper']);
const bootstrapConf = new Ministrapper([config.name, 'utils', 'ministrapper']);

// @NOTE: do we want to accept some hidden args for this eg `hyperdrive --config bootstrap.module=something?`
// ENVARS are highest priority
Expand All @@ -41,6 +41,8 @@ module.exports = async({id, argv, config}) => {
mode: 'cli',
leia: Object.prototype.hasOwnProperty.call(process.env, 'LEIA_PARSER_RUNNING'),
packaged: Object.prototype.hasOwnProperty.call(process, 'pkg'),
plugins: [],
pluginDirs: [],
product: 'hyperdrive',
});
debug('get config from defaults');
Expand All @@ -49,15 +51,29 @@ module.exports = async({id, argv, config}) => {
debug = createDebugger(bootstrapConf.get('product'), 'hooks', 'init');
debug('bootstrap config set to %O', bootstrapConf.get());

// Set DEBUG=* when -vvv is set?
// 0. need to add plugins and plugin dirs to bootstrap config
// 1. Check if bootstrap exists, throw error if not
// 1. bootstrap hook?
// 2. run bootstrap
// * consolidate and organize plugins
// * external plugins
// * ./plugins
// * dataDir/plugins
// * build plugin manifest/registry
// * load plugins
// 3. hook?
// 4. merge into config?

// run bootstrap
// 1. merge in more config
// 2. go through plugins and build manifest of components/config/whatever
// 3. traverse plugins to find commands
// 4. what do commandIDs do?
// 5. install defaults eg desktop -> lando-desktop

// *. what do commandIDs do?
// *. install defaults eg desktop -> lando-desktop
/*
hyperdrive:
config:
// list of installers
installers:
Expand Down
Empty file added lib/hyperdrive.js
Empty file.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,16 @@
"/lib",
"/npm-shrinkwrap.json",
"/scripts",
"/src"
"/src",
"/utils"
],
"homepage": "https://github.com/lando/hyperdrive",
"keywords": [
"lando",
"oclif"
],
"license": "GPL-3.0",
"main": "lib/index.js",
"main": "lib/hyperdrive.js",
"oclif": {
"bin": "hyperdrive",
"commands": "./cli/commands",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ceffeed

Please sign in to comment.