Skip to content

Redesign crx API #61

Description

@thom4parisot
crx(['/path/to/manifest.json', '/path/to/**.js', '!/path/to/node_modules'], { options })
  .then(crx => {
    crx.options; // { options }
    crx.included; // => ['manifest.json', 'index.js'];
    crx.excluded; // => ['node_modules/jquery/dist/jquery.js', ...]
    crx.mapping; // => { '/path/to/manifest.json' => 'manifest.json', ... }

    crx.archive()
      .then(archive => archive.pipe(fs.createWriteFile('extension.zip')))
      .then(archive => crx.sign(archive))
      .then(stream => stream.pipe(fs.createWriteFile('extension.crx')));
  });

API

  • keys API
  • create Public Key
  • read Private Key
  • generate Private Key
  • crx API
  • crx(files, options) file selection constructor
  • pack().then(archive)
  • sign(archive).then(crx)
  • autoupdate API
  • getManifest(appId)

Under the hood we need to have:

  • generateAppId(publicKey).then(appId)
  • generateSignature(archive).then(signature)

Are dropped:

  • writeFile
  • load
  • options.rootDirectory, options.path and options.src

Options

  • ignore (defaults to ['*.pem', '.git', '*.crx'])
  • publicKey
  • privateKey (optional, to use #sign() only)
  • autoupdate
    • codebase
    • prodversionmin

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions