How to use the @boost/common.Path.resolve function in @boost/common

To help you get started, we’ve selected a few @boost/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github beemojs / beemo / packages / core / src / testUtils.ts View on Github external
}

export class TestScript<a> extends Script {
  name = 'test-script';

  blueprint() {
    // eslint-disable-next-line
    return {} as $FixMe;
  }
}

// Use core package since resources are located here
export const BEEMO_APP_PATH = Path.resolve('..', __dirname);

// Use a folder that should not cause issues / contain much code
export const BEEMO_TEST_ROOT = Path.resolve('../../../tests', __dirname);

export function mockTool(argv: Argv = []): Beemo {
  const tool = new Beemo(argv, '', true);

  Object.assign(tool.options, {
    appName: 'beemo',
    appPath: BEEMO_APP_PATH.path(),
    root: BEEMO_TEST_ROOT.path(),
    workspaceRoot: BEEMO_TEST_ROOT.path(),
  });

  tool.config = stubToolConfig({
    configure: {
      cleanup: false,
      parallel: true,
    },</a>
github beemojs / beemo / packages / core / src / Beemo.ts View on Github external
if (!module) {
      throw new Error(this.msg('errors:moduleConfigMissing', { configName }));
    }

    // Allow for local development
    if (module === '@local') {
      this.debug('Using %s configuration module', chalk.yellow('@local'));

      this.moduleRoot = new Path(process.cwd());

      return this.moduleRoot;
    }

    // Reference a node module
    const rootPath = Path.resolve(`node_modules/${module}`);

    if (!rootPath.exists()) {
      throw new Error(this.msg('errors:moduleMissing', { configName, module }));
    }

    this.debug('Found configuration module root path: %s', chalk.cyan(rootPath));

    this.moduleRoot = rootPath;

    return rootPath;
  }
github beemojs / beemo / packages / core / src / Beemo.ts View on Github external
protected prepareContext(context: T): T {
    context.argv = this.argv;
    context.cwd = Path.resolve(this.options.root);
    context.moduleRoot = this.getConfigModuleRoot();
    context.workspaceRoot = Path.resolve(this.options.workspaceRoot || this.options.root);
    context.workspaces = this.getWorkspacePaths({ root: context.workspaceRoot });

    return context;
  }
github beemojs / beemo / packages / core / src / Beemo.ts View on Github external
protected prepareContext(context: T): T {
    context.argv = this.argv;
    context.cwd = Path.resolve(this.options.root);
    context.moduleRoot = this.getConfigModuleRoot();
    context.workspaceRoot = Path.resolve(this.options.workspaceRoot || this.options.root);
    context.workspaces = this.getWorkspacePaths({ root: context.workspaceRoot });

    return context;
  }