Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2d9b605
chore: update eslint to v10
paulrobertlloyd Jun 26, 2026
de4d05a
style: remove unused eslint-disable directive
paulrobertlloyd Jun 26, 2026
ef5532f
style: no-useless-assignment
paulrobertlloyd Jun 26, 2026
8636a8f
style: preserve-caught-error
paulrobertlloyd Jun 26, 2026
2ee20d8
style: unicorn/consistent-class-member-order
paulrobertlloyd Jun 26, 2026
9261d16
style: unicorn/consistent-compound-words
paulrobertlloyd Jun 26, 2026
9697d26
style: unicorn/prefer-https
paulrobertlloyd Jun 26, 2026
4dadab1
style: unicorn/prefer-global-this
paulrobertlloyd Jun 26, 2026
4155cf2
style: unicorn/require-css-escape
paulrobertlloyd Jun 26, 2026
3e7219b
style: unicorn/no-unused-array-method-return
paulrobertlloyd Jun 26, 2026
826dedf
style: unicorn/prefer-split-limit
paulrobertlloyd Jun 26, 2026
480055d
style: unicorn/no-exports-in-scripts
paulrobertlloyd Jun 26, 2026
cee5f45
style: unicorn/no-this-outside-of-class
paulrobertlloyd Jun 26, 2026
46761e7
style: unicorn/no-useless-template-literals
paulrobertlloyd Jun 26, 2026
1089ba2
style: unicorn/prefer-smaller-scope
paulrobertlloyd Jun 26, 2026
dc1c25b
style: unicorn/no-useless-else
paulrobertlloyd Jun 26, 2026
c0bd4c1
style: unicorn/prefer-short-arrow-method
paulrobertlloyd Jun 26, 2026
838cb13
style: unicorn/no-useless-fallback-in-spread
paulrobertlloyd Jun 26, 2026
043d5e1
style: unicorn/no-useless-recursion
paulrobertlloyd Jun 26, 2026
a006c1a
style: unicorn/prefer-math-trunc
paulrobertlloyd Jun 26, 2026
b9831e1
style: unicorn/no-declarations-before-early-exit
paulrobertlloyd Jun 26, 2026
89a2588
style: unicorn/prefer-object-iterable-methods
paulrobertlloyd Jun 26, 2026
7ac4daf
style: unicorn/no-useless-template-literals
paulrobertlloyd Jun 26, 2026
31dc578
style: unicorn/no-break-in-nested-loop
paulrobertlloyd Jun 26, 2026
0ed4852
style: unicorn/prefer-early-return
paulrobertlloyd Jun 26, 2026
8851769
style: unicorn/no-unnecessary-global-this
paulrobertlloyd Jun 26, 2026
84211fb
style: unicorn/no-undeclared-class-members
paulrobertlloyd Jun 26, 2026
e7c9dee
style: unicorn/prefer-number-coercion
paulrobertlloyd Jun 26, 2026
ecbcec0
style: unicorn/require-array-sort-compare
paulrobertlloyd Jun 26, 2026
3e81618
style: unicorn/consistent-boolean-name
paulrobertlloyd Jun 26, 2026
ebebc65
style: unicorn/prefer-else-if
paulrobertlloyd Jun 26, 2026
269fd14
style: unicorn/logical-assignment-operators
paulrobertlloyd Jun 26, 2026
76100f5
style: unicorn/new-for-builtins
paulrobertlloyd Jun 26, 2026
32a053c
style: unicorn/no-loop-iterable-mutation
paulrobertlloyd Jun 27, 2026
e1e4637
style: unicorn/no-computed-property-existence-check
paulrobertlloyd Jun 27, 2026
e1b79fc
style: unicorn/no-top-level-side-effects
paulrobertlloyd Jun 28, 2026
e5908b4
style: unicorn/no-process-exit
paulrobertlloyd Jun 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/configuration/commit-messages.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Commit messages

Indiekit provides content store plug-ins with a `metaData` object. This contains the following meta data that can be used in commit messages:
Indiekit provides content store plug-ins with a `metadata` object. This contains the following meta data that can be used in commit messages:

- `action`: Action to take i.e. ‘create’, ‘upload’.
- `result`: Result of action, i.e. ‘created’, ’uploaded’.
Expand All @@ -19,8 +19,8 @@ You can then provide a naming function for `publication.storeMessageTemplate`. F
```js
export default {
publication: {
storeMessageTemplate: (metaData) =>
`🤖 ${metaData.result} a ${metaData.postType} ${metaData.fileType}`,
storeMessageTemplate: (metadata) =>
`🤖 ${metadata.result} a ${metadata.postType} ${metadata.fileType}`,
},
};
```
Expand Down
21 changes: 17 additions & 4 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import importPlugin from "eslint-plugin-import-x";
import js from "@eslint/js";
import prettier from "eslint-config-prettier";
import jsdoc from "eslint-plugin-jsdoc";
import sortClassMembers from "eslint-plugin-sort-class-members";
import unicorn from "eslint-plugin-unicorn";
import * as webComponents from "eslint-plugin-wc";
import globals from "globals";
Expand All @@ -16,7 +15,6 @@ export default [
},
js.configs.recommended,
jsdoc.configs["flat/recommended"],
sortClassMembers.configs["flat/recommended"],
unicorn.configs["recommended"],
webComponents.configs["flat/recommended"],
{
Expand All @@ -41,10 +39,25 @@ export default [
],
"jsdoc/no-undefined-types": [1, { definedTypes: ["NodeJS"] }],
"jsdoc/require-hyphen-before-param-description": "warn",
"unicorn/prevent-abbreviations": [
"unicorn/comment-content": "off",
"unicorn/consistent-optional-chaining": "off",
"unicorn/no-incorrect-template-string-interpolation": "off",
"unicorn/no-unreadable-new-expression": "off",
"unicorn/no-unsafe-buffer-conversion": "off",
"unicorn/no-unsafe-string-replacement": "off",
"unicorn/prefer-array-from-map": "off",
"unicorn/prefer-continue": "off",
"unicorn/prefer-iterator-to-array": "off",
"unicorn/prefer-minimal-ternary": "off",
"unicorn/prefer-private-class-fields": "off",
"unicorn/prefer-scoped-selector": "off",
"unicorn/prefer-ternary": "off",
"unicorn/prefer-uint8array-base64": "off",
"unicorn/name-replacements": [
"error",
{
allowList: { utils: true },
allowList: { application: true, utils: true },
replacements: { application: false },
},
],
},
Expand Down
7 changes: 4 additions & 3 deletions helpers/fixtures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import { fileURLToPath } from "node:url";

/**
* @param {string} filename - Fixture’s file name
* @param {boolean} utf8 - Encoding fixture as UTF8
* @param {boolean} isUtf8 - Encoding fixture as UTF8
* @returns {object} File contents
*/
export const getFixture = (filename, utf8 = true) => {
export const getFixture = (filename, isUtf8 = true) => {
const file = fileURLToPath(new URL(filename, import.meta.url));

return fs.readFileSync(file, {
...(utf8 && { encoding: "utf8" }),
...(isUtf8 && { encoding: "utf8" }),
});
};
2 changes: 1 addition & 1 deletion helpers/mock-agent/syndicator-internet-archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function mockClient() {
const job_id = "ac58789b-f3ca-48d0-9ea6-1d1225e98695";
const origin = "https://web.archive.org";
const timestamp = "20180326070330";
const url = "http://website.example/post/1";
const url = "https://website.example/post/1";

// Request capture
agent
Expand Down
8 changes: 3 additions & 5 deletions helpers/publication/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ import TestStore from "@indiekit-test/store";
export const publication = {
categories: `https://website.example/categories.json`,
me: "https://website.example",
postTemplate(properties) {
return JSON.stringify(properties);
},
postTemplate: (properties) => JSON.stringify(properties),
mediaStore: new TestStore({
user: "user",
}),
store: new TestStore({
user: "user",
}),
storeMessageTemplate: (metaData) =>
`${metaData.action} ${metaData.postType} ${metaData.fileType}`,
storeMessageTemplate: (metadata) =>
`${metadata.action} ${metadata.postType} ${metadata.fileType}`,
preset: new JekyllPreset(),
};
18 changes: 9 additions & 9 deletions helpers/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ export default class TestStore {
this.options = { ...defaults, ...options };
}

get info() {
const { baseUrl, user } = this.options;
return {
name: "Test store",
uid: `${baseUrl}/${user}`,
};
}

/**
* @access private
* @param {string} path - Request path
Expand Down Expand Up @@ -54,6 +46,14 @@ export default class TestStore {
}
}

get info() {
const { baseUrl, user } = this.options;
return {
name: "Test store",
uid: `${baseUrl}/${user}`,
};
}

/**
* Create file
* @param {string} path - Path to file
Expand Down Expand Up @@ -88,7 +88,7 @@ export default class TestStore {
* @returns {Promise<string>} Updated file URL
*/
async updateFile(path, content, { message, newPath }) {
path = path || newPath;
path ||= newPath;
await this.#client(path, "PATCH", { content, message, newPath });
return `${this.info.uid}/${path}`;
}
Expand Down
1 change: 1 addition & 0 deletions indiekit.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import process from "node:process";
import * as dotenv from "dotenv";

// eslint-disable-next-line unicorn/no-top-level-side-effects
dotenv.config();

const config = {
Expand Down
Loading
Loading