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: updated http-auth dependency #1379

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
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
3 changes: 2 additions & 1 deletion packages/live-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,12 @@ LiveServer.start = function (options) {
// Use http-auth if configured
if (htpasswd !== null) {
const auth = require('http-auth');
const authConnect = require('http-auth-connect');
const basic = auth.basic({
realm: 'Please authorize',
file: htpasswd,
});
app.use(auth.connect(basic));
app.use(authConnect(basic));
}

if (cors) {
Expand Down
3 changes: 2 additions & 1 deletion packages/live-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"cors": "2.8.5",
"event-stream": "3.3.4",
"faye-websocket": "0.11.x",
"http-auth": "3.2.x",
"http-auth": "4.1.x",
"http-auth-connect": "^1.0.5",
"morgan": "1.10.0",
"object-assign": "4.1.1",
"opn": "5.3.0",
Expand Down
Loading