1
1
Fork 0

More status console logs. Prepped index page command

This commit is contained in:
Joe Wroten 2018-12-30 23:17:07 -06:00
parent 1f6be804b7
commit cb854ff218
4 changed files with 78 additions and 6 deletions

View file

@ -1,16 +1,26 @@
const chalk = require('chalk');
const { getPinnedRepoJSONs, getStaticPageJSONs } = require('./src/discoverJSONData'); const { getPinnedRepoJSONs, getStaticPageJSONs } = require('./src/discoverJSONData');
const { generateStaticPages } = require('./src/generateHTMLPages'); const { generateIndexPage, generateInteriorPages } = require('./src/generateHTMLPages');
const copyStaticAssets = require('./src/copyStaticAssets'); const copyStaticAssets = require('./src/copyStaticAssets');
(async () => { (async () => {
console.log(chalk.blue('● Fetching Pinned Repo Data...'));
let repoJSONs = await getPinnedRepoJSONs(); let repoJSONs = await getPinnedRepoJSONs();
console.log(chalk.blue('● Fetching Static Page Data...'));
let staticJSONs = await getStaticPageJSONs(); let staticJSONs = await getStaticPageJSONs();
await generateStaticPages(repoJSONs.concat(staticJSONs));
console.log('✓ Generated html pages'); console.log(chalk.blue('● Generating index html page...'));
await generateIndexPage(repoJSONs.concat(staticJSONs));
console.log(chalk.green('✓ Generated index html page'));
console.log(chalk.blue('● Generating interior html pages...'));
await generateInteriorPages(repoJSONs.concat(staticJSONs));
console.log(chalk.green('✓ Generated interior html pages'));
})(); })();
(async () => { (async () => {
console.log(chalk.blue('● Copying static assets...'));
await copyStaticAssets(); await copyStaticAssets();
console.log('✓ Copied static assets'); console.log(chalk.green('✓ Copied static assets'));
})(); })();

56
package-lock.json generated
View file

@ -3,6 +3,15 @@
"requires": true, "requires": true,
"lockfileVersion": 1, "lockfileVersion": 1,
"dependencies": { "dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"async": { "async": {
"version": "2.6.1", "version": "2.6.1",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
@ -22,6 +31,32 @@
"is-buffer": "^1.1.5" "is-buffer": "^1.1.5"
} }
}, },
"chalk": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
"integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"commander": { "commander": {
"version": "2.17.1", "version": "2.17.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
@ -38,6 +73,12 @@
"ms": "2.0.0" "ms": "2.0.0"
} }
}, },
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"follow-redirects": { "follow-redirects": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.0.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.6.0.tgz",
@ -76,6 +117,12 @@
"uglify-js": "^3.1.4" "uglify-js": "^3.1.4"
} }
}, },
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"is-buffer": { "is-buffer": {
"version": "1.1.6", "version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
@ -131,6 +178,15 @@
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true "dev": true
}, },
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
},
"uglify-js": { "uglify-js": {
"version": "3.4.9", "version": "3.4.9",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz",

View file

@ -6,6 +6,7 @@
}, },
"devDependencies": { "devDependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
"chalk": "^2.4.1",
"fs-extra": "^7.0.1", "fs-extra": "^7.0.1",
"handlebars": "^4.0.12", "handlebars": "^4.0.12",
"marked": "^0.5.2" "marked": "^0.5.2"

View file

@ -5,7 +5,11 @@ const getTemplate = require('./template');
const distPath = './dist'; const distPath = './dist';
const generateStaticPages = async jsonData => { const generateIndexPage = async jsonData => {
console.log('Index page...TODO');
};
const generateInteriorPages = async jsonData => {
const interiorTemplate = await getTemplate('interior'); const interiorTemplate = await getTemplate('interior');
const saveAsInteriorHTML = async json => { const saveAsInteriorHTML = async json => {
let fileName = json.name.replace(/[^a-zA-Z\d:]/g, '').toLowerCase(); let fileName = json.name.replace(/[^a-zA-Z\d:]/g, '').toLowerCase();
@ -24,5 +28,6 @@ const generateStaticPages = async jsonData => {
}; };
module.exports = { module.exports = {
generateStaticPages, generateInteriorPages,
generateIndexPage,
}; };