How to use @pattern-lab/core - 2 common examples

To help you get started, we’ve selected a few @pattern-lab/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pattern-lab / patternlab-node / packages / cli / bin / cli-actions / init.js View on Github external
'use strict';
const patternlab = require('@pattern-lab/core');
const merge = require('deepmerge');
const ask = require('../ask');
const scaffold = require('../scaffold');
const installEdition = require('../install-edition');
const installStarterkit = require('../install-starterkit');
const replaceConfigPaths = require('../replace-config');
const ora = require('ora');
const path = require('path');
const wrapAsync = require('../utils').wrapAsync;
const writeJsonAsync = require('../utils').writeJsonAsync;

const defaultPatternlabConfig = patternlab.getDefaultConfig();

// https://github.com/TehShrike/deepmerge#overwrite-array
const overwriteMerge = (destinationArray, sourceArray, options) => sourceArray;

const init = options =>
  wrapAsync(function*() {
    const sourceDir = 'source';
    const publicDir = 'public';
    const exportDir = 'pattern_exports';
    const answers = options.projectDir ? options : yield ask(options);
    const projectDir = answers.projectDir || './';
    const edition = answers.edition;
    const starterkit = answers.starterkit;

    /**
     * Process the init routines
github pattern-lab / patternlab-node / packages / cli / bin / cli-actions / version.js View on Github external
'use strict';
const patternlab = require('@pattern-lab/core');
const config = Object.assign(patternlab.getDefaultConfig(), {
	logLevel: 'quiet',
});

module.exports = ({ version }) =>
	`${version} (PatternLab Node Core version: ${patternlab(config).version()})`;

@pattern-lab/core

Create atomic design systems with Pattern Lab. This is the core API and orchestrator of the ecosystem.

MIT
Latest version published 1 year ago

Package Health Score

54 / 100
Full package analysis

Popular @pattern-lab/core functions