How to use the relay-compiler.JSModuleParser.getFileFilter function in relay-compiler

To help you get started, weโ€™ve selected a few relay-compiler 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 yusinto / relay-compiler-plus / src / compiler / main.js View on Github external
}

  console.log(`schemaPath: ${schemaPath}`);
  clean(srcDir);

  const reporter = new ConsoleReporter({
    verbose: options.verbose,
    quiet: options.quiet,
  });


  const schema = getSchema(schemaPath);
  const parserConfigs = {
    js: {
      baseDir: srcDir,
      getFileFilter: JSModuleParser.getFileFilter,
      getParser: JSModuleParser.getParser,
      getSchema: () => schema,
      filepaths: getFilepathsFromGlob(srcDir, {
        extensions: options.extensions,
        include: ['**'],
        exclude: [
          '**/node_modules/**',
          '**/__mocks__/**',
          '**/__tests__/**',
          '**/__generated__/**',
        ],
      }),
    },
    graphql: {
      baseDir: srcDir,
      getParser: DotGraphQLParser.getParser,
github yusinto / relay-compiler-plus / src / compiler / main.js View on Github external
}

  console.log(`schemaPath: ${schemaPath}`);
  clean(srcDir);

  const reporter = new ConsoleReporter({
    verbose: options.verbose,
    quiet: options.quiet,
  });


  const schema = getSchema(schemaPath);
  const parserConfigs = {
    js: {
      baseDir: srcDir,
      getFileFilter: JSModuleParser.getFileFilter,
      getParser: JSModuleParser.getParser,
      getSchema: () => schema,
      filepaths: getFilepathsFromGlob(srcDir, {
        extensions: options.extensions,
        include: options.include,
        exclude: options.exclude,
      }),
    },
    graphql: {
      baseDir: srcDir,
      getParser: DotGraphQLParser.getParser,
      getSchema: () => schema,
      filepaths: getFilepathsFromGlob(srcDir, {
        extensions: ['graphql'],
        include: options.include,
        exclude: options.exclude,
github kiwicom / mobile / app / relay / scripts / RelayCompiler.js View on Github external
throw new Error(
      `
--watch requires that the src directory have a valid watchman "root" (.git/ folder).

Ensure that it exists in ${srcDir} or its parents.
    `.trim(),
    );
  }

  const reporter = new ConsoleReporter({ verbose: true });
  const useWatchman = await WatchmanClient.isAvailable();

  const parserConfigs = {
    default: {
      baseDir: srcDir,
      getFileFilter: RelayJSModuleParser.getFileFilter,
      getParser: RelayJSModuleParser.getParser,
      getSchema: () => getSchema(schemaPath),
      watchmanExpression: useWatchman ? buildWatchExpression(options) : null,
      filepaths: useWatchman ? null : getFilepathsFromGlob(srcDir, options),
    },
  };
  const writerConfigs = {
    default: {
      getWriter: getRelayFileWriter(srcDir),
      isGeneratedFile: (filePath: string) =>
        filePath.endsWith('.js') && filePath.includes('__generated__'),
      parser: 'default',
    },
  };
  const codegenRunner = new CodegenRunner({
    reporter,