Skip to main content

Frontend Library Manager

Project description

FrontMan - Frontend Library Manager

Tool to help manage frontend dependencies (javascript, css)

Inspired by AspNet Library Manager

Installation

pip install frontman

Usage

  1. Create the manifest file frontman.json
{
  "provider": "jsdelivr",
  "destination": "assets",
  "packages": [
    {
      "name": "jquery",
      "version": "3.5.1",
      "provider": "cdnjs",
      "files": [
        {
          "name": "jquery.min.js",
          "destination": "jquery"
        }
      ]
    },
    {
      "name": "@popperjs/core",
      "version": "2.6.0",
      "path": "dist/umd",
      "destination":"popper",
      "files": [
        {
          "name": "popper.min.js",
          "rename": "popper.js"
        }
      ]
    },
    {
      "name": "bootstrap",
      "version": "4.6.0",
      "path": "dist",
      "destination": "bootstrap",
      "files": [
        "js/bootstrap.min.js",
        "css/bootstrap.min.css"
      ]
    }
  ]
}
  1. Execute FrontMan
frontman install

You should see an output like this:

OK   https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js -> assets/jquery/jquery.min.js
OK   https://cdn.jsdelivr.net/npm/@popperjs/core@2.6.0/dist/umd/popper.min.js -> assets/popper/popper.js
OK   https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/js/bootstrap.min.js -> assets/bootstrap/js/bootstrap.min.js
OK   https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css -> assets/bootstrap/css/bootstrap.min.css

Force package download

By default, files that already have been downloaded will be skipped. To force download these files, use the --force (or -f) flag:

frontman install --force

Manifest Format

provider: The server we will download the files from. It can be cdnjs, jsdelivr or unpkg.

destination: Directory where the files will be downloaded.

packages: List of packaged to be downloaded.

Each package item have the following format:

name: Name of the package, according to the chosen provider.

version: Version of the package.

path (Optional): The provider may serve the files in a sub path (eg. "dist"). Setting this option will strip the path from the downloaded file path.

destination (Optional): Directory inside the top level destination where the files from this package will be downloaded.

provider (Optional): Provider to use for this package.

files: List of files to download for this package.

The files can be specified as string containing the path to the file. The path specified here will be present in the final destination (eg. "js/bootstrap.min.js" will be downloaded to "{destination}/js/bootstrap.min.js")

Files can also be specified as objects with the following format:

name: Name of the file to download.

destination: Directory to be appended to the previous destination.

rename: Change the name of the downloaded file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frontman-0.3.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

frontman-0.3.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file frontman-0.3.1.tar.gz.

File metadata

  • Download URL: frontman-0.3.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.5 Windows/10

File hashes

Hashes for frontman-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2e9cb418876d1d22cd09853136970bdb4f34a138615263e14603c7198d7374ba
MD5 6b86cdcbc9f31300f225d16676903cc6
BLAKE2b-256 574fee507a5812a8aec07d3abe148427c643feb695e070815d53ac680d8af6a0

See more details on using hashes here.

File details

Details for the file frontman-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: frontman-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.5 Windows/10

File hashes

Hashes for frontman-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a28ea3ff3b12f56dc4b0e668388354d034cd01f82c1301007fbc6b293508aa02
MD5 caec23ebe701921ba93cc342490e622e
BLAKE2b-256 7c1eb78acba7c3c591e5b0521798252f68249a6118402b172bbbd5cf1989d537

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page