xertz 0.52.0 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Brady Holt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -38,9 +38,9 @@ When you initialize a xertz site, a directory will created that looks like this:
38
38
  |-- index.html.hbs
39
39
  ```
40
40
 
41
- - *_layouts* - This folder contains Handlebars layouts which will be used to contruct rendered pages.
42
- - *media* - This is folder that is indented to hold images and other assets. The folder will be emitted as is.
43
- - *posts* - This is folder that is indented to blog posts.
41
+ - *_layouts* - This folder contains Handlebars layouts which will be used to contsruct rendered pages.
42
+ - *media* - This folder contains images and other assets and will be copied as is.
43
+ - *posts* - This folder contains the posts.
44
44
  - *styles* - CSS files can be placed here and will be be made available in the template data.
45
45
  - *_config.yml* - This is the base config file.
46
46
  - *index.html.hbs* - This is the main index page for the site.
@@ -64,7 +64,7 @@ A file with the `html.hbs` extension will be processed as a Handlebars template
64
64
 
65
65
  #### Content Package Directory
66
66
 
67
- If subdirectory of `content/` contans contains a file called `index.md`, it will be deemed a Content Package Directory. This means all files within the directory will be
67
+ If subdirectory of `posts/` contains contains a file called `index.md`, it will be deemed a Content Package Directory. This means all files within the directory will be processed as a unit and copied to a corresponding output directory.
68
68
 
69
69
  For example, if you had a directory structure defined as:
70
70
 
package/dist/builder.js CHANGED
@@ -1,18 +1,43 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
7
23
  return result;
8
24
  };
9
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.Builder = void 0;
10
27
  const fse = __importStar(require("fs-extra"));
11
28
  const path = __importStar(require("path"));
12
29
  const configHelper_1 = require("./configHelper");
13
30
  const stylesGenerator_1 = require("./generators/stylesGenerator");
14
31
  const contentGenerator_1 = require("./generators/contentGenerator");
15
32
  class Builder {
33
+ static distDirectoryName = "_dist";
34
+ static layoutsDirectoryName = "_layouts";
35
+ static stylesDirectoryName = "styles";
36
+ baseDirectory;
37
+ contentDirectory;
38
+ layoutsDirectory;
39
+ stylesDirectory;
40
+ distDirectory;
16
41
  constructor(baseDirectory) {
17
42
  this.baseDirectory = baseDirectory;
18
43
  this.contentDirectory = this.baseDirectory;
@@ -21,7 +46,7 @@ class Builder {
21
46
  this.distDirectory = path.join(this.baseDirectory, Builder.distDirectoryName);
22
47
  }
23
48
  async start() {
24
- let baseConfig = configHelper_1.loadConfigFile(this.baseDirectory);
49
+ let baseConfig = (0, configHelper_1.loadConfigFile)(this.baseDirectory);
25
50
  if (!baseConfig) {
26
51
  throw Error(`Config file not found in ${this.baseDirectory}.`);
27
52
  }
@@ -34,6 +59,3 @@ class Builder {
34
59
  }
35
60
  }
36
61
  exports.Builder = Builder;
37
- Builder.distDirectoryName = "_dist";
38
- Builder.layoutsDirectoryName = "_layouts";
39
- Builder.stylesDirectoryName = "styles";
package/dist/cli.js CHANGED
@@ -1,9 +1,25 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
7
23
  return result;
8
24
  };
9
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
@@ -20,9 +36,11 @@ const express = require("express");
20
36
  const package_json_2 = __importDefault(require("../package.json"));
21
37
  const dateHelper_1 = require("./dateHelper");
22
38
  class cli {
39
+ scaffoldDirectoryName = "scaffold";
40
+ scaffoldContentExampleFileName = "YYYY-MM-DD-my-first-post.md";
41
+ cwd;
42
+ args;
23
43
  constructor(cwd, args) {
24
- this.scaffoldDirectoryName = "scaffold";
25
- this.scaffoldContentExampleFileName = "YYYY-MM-DD-my-first-post.md";
26
44
  this.cwd = cwd;
27
45
  this.args = args;
28
46
  }
@@ -87,17 +105,17 @@ Commands:
87
105
  }
88
106
  });
89
107
  // Add today's date in the example content file
90
- fse.renameSync(path.join(targetDirectoryPath, "posts", this.scaffoldContentExampleFileName), path.join(targetDirectoryPath, "posts", this.scaffoldContentExampleFileName.replace("YYYY-MM-DD", dateHelper_1.getCurrentDateInISOFormat())));
108
+ fse.renameSync(path.join(targetDirectoryPath, "posts", this.scaffoldContentExampleFileName), path.join(targetDirectoryPath, "posts", this.scaffoldContentExampleFileName.replace("YYYY-MM-DD", (0, dateHelper_1.getCurrentDateInISOFormat)())));
91
109
  // Configure package.json file with name of latest version of xertz specified
92
110
  const scaffoldFile = path.join(scaffoldDirectory, "package.json");
93
111
  const scaffoldPackageContent = JSON.parse(fse.readFileSync(scaffoldFile, "utf8"));
94
112
  scaffoldPackageContent.name = targetDirectoryName;
95
- const latestPackageInfo = await package_json_1.default(package_json_2.default.name);
113
+ const latestPackageInfo = await (0, package_json_1.default)(package_json_2.default.name);
96
114
  scaffoldPackageContent.dependencies.xertz = latestPackageInfo.version;
97
115
  fse.writeFileSync(scaffoldFile, JSON.stringify(scaffoldPackageContent));
98
116
  // Run npm install
99
117
  console.log(`[init]: Installing packages...`);
100
- child_process_1.execSync(`npm install --silent`, { cwd: targetDirectoryPath, env: {} });
118
+ (0, child_process_1.execSync)(`npm install --silent`, { cwd: targetDirectoryPath, env: {} });
101
119
  console.log(`[init]: Done! Run \`cd ${targetDirectoryName} && npx xertz serve\` and start blogging.`);
102
120
  process.exit();
103
121
  }
@@ -108,7 +126,7 @@ Commands:
108
126
  title = "My New Post";
109
127
  }
110
128
  const postSlug = title.toLocaleLowerCase().replace(/\s/g, "-");
111
- const postPath = path.join(postsPath, `${dateHelper_1.getCurrentDateInISOFormat()}-${postSlug}`);
129
+ const postPath = path.join(postsPath, `${(0, dateHelper_1.getCurrentDateInISOFormat)()}-${postSlug}`);
112
130
  fse.ensureDirSync(postPath);
113
131
  fse.writeFileSync(path.join(postPath, "index.md"), `\
114
132
  ---
@@ -152,13 +170,13 @@ This is a new post.
152
170
  async updateCommand() {
153
171
  console.log(`[update]: Start`);
154
172
  // Update xertz depedency to latest version in package.json
155
- const latestNpmPackageInfo = await package_json_1.default(package_json_2.default.name);
173
+ const latestNpmPackageInfo = await (0, package_json_1.default)(package_json_2.default.name);
156
174
  const packageFile = path.join(this.cwd, "package.json");
157
175
  const sitePackageInfo = JSON.parse(fse.readFileSync(packageFile, "utf8"));
158
176
  sitePackageInfo.dependencies[package_json_2.default.name] =
159
177
  latestNpmPackageInfo.version;
160
178
  fse.writeFileSync(packageFile, JSON.stringify(sitePackageInfo, null, 2));
161
- child_process_1.execSync(`npm install --silent`, { cwd: this.cwd });
179
+ (0, child_process_1.execSync)(`npm install --silent`, { cwd: this.cwd });
162
180
  console.log(`[update]: Successfully updated ${package_json_2.default.name} to version ${latestNpmPackageInfo.version}.`);
163
181
  }
164
182
  /* Misc */
@@ -168,11 +186,11 @@ This is a new post.
168
186
  });
169
187
  }
170
188
  async checkForUpdates() {
171
- const latestNpmPackageInfo = await package_json_1.default(package_json_2.default.name);
189
+ const latestNpmPackageInfo = await (0, package_json_1.default)(package_json_2.default.name);
172
190
  const sitePackageInfo = JSON.parse(fse.readFileSync(path.join(this.cwd, "package.json"), "utf8"));
173
191
  if (latestNpmPackageInfo.version !=
174
192
  sitePackageInfo.dependencies[package_json_2.default.name]) {
175
- console.log("\x1b[33m%s", `New version is available (${latestNpmPackageInfo.version}). Run \`${package_json_2.default.name} update\` to update.`, "\x1b[0m");
193
+ console.log("\x1b[33m%s", `New version is available (${latestNpmPackageInfo.version}). Run \`npx ${package_json_2.default.name} update\` to update.`, "\x1b[0m");
176
194
  }
177
195
  }
178
196
  exitWithError(errorMessage) {
@@ -1,12 +1,29 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
7
23
  return result;
8
24
  };
9
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.loadConfigFile = void 0;
10
27
  const path = __importStar(require("path"));
11
28
  const fs = __importStar(require("fs"));
12
29
  const fse = __importStar(require("fs-extra"));
@@ -17,7 +34,7 @@ function loadConfigFile(sourceDirectory) {
17
34
  const configFilePath = path.join(sourceDirectory, "_config.yml");
18
35
  if (fse.existsSync(configFilePath)) {
19
36
  const configFileContent = fs.readFileSync(path.join(sourceDirectory, "_config.yml"), "utf-8");
20
- const config = yaml.safeLoad(configFileContent);
37
+ const config = yaml.load(configFileContent);
21
38
  cachedConfigFiles[sourceDirectory] = config;
22
39
  }
23
40
  else {
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCurrentDateInLocalTimezone = exports.getCurrentDateInISOFormat = void 0;
3
4
  function getCurrentDateInISOFormat(currentDate = new Date()) {
4
5
  let isoLocalDateString = getCurrentDateInLocalTimezone(currentDate).toISOString();
5
6
  return isoLocalDateString.substring(0, 10);
@@ -1,15 +1,32 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
7
23
  return result;
8
24
  };
9
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
11
27
  };
12
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.AmpGenerator = void 0;
13
30
  const fs = __importStar(require("fs"));
14
31
  const path = __importStar(require("path"));
15
32
  const ampify_1 = __importDefault(require("@bradymholt/ampify"));
@@ -17,8 +34,12 @@ const ampify_1 = __importDefault(require("@bradymholt/ampify"));
17
34
  * Generates an AMP page given ITemplateData
18
35
  */
19
36
  class AmpGenerator {
37
+ static ampPageName = "amp.html";
38
+ ampLayout = "amp";
39
+ baseSourceDirectory;
40
+ baseDestDirectory;
41
+ templateManager;
20
42
  constructor(baseSourceDirectory, baseDestDirectory, templateManager) {
21
- this.ampLayout = "amp";
22
43
  this.baseSourceDirectory = baseSourceDirectory;
23
44
  this.baseDestDirectory = baseDestDirectory;
24
45
  this.templateManager = templateManager;
@@ -26,7 +47,7 @@ class AmpGenerator {
26
47
  async generate(pageConfig, templateData) {
27
48
  const applyTemplate = this.templateManager.getTemplate(this.ampLayout);
28
49
  const html = applyTemplate(Object.assign({}, pageConfig, templateData));
29
- let ampOutput = await ampify_1.default(html, {
50
+ let ampOutput = await (0, ampify_1.default)(html, {
30
51
  // TODO: We're passing the destination directory to ampify which it will read from. I'd
31
52
  // prefer to feed only source directory files in to any build time processing but this is easier. Circle back and re-evalulate this.
32
53
  cwd: this.baseDestDirectory
@@ -35,4 +56,3 @@ class AmpGenerator {
35
56
  }
36
57
  }
37
58
  exports.AmpGenerator = AmpGenerator;
38
- AmpGenerator.ampPageName = "amp.html";
@@ -1,19 +1,36 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
7
23
  return result;
8
24
  };
9
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
11
27
  };
12
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.ContentGenerator = void 0;
13
30
  const fs = __importStar(require("fs"));
14
31
  const fse = __importStar(require("fs-extra"));
15
32
  const path = __importStar(require("path"));
16
- const marked_1 = __importDefault(require("marked"));
33
+ const marked_1 = require("marked");
17
34
  const gray_matter_1 = __importDefault(require("gray-matter"));
18
35
  const prismjs_1 = __importDefault(require("prismjs"));
19
36
  const configHelper_1 = require("../configHelper");
@@ -21,14 +38,25 @@ const templateGenerator_1 = require("./templateGenerator");
21
38
  const ampGenerator_1 = require("./ampGenerator");
22
39
  const templateManager_1 = require("../templateManager");
23
40
  class ContentGenerator {
41
+ // Options
42
+ renderAmpPages = true;
43
+ codeHighlight = true;
44
+ styles;
45
+ contentPageName = "index.html";
46
+ ignorePrefixes = [".", "_", "node_modules"];
47
+ contentExtensionsToInclude = ["md"];
48
+ assetIgnoreExtensions = ["md", "hbs"];
49
+ templateManager;
50
+ markedRender;
51
+ markedHighlighter;
52
+ baseConfig;
53
+ stylesDirectory;
54
+ baseSourceDirectory;
55
+ baseDestDirectory;
56
+ baseTemplateData;
57
+ templateGenerator;
58
+ ampGenerator;
24
59
  constructor(baseConfig, styles, stylesDirectory, layoutsDirectory, sourceDirectory, destDirectory) {
25
- // Options
26
- this.renderAmpPages = true;
27
- this.codeHighlight = true;
28
- this.contentPageName = "index.html";
29
- this.ignorePrefixes = [".", "_", "node_modules"];
30
- this.contentExtensionsToInclude = ["md"];
31
- this.assetIgnoreExtensions = ["md", "hbs"];
32
60
  this.styles = styles;
33
61
  this.stylesDirectory = stylesDirectory;
34
62
  this.templateManager = new templateManager_1.TemplateManager(layoutsDirectory);
@@ -46,7 +74,7 @@ class ContentGenerator {
46
74
  }
47
75
  async generate(config, sourceDirectory, destDirectory) {
48
76
  const originalDestDirectory = destDirectory;
49
- let sourceDirectoryConfig = configHelper_1.loadConfigFile(sourceDirectory);
77
+ let sourceDirectoryConfig = (0, configHelper_1.loadConfigFile)(sourceDirectory);
50
78
  // Merge any _config.yml file in current directory with baseConfig to gather config for current directory
51
79
  let currentDirectoryPageConfig = Object.assign({}, config, sourceDirectoryConfig);
52
80
  // If this directory contains an index.md file, it is designated as a content package directory.
@@ -183,7 +211,7 @@ class ContentGenerator {
183
211
  }
184
212
  parseContentFile(pageConfig) {
185
213
  const source = fs.readFileSync(pageConfig.source, { encoding: "utf-8" });
186
- const parsedMatter = gray_matter_1.default(source);
214
+ const parsedMatter = (0, gray_matter_1.default)(source);
187
215
  let markdownContent = parsedMatter.content;
188
216
  // Prepend relative image references with path
189
217
  markdownContent = markdownContent
@@ -213,7 +241,7 @@ class ContentGenerator {
213
241
  switch (fileExtension) {
214
242
  case "md":
215
243
  // Parse markdown
216
- html = marked_1.default(markdownContent, {
244
+ html = (0, marked_1.marked)(markdownContent, {
217
245
  smartypants: true,
218
246
  highlight: this.codeHighlight ? this.prismHighlighter : undefined,
219
247
  renderer: this.markedRender
@@ -263,7 +291,7 @@ class ContentGenerator {
263
291
  return prismjs_1.default.highlight(code, prismjs_1.default.languages[lang] || prismjs_1.default.languages.markup, "");
264
292
  }
265
293
  getMarkedRender() {
266
- const renderer = new marked_1.default.Renderer();
294
+ const renderer = new marked_1.marked.Renderer();
267
295
  renderer.code = function (code, language) {
268
296
  const options = this.options;
269
297
  var lang = (language || "markup").match(/\S*/)[0];
@@ -1,25 +1,40 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
7
23
  return result;
8
24
  };
9
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.StylesGenerator = void 0;
10
27
  const fs = __importStar(require("fs"));
11
28
  const fse = __importStar(require("fs-extra"));
12
29
  const path = __importStar(require("path"));
13
- const sass = __importStar(require("node-sass"));
30
+ const sass = __importStar(require("sass"));
14
31
  /**
15
32
  * Generates CSS and compiles Sass
16
33
  */
17
34
  class StylesGenerator {
18
- constructor() {
19
- this.extensionsToInclude = ["scss", "sass", "css"];
20
- this.outFileExtension = "css";
21
- this.outputStyle = "compressed";
22
- }
35
+ extensionsToInclude = ["scss", "sass", "css"];
36
+ outFileExtension = "css";
37
+ outputStyle = "compressed";
23
38
  generate(sourceDirectory, destDirectory) {
24
39
  const styles = [];
25
40
  const baseDirFileNames = fs.readdirSync(sourceDirectory);
@@ -1,18 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
7
23
  return result;
8
24
  };
9
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.TemplateGenerator = void 0;
10
27
  const fs = __importStar(require("fs"));
11
28
  const fse = __importStar(require("fs-extra"));
12
29
  const path = __importStar(require("path"));
13
30
  class TemplateGenerator {
31
+ extensionsToInclude = ["hbs"];
32
+ baseTemplateData;
33
+ templateManager;
14
34
  constructor(baseTemplateData, templateManager) {
15
- this.extensionsToInclude = ["hbs"];
16
35
  this.baseTemplateData = baseTemplateData;
17
36
  this.templateManager = templateManager;
18
37
  }
@@ -1,15 +1,32 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
7
23
  return result;
8
24
  };
9
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
11
27
  };
12
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.encodeURI = exports.group = exports.indent = exports.dateFormat = exports.iif = exports.filter = exports.limit = void 0;
13
30
  const handlebars = __importStar(require("handlebars"));
14
31
  const dateformat_1 = __importDefault(require("dateformat"));
15
32
  function register() {
@@ -51,7 +68,7 @@ function dateFormat(dateString, format = "mm/dd/yyyy") {
51
68
  // dateString had no time component (e.g. 2019-01-01) so we'll convert to UTC to make the date stable.
52
69
  format = "UTC:" + format;
53
70
  }
54
- return dateformat_1.default(date, format);
71
+ return (0, dateformat_1.default)(date, format);
55
72
  }
56
73
  exports.dateFormat = dateFormat;
57
74
  /**
@@ -1,22 +1,41 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
2
18
  var __importStar = (this && this.__importStar) || function (mod) {
3
19
  if (mod && mod.__esModule) return mod;
4
20
  var result = {};
5
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
- result["default"] = mod;
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
7
23
  return result;
8
24
  };
9
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
10
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
11
27
  };
12
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.TemplateManager = void 0;
13
30
  const fs = __importStar(require("fs"));
14
31
  const path = __importStar(require("path"));
15
32
  const handlebars = __importStar(require("handlebars"));
16
33
  const hbs_helpers_1 = __importDefault(require("./hbs-helpers"));
17
34
  class TemplateManager {
35
+ layoutsDirectory;
36
+ layouts;
37
+ initialized = false;
18
38
  constructor(layoutDirectory) {
19
- this.initialized = false;
20
39
  this.layoutsDirectory = layoutDirectory;
21
40
  this.layouts = {};
22
41
  }
@@ -49,7 +68,7 @@ class TemplateManager {
49
68
  initialize() {
50
69
  if (!this.initialized) {
51
70
  this.registerTemplatePartials();
52
- hbs_helpers_1.default();
71
+ (0, hbs_helpers_1.default)();
53
72
  this.initialized = true;
54
73
  }
55
74
  }
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "xertz",
3
- "version": "0.52.0",
3
+ "version": "0.55.0",
4
4
  "description": "A static site generator written in TypeScript",
5
5
  "author": "Brady Holt",
6
6
  "license": "MIT",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
+ "engines": {
11
+ "node": ">=16"
12
+ },
10
13
  "main": "index.js",
11
14
  "bin": "bin/start.js",
12
15
  "files": [
@@ -16,38 +19,37 @@
16
19
  ],
17
20
  "scripts": {
18
21
  "build_scaffold": "cd scaffold/ && npx ts-node --files ../bin/start.ts build",
19
- "test": "npx jest",
22
+ "test": "jest",
20
23
  "prepublishOnly": "tsc"
21
24
  },
22
25
  "dependencies": {
23
26
  "@bradymholt/ampify": "^1.2.0",
24
- "@types/package-json": "^5.0.1",
25
- "chokidar": "^3.3.1",
26
- "dateformat": "^3.0.3",
27
- "express": "^4.17.1",
28
- "fs-extra": "^8.1.0",
29
- "gray-matter": "^4.0.2",
30
- "handlebars": "^4.7.3",
31
- "js-yaml": "^3.13.1",
32
- "marked": "^0.8.0",
33
- "node-sass": "^4.13.1",
34
- "npm-check-updates": "^4.0.4",
27
+ "chokidar": "^3.5.3",
28
+ "dateformat": "^4.5.1",
29
+ "express": "^4.18.1",
30
+ "fs-extra": "^10.1.0",
31
+ "gray-matter": "^4.0.3",
32
+ "handlebars": "^4.7.7",
33
+ "js-yaml": "^4.1.0",
34
+ "marked": "^4.0.17",
35
35
  "package-json": "^6.5.0",
36
- "prismjs": "^1.19.0"
36
+ "prismjs": "^1.28.0",
37
+ "sass": "^1.52.3"
37
38
  },
38
39
  "devDependencies": {
39
- "@types/dateformat": "^3.0.1",
40
- "@types/express": "^4.17.3",
41
- "@types/fs-extra": "^8.1.0",
42
- "@types/jest": "^25.1.4",
43
- "@types/js-yaml": "^3.12.2",
44
- "@types/marked": "^0.7.3",
45
- "@types/node": "^13.9.1",
46
- "@types/node-sass": "^4.11.0",
47
- "@types/prismjs": "^1.16.0",
48
- "jest": "^25.1.0",
49
- "ts-jest": "^25.2.1",
50
- "ts-node": "^8.6.2",
51
- "typescript": "^3.8.3"
40
+ "@types/dateformat": "^5.0.0",
41
+ "@types/express": "^4.17.13",
42
+ "@types/fs-extra": "^9.0.13",
43
+ "@types/jest": "^28.1.2",
44
+ "@types/js-yaml": "^4.0.5",
45
+ "@types/marked": "^4.0.3",
46
+ "@types/node": "^18.0.0",
47
+ "@types/package-json": "^5.0.1",
48
+ "@types/prismjs": "^1.26.0",
49
+ "jest": "^28.1.1",
50
+ "npm-check-updates": "^14.0.1",
51
+ "ts-jest": "^28.0.5",
52
+ "ts-node": "^10.8.1",
53
+ "typescript": "^4.7.4"
52
54
  }
53
55
  }
@@ -1 +1 @@
1
- {"name":"tmp_init","version":"1.0.0","description":"A site built with xertz.","dependencies":{"xertz":"0.51.0"}}
1
+ {"name":"tmp_init","version":"1.0.0","description":"A site built with xertz.","dependencies":{"xertz":"0.54.0"}}