node-library-preset/lib/index.mjs

35 lines
2.3 KiB
JavaScript

import { resolve } from "node:path";
export const DEFAULT_VARIABLE = {
source: "src",
};
export default async function () {
let DIR;
if (typeof `${process.platform === 'win32' ? '' : '/'}${/file:\/{2,3}(.+)\/[^/]/.exec(import.meta.url)[1]}` === "undefined") {
DIR = (await import("./path.mjs")).default();
}
else {
DIR = `${process.platform === 'win32' ? '' : '/'}${/file:\/{2,3}(.+)\/[^/]/.exec(import.meta.url)[1]}`;
}
const TEMPLATES = resolve(DIR, "..", "templates");
return {
extends: ["presetter-preset-strict"],
template: {
".github/workflows/ci.yml": resolve(TEMPLATES, "ci.yml.raw"),
".releaserc.json": resolve(TEMPLATES, ".releaserc.json"),
},
noSymlinks: [".github/workflows/ci.yml"],
variable: DEFAULT_VARIABLE,
supplementaryConfig: {
prettier: {
singleQuote: false,
},
gitignore: [".releaserc.json"],
tsconfig: {
compilerOptions: {
lib: ["ES2021", "dom"],
},
},
},
};
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLFdBQVcsQ0FBQztBQUtwQyxNQUFNLENBQUMsTUFBTSxnQkFBZ0IsR0FBRztJQUM5QixNQUFNLEVBQUUsS0FBSztDQUNkLENBQUM7QUFNRixNQUFNLENBQUMsT0FBTyxDQUFDLEtBQUs7SUFDbEIsSUFBSSxHQUFXLENBQUM7SUFFaEIsSUFBSSxPQUFPLFNBQVMsS0FBSyxXQUFXLEVBQUU7UUFDcEMsR0FBRyxHQUFHLENBQUMsTUFBTSxNQUFNLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQyxPQUFPLEVBQUUsQ0FBQztLQUM3QztTQUFNO1FBQ0wsR0FBRyxHQUFHLFNBQVMsQ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