0.10.0 • Published 6 months ago

@wixc3/codux-librarian v0.10.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Codux Librarian

codux-librarian is a CLI tool for packaging libraries of third-party boards and components templates into a format that can be consumed by Codux.

This tool creates an NPM package containing the library's boards. Once this package is added as a dev dependency in a user's project, the boards will appear in the "libraries" section of the Add Panel when the project is opened in Codux and in the new component dialog to allow install/inline component templates.

Building an Asset Library

To package your boards into a library, follow these steps:

  1. Add @wixc3/codux-librarian as a dev dependency to the project you want to use for providing boards to other projects:
npm install --save-dev @wixc3/codux-librarian
  1. Create a codux-librarian.config.json file in the root directory of the project. Configure it based on the format described in the LibrarianConfig interface.

  2. Build the library using the CLI:

    npx codux-librarian build

    Build Options

    The build command supports the following option:

    • --config: Specify a custom path to a configuration file. Defaults to ./codux-librarian.config.json.
  3. A new directory containing the packaged library will be generated. Publish this package to NPM:

Build Process Details and Requirements

Board Templates

Any board file located in the configured boardsPath will be copied to the package.

Component Templates

Folders containing a *.component.json file under the configured componentsPath will be copied to the package. Required dependencies for components are automatically determined by inspecting JavaScript imports in the component template modules.

Dependency Management:

  • Dependencies required by components must be explicitly set as peerDependencies in the library package with the acceptable version range.
  • To prevent automatic installation by consuming projects, the dependency's optional flag should be set in the usedPeerDependenciesMeta.

Ignored Directories

The metadata directory is excluded from the package during the build process.

Consuming an Asset library

To use a packaged library in a project:

  1. Add the packaged library as a development dependency:

    npm install --save-dev library-package
  2. Update the codux.config.json file of the consuming project to include the library:

    {
      "addPanel": {
        "assets": ["library-package"]
      }
    }

Limitations

  1. Boards in the boardsPath that import components using relative paths are not supported. Components must be imported from external packages.
  2. Boards containing multiple return statements are not supported.
  3. Board cover images must be imported using a relative path to the image file, including the file extension.
0.10.0

6 months ago

0.9.0

7 months ago

0.8.1

7 months ago

0.8.0

7 months ago

0.7.0

7 months ago

0.6.1

7 months ago

0.6.0

7 months ago

0.5.0

9 months ago

0.4.3

10 months ago

0.4.2

11 months ago

0.4.1

11 months ago

0.4.0

11 months ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.0

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.1.0-beta001

2 years ago