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 even further dependencies #1318

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
26db979
Merge pull request #1 from pattern-lab/dev
mfranzke Apr 24, 2020
7812878
Merge pull request #2 from pattern-lab/dev
mfranzke Apr 25, 2020
271dc8d
chore(docs): some typos
Apr 25, 2020
ccdf238
Revert "Merge pull request #2 from pattern-lab/dev"
Apr 25, 2020
4c2070f
Revert "Merge pull request #1 from pattern-lab/dev"
Apr 25, 2020
117ca22
Revert "chore(docs): some typos"
Apr 25, 2020
4f5bff6
Merge remote-tracking branch 'upstream/dev' into dev
Apr 28, 2020
73df9d3
Merge remote-tracking branch 'upstream/dev' into dev
Apr 30, 2020
9115c17
Merge remote-tracking branch 'upstream/dev' into dev
May 2, 2020
e86272f
Merge remote-tracking branch 'upstream/dev' into dev
May 8, 2020
a243f5d
Merge remote-tracking branch 'upstream/dev' into dev
May 11, 2020
3238ac7
Merge remote-tracking branch 'upstream/dev' into dev
May 23, 2020
7f4ba39
Merge remote-tracking branch 'upstream/dev' into dev
Jun 11, 2020
f7b514b
Merge remote-tracking branch 'upstream/dev' into dev
Jun 13, 2020
37f9749
Merge remote-tracking branch 'upstream/dev' into dev
Jun 28, 2020
572afec
Merge branch 'dev' of https://github.com/mfranzke/patternlab-node int…
Jun 28, 2020
e4a5245
Merge remote-tracking branch 'upstream/dev' into dev
Sep 6, 2020
4aa9366
Merge remote-tracking branch 'upstream/dev' into dev
Sep 11, 2020
155c253
Merge remote-tracking branch 'upstream/dev' into dev
Oct 11, 2020
3b95604
Merge remote-tracking branch 'upstream/dev' into dev
Jan 12, 2021
6b4a6fb
Merge remote-tracking branch 'upstream/dev' into dev
Feb 5, 2021
6431987
Merge remote-tracking branch 'upstream/dev' into dev
Feb 20, 2021
d486051
Merge remote-tracking branch 'upstream/dev' into dev
mfranzke Mar 23, 2021
be17657
Merge remote-tracking branch 'upstream/dev' into dev
mfranzke Mar 24, 2021
6c18bdc
Merge remote-tracking branch 'upstream/dev' into dev
mfranzke Mar 26, 2021
46eb7dc
Merge remote-tracking branch 'upstream/dev' into dev
mfranzke Mar 29, 2021
ce0dedd
Merge remote-tracking branch 'upstream/dev' into dev
mfranzke Apr 18, 2021
448eda0
refactor: updated dependency ejs
mfranzke Apr 21, 2021
e33e145
refactor: updated dependency scroll-js
mfranzke Apr 21, 2021
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
534 changes: 267 additions & 267 deletions CHANGELOG.md

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions packages/cli/bin/scaffold.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
const path = require('path');
const execa = require('execa');
const fs = require('fs-extra');
const fs = require('fs');
const wrapAsync = require('./utils').wrapAsync;
const mkdirsAsync = require('./utils').mkdirsAsync;

Expand All @@ -18,7 +18,6 @@ const scaffold = (projectDir, sourceDir, publicDir, exportDir) =>
wrapAsync(function*() {
const projectPath = path.join(process.cwd(), projectDir);
if (!fs.existsSync(path.join(projectPath, 'package.json'))) {
fs.ensureDirSync(projectPath);
execa.sync('npm', ['init', '-y'], {
cwd: projectPath,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
],
"scripts": {
"lint": "eslint ./{bin,test}",
"test:separate": "tap ./test/*.test.js --reporter spec --timeout=120"
"test:separate": "tap './test/*.test.js' --reporter spec --timeout=120"
},
"repository": "https://github.com/pattern-lab/patternlab-node/tree/master/packages/cli",
"bugs": "https://github.com/pattern-lab/patternlab-node/issues",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/addPattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const logger = require('./log');

module.exports = function (pattern, patternlab) {
module.exports = function(pattern, patternlab) {
//add the link to the global object
if (!patternlab.data.link) {
patternlab.data.link = {};
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/lib/annotation_exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const _ = require('lodash');
const mp = require('./markdown_parser');
const logger = require('./log');

const annotations_exporter = function (pl) {
const annotations_exporter = function(pl) {
const paths = pl.config.paths;
let oldAnnotations;

Expand Down Expand Up @@ -68,7 +68,7 @@ const annotations_exporter = function (pl) {
//let annotations = annotations;
const markdown_parser = parser;

return function (filePath) {
return function(filePath) {
const annotationsMD = fs.readFileSync(path.resolve(filePath), 'utf8');

//take the annotation snippets and split them on our custom delimiter
Expand Down Expand Up @@ -110,15 +110,15 @@ const annotations_exporter = function (pl) {
}

return {
gather: function () {
gather: function() {
return gatherAnnotations();
},
gatherJS: function () {
gatherJS: function() {
return parseAnnotationsJS();
},
gatherMD: function () {
gatherMD: function() {
return parseAnnotationsMD();
},
}
};
};

Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/lib/buildFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ let render = require('./render'); //eslint-disable-line prefer-const
* @param patternPartial - the partial key to build this for, either viewall-patternPartial or a viewall-patternGroup-all
* @returns A promise which resolves with the HTML
*/
module.exports = function (patternlab, patternPartial, uikit) {
module.exports = function(patternlab, patternPartial, uikit) {
//first render the general footer
return render(Pattern.createEmpty({ extendedTemplate: uikit.footer }), {
patternData: JSON.stringify({
patternPartial: patternPartial,
patternPartial: patternPartial
}),
cacheBuster: patternlab.cacheBuster,
cacheBuster: patternlab.cacheBuster
})
.then((footerPartial) => {
.then(footerPartial => {
let allFooterData;
try {
allFooterData = jsonCopy(
Expand All @@ -36,7 +36,7 @@ module.exports = function (patternlab, patternPartial, uikit) {

return render(patternlab.userFoot, allFooterData);
})
.catch((reason) => {
.catch(reason => {
console.log(reason);
logger.error('Error building buildFooterHTML');
});
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/lib/buildListItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ const items = [
'seventeen',
'eighteen',
'nineteen',
'twenty',
'twenty'
];

module.exports = function (container) {
module.exports = function(container) {
//combine all list items into one structure
const list = [];
for (const item in container.listitems) {
Expand Down
28 changes: 14 additions & 14 deletions packages/core/src/lib/buildPatterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => {
return render(
Pattern.createEmpty({
// todo should this be uikit.header?
extendedTemplate: patternlab.header,
extendedTemplate: patternlab.header
}),
{
cacheBuster: patternlab.cacheBuster,
cacheBuster: patternlab.cacheBuster
}
)
.then((results) => {
.then(results => {
patternlab.data.patternLabHead = results;

// If deletePatternDir == true or graph needs to be updated
Expand All @@ -133,7 +133,7 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => {
if (patternlab.incrementalBuildsEnabled) {
// When the graph was loaded from file, some patterns might have been moved/deleted between runs
// so the graph data become out of sync
patternlab.graph.sync().forEach((n) => {
patternlab.graph.sync().forEach(n => {
logger.info('[Deleted/Moved] ' + n);
});

Expand All @@ -150,18 +150,18 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => {
}
//render all patterns last, so lineageR works
const allPatternsPromise = patternsToBuild.map(
async (pattern) => await compose(pattern, patternlab)
async pattern => await compose(pattern, patternlab)
);
//copy non-pattern files like JavaScript
const allJS = patternsToBuild.map((pattern) => {
const allJS = patternsToBuild.map(pattern => {
const { name, patternPartial, subdir } = pattern;
const {
source: { patterns: sourceDir },
public: { patterns: publicDir },
public: { patterns: publicDir }
} = patternlab.config.paths;
const src = path.join(sourceDir, subdir);
const dest = path.join(publicDir, name);
return map(patternlab.uikits, (uikit) => {
return map(patternlab.uikits, uikit => {
return copy(
src,
path.resolve(process.cwd(), uikit.outputDir, dest),
Expand All @@ -170,7 +170,7 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => {
filter: ['*.js'],
rename: () => {
return `${patternPartial}.js`;
},
}
}
).on(copy.events.COPY_FILE_COMPLETE, () => {
logger.debug(
Expand Down Expand Up @@ -199,27 +199,27 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => {
//export patterns if necessary
pattern_exporter.export_patterns(patternlab);
})
.catch((reason) => {
.catch(reason => {
console.log(reason);
logger.error('Error rendering patterns');
});
})
.catch((reason) => {
.catch(reason => {
console.log(reason);
logger.error('Error rendering pattern lab header');
});
})
.catch((reason) => {
.catch(reason => {
console.log(reason);
logger.error('Error processing meta patterns');
});
})
.catch((reason) => {
.catch(reason => {
console.log(reason);
logger.error('Error processing patterns recursively');
});
})
.catch((reason) => {
.catch(reason => {
console.log(reason);
logger.error('Error in buildPatterns()');
});
Expand Down
14 changes: 7 additions & 7 deletions packages/core/src/lib/changes_hunter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let fs = require('fs-extra'); //eslint-disable-line prefer-const
* For detecting changed patterns.
* @constructor
*/
const ChangesHunter = function () {};
const ChangesHunter = function() {};

ChangesHunter.prototype = {
/**
Expand All @@ -25,7 +25,7 @@ ChangesHunter.prototype = {
*
* @see {@link CompileState}
*/
checkBuildState: function (pattern, patternlab) {
checkBuildState: function(pattern, patternlab) {
//write the compiled template to the public patterns directory
const renderedTemplatePath =
patternlab.config.paths.public.patterns +
Expand All @@ -40,12 +40,12 @@ ChangesHunter.prototype = {
pattern.compileState = CompileState.NEEDS_REBUILD;
}

_.each(patternlab.uikits, (uikit) => {
_.each(patternlab.uikits, uikit => {
try {
// renderedTemplatePath required to display a single element
// Markup only is required for "View All" pages. It will get loaded later on.
// If any of these is missing, mark pattern for recompile
[renderedTemplatePath, markupOnlyPath].forEach((renderedFile) => {
[renderedTemplatePath, markupOnlyPath].forEach(renderedFile => {
// Prevent error message if file does not exist
fs.accessSync(
path.join(process.cwd(), uikit.outputDir, renderedFile),
Expand Down Expand Up @@ -94,7 +94,7 @@ ChangesHunter.prototype = {
* @param {Pattern} currentPattern
* @param {string} file
*/
checkLastModified: function (currentPattern, file) {
checkLastModified: function(currentPattern, file) {
if (file && fs.pathExistsSync(file)) {
try {
const stat = fs.statSync(file);
Expand All @@ -110,12 +110,12 @@ ChangesHunter.prototype = {
}
},

needsRebuild: function (lastModified, p) {
needsRebuild: function(lastModified, p) {
if (p.compileState !== CompileState.CLEAN || !p.lastModified) {
return true;
}
return p.lastModified >= lastModified;
},
}
};

module.exports = ChangesHunter;
4 changes: 2 additions & 2 deletions packages/core/src/lib/cleanBuildDirectory.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ module.exports = (incrementalBuildsEnabled, patternlab) => {
return Promise.resolve();
} else {
return Promise.all(
_.map(patternlab.uikits, (uikit) => {
_.map(patternlab.uikits, uikit => {
return fs.emptyDir(
path.join(process.cwd(), uikit.outputDir, paths.public.patterns)
);
})
).catch((reason) => {
).catch(reason => {
logger.error(reason);
});
}
Expand Down
20 changes: 10 additions & 10 deletions packages/core/src/lib/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const pluginManager = new pm();
const Pattern = require('./object_factory').Pattern;
const CompileState = require('./object_factory').CompileState;

module.exports = async function (pattern, patternlab) {
module.exports = async function(pattern, patternlab) {
// Pattern does not need to be built and recompiled more than once
if (!pattern.isPattern || pattern.compileState === CompileState.CLEAN) {
return Promise.resolve(false);
Expand All @@ -41,7 +41,7 @@ module.exports = async function (pattern, patternlab) {
);

return Promise.all(
_.map(patternlab.uikits, (uikit) => {
_.map(patternlab.uikits, uikit => {
// exclude pattern from uikit rendering
if (uikitExcludePattern(pattern, uikit)) {
return Promise.resolve();
Expand Down Expand Up @@ -125,18 +125,18 @@ module.exports = async function (pattern, patternlab) {
patternBreadcrumb:
pattern.patternGroup === pattern.patternSubgroup
? {
patternGroup: pattern.patternGroup,
patternGroup: pattern.patternGroup
}
: {
patternGroup: pattern.patternGroup,
patternSubgroup: pattern.patternSubgroup,
patternSubgroup: pattern.patternSubgroup
},
patternExtension: pattern.fileExtension.substr(1), //remove the dot because styleguide asset default adds it for us
patternName: pattern.patternName,
patternPartial: pattern.patternPartial,
patternState: pattern.patternState,
patternEngineName: pattern.engine.engineName,
extraOutput: extraOutput,
extraOutput: extraOutput
});

//set the pattern-specific footer by compiling the general-footer with data, and then adding it to the meta footer
Expand All @@ -145,16 +145,16 @@ module.exports = async function (pattern, patternlab) {
{
isPattern: pattern.isPattern,
patternData: pattern.patternData,
cacheBuster: patternlab.cacheBuster,
cacheBuster: patternlab.cacheBuster
}
);

return Promise.all([
headPromise,
patternPartialPromise,
footerPartialPromise,
footerPartialPromise
])
.then((intermediateResults) => {
.then(intermediateResults => {
// retrieve results of promises
const headHTML = intermediateResults[0]; //headPromise
pattern.patternPartialCode = intermediateResults[1]; //patternPartialPromise
Expand All @@ -178,7 +178,7 @@ module.exports = async function (pattern, patternlab) {
allFooterData.patternLabFoot = footerPartial;

return render(patternlab.userFoot, allFooterData).then(
async (footerHTML) => {
async footerHTML => {
///////////////
// WRITE FILES
///////////////
Expand Down Expand Up @@ -212,7 +212,7 @@ module.exports = async function (pattern, patternlab) {
}
);
})
.catch((reason) => {
.catch(reason => {
console.log(reason);
});
})
Expand Down
Loading