How to use the @beemo/core.Path.resolve function in @beemo/core

To help you get started, we’ve selected a few @beemo/core 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 milesj / build-tool-config / packages / config / src / configs / eslint.ts View on Github external
import fs from 'fs';
import { Path } from '@beemo/core';
import { ESLintConfig } from '@beemo/driver-eslint';
import { EXTS, EXT_PATTERN, IGNORE_PATHS } from '../constants';
import { BeemoProcess } from '../types';

const { tool } = (process.beemo as unknown) as BeemoProcess;
const { node } = tool.config.settings;
// @ts-ignore
const workspacesEnabled = !!tool.package.workspaces;
let project: Path;

// Lint crashes with an OOM error when using project references,
// so just use a single file that globs everything.
if (workspacesEnabled) {
  project = Path.resolve('tsconfig.eslint.json');

  const include: Path[] = [];

  tool.getWorkspacePaths({ relative: true }).forEach(wsPath => {
    include.push(
      new Path(wsPath, 'src/**/*'),
      new Path(wsPath, 'tests/**/*'),
      new Path(wsPath, 'types/**/*'),
    );
  });

  fs.writeFileSync(
    project.path(),
    JSON.stringify({
      extends: './tsconfig.options.json',
      include: include.map(i => i.path()),
github milesj / build-tool-config / packages / config / src / configs / jest.ts View on Github external
import { Path } from '@beemo/core';
import { JestConfig } from '@beemo/driver-jest';
import { IGNORE_PATHS } from '../constants';
import { BeemoProcess } from '../types';

// Package: Run in root
// Workspaces: Run in root
const { tool } = (process.beemo as unknown) as BeemoProcess;
const { react } = tool.config.settings;
// @ts-ignore
const workspacesEnabled = !!tool.package.workspaces;
const setupFilePath = Path.resolve('./tests/setup.ts');
const setupFilesAfterEnv: string[] = [];
const roots: string[] = [];

if (workspacesEnabled) {
  tool.getWorkspacePaths({ relative: true }).forEach(wsPath => {
    roots.push(`/${wsPath.replace('/*', '')}`);
  });
} else {
  roots.push('');
}

if (setupFilePath.exists()) {
  setupFilesAfterEnv.push(setupFilePath.path());
}

const config: JestConfig = {
github milesj / build-tool-config / packages / config / src / configs / eslint.ts View on Github external
new Path(wsPath, 'src/**/*'),
      new Path(wsPath, 'tests/**/*'),
      new Path(wsPath, 'types/**/*'),
    );
  });

  fs.writeFileSync(
    project.path(),
    JSON.stringify({
      extends: './tsconfig.options.json',
      include: include.map(i => i.path()),
    }),
    'utf8',
  );
} else {
  project = Path.resolve('tsconfig.json');
}

// Package: Run in root
// Workspaces: Run in root
const config: ESLintConfig = {
  root: true,
  parser: '@typescript-eslint/parser',
  extends: ['airbnb', 'prettier', 'prettier/react', 'prettier/@typescript-eslint'],
  plugins: ['react-hooks', 'promise', 'unicorn', 'compat', 'babel'],
  ignore: [...IGNORE_PATHS, '*.min.js', '*.map'],
  env: {
    browser: true,
  },
  globals: {
    __DEV__: 'readable',
  },
github beemojs / beemo / packages / driver-typescript / src / TypeScriptDriver.ts View on Github external
private handleCleanTarget = ({ args }: DriverContext) => {
    const outDir =
      args.outDir || (this.config.compilerOptions && this.config.compilerOptions.outDir);

    if (args.clean && outDir) {
      rimraf.sync(Path.resolve(outDir).path());
    }

    return Promise.resolve();
  };
github milesj / build-tool-config / packages / config / src / index.ts View on Github external
tool.getPlugin('driver', 'typescript').onAfterExecute.listen(() => {
      const corePackage = Path.resolve('packages/core', tool.options.root);

      if (corePackage.exists()) {
        fs.copySync(
          Path.resolve('README.md', tool.options.root).path(),
          corePackage.append('README.md').path(),
        );
      }

      return Promise.resolve();
    });
  }
github milesj / build-tool-config / packages / config / src / index.ts View on Github external
tool.getPlugin('driver', 'typescript').onAfterExecute.listen(() => {
      const corePackage = Path.resolve('packages/core', tool.options.root);

      if (corePackage.exists()) {
        fs.copySync(
          Path.resolve('README.md', tool.options.root).path(),
          corePackage.append('README.md').path(),
        );
      }

      return Promise.resolve();
    });
  }
github beemojs / beemo / packages / driver-babel / src / BabelDriver.ts View on Github external
private handleCleanTarget = ({ args }: DriverContext) => {
    if (args.clean && args.outDir) {
      rimraf.sync(Path.resolve(args.outDir).path());
    }

    return Promise.resolve();
  };
}
github airbnb / nimbus / packages / config-eslint / src / presets / base.ts View on Github external
env: {
    browser: true,
    node: false,
  },

  reportUnusedDisableDirectives: true,

  settings: {
    propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],
    'import/ignore': ['node_modules', '\\.json$', ASSET_EXT_PATTERN.source, GQL_EXT_PATTERN.source],
    'import/extensions': EXTS,
    'import/resolver': {
      node: {
        extensions: EXTS,
      },
      [Path.resolve('../resolvers/graphql.js', __dirname).path()]: {
        extensions: ['.gql', '.graphql'],
      },
    },
  },

  rules: {
    'react-hooks/exhaustive-deps': 'error',
    'react-hooks/rules-of-hooks': 'error',
  },

  overrides: [
    {
      files: [`*.test.${EXTS_GROUP}`],
      plugins: ['jest'],
      globals: {
        jsdom: 'readonly',

@beemo/core

Manage all dev tool configurations in a single centralized repository.

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis