Handles the create-bundle subcommand
323328
def _bse_cli_create_bundle(args):
    ''''''
    bundle.create_bundle(args.bundle_file, args.fmt, args.reffmt, args.archive_type, args.data_dir)
    return "Created " + args.bundle_file
214552
def render_subcommand(args):
    """"""
    if args.subcommand == 'delete':
        return 'delete ' + args.delete_subcommand

    if args.subcommand in ('wal-prefetch', 'wal-push', 'wal-fetch'):
        return None

    return args.subcommand
344233
function runJekyll (next) {

      // Build the command string
      if (options.bundleExec) {
        command = 'bundle exec ' + command;
      }

      if (options.serve) {
        command += majorVersion > 0 ? ' serve' : ' server';
      }
      else {
        command += ' build';
      }

      // Insert temporary config path into the config option
      if (typeof rawConfigFile !== 'undefined') {
        options.config = options.config ? options.config + ',' + rawConfigFile : rawConfigFile;
      }

      // Add flags to command if running serve or build
      Object.keys(optionList).forEach(function(option) {
        if (options[option]) {
          command += ' ' + optionList[option];
          if (typeof options[option] !== 'boolean') {
            command += ' ' + options[option];
          }
          if (!options[option]) {
            grunt.warn('`' + option + '` has been deprecated. You may want to try this as a `raw` option in your Gruntfile or in `_config.yml`.');
          }
        }
      });

      // Execute command
      grunt.log.write('`' + command + '` was initiated.\n');

      if (options.serve) {
        grunt.log.write('Started web server on http://localhost:' + (options.port || 4000) + '. Press Ctrl-C to stop it.\n');
      }

      exec(command, function(err, stdout) {
        grunt.log.write('\n\nJekyll output:\n' + stdout);

        if (err) {
          grunt.fail.warn(err);
          done(false);
        }
        else {
          next();
        }
      });
    }
565133
function bundle() {
  return browserify( config.inputDir + config.inputFile ).bundle()
    .pipe(
      source( config.outputFile )
    )
    .pipe(
      rename( config.outputFile )
    )
    .pipe(
      gulp.dest( config.outputDir ) // Create the .devel.js
    )
    .pipe(
      streamify( jsmin() )
    )
    .pipe(
      rename( config.outputFileMin )
    )
    .pipe(
      gulp.dest( config.outputDir ) // Create the .min.js
    )
    .pipe(
      streamify( gzip() )
    )
    .pipe(
      rename( config.outputFileMinGz )
    )
    .pipe(
      gulp.dest( config.outputDir ) // Create the .min.gz
    );
}
1126282
function setBundleConfig(bundleName,_bundleMap){
	    	var targetName = bundleName.split("/").join("_");
	    	grunt.config("uglify."+targetName+".files",_bundleMap);
	    	grunt.config("uglify."+targetName+".options.footer",
	    	';\n(function(foo,bundles){foo.__bundled__ = foo.__bundled__ ? foo.__bundled__.concat(bundles) : bundles;})(this,["'+
	    		bundleName
	    	+'"]);'
	    	);
	    }
375224
def bundle(context, yes, bundle_name):
    """"""
    bundle_obj = context.obj['store'].bundle(bundle_name)
    if bundle_obj is None:
        click.echo(click.style('bundle not found', fg='red'))
        context.abort()
    version_obj = bundle_obj.versions[0]
    if version_obj.included_at:
        question = f"remove bundle version from file system and database: {version_obj.full_path}"
    else:
        question = f"remove bundle version from database: {version_obj.created_at.date()}"
    if yes or click.confirm(question):
        if version_obj.included_at:
            shutil.rmtree(version_obj.full_path, ignore_errors=True)
        version_obj.delete()
        context.obj['store'].commit()
        click.echo(f"version deleted: {version_obj.full_path}")
1228778
function Bundler(file, cb) {

    var bundler = this, bundle,
        watchMsg = format('Watching bundle %s...', chalk.magenta(file));

    // set entry file for this bundler
    options.browserify.entries = [path.join(options.cwd, file)];

    // initiate bundle
    bundle = watchify(browserify(options.browserify), options.watchify);

    /**
     * on update, log to console and bundle
     * @param  {Array} ev  array of event files
     * @return {undefined}
     */
    bundle.on('update', function(ev) {
      log(format('%s File %s updated. Bundling %s ...',
        chalk.yellow('☀'),
        chalk.magenta(path.relative(options.cwd, ev[0])),
        chalk.magenta(file)
      ));
      bundler.outputBundle();
    });

    /**
     * when bundling, log infos to console
     * @param  {String} msg  bundling info
     * @return {undefined}
     */
    bundle.on('log', function(msg) {
      if (options.watch && !watchMsg) {
        log(format('%s Bundled %s %s',
          chalk.green('✓'),
          chalk.magenta(file),
          chalk.gray(msg)
        ));
      }
    });

    /**
     * bundle and transform to stream
     * @return {Object} gulp stream
     */
    this.outputBundle = function() {
      return streamHandler(
        bundle.bundle()
          .on('error', function(err) {
            log(chalk.red(format('✖ Bundling failed for %s %s',
              chalk.magenta(file),
              chalk.gray('(' + String(err) + ')')
            )));
            this.emit('end');
          })
          .pipe(source(file))
          .pipe(buffer())
          .on('end', function() {
            if (!options.watch) {
              bundle.close();
              return cb();
            } else if (watchMsg) {
              log(watchMsg);
              watchMsg = false;
            }
          })
      );
    };

  }
240327
function createBundler(opts, file, transform) {
  // omit file contents to make browserify-incremental work propery
  // on main entry (#4)
  opts.entries = file.path
  opts.basedir = path.dirname(file.path)

  let bundler = bundlers[file.path]

  if (bundler) {
    bundler.removeAllListeners('log')
    bundler.removeAllListeners('time')
  }
  else {
    bundler = browserify(Object.assign(opts, incremental.args))
    // only available via method call (#25)
    if (opts.external) {
      bundler.external(opts.external)
    }
    incremental(bundler)
    bundlers[file.path] = bundler
  }

  bundler.on('log', message => transform.emit('log', message))
  bundler.on('time', time => transform.emit('time', time))

  return bundler
}
1105506
def create_bundle(self, bundleId, data=None):
        """"""
        headers={'content-type':'application/json'}
        url = self.__get_base_bundle_url() + "/" + bundleId
        if data is None:
            data = {}
            data['sourceLanguage'] = 'en'
            data['targetLanguages'] = []
            data['notes']=[]
            data['metadata']={}
            data['partner']=''
            data['segmentSeparatorPattern']=''
            data['noTranslationPattern']=''
        json_data = json.dumps(data)
        response = self.__perform_rest_call(requestURL=url, restType='PUT', body=json_data, headers=headers)
        return response
933731
function createBundle(skyPagesConfig, webpack) {
  const webpackConfig = require('../config/webpack/build-public-library.webpack.config');
  const config = webpackConfig.getWebpackConfig(skyPagesConfig);
  return runCompiler(webpack, config);
}
770579
function handleEntryPoints(opts, io, nextHandler) {
  var entries = opts.entries
    , bundlerOpts

  bundlerOpts = opts.bundler

  if(!bundlerOpts || !bundlerOpts.legacy) {
    return nextHandler
  }

  if(!opts.entries || !opts.bundler) {
    return nextHandler
  }

  return handle

  function handle(server, req, resp, parsed) {
    if(!(parsed.pathname in entries) && !('browserify' in parsed.query)) {
      return nextHandler(server, req, resp, parsed)
    }

    var entryPath = entries[parsed.pathname]
      , args = bundlerOpts.flags.slice()
      , bundler
      , output

    if(entryPath) {
      args.unshift(entryPath)
    }

    args.unshift(bundlerOpts.command)
    parsed.loggedPathname = ansicolors.magenta(
        parsed.pathname + ' -> ' + args.map(toLocal).join(' ')
    )
    args.shift()

    bundler = spawn(bundlerOpts.command, args)
    bundler.stderr.pipe(accumError(io.error, resp))
    resp.setHeader('content-type', 'text/javascript')
    bundler.stdout.pipe(resp)
  }

  function toLocal(file) {
    return file.replace(opts.cwd, '.')
  }
}
821262
function bundle(srcFiles, destDir, optionsFn) {
    return gulp.src(srcFiles, {
        read: false
    })
    .pipe(tap(function(file) {
        var options = {};
        if (optionsFn) options = optionsFn(file);
        var fileName = options.fileName || path.basename(file.path);

        if (options.standalone)
            console.log(`Creating ${options.standalone} in ${destDir}/${fileName}`);
        else
            console.log(`Creating ${destDir}/${fileName}`);

        file.contents = browserify(file.path, options)
            .ignore("buffer")
            .ignore("dotenv")
        .bundle()
            .on("error", function (err) {
                console.log(err);
            });
        file.path = path.join(file.base, fileName);
    }))
    .pipe(buffer())
    .pipe(sourcemaps.init({
        loadMaps: true
    }))
    .pipe(uglify({
        preserveComments: function(node, comment) {
            return comment.value.includes("Copyright Arm");
        }
    }))
    .pipe(sourcemaps.write(".", {
        sourceRoot: path.relative(destDir, nodeDir)
    }))
    .pipe(gulp.dest(destDir));
}
1297211
async function bundle(opts: *) {
  const directory = process.cwd();
  const configPath = getWebpackConfig(directory, opts.config);

  const [
    configs,
    availablePlatforms,
  ] = makeReactQMLConfig(
    // $FlowFixMe: Dynamic require
    require(configPath),
    {
      root: directory,
      dev: opts.dev,
      minify: opts.minify,
      bundle: true,
    }
  );

  const config = configs[availablePlatforms.indexOf(opts.platform)];

  if (opts.assetsDest) {
    config.output.path = path.isAbsolute(opts.assetsDest)
      ? opts.assetsDest
      : path.join(directory, opts.assetsDest);
  }

  if (opts.bundleOutput) {
    config.output.filename = path.isAbsolute(opts.bundleOutput)
      ? path.relative(config.output.path, opts.bundleOutput)
      : path.relative(
          config.output.path,
          path.join(directory, opts.bundleOutput)
        );
  }

  const compiler = webpack(config);

  logger.info(
    messages.initialBundleInformation({
      entry: config.entry,
      dev: opts.dev,
    })
  );

  const stats = await new Promise((resolve, reject) =>
    compiler.run((err, info) => {
      if (err || info.hasErrors()) {
        reject(
          new MessageError(
            messages.bundleFailed({
              errors: err
                ? [err.message]
                : info.toJson({ errorDetails: true }).errors,
            })
          )
        );
      } else {
        resolve(info);
      }
    })
  );

  clear();

  logger.done(
    messages.bundleBuilt({
      stats,
      platform: opts.platform,
      assetsPath: config.output.path,
      bundlePath: config.output.filename,
    })
  );
}
495469
def prepare_bundles_delete_params(name_or_bundle)
        bundle = prepare_param_bundle(name_or_bundle) do |b|
          raise Error, "Bundle name is empty" if b.name.empty?
        end
        { :bundle => bundle.name }
      end
692271
function bundlePreprocessor(config) {

    var debug = config.browserify && config.browserify.debug;

    function updateSourceMap(file, content) {
      var map;

      if (debug) {

        map = extractSourceMap(content);

        file.sourceMap = map && map.sourcemap;
      }
    }

    return function(content, file, done) {

      if (b._builtOnce) {
        updateSourceMap(file, content);
        return done(content);
      }

      log.debug('building bundle');

      // wait for the initial bundle to be created
      b.deferredBundle(function(err, content) {

        b._builtOnce = config.autoWatch;

        if (err) {
          return done(BUNDLE_ERROR_TPL);
        }

        content = content.toString('utf-8');
        updateSourceMap(file, content);

        log.info('bundle built');

        done(content);
      });
    };
  }
193137
def hydrate_bundles(bundles_field, glob_match_error_behavior):
  """"""
  path_globs_with_match_errors = [
    pg.copy(glob_match_error_behavior=glob_match_error_behavior)
    for pg in bundles_field.path_globs_list
  ]
  snapshot_list = yield [Get(Snapshot, PathGlobs, pg) for pg in path_globs_with_match_errors]

  spec_path = bundles_field.address.spec_path

  bundles = []
  zipped = zip(bundles_field.bundles,
               bundles_field.filespecs_list,
               snapshot_list)
  for bundle, filespecs, snapshot in zipped:
    rel_spec_path = getattr(bundle, 'rel_path', spec_path)
    kwargs = bundle.kwargs()
    # NB: We `include_dirs=True` because bundle filesets frequently specify directories in order
    # to trigger a (deprecated) default inclusion of their recursive contents. See the related
    # deprecation in `pants.backend.jvm.tasks.bundle_create`.
    kwargs['fileset'] = _eager_fileset_with_spec(rel_spec_path,
                                                 filespecs,
                                                 snapshot,
                                                 include_dirs=True)
    bundles.append(BundleAdaptor(**kwargs))
  yield HydratedField('bundles', bundles)
998093
def add_bundle(self, data: dict) -> models.Bundle:
        
        bundle_obj = self.bundle(data['name'])
        if bundle_obj and self.version(bundle_obj.name, data['created']):
            LOG.debug('version of bundle already added')
            return None

        if bundle_obj is None:
            bundle_obj = self.new_bundle(name=data['name'], created_at=data['created'])

        version_obj = self.new_version(created_at=data['created'], expires_at=data.get('expires'))

        tag_names = set(tag_name for file_data in data['files'] for tag_name in file_data['tags'])
        tag_map = self._build_tags(tag_names)

        for file_data in data['files']:
            LOG.debug(f"adding file: {file_data['path']}")
            if not Path(file_data['path']).exists():
                raise FileNotFoundError(file_data['path'])
            tags = [tag_map[tag_name] for tag_name in file_data['tags']]
            new_file = self.new_file(file_data['path'], to_archive=file_data['archive'], tags=tags)
            version_obj.files.append(new_file)

        version_obj.bundle = bundle_obj
        return bundle_obj, version_obj