Compare commits

..

2 Commits

10 changed files with 385 additions and 6 deletions

1
dist/build.js vendored
View File

@ -1,5 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("dotenv/config");
const log_1 = require("./log");
const templates_1 = require("./templates");
class Build {

2
dist/build.js.map vendored
View File

@ -1 +1 @@
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":";;AAAA,+BAAkC;AAElC,2CAAwC;AAGxC,MAAM,KAAK;IAGV;QACC,IAAI,CAAC,GAAG,GAAG,IAAA,eAAS,EAAC,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,GAAG,IAAI,qBAAS,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAEO,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;CACD;AAED,IAAI,KAAK,EAAE,CAAC"}
{"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":";;AAAA,yBAAuB;AACvB,+BAAkC;AAElC,2CAAwC;AAGxC,MAAM,KAAK;IAGV;QACC,IAAI,CAAC,GAAG,GAAG,IAAA,eAAS,EAAC,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAkB,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,GAAG,IAAI,qBAAS,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IAEO,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;CACD;AAED,IAAI,KAAK,EAAE,CAAC"}

16
dist/generate.js vendored
View File

@ -1,11 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
require("dotenv/config");
const log_1 = require("./log");
const shell_1 = require("./shell");
class Generate {
constructor() {
this.log = (0, log_1.createLog)('generate');
this.log.info(`Generating site: ${new Date()}`);
}
async checkInbox() {
}
async img(file) {
const cmd = ['bash', 'scripts/img.sh', file];
const shell = new shell_1.Shell(cmd);
try {
await shell.execute();
}
catch (err) {
this.log.error(err);
return;
}
this.log.info(`Processed image file for ${file}`);
}
}
new Generate();
//# sourceMappingURL=generate.js.map

View File

@ -1 +1 @@
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":";;AAAA,+BAAkC;AAKlC,MAAM,QAAQ;IAEb;QACC,IAAI,CAAC,GAAG,GAAG,IAAA,eAAS,EAAC,UAAU,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;CACD;AAED,IAAI,QAAQ,EAAE,CAAC"}
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":";;AAAA,yBAAuB;AACvB,+BAAkC;AAElC,mCAAgC;AAGhC,MAAM,QAAQ;IAGb;QACC,IAAI,CAAC,GAAG,GAAG,IAAA,eAAS,EAAC,UAAU,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;IAEO,KAAK,CAAC,UAAU;IAExB,CAAC;IAEO,KAAK,CAAC,GAAG,CAAE,IAAa;QAC/B,MAAM,GAAG,GAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC;QACxD,MAAM,KAAK,GAAW,IAAI,aAAK,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC;YACJ,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QACvB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpB,OAAO;QACR,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC;CACD;AAED,IAAI,QAAQ,EAAE,CAAC"}

311
package-lock.json generated
View File

@ -14,6 +14,7 @@
"handlebars-helpers": "^0.10.0",
"lodash": "^4.17.21",
"mime": "^4.0.1",
"s3-cli": "^0.13.0",
"sqlite3": "^5.1.7",
"triple-beam": "^1.4.1",
"uuid": "^9.0.1",
@ -629,6 +630,18 @@
"gulp-header": "^1.7.1"
}
},
"node_modules/aws-sdk": {
"version": "2.0.31",
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.0.31.tgz",
"integrity": "sha512-rgmExM3/LjhI95PfjwDs1hks/RYrQ/V3qLybFCzBqr8Y3Hz9Qq3jp+WR1BaWhUckgoVJs/ZE4VSvMKZeNwuFoA==",
"dependencies": {
"xml2js": "0.2.6",
"xmlbuilder": "0.4.2"
},
"engines": {
"node": ">= 0.8.0"
}
},
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@ -1271,6 +1284,14 @@
"node": ">=0.10.0"
}
},
"node_modules/fd-slicer": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-0.1.0.tgz",
"integrity": "sha512-KQeACM2iZaDECIKvocNr5r1UAAURMlgSJkT5noPfhmWNvlHr0DEOweJsAHX1/Sn66JKs1VhnKjiXsD2rgzWneg==",
"dependencies": {
"pend": "~1.1.2"
}
},
"node_modules/fecha": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
@ -1317,6 +1338,11 @@
"node": ">=0.10.0"
}
},
"node_modules/findit": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/findit/-/findit-2.0.0.tgz",
"integrity": "sha512-ENZS237/Hr8bjczn5eKuBohLgaD0JyUd0arxretR1f9RO46vZHA1b2y0VorgGV3WaOT3c+78P8h7v4JGJ1i/rg=="
},
"node_modules/fn.name": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
@ -1753,6 +1779,11 @@
"node": ">= 6"
}
},
"node_modules/human-size": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/human-size/-/human-size-1.1.0.tgz",
"integrity": "sha512-87GIsh59t9qL2939KBKmnT/EfcFk1suakkHoTjHsdnXB/JEU0ibz+9HRiwMueGVhKuRGby6bOtQHd+mIt4BIAQ=="
},
"node_modules/humanize-ms": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
@ -2518,6 +2549,12 @@
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
"integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
},
"node_modules/natives": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/natives/-/natives-1.1.6.tgz",
"integrity": "sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA==",
"deprecated": "This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x."
},
"node_modules/negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
@ -2687,6 +2724,31 @@
"fn.name": "1.x.x"
}
},
"node_modules/os-homedir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/osenv": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
"dependencies": {
"os-homedir": "^1.0.0",
"os-tmpdir": "^1.0.0"
}
},
"node_modules/p-map": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",
@ -2719,6 +2781,11 @@
"node": ">=0.10.0"
}
},
"node_modules/pend": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/pend/-/pend-1.1.3.tgz",
"integrity": "sha512-oQiRXTFeL4KY2IAVuBsaokdEw4+WpKUu8qr/bFyKEpaqpcaflo3M/v5AORXbKxd1liRNtoOEfAV5FRjzrr1jJA=="
},
"node_modules/posix-character-classes": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
@ -2938,6 +3005,88 @@
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/s3": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/s3/-/s3-4.2.0.tgz",
"integrity": "sha512-yUsvDgdC9alRhzXKHwLmD5NjZFeivW9n26J5KJ8yWXnE3sFR45ghlKVCOkAROax7XDPSASvjLW10dzqzdKwX9Q==",
"dependencies": {
"aws-sdk": "~2.0.17",
"fd-slicer": "~0.1.0",
"findit": "~2.0.0",
"graceful-fs": "~3.0.2",
"mime": "~1.2.11",
"mkdirp": "~0.5.0",
"pend": "~1.1.2",
"rimraf": "~2.2.8"
},
"engines": {
"node": ">=0.10.20"
}
},
"node_modules/s3-cli": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/s3-cli/-/s3-cli-0.13.0.tgz",
"integrity": "sha512-VoRs+bFHUB6qRxHZ1cnRVxFBVV/X026IJouN/UAONL/2Xa5drSi2q/AXLXubpvEDl6OKXF6Yp6YY8/u4t6f+Lg==",
"dependencies": {
"human-size": "~1.1.0",
"ini": "~1.2.1",
"minimist": "~1.1.0",
"osenv": "~0.1.0",
"s3": "~4.2.0"
},
"bin": {
"s3-cli": "cli.js"
}
},
"node_modules/s3-cli/node_modules/ini": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.2.1.tgz",
"integrity": "sha512-PPRGV0RPXb9U748Lxc17NPoSXcsXaglLchPRwpXSGnUnp+aSVPyxwDod4BX1WDLovubZWGmezFyBwy4FwQOLCQ==",
"deprecated": "Please update to ini >=1.3.6 to avoid a prototype pollution issue",
"engines": {
"node": "*"
}
},
"node_modules/s3-cli/node_modules/minimist": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz",
"integrity": "sha512-2RbeLaM/Hbo9vJ1+iRrxzfDnX9108qb2m923U+s+Ot2eMey0IYGdSjzHmvtg2XsxoCuMnzOMw7qc573RvnLgwg=="
},
"node_modules/s3/node_modules/graceful-fs": {
"version": "3.0.12",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.12.tgz",
"integrity": "sha512-J55gaCS4iTTJfTXIxSVw3EMQckcqkpdRv3IR7gu6sq0+tbC363Zx6KH/SEwXASK9JRbhyZmVjJEVJIOxYsB3Qg==",
"dependencies": {
"natives": "^1.1.3"
},
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/s3/node_modules/mime": {
"version": "1.2.11",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz",
"integrity": "sha512-Ysa2F/nqTNGHhhm9MV8ure4+Hc+Y8AWiqUdHxsO7xu8zc92ND9f3kpALHjaP026Ft17UfxrMt95c50PLUeynBw=="
},
"node_modules/s3/node_modules/mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"dependencies": {
"minimist": "^1.2.6"
},
"bin": {
"mkdirp": "bin/cmd.js"
}
},
"node_modules/s3/node_modules/rimraf": {
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
"integrity": "sha512-R5KMKHnPAQaZMqLOsyuyUmcIjSeDm+73eoqQpaXA7AZ22BL+6C+1mcUscgOsNd8WVlJuvlgAPsegcx7pjlV0Dg==",
"bin": {
"rimraf": "bin.js"
}
},
"node_modules/safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
@ -2979,6 +3128,11 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"optional": true
},
"node_modules/sax": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/sax/-/sax-0.4.2.tgz",
"integrity": "sha512-6Zsl4gnHjiTQfrOzsWdc0bHJepF5KJAVuM5fcyEJrqGyszkx2c55IclWP4D692rJrl1w0tExhbvYKjKNZl5wHg=="
},
"node_modules/self-closing-tags": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/self-closing-tags/-/self-closing-tags-1.0.1.tgz",
@ -3895,6 +4049,22 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
},
"node_modules/xml2js": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.2.6.tgz",
"integrity": "sha512-h+Nzgo0eLwideldZGqSquNtrsuX5zcDREImBa1GSNw9QljlXiFcM3E1kWjLprRjJe2jRuvnVk0j3WgQo9Deoog==",
"dependencies": {
"sax": "0.4.2"
}
},
"node_modules/xmlbuilder": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-0.4.2.tgz",
"integrity": "sha512-h/+ncQQSU/iYycmI2wTN25t7RYN7O2oq9uvI+2+UObi4KcmQh/jUS4N31g5vJttQt7MODsnmBtbcll3YbNyvfw==",
"engines": {
"node": ">=0.2.0"
}
},
"node_modules/xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
@ -4383,6 +4553,15 @@
"gulp-header": "^1.7.1"
}
},
"aws-sdk": {
"version": "2.0.31",
"resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.0.31.tgz",
"integrity": "sha512-rgmExM3/LjhI95PfjwDs1hks/RYrQ/V3qLybFCzBqr8Y3Hz9Qq3jp+WR1BaWhUckgoVJs/ZE4VSvMKZeNwuFoA==",
"requires": {
"xml2js": "0.2.6",
"xmlbuilder": "0.4.2"
}
},
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@ -4893,6 +5072,14 @@
}
}
},
"fd-slicer": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-0.1.0.tgz",
"integrity": "sha512-KQeACM2iZaDECIKvocNr5r1UAAURMlgSJkT5noPfhmWNvlHr0DEOweJsAHX1/Sn66JKs1VhnKjiXsD2rgzWneg==",
"requires": {
"pend": "~1.1.2"
}
},
"fecha": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
@ -4932,6 +5119,11 @@
}
}
},
"findit": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/findit/-/findit-2.0.0.tgz",
"integrity": "sha512-ENZS237/Hr8bjczn5eKuBohLgaD0JyUd0arxretR1f9RO46vZHA1b2y0VorgGV3WaOT3c+78P8h7v4JGJ1i/rg=="
},
"fn.name": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
@ -5273,6 +5465,11 @@
"debug": "4"
}
},
"human-size": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/human-size/-/human-size-1.1.0.tgz",
"integrity": "sha512-87GIsh59t9qL2939KBKmnT/EfcFk1suakkHoTjHsdnXB/JEU0ibz+9HRiwMueGVhKuRGby6bOtQHd+mIt4BIAQ=="
},
"humanize-ms": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
@ -5853,6 +6050,11 @@
"resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
"integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
},
"natives": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/natives/-/natives-1.1.6.tgz",
"integrity": "sha512-6+TDFewD4yxY14ptjKaS63GVdtKiES1pTPyxn9Jb0rBqPMZ7VcCiooEhPNsr+mqHtMGxa/5c/HhcC4uPEUw/nA=="
},
"negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
@ -5985,6 +6187,25 @@
"fn.name": "1.x.x"
}
},
"os-homedir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
"integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ=="
},
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g=="
},
"osenv": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
"requires": {
"os-homedir": "^1.0.0",
"os-tmpdir": "^1.0.0"
}
},
"p-map": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz",
@ -6005,6 +6226,11 @@
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
"optional": true
},
"pend": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/pend/-/pend-1.1.3.tgz",
"integrity": "sha512-oQiRXTFeL4KY2IAVuBsaokdEw4+WpKUu8qr/bFyKEpaqpcaflo3M/v5AORXbKxd1liRNtoOEfAV5FRjzrr1jJA=="
},
"posix-character-classes": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
@ -6170,6 +6396,73 @@
"glob": "^7.1.3"
}
},
"s3": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/s3/-/s3-4.2.0.tgz",
"integrity": "sha512-yUsvDgdC9alRhzXKHwLmD5NjZFeivW9n26J5KJ8yWXnE3sFR45ghlKVCOkAROax7XDPSASvjLW10dzqzdKwX9Q==",
"requires": {
"aws-sdk": "~2.0.17",
"fd-slicer": "~0.1.0",
"findit": "~2.0.0",
"graceful-fs": "~3.0.2",
"mime": "~1.2.11",
"mkdirp": "~0.5.0",
"pend": "~1.1.2",
"rimraf": "~2.2.8"
},
"dependencies": {
"graceful-fs": {
"version": "3.0.12",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.12.tgz",
"integrity": "sha512-J55gaCS4iTTJfTXIxSVw3EMQckcqkpdRv3IR7gu6sq0+tbC363Zx6KH/SEwXASK9JRbhyZmVjJEVJIOxYsB3Qg==",
"requires": {
"natives": "^1.1.3"
}
},
"mime": {
"version": "1.2.11",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz",
"integrity": "sha512-Ysa2F/nqTNGHhhm9MV8ure4+Hc+Y8AWiqUdHxsO7xu8zc92ND9f3kpALHjaP026Ft17UfxrMt95c50PLUeynBw=="
},
"mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
"integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
"requires": {
"minimist": "^1.2.6"
}
},
"rimraf": {
"version": "2.2.8",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz",
"integrity": "sha512-R5KMKHnPAQaZMqLOsyuyUmcIjSeDm+73eoqQpaXA7AZ22BL+6C+1mcUscgOsNd8WVlJuvlgAPsegcx7pjlV0Dg=="
}
}
},
"s3-cli": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/s3-cli/-/s3-cli-0.13.0.tgz",
"integrity": "sha512-VoRs+bFHUB6qRxHZ1cnRVxFBVV/X026IJouN/UAONL/2Xa5drSi2q/AXLXubpvEDl6OKXF6Yp6YY8/u4t6f+Lg==",
"requires": {
"human-size": "~1.1.0",
"ini": "~1.2.1",
"minimist": "~1.1.0",
"osenv": "~0.1.0",
"s3": "~4.2.0"
},
"dependencies": {
"ini": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.2.1.tgz",
"integrity": "sha512-PPRGV0RPXb9U748Lxc17NPoSXcsXaglLchPRwpXSGnUnp+aSVPyxwDod4BX1WDLovubZWGmezFyBwy4FwQOLCQ=="
},
"minimist": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz",
"integrity": "sha512-2RbeLaM/Hbo9vJ1+iRrxzfDnX9108qb2m923U+s+Ot2eMey0IYGdSjzHmvtg2XsxoCuMnzOMw7qc573RvnLgwg=="
}
}
},
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
@ -6194,6 +6487,11 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"optional": true
},
"sax": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/sax/-/sax-0.4.2.tgz",
"integrity": "sha512-6Zsl4gnHjiTQfrOzsWdc0bHJepF5KJAVuM5fcyEJrqGyszkx2c55IclWP4D692rJrl1w0tExhbvYKjKNZl5wHg=="
},
"self-closing-tags": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/self-closing-tags/-/self-closing-tags-1.0.1.tgz",
@ -6901,6 +7199,19 @@
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
},
"xml2js": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.2.6.tgz",
"integrity": "sha512-h+Nzgo0eLwideldZGqSquNtrsuX5zcDREImBa1GSNw9QljlXiFcM3E1kWjLprRjJe2jRuvnVk0j3WgQo9Deoog==",
"requires": {
"sax": "0.4.2"
}
},
"xmlbuilder": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-0.4.2.tgz",
"integrity": "sha512-h/+ncQQSU/iYycmI2wTN25t7RYN7O2oq9uvI+2+UObi4KcmQh/jUS4N31g5vJttQt7MODsnmBtbcll3YbNyvfw=="
},
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",

View File

@ -6,9 +6,9 @@
"scripts": {
"test": "node test/",
"compile": "./node_modules/.bin/tsc -p tsconfig.json",
"build" : "bash scripts/build.sh",
"generate" : "bash scripts/generate.sh",
"all" : "bash scripts/generate.sh"
"build": "bash scripts/build.sh",
"generate": "bash scripts/generate.sh",
"all": "bash scripts/generate.sh"
},
"repository": {
"type": "git",
@ -31,6 +31,7 @@
"handlebars-helpers": "^0.10.0",
"lodash": "^4.17.21",
"mime": "^4.0.1",
"s3-cli": "^0.13.0",
"sqlite3": "^5.1.7",
"triple-beam": "^1.4.1",
"uuid": "^9.0.1",

31
scripts/img.sh Normal file
View File

@ -0,0 +1,31 @@
#!/bin/bash
set -e
source .env
INPUT="${1}"
SIZES=(
"home:420"
"full:1024"
)
function img () {
convert "${1}" -colorspace LAB -filter Lanczos -resize ${3}x -strip -quality 86 -colorspace sRGB "${2}"
echo "${1} -> ${2}"
}
mkdir -p "${WWW}/img/"
mkdir -p "${PHOTOS}/"
for sizeRaw in ${SIZES[@]}; do
sizeName=$(echo $sizeRaw | awk -F':' '{print $1}')
size=$(echo $sizeRaw | awk -F':' '{print $2}')
name=$(basename "${1}")
name=${name%.*}
output="${WWW}/img/${name}_${size}.jpg"
img "${1}" "${output}" "${size}"
done
mv "${1}" "${PHOTOS}/"

View File

@ -1,3 +1,4 @@
import 'dotenv/config';
import { createLog } from './log';
import type { Logger } from 'winston';
import { Templates } from './templates';

View File

@ -1,3 +1,4 @@
import 'dotenv/config';
import { createLog } from './log';
import type { Logger } from 'winston';
import { Shell } from './shell';
@ -5,10 +6,27 @@ import { Database } from 'sqlite3';
class Generate {
private log : Logger;
private files : string[];
constructor () {
this.log = createLog('generate');
this.log.info(`Generating site: ${new Date()}`);
}
private async checkInbox () {
}
private async img (file : string) {
const cmd : string[] = ['bash', 'scripts/img.sh', file];
const shell : Shell = new Shell(cmd);
try {
await shell.execute();
} catch (err) {
this.log.error(err);
return;
}
this.log.info(`Processed image file for ${file}`);
}
}
new Generate();