contentful-hugo
Advanced tools
Comparing version 1.16.2 to 1.16.3
@@ -44,2 +44,3 @@ #!/usr/bin/env node | ||
var yargs_1 = __importDefault(require("yargs")); | ||
var contants_1 = require("./helpers/contants"); | ||
var main_1 = require("./main"); | ||
@@ -87,3 +88,3 @@ var clean_1 = __importDefault(require("./main/clean")); | ||
if (!(config.staticContent && config.staticContent.length)) return [3 /*break*/, 2]; | ||
console.log('Copying static content...'); | ||
console.log(contants_1.LOG_PREFIX + " Copying static content..."); | ||
return [4 /*yield*/, main_1.copyStaticContent(config)]; | ||
@@ -90,0 +91,0 @@ case 1: |
@@ -41,4 +41,5 @@ "use strict"; | ||
var strings_1 = require("../helpers/strings"); | ||
var contants_1 = require("../helpers/contants"); | ||
var cleanDirectories = function (config) { return __awaiter(void 0, void 0, void 0, function () { | ||
var dirs, getRootDir, _i, _a, item, newDir, _b, _c, item, newDir, tasks, _d, dirs_1, dir; | ||
var dirs, getRootDir, _i, _a, item, newDir, _b, _c, item, newDir, tasks, _loop_1, _d, dirs_1, dir; | ||
return __generator(this, function (_e) { | ||
@@ -68,5 +69,10 @@ switch (_e.label) { | ||
tasks = []; | ||
_loop_1 = function (dir) { | ||
tasks.push(fs_extra_1.remove(dir).then(function () { | ||
console.log(contants_1.LOG_PREFIX + " cleaned ./" + dir); | ||
})); | ||
}; | ||
for (_d = 0, dirs_1 = dirs; _d < dirs_1.length; _d++) { | ||
dir = dirs_1[_d]; | ||
tasks.push(fs_extra_1.remove(dir)); | ||
_loop_1(dir); | ||
} | ||
@@ -73,0 +79,0 @@ return [4 /*yield*/, Promise.all(tasks)]; |
@@ -60,4 +60,4 @@ "use strict"; | ||
case 0: | ||
console.log('creating contentful-hugo.config.js'); | ||
configContent = "// go to https://github.com/ModiiMedia/contentful-hugo#configuration for configuration instructions\n\n/**\n * @type {import('contentful-hugo').ContentfulHugoConfig}\n */\nmodule.exports = {\n locales: [],\n singleTypes: [],\n repeatableTypes: []\n};"; | ||
console.log("creating ./contentful-hugo.config.js"); | ||
configContent = "// go to https://github.com/ModiiMedia/contentful-hugo#configuration for configuration instructions\n\n/**\n * @type {import('contentful-hugo').ContentfulHugoConfig}\n */\nmodule.exports = {\n locales: [], // uses default locale if left empty\n singleTypes: [],\n repeatableTypes: [],\n};"; | ||
return [4 /*yield*/, fs_extra_1.writeFile(filepath, configContent)]; | ||
@@ -76,3 +76,3 @@ case 1: | ||
case 0: | ||
console.log('checking for config...'); | ||
console.log("checking for config..."); | ||
return [4 /*yield*/, wait(1000)]; | ||
@@ -90,3 +90,3 @@ case 1: | ||
if (singleTypes || repeatableTypes) { | ||
console.log('config already exists\n'); | ||
console.log("config already exists\n"); | ||
return [2 /*return*/, null]; | ||
@@ -126,3 +126,3 @@ } | ||
return __awaiter(void 0, void 0, void 0, function () { | ||
var directory; | ||
var directory, handleShortCode, tasks; | ||
return __generator(this, function (_a) { | ||
@@ -139,3 +139,3 @@ switch (_a.label) { | ||
_a.sent(); | ||
Object.keys(shortcodes_1.default).forEach(function (key) { return __awaiter(void 0, void 0, void 0, function () { | ||
handleShortCode = function (key) { return __awaiter(void 0, void 0, void 0, function () { | ||
var _a, filename, template, finalTemplate, filepath; | ||
@@ -161,4 +161,15 @@ return __generator(this, function (_b) { | ||
}); | ||
}); }; | ||
tasks = []; | ||
Object.keys(shortcodes_1.default).forEach(function (key) { return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
tasks.push(handleShortCode(key)); | ||
return [2 /*return*/]; | ||
}); | ||
}); }); | ||
console.log('\n'); | ||
return [4 /*yield*/, Promise.all(tasks).then(function () { | ||
console.log('\n'); | ||
})]; | ||
case 3: | ||
_a.sent(); | ||
return [2 /*return*/, null]; | ||
@@ -165,0 +176,0 @@ } |
@@ -248,3 +248,3 @@ "use strict"; | ||
if (mainContentField) { | ||
return mainContentField; | ||
return "\n" + mainContentField; | ||
} | ||
@@ -251,0 +251,0 @@ return null; |
@@ -9,2 +9,3 @@ "use strict"; | ||
var strings_1 = require("../../helpers/strings"); | ||
var contants_1 = require("../../helpers/contants"); | ||
var createWatcher = function (config) { | ||
@@ -47,11 +48,11 @@ if (!config.singleTypes || !config.staticContent.length) { | ||
watcher.on('add', function (path) { | ||
console.log("[contentful hugo] " + path + " added"); | ||
console.log(contants_1.LOG_PREFIX + " " + path + " added"); | ||
return handleCopy(strings_1.replaceBackslashesWithForwardSlashes(path)); | ||
}); | ||
watcher.on('change', function (path) { | ||
console.log("[contentful hugo] " + path + " changed"); | ||
console.log(contants_1.LOG_PREFIX + " " + path + " changed"); | ||
return handleCopy(strings_1.replaceBackslashesWithForwardSlashes(path)); | ||
}); | ||
watcher.on('unlink', function (path) { | ||
console.log("[contentful hugo] " + path + " deleted"); | ||
console.log(contants_1.LOG_PREFIX + " " + path + " deleted"); | ||
return handleDelete(strings_1.replaceBackslashesWithForwardSlashes(path)); | ||
@@ -58,0 +59,0 @@ }); |
@@ -105,2 +105,5 @@ #!/usr/bin/env node | ||
} | ||
app.get('/_status', function (_req, res) { | ||
return res.status(200).send('ok'); | ||
}); | ||
app.post('/', function (req, res) { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -107,0 +110,0 @@ var sys, triggerType; |
{ | ||
"name": "contentful-hugo", | ||
"version": "1.16.2", | ||
"version": "1.16.3", | ||
"description": "Node module that pulls data from Contentful and turns it into markdown files for Hugo. Can be used with other Static Site Generators, but has some Hugo specific features.", | ||
@@ -46,4 +46,4 @@ "main": "./dist/main/index.js", | ||
"chokidar": "^3.5.1", | ||
"contentful": "^8.3.2", | ||
"dotenv": "^8.2.0", | ||
"contentful": "^8.3.4", | ||
"dotenv": "^8.6.0", | ||
"express": "^4.17.1", | ||
@@ -68,4 +68,4 @@ "fs-extra": "^9.1.0", | ||
"@types/js-yaml": "^4.0.1", | ||
"@typescript-eslint/eslint-plugin": "^4.22.0", | ||
"@typescript-eslint/parser": "^4.22.0", | ||
"@typescript-eslint/eslint-plugin": "^4.22.1", | ||
"@typescript-eslint/parser": "^4.22.1", | ||
"babel-plugin-module-resolver": "^4.1.0", | ||
@@ -77,3 +77,3 @@ "eslint": "^7.25.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-promise": "^4.3.1", | ||
"eslint-plugin-promise": "^5.1.0", | ||
"eslint-plugin-standard": "^5.0.0", | ||
@@ -83,4 +83,4 @@ "jest": "^26.6.3", | ||
"prettier-plugin-go-template": "0.0.10", | ||
"ts-jest": "^26.5.5", | ||
"ts-loader": "^8.2.0", | ||
"ts-jest": "^26.5.6", | ||
"ts-loader": "^9.1.2", | ||
"tscpaths": "0.0.9", | ||
@@ -87,0 +87,0 @@ "typescript": "^4.2.4" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202597
66
3257
Updatedcontentful@^8.3.4
Updateddotenv@^8.6.0