Git Product home page Git Product logo

npm-pkgbuild's Introduction

npm License Open Bundle downloads GitHub Issues Build Status Styled with prettier Commitizen friendly Known Vulnerabilities Coverage Status

npm-pkgbuild

Create ArchLinux, RPM and Debian packages from npm packages.

usage

In a package directory execute

npm-pkgbuild --rpm --debian --arch --content /destination:build --publish /some/directory

This will create a arch, rpm and a debian package of the build dir.

upload package

npm-pkgbuild --arch --content build --publish 'https://my.package-service.com/binaries/linux/{{type}}/{{access}}/{{arch}}'

You can specify the package content in package.json.

{
  "pkgbuild": {
    "content": {
      "/some/location/" : { "base": "build" },
      "/etc/myconfig.json" : "sample-config.json",
      "/erc/secret" : { "name":  "secret", "mode": "600" },
      "/opt/myapp": [
        {
          "type": "npm-pack"
        },
        {
          "type": "node-modules",
          "withoutDevelpmentDependencies": true
        }
      ]
    },
    "hooks" : "pkg/hooks",
    "output": {
      "debian" : {},
      "rpm" : {},
      "arch" : {}
    },
  "dependencies": { "nginx" : ">=1.12" }
  }
}

content providers

files (default)

content from the file system

npm-pack

content as provided by npm pack

node-modules

content of all (production) dependencies

options: - withoutDevelpmentDependencies when to stip away dev dependencies (defaults to true)

shared configuration

You can import common configuration from other packages see mf-hoting module as an example.

API

Table of Contents

ContentProvider

Source of package content.

asyncIterator

List all entries.

Returns asyncIterator<ContentEntry> all entries

FileContentProvider

Extends ContentProvider

Content provided form the file system.

Parameters

name

Returns string name of the content provider

packageNameMapping

What is the node name in the package eco-system

decodePassword

Decode a password

Parameters

Returns string plaintext password

extractFunctions

Extract shell functions from a given text.

Parameters

  • source AsyncIterator<string>

Returns AsyncIterator<FunctionDecl>

fieldProvider

Parameters

Returns Function

Expander

Type: Function

Parameters

Returns string

copyEntries

Copy content from source into destinationDirectory. Destination paths a generated without leading '/' (as for entry names too).

Parameters

  • source AsyncIterator<ContentEntry>
  • destinationDirectory string
  • expander Expander (optional, default v=>v)
  • attributes Array<ContentEntryAttribute>

NFTContentProvider

Extends ContentProvider

Content provided form the file system.

Parameters

name

Returns string name of the content provider

NodeModulesContentProvider

Extends ContentProvider

Content from node_modules

Parameters

  • definitions
  • entryProperties

name

Returns string name of the content provider

NPMPackContentProvider

Extends ContentProvider

Content from npm pack.

Parameters

  • definitions Object
  • entryProperties Object to be set for each entry

name

Returns string name of the content provider

pkgKeyValuePairOptions

fields

well known package properties https://www.archlinux.org/pacman/PKGBUILD.5.html

fields

fields

hookMapping

map install hook named from arch to deb

hookMapping

map install hook named from arch to rpm

Field

Type: Object

Properties

Packager

Parameters

tmpdir

Create tmp directory.

Returns Promise<string> directory path

execute

Execute package generation

Parameters

  • sources
  • transformer
  • dependencies
  • options
  • expander

available

Check for rpmbuild presence.

Returns boolean true when rpmbuild is present

install

With npm do:

npm install npm-pkgbuild

license

BSD-2-Clause

npm-pkgbuild's People

Contributors

arlac77 avatar dependabot[bot] avatar snyk-bot avatar greenkeeper[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.