mix outerfaces.into_odd_cdn (Outerfaces Dependency Distribution (ODD) v0.2.5)

View Source

Vendor a JS library into the app's outerfaces/projects/odd_cdn directory.

What gets copied

  1. Task argumentsinclude="lib,README.md", exclude="tests,tools".

  2. Application config

    config :outerfaces_odd, :odd_cdn,
      exclude: ["tests", "tools"]

    or per library:

    config :outerfaces_odd, :odd_cdn,
      my_lib: [exclude: ["tests", "tools"]]
  3. The library's own outerfaces.registry.json — the best place for it, since what a library publishes is the library's business and not every consumer's:

    {
      "name": "my_lib",
      "version": "0.1.0",
      "odd_cdn": { "exclude": ["tests", "tools"] }
    }
  4. Defaults[".git", ".DS_Store", "node_modules", "_build", "deps", "cover", ".elixir_ls"], which are always excluded on top of whatever else is configured, because nothing wants them on a CDN.

include and exclude are lists of Path.wildcard/2 patterns relative to the library root, so "tests" prunes a directory, "**/*.map" prunes by extension anywhere, and "lib" (as an include) publishes that tree and nothing else. An empty include means "everything not excluded", which is the previous behaviour and stays the default.

Examples

mix outerfaces.into_odd_cdn
mix outerfaces.into_odd_cdn lib="my_lib" exclude="tests,tools"

Currently depends on local source files.

TODO: Copy from a public git repo or tarball. TODO: Create a hash digest of the files copied and store it in a file in the target directory.

Summary

Functions

Callback implementation for Mix.Task.run/1.

Functions

run(args \\ [])

Callback implementation for Mix.Task.run/1.