2023-06-25 21:08:35 +00:00
|
|
|
import { resolve } from "node:path";
|
2023-06-25 02:00:40 +00:00
|
|
|
|
|
|
|
import type { PresetAsset } from "presetter-types";
|
|
|
|
|
|
|
|
// paths to the template directory
|
|
|
|
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> {
|
2023-06-25 21:11:52 +00:00
|
|
|
let DIR: string;
|
|
|
|
|
|
|
|
if (typeof __dirname === "undefined") {
|
|
|
|
DIR = (await import("./path.js")).default();
|
|
|
|
} else {
|
|
|
|
DIR = __dirname;
|
|
|
|
}
|
|
|
|
|
|
|
|
const TEMPLATES = resolve(DIR, "..", "templates");
|
|
|
|
|
2023-06-25 02:00:40 +00:00
|
|
|
return {
|
|
|
|
extends: ["presetter-preset-strict"],
|
|
|
|
template: {
|
2023-06-25 09:12:57 +00:00
|
|
|
".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 09:24:58 +00:00
|
|
|
gitignore: [".releaserc.json"],
|
2023-06-25 08:53:56 +00:00
|
|
|
tsconfig: {
|
|
|
|
compilerOptions: {
|
2023-06-25 09:19:23 +00:00
|
|
|
lib: ["ES2021", "dom"],
|
2023-06-25 08:53:56 +00:00
|
|
|
},
|
|
|
|
},
|
2023-06-25 02:00:40 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|