Prettier (#852)
* add prettier * lint-staged * prettier * upgrade husky
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { ScrpitGeneratorFunction } from "../generate";
|
||||
import { LightNovelWPMetadata } from "./template";
|
||||
import list from "./sources.json";
|
||||
import { readFileSync } from "fs";
|
||||
import path from "path";
|
||||
import { ScrpitGeneratorFunction } from '../generate';
|
||||
import { LightNovelWPMetadata } from './template';
|
||||
import list from './sources.json';
|
||||
import { readFileSync } from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
export const generateAll: ScrpitGeneratorFunction = function (name) {
|
||||
return list.map((source: LightNovelWPMetadata) => {
|
||||
@@ -11,15 +11,20 @@ export const generateAll: ScrpitGeneratorFunction = function (name) {
|
||||
filters = require(`./filters/${source.id}`);
|
||||
source.filters = filters.filters;
|
||||
} catch (e) {}
|
||||
console.log(`[${name}] Generating: ${source.id}${" ".repeat(20 - source.id.length)} ${source.filters ? "🔎with filters🔍" : "🚫no filters🚫"}`);
|
||||
console.log(
|
||||
`[${name}] Generating: ${source.id}${' '.repeat(20 - source.id.length)} ${source.filters ? '🔎with filters🔍' : '🚫no filters🚫'}`,
|
||||
);
|
||||
return generator(source);
|
||||
});
|
||||
};
|
||||
|
||||
const generator = function generator(source: LightNovelWPMetadata) {
|
||||
const LightNovelWPTemplate = readFileSync(path.join(__dirname, "template.ts"),{
|
||||
encoding: "utf-8",
|
||||
});
|
||||
const LightNovelWPTemplate = readFileSync(
|
||||
path.join(__dirname, 'template.ts'),
|
||||
{
|
||||
encoding: 'utf-8',
|
||||
},
|
||||
);
|
||||
|
||||
const pluginScript = `
|
||||
${LightNovelWPTemplate}
|
||||
@@ -28,7 +33,7 @@ export default plugin;
|
||||
`.trim();
|
||||
|
||||
return {
|
||||
lang: source.options?.lang || "English",
|
||||
lang: source.options?.lang || 'English',
|
||||
filename: source.sourceName,
|
||||
pluginScript,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user