0.2.8 • Published 1 year ago

launchpack-assemble v0.2.8

Weekly downloads
5
License
MIT
Repository
bitbucket
Last release
1 year ago

LaunchPack Assemble

A TypeScript assembly engine for LaunchPack.

Inspired by Fabricator and Fabricator Assemble

Usage

const { LaunchPackAssembler } = require('launchpack-assemble');

const assembler = new LaunchPackAssembler(options);
assembler.assemble();

Options

Default Object

{
  layout: 'default',
  layouts: ['src/views/layouts/*'],
  layoutIncludes: ['src/views/layouts/includes/*'],
  views: ['src/views/**/*', '!src/views/+(layouts)/**'],
  materials: ['src/materials/**/*'],
  data: ['src/data/**/*.{json,yml}'],
  docs: ['src/docs/**/*.md'],
  keys: {
    materials: 'materials',
    views: 'views',
    docs: 'docs',
  },
  dest: 'dist',
  onError: undefined,
  logErrors: false,
  baseUrl: '',
  GLOBAL: {},
  helpers: {},
}
OptionTypeDefaultDescription
baseUrlstring''Changes the baseurl path.
datastring[]['src/data/**/*.{json,yml}']Paths to get data for views written in JSON or YAML.
deststring'dist'Name of the destination folder of compiled files.
docsstring[]['src/docs/**/*.md']Paths to markdown files containing documentation.
GLOBALobject{}Holds global values to use across the instance. Example: {{ GLOBAL.MY_VARIABLE }}
helpersobject{}Custom handlebars helpers. Example: { hello: () => 'world' }
keysobject{ materials: 'materials', views: 'views', docs: 'docs' }Defines the names views will use when accessing different components.
layoutstring'default'Name of the default layout template.
layoutsstring[]['src/views/layouts/*']Paths to files that are used as layout templates.
layoutIncludesstring[]['src/views/layouts/includes/*']Paths to includes for layout templates.
logErrorsbooleanfalseIf the assembler will log errors to the console instead of exiting.
materialsstring[]['src/materials/**/*']Paths to the materials to build your design system.
onErrorfunctionundefinedFunction to run if there is an error. Takes an Error parameter.
viewsstring[]['src/views/**/*', '!src/views/+(layouts)/**']Paths to pages to pass through the assembler.

Development

Commands

npm run build - Builds the project

npm run commit - Runs commitizen to create a commit

npm run prettier:check - Checks if all the files conform to the Prettier settings

npm run prettier:write - Checks and fixes files to conform to the Prettier settings

npm run release - Runs Standard Version to automate versioning

npm run test - Runs all tests

npm run validate - Runs all commands to validate files and tests

Committing Changes

This project uses the Conventional Commits Specification. Follow this process when committing changes:

  1. Run git add . to stage all files. Or add files individually
  2. Run npm run commit instead to initialize the commit
  3. Follow the prompts to ensure the commit stays under the specification
  4. If there are any errors, fix them and start back at step 1

Releases

  1. Run npm run release to auto-version the project based on commits and push to master

Definitions

  • Layouts: Templates to wrap pages
  • Views: Individual pages
  • Materials: Components to be added to views
  • Data: Data to be used in views
  • Docs: Markdown files created for documentation
0.2.8

1 year ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.0

4 years ago

1.0.0

4 years ago