-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Preliminary Support For Javascript-based Configs #1000
Changes from 1 commit
e993ddc
94e42c2
f1b6f2a
9959b98
2772373
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
const resolvePkg = require('resolve-pkg'); | ||
|
||
module.exports = { | ||
engines: { | ||
twig: { | ||
namespaces: [ | ||
{ | ||
id: 'uikit', | ||
recursive: true, | ||
paths: [resolvePkg(`@pattern-lab/uikit-workshop/views-twig`)], | ||
EvanLovely marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
{ | ||
id: 'atoms', | ||
recursive: true, | ||
paths: ['source/_patterns/00-atoms'], | ||
}, | ||
{ | ||
id: 'molecules', | ||
recursive: true, | ||
paths: ['source/_patterns/01-molecules'], | ||
}, | ||
], | ||
alterTwigEnv: [ | ||
{ | ||
file: 'alter-twig.php', | ||
functions: ['addCustomExtension'], | ||
}, | ||
], | ||
}, | ||
}, | ||
cacheBust: true, | ||
cleanPublic: true, | ||
defaultPattern: 'all', | ||
defaultShowPatternInfo: false, | ||
ishControlsHide: { | ||
s: false, | ||
m: false, | ||
l: false, | ||
full: false, | ||
random: false, | ||
disco: false, | ||
hay: true, | ||
mqs: false, | ||
find: false, | ||
'views-all': false, | ||
'views-annotations': false, | ||
'views-code': false, | ||
'views-new': false, | ||
'tools-all': false, | ||
'tools-docs': false, | ||
}, | ||
ishViewportRange: { | ||
s: [240, 500], | ||
m: [500, 800], | ||
l: [800, 2600], | ||
}, | ||
logLevel: 'info', | ||
outputFileSuffixes: { | ||
rendered: '.rendered', | ||
rawTemplate: '', | ||
markupOnly: '.markup-only', | ||
}, | ||
paths: { | ||
source: { | ||
root: './source/', | ||
patterns: './source/_patterns/', | ||
data: './source/_data/', | ||
meta: './source/_meta/', | ||
annotations: './source/_annotations/', | ||
styleguide: 'dist/', | ||
patternlabFiles: { | ||
'general-header': | ||
'../uikit-workshop/views/partials/general-header.mustache', | ||
'general-footer': | ||
'../uikit-workshop/views/partials/general-footer.mustache', | ||
patternSection: | ||
'../uikit-workshop/views/partials/patternSection.mustache', | ||
patternSectionSubtype: | ||
'../uikit-workshop/views/partials/patternSectionSubtype.mustache', | ||
viewall: '../uikit-workshop/views/viewall.mustache', | ||
}, | ||
js: './source/js', | ||
images: './source/images', | ||
fonts: './source/fonts', | ||
css: './source/css', | ||
}, | ||
public: { | ||
root: 'public/', | ||
patterns: 'public/patterns/', | ||
data: 'public/styleguide/data/', | ||
annotations: 'public/annotations/', | ||
styleguide: 'public/styleguide/', | ||
js: 'public/js', | ||
images: 'public/images', | ||
fonts: 'public/fonts', | ||
css: 'public/css', | ||
}, | ||
}, | ||
patternExtension: 'twig', | ||
patternStateCascade: ['inprogress', 'inreview', 'complete'], | ||
patternExportDirectory: './pattern_exports/', | ||
patternExportPatternPartials: [], | ||
serverOptions: { | ||
wait: 1000, | ||
}, | ||
starterkitSubDir: 'dist', | ||
styleGuideExcludes: [], | ||
theme: { | ||
color: 'light', | ||
density: 'compact', | ||
layout: 'horizontal', | ||
}, | ||
uikits: [ | ||
{ | ||
name: 'uikit-workshop', | ||
outputDir: '', | ||
enabled: true, | ||
excludedPatternStates: [], | ||
excludedTags: [], | ||
}, | ||
], | ||
}; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,8 +36,7 @@ module.exports = class PatternLab { | |
constructor(config) { | ||
// Either use the config we were passed, or load one up from the config file ourselves | ||
this.config = | ||
config || | ||
fs.readJSONSync(path.resolve(__dirname, '../../patternlab-config.json')); | ||
config || require(path.resolve(__dirname, '../../patternlab-config.js')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't we just do this instead and then either - require(path.resolve(__dirname, '../../patternlab-config.js'))
+ require(path.resolve(__dirname, '../../patternlab-config')) |
||
|
||
//register our log events | ||
this.registerLogger(config.logLevel); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
twig engine should not be in core?