node-library-preset/src/index.ts

39 lines
966 B
TypeScript
Raw Normal View History

2023-06-25 02:00:40 +00:00
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import type { PresetAsset } from "presetter-types";
const DIR = dirname(fileURLToPath(import.meta.url));
// paths to the template directory
const TEMPLATES = resolve(DIR, "..", "templates");
export const DEFAULT_VARIABLE = {
source: "src",
};
/**
* get the list of templates provided by this preset
* @returns list of preset templates
*/
export default async function (): Promise<PresetAsset> {
return {
extends: ["presetter-preset-strict"],
template: {
".github/workflows/ci.yml": resolve(TEMPLATES, "ci.yml.raw"),
2023-06-25 08:59:59 +00:00
".releaserc.json": resolve(TEMPLATES, ".releaserc.json"),
2023-06-25 02:00:40 +00:00
},
2023-06-25 08:28:29 +00:00
noSymlinks: [".github/workflows/ci.yml"],
2023-06-25 02:00:40 +00:00
variable: DEFAULT_VARIABLE,
supplementaryConfig: {
prettier: {
singleQuote: false,
},
2023-06-25 08:53:56 +00:00
tsconfig: {
compilerOptions: {
lib: ["ES2021"],
},
},
2023-06-25 02:00:40 +00:00
},
};
}