How to use the @now/build-utils/file-fs-ref.js function in @now/build-utils

To help you get started, we’ve selected a few @now/build-utils 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 juicyfx / now-builders / src / php-bridge / launchers / fpm / index.js View on Github external
function getFiles() {
  // Provide FCGCI client files manually
  return {
    'fastcgi/connection.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/connection.js'),
    }),
    'fastcgi/consts.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/consts.js'),
    }),
    'fastcgi/stringifykv.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/stringifykv.js'),
    }),
    'fastcgi/index.js': new FileFsRef({
      fsPath: path.join(__dirname, 'fastcgi/index.js'),
    }),
    'launcher.js': new FileFsRef({
      fsPath: path.join(__dirname, 'launcher.js'),
    })
  };
}
github juicyfx / now-builders / src / php-bridge / launchers / fpm / index.js View on Github external
function getFiles() {
  // Provide FCGCI client files manually
  return {
    'fastcgi/connection.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/connection.js'),
    }),
    'fastcgi/consts.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/consts.js'),
    }),
    'fastcgi/stringifykv.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/stringifykv.js'),
    }),
    'fastcgi/index.js': new FileFsRef({
      fsPath: path.join(__dirname, 'fastcgi/index.js'),
    }),
    'launcher.js': new FileFsRef({
      fsPath: path.join(__dirname, 'launcher.js'),
    })
  };
}
github juicyfx / now-builders / src / php-bridge / launchers / fpm / index.js View on Github external
function getFiles() {
  // Provide FCGCI client files manually
  return {
    'fastcgi/connection.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/connection.js'),
    }),
    'fastcgi/consts.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/consts.js'),
    }),
    'fastcgi/stringifykv.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/stringifykv.js'),
    }),
    'fastcgi/index.js': new FileFsRef({
      fsPath: path.join(__dirname, 'fastcgi/index.js'),
    }),
    'launcher.js': new FileFsRef({
      fsPath: path.join(__dirname, 'launcher.js'),
    })
  };
}
github juicyfx / now-builders / src / php-bridge / launchers / fpm / index.js View on Github external
function getFiles() {
  // Provide FCGCI client files manually
  return {
    'fastcgi/connection.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/connection.js'),
    }),
    'fastcgi/consts.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/consts.js'),
    }),
    'fastcgi/stringifykv.js': new FileFsRef({
      fsPath: require.resolve('fastcgi-client/lib/stringifykv.js'),
    }),
    'fastcgi/index.js': new FileFsRef({
      fsPath: path.join(__dirname, 'fastcgi/index.js'),
    }),
    'launcher.js': new FileFsRef({
      fsPath: path.join(__dirname, 'launcher.js'),
    })
  };
}
github juicyfx / now-builders / src / php-caddy / index.js View on Github external
const includedFiles = await getIncludedFiles({ files, workPath, config, meta });

  const userFiles = rename(includedFiles, name => path.join('user', name));

  const bridgeConfig = { ...config, ...{ 'mode': 'fpm' }  };
  const bridgeFiles = {
    ...await getPhpFiles({ workPath, config: bridgeConfig }),
    ...{
      'launcher.js': new FileFsRef({
        fsPath: path.join(__dirname, 'launcher.js'),
      }),
      'caddy': new FileFsRef({
        mode: 0o755,
        fsPath: path.join(__dirname, 'caddy/caddy'),
      }),
      'Caddyfile': new FileFsRef({
        fsPath: path.join(__dirname, 'caddy/Caddyfile'),
      }),
    }
  };

  console.log('Entrypoint:', entrypoint);
  console.log('Config:', bridgeConfig);
  console.log('Work path:', workPath);
  console.log('Meta:', meta);
  console.log('User files:', Object.keys(userFiles));
  console.log('Bridge files:', Object.keys(bridgeFiles));

  const lambda = await createLambda({
    files: { ...userFiles, ...bridgeFiles },
    handler: 'launcher.launcher',
    runtime: 'nodejs10.x',
github juicyfx / now-builders / src / php-bref / index.js View on Github external
exports.build = async ({
  files, entrypoint, workPath, config, meta,
}) => {
  const downloadedFiles = await download(files, workPath, meta);
  const userFiles = rename(downloadedFiles, name => path.join('user', name));

  const bridgeFiles = {
    ...await getFiles(),
    ...{
      'bootstrap': new FileFsRef({
        mode: 0o755,
        fsPath: path.join(__dirname, 'bootstrap'),
      }),
    }
  };

  console.log('Entrypoint:', entrypoint);
  console.log('Config:', config);
  console.log('Work path:', workPath);
  console.log('Meta:', meta);
  console.log('User files:', Object.keys(userFiles));
  console.log('Bridge files:', Object.keys(bridgeFiles));

  const lambda = await createLambda({
    files: { ...userFiles, ...bridgeFiles },
    handler: entrypoint,
github juicyfx / now-builders / src / php-bridge / launchers / server / index.js View on Github external
function getFiles() {
  return {
    'launcher.js': new FileFsRef({
      fsPath: path.join(__dirname, 'launcher.js'),
    }),
  };
}
github juicyfx / now-builders / src / php-bridge / launchers / cli / index.js View on Github external
function getFiles() {
  return {
    'launcher.js': new FileFsRef({
      fsPath: path.join(__dirname, 'launcher.js'),
    }),
  };
}