Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed Aug 19, 2024
1 parent 071255b commit e85d156
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/docs/plugins/writing-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ There are two patterns used by v8r plugin hooks.

### Register Hooks

- `registerFileParsers`
- `registerInputFileParsers`
- `registerOutputFormats`

These hooks return an array of strings. Any values returned by these hooks are added to the list of formats v8r can work with.
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function parseArgs(argv, config, documentFormats, outputFormats) {
function getDocumentFormats(loadedPlugins) {
let documentFormats = [];
for (const plugin of loadedPlugins) {
documentFormats = documentFormats.concat(plugin.registerFileParsers());
documentFormats = documentFormats.concat(plugin.registerInputFileParsers());
}
return documentFormats;
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class BasePlugin {
static name = "untitled plugin";

/**
* Use the `registerFileParsers` hook to tell v8r about additional file
* Use the `registerInputFileParsers` hook to tell v8r about additional file
* formats that can be parsed. Any parsers registered with this hook become
* valid values for the `parser` property in custom schemas.
*
* @returns {string[]} File parsers to register
*/
registerFileParsers() {
registerInputFileParsers() {
return [];
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe("loadAllPlugins", function () {
{
name: "Error",
message:
"Error loading plugin v8r-plugin-test-invalid-params: registerFileParsers must take exactly 0 arguments",
"Error loading plugin v8r-plugin-test-invalid-params: registerInputFileParsers must take exactly 0 arguments",
},
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/parser-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BasePlugin, Document } from "../plugins.js";
class JsonParser extends BasePlugin {
static name = "v8r-plugin-json-parser";

registerFileParsers() {
registerInputFileParsers() {
return ["json"];
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/parser-json5.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BasePlugin, Document } from "../plugins.js";
class Json5Parser extends BasePlugin {
static name = "v8r-plugin-json5-parser";

registerFileParsers() {
registerInputFileParsers() {
return ["json5"];
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/parser-toml.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BasePlugin, Document } from "../plugins.js";
class TomlParser extends BasePlugin {
static name = "v8r-plugin-toml-parser";

registerFileParsers() {
registerInputFileParsers() {
return ["toml"];
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/parser-yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BasePlugin, Document } from "../plugins.js";
class YamlParser extends BasePlugin {
static name = "v8r-plugin-yaml-parser";

registerFileParsers() {
registerInputFileParsers() {
return ["yaml"];
}

Expand Down
2 changes: 1 addition & 1 deletion testfiles/plugins/invalid-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default class InvalidParamsTestPlugin extends BasePlugin {
static name = "v8r-plugin-test-invalid-params";

// eslint-disable-next-line no-unused-vars
registerFileParsers(foo) {
registerInputFileParsers(foo) {
return [];
}
}

0 comments on commit e85d156

Please sign in to comment.