Skip to content
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

refactor: moved dependencies to devDependencies @ cli #1384

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"dependencies": {
"@pattern-lab/core": "^5.15.2",
"@pattern-lab/live-server": "^5.15.1",
"@pattern-lab/starterkit-mustache-base": "3.0.3",
"archiver": "2.1.1",
"chalk": "4.1.0",
"commander": "2.15.1",
Expand All @@ -24,18 +23,19 @@
"lodash": "4.17.21",
"ora": "2.1.0",
"path-exists": "3.0.0",
"sanitize-filename": "1.6.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sanitize-filename is not in use anymore?

Copy link
Contributor Author

@mfranzke mfranzke Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JosefBredereck exactly. I've left it within this pull request to only make the move of the other dependencies, but will provide a new pull request with an explanation and code references that provide the reasons for its removal.

"starterkit-mustache-acidtest": "0.0.3",
"starterkit-mustache-bootstrap": "0.1.1",
"starterkit-mustache-foundation": "0.1.1",
"starterkit-mustache-materialdesign": "0.1.2"
"sanitize-filename": "1.6.3"
},
"devDependencies": {
"@pattern-lab/starterkit-mustache-base": "3.0.3",
"eslint": "4.18.2",
"eslint-config-prettier": "2.9.0",
"eslint-plugin-prettier": "2.6.0",
"prettier": "2.2.1",
"proxyquire": "2.1.3",
"starterkit-mustache-acidtest": "0.0.3",
"starterkit-mustache-bootstrap": "0.1.1",
"starterkit-mustache-foundation": "0.1.1",
"starterkit-mustache-materialdesign": "0.1.2",
"tap": "14.11.0"
},
"files": [
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/lib/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,8 @@ module.exports = async function (pattern, patternlab) {
);

// Allows serializing the compile state
patternlab.graph.node(
pattern
).compileState = pattern.compileState = CompileState.CLEAN;
patternlab.graph.node(pattern).compileState =
pattern.compileState = CompileState.CLEAN;
logger.info('Built pattern: ' + pattern.patternPartial);
}
);
Expand Down
9 changes: 5 additions & 4 deletions packages/core/src/lib/expandPartials.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ module.exports = function (currentPattern, patternlab) {
`within ${currentPattern.patternPartial}, replacing extendedTemplate partial ${foundPartial} with ${cleanPartialPattern.patternPartial}'s extendedTemplate`
);

currentPattern.extendedTemplate = currentPattern.extendedTemplate.replace(
foundPartial,
cleanPartialPattern.extendedTemplate
);
currentPattern.extendedTemplate =
currentPattern.extendedTemplate.replace(
foundPartial,
cleanPartialPattern.extendedTemplate
);

// update the extendedTemplate in the partials object in case this
// pattern is consumed later
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/lib/loadPattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ module.exports = function (relPath, patternlab) {
currentPattern.template = fs.readFileSync(templatePath, 'utf8');

//find any stylemodifiers that may be in the current pattern
currentPattern.stylePartials = currentPattern.findPartialsWithStyleModifiers();
currentPattern.stylePartials =
currentPattern.findPartialsWithStyleModifiers();

//find any pattern parameters that may be in the current pattern
currentPattern.parameteredPartials = currentPattern.findPartialsWithPatternParameters();
currentPattern.parameteredPartials =
currentPattern.findPartialsWithPatternParameters();

[
templatePath,
Expand Down
10 changes: 4 additions & 6 deletions packages/core/src/lib/object_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,14 @@ Pattern.prototype = {
.map((o, i) => {
if (i === 0) {
// TODO: Remove when prefix gets deprecated
info.patternGroupOrder = Pattern.prototype.setPatternOrderDataForInfo(
o
);
info.patternGroupOrder =
Pattern.prototype.setPatternOrderDataForInfo(o);
}

if (i === 1) {
// TODO: Remove when prefix gets deprecated
info.patternSubgroupOrder = Pattern.prototype.setPatternOrderDataForInfo(
o
);
info.patternSubgroupOrder =
Pattern.prototype.setPatternOrderDataForInfo(o);
}

return o.replace(prefixMatcher, '');
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/lib/pattern_engines.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ const PatternEngines = Object.create({
}

// not a hidden pattern, let's dig deeper
const supportedPatternFileExtensions = PatternEngines.getSupportedFileExtensions();
const supportedPatternFileExtensions =
PatternEngines.getSupportedFileExtensions();
return (
supportedPatternFileExtensions.lastIndexOf(extension) !== -1 ||
PatternEngines.isPseudoPatternJSON(filename)
Expand Down
10 changes: 4 additions & 6 deletions packages/core/src/lib/ui_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,8 @@ const ui_builder = function () {
] = {};
groupedPatterns.patternGroups[pattern.patternGroup][
pattern.patternSubgroup
][
'viewall-' + pattern.patternGroup + '-' + pattern.patternSubgroup
] = injectDocumentationBlock(pattern, patternlab, true);
]['viewall-' + pattern.patternGroup + '-' + pattern.patternSubgroup] =
injectDocumentationBlock(pattern, patternlab, true);

addToViewAllPaths(patternlab, pattern);
addPatternSubgroupItem(patternlab, pattern, true);
Expand Down Expand Up @@ -588,9 +587,8 @@ const ui_builder = function () {
`Omitting ${patternGroupName}/${patternName} from building a viewall page because its patternSubgroup is specified in styleguideExcludes.`
);
} else {
styleguideGroupedPatterns = styleguideGroupedPatterns.concat(
subgroupPatterns
);
styleguideGroupedPatterns =
styleguideGroupedPatterns.concat(subgroupPatterns);
}

groupedPatterns = groupedPatterns.concat(subgroupPatterns);
Expand Down
Loading