@slybridges/kiss 0.8.2 → 0.8.5

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.
@@ -0,0 +1,17 @@
1
+ const js = require("@eslint/js")
2
+ const eslintConfigPrettier = require("eslint-config-prettier")
3
+ const globals = require("globals")
4
+
5
+ module.exports = [
6
+ js.configs.recommended,
7
+ eslintConfigPrettier,
8
+ {
9
+ languageOptions: {
10
+ ecmaVersion: 2022,
11
+ globals: {
12
+ ...globals.node,
13
+ },
14
+ },
15
+ rules: {},
16
+ },
17
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slybridges/kiss",
3
- "version": "0.8.2",
3
+ "version": "0.8.5",
4
4
  "description": "Keep It Simple and Static site generator",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -29,8 +29,10 @@
29
29
  "yargs": "^17.7.2"
30
30
  },
31
31
  "devDependencies": {
32
- "eslint": "^8.57.0",
32
+ "@eslint/js": "^9.5.0",
33
+ "eslint": "^9.5.0",
33
34
  "eslint-config-prettier": "^9.1.0",
35
+ "globals": "^15.6.0",
34
36
  "prettier": "^3.2.5"
35
37
  },
36
38
  "repository": {
package/src/build.js CHANGED
@@ -295,7 +295,11 @@ const countPendingDependencies = (page, pages, deps = []) => {
295
295
  pendingCount++
296
296
  } else {
297
297
  // assume a single page id
298
- pendingCount += countPendingDependencies(depValue, pages, restDeps)
298
+ pendingCount += countPendingDependencies(
299
+ pages[depValue],
300
+ pages,
301
+ restDeps,
302
+ )
299
303
  }
300
304
  } else {
301
305
  throw new Error(
@@ -43,9 +43,13 @@ const computeIsCollection = ({ isCollection, _meta }) =>
43
43
 
44
44
  computeIsCollection.kissDependencies = ["isCollection", "_meta.children"]
45
45
 
46
- const computeIsPost = ({ content, isPost }) => isPost || !!content
46
+ // In case a page is programmatically generated based only on the YAML front matter,
47
+ // it may not have a content but still be considered a post. We look into the
48
+ // _meta.isCollection to determine if the page is a collection or not in that case.
49
+ const computeIsPost = ({ content, isPost, _meta }) =>
50
+ isPost || !!content || !_meta.isCollection
47
51
 
48
- computeIsPost.kissDependencies = ["content", "isPost"]
52
+ computeIsPost.kissDependencies = ["content", "isPost", "_meta.isCollection"]
49
53
 
50
54
  const computeOutputPath = ({ permalink, _meta }, config) => {
51
55
  if (!permalink) {
@@ -24,6 +24,7 @@ const pageObject = (page, options, config) => {
24
24
  if (lastMod) {
25
25
  try {
26
26
  lastMod = formatISO(lastMod)
27
+ // eslint-disable-next-line no-unused-vars
27
28
  } catch (err) {
28
29
  global.logger.warn(
29
30
  `[${this.name}]: cannot format lastmod date '${lastMod}' to ISO for page '${page.permalink}'. Setting null.`,
package/.eslintrc.js DELETED
@@ -1,11 +0,0 @@
1
- module.exports = {
2
- env: {
3
- es6: true,
4
- node: true,
5
- },
6
- extends: ["eslint:recommended", "prettier"],
7
- parserOptions: {
8
- ecmaVersion: 12,
9
- },
10
- rules: {},
11
- }