@cenk1cenk2/md-printer 2.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,105 +1,193 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
4
10
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const command_1 = require("@oclif/command");
7
- const fs_extra_1 = __importDefault(require("fs-extra"));
8
- const md_to_pdf_1 = __importDefault(require("md-to-pdf"));
9
- const path_1 = require("path");
10
- const boilerplate_oclif_1 = require("@cenk1cenk2/boilerplate-oclif");
11
- const constants_1 = require("../constants");
12
- class MDPrinter extends boilerplate_oclif_1.BaseCommand {
13
- async run() {
14
- const { args, flags } = this.parse(MDPrinter);
15
- this.tasks.options = { rendererSilent: true };
16
- this.tasks.add([
17
- {
18
- task: async (ctx) => {
19
- const file = (0, path_1.join)(process.cwd(), args.file);
20
- if (!constants_1.INPUT_FILE_ACCEPTED_TYPES.includes((0, path_1.extname)(file))) {
21
- throw new Error(`Input file should be ending with the extension: ${constants_1.INPUT_FILE_ACCEPTED_TYPES.join(', ')} -> current: ${(0, path_1.extname)(file)}`);
22
- }
23
- if (!fs_extra_1.default.existsSync(file)) {
24
- throw new Error(`File does not exists: ${file}`);
25
- }
26
- this.logger.debug('Loading file: %s', file);
27
- ctx.file = file;
28
- ctx.content = await fs_extra_1.default.readFile(file, 'utf-8');
29
- }
30
- },
31
- {
32
- task: async (ctx) => {
33
- this.logger.debug('Loading template: %s', flags.template);
34
- const templates = new RegExp(/\.\.?\//).test(flags.template) ? (0, path_1.join)(process.cwd(), flags.template) : (0, path_1.join)(this.config.root, constants_1.TEMPLATE_DIRECTORY, flags.template);
35
- await Promise.all(Object.values(constants_1.TemplateFiles).map(async (file) => {
36
- const current = (0, path_1.join)(templates, file);
37
- if (!fs_extra_1.default.existsSync(current)) {
38
- throw new Error(`Template file does not exists: ${current}`);
39
- }
40
- }));
41
- ctx.options = (0, boilerplate_oclif_1.deepMergeWithArrayOverwrite)(await fs_extra_1.default.readJSON((0, path_1.join)(templates, constants_1.TemplateFiles.SETTINGS)), {
42
- css: await fs_extra_1.default.readFile((0, path_1.join)(templates, constants_1.TemplateFiles.CSS), 'utf-8'),
43
- pdf_options: {
44
- headerTemplate: await fs_extra_1.default.readFile((0, path_1.join)(templates, constants_1.TemplateFiles.HEADER), 'utf-8'),
45
- footerTemplate: await fs_extra_1.default.readFile((0, path_1.join)(templates, constants_1.TemplateFiles.FOOTER), 'utf-8')
46
- },
47
- document_title: flags.title ?? args.file
48
- });
49
- }
50
- },
51
- {
52
- task: async (ctx) => {
53
- const pdf = await (0, md_to_pdf_1.default)({ content: ctx.content }, ctx.options);
54
- let output;
55
- if (args.output) {
56
- output = args.output;
57
- }
58
- else if (pdf.filename) {
59
- output = pdf.filename;
60
- }
61
- else {
62
- output = `${(0, path_1.basename)(args.file, (0, path_1.extname)(args.file))}.pdf`;
63
- }
64
- await fs_extra_1.default.mkdirp((0, path_1.dirname)(output));
65
- if (!output) {
66
- throw new Error('Output should either be defined with the variable or front-matter.');
67
- }
68
- else if (!constants_1.OUTPUT_FILE_ACCEPTED_TYPES.includes((0, path_1.extname)(output))) {
69
- throw new Error(`Output file should be ending with the extension: ${constants_1.OUTPUT_FILE_ACCEPTED_TYPES.join(', ')} -> current: ${(0, path_1.extname)(output)}`);
70
- }
71
- this.logger.debug('Output file will be: %s', output);
72
- if (pdf) {
73
- this.logger.debug('Writing file to output: %s', output);
74
- await fs_extra_1.default.writeFile(output, pdf.content);
75
- }
76
- }
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/commands/index.ts
23
+ var commands_exports = {};
24
+ __export(commands_exports, {
25
+ default: () => MDPrinter
26
+ });
27
+ module.exports = __toCommonJS(commands_exports);
28
+ var import_command = require("@oclif/command");
29
+ var import_chokidar = require("chokidar");
30
+ var import_fs_extra = __toESM(require("fs-extra"));
31
+ var import_gray_matter = require("gray-matter");
32
+ var import_md_to_pdf = __toESM(require("md-to-pdf"));
33
+ var import_nunjucks = __toESM(require("nunjucks"));
34
+ var import_path = require("path");
35
+ var import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
36
+
37
+ // src/constants/template.constants.ts
38
+ var RequiredTemplateFiles = ["settings.json" /* SETTINGS */];
39
+ var TEMPLATE_DIRECTORY = "templates";
40
+
41
+ // src/constants/file.constants.ts
42
+ var INPUT_FILE_ACCEPTED_TYPES = [".md"];
43
+ var OUTPUT_FILE_ACCEPTED_TYPES = [".pdf"];
44
+
45
+ // src/commands/index.ts
46
+ var _MDPrinter = class extends import_boilerplate_oclif.BaseCommand {
47
+ constructor() {
48
+ super(...arguments);
49
+ this.nunjucks = import_nunjucks.default.configure({
50
+ autoescape: false,
51
+ throwOnUndefined: true,
52
+ trimBlocks: true,
53
+ lstripBlocks: false
54
+ });
55
+ }
56
+ async run() {
57
+ const { args, flags: flags2 } = this.parse(_MDPrinter);
58
+ this.tasks.options = { rendererSilent: true };
59
+ const tasks = this.tasks.newListr([
60
+ {
61
+ task: async (ctx2) => {
62
+ const file = (0, import_path.join)(process.cwd(), args.file);
63
+ if (!INPUT_FILE_ACCEPTED_TYPES.includes((0, import_path.extname)(file))) {
64
+ throw new Error(`Input file should be ending with the extension: ${INPUT_FILE_ACCEPTED_TYPES.join(", ")} -> current: ${(0, import_path.extname)(file)}`);
65
+ }
66
+ if (!import_fs_extra.default.existsSync(file)) {
67
+ throw new Error(`File does not exists: ${file}`);
68
+ }
69
+ this.logger.debug("Loading file: %s", file);
70
+ ctx2.file = file;
71
+ ctx2.content = await import_fs_extra.default.readFile(file, "utf-8");
72
+ ctx2.graymatter = (0, import_gray_matter.read)(ctx2.file);
73
+ }
74
+ },
75
+ {
76
+ task: async (ctx2) => {
77
+ const template = ctx2.graymatter?.data?.template ?? flags2.template;
78
+ this.logger.debug("Loading template: %s", template);
79
+ ctx2.templates = new RegExp(/\.\.?\//).test(template) ? (0, import_path.join)(process.cwd(), template) : (0, import_path.join)(this.config.root, TEMPLATE_DIRECTORY, template);
80
+ await Promise.all(RequiredTemplateFiles.map(async (file) => {
81
+ const current = (0, import_path.join)(ctx2.templates, file);
82
+ if (!import_fs_extra.default.existsSync(current)) {
83
+ throw new Error(`Template does not exists: ${current}`);
77
84
  }
78
- ]);
85
+ }));
86
+ const paths = {
87
+ ["settings.json" /* SETTINGS */]: (0, import_path.join)(ctx2.templates, "settings.json" /* SETTINGS */),
88
+ ["main.css" /* CSS */]: (0, import_path.join)(ctx2.templates, "main.css" /* CSS */),
89
+ ["header.html" /* HEADER */]: (0, import_path.join)(ctx2.templates, "header.html" /* HEADER */),
90
+ ["footer.html" /* FOOTER */]: (0, import_path.join)(ctx2.templates, "footer.html" /* FOOTER */),
91
+ ["template.html.j2" /* TEMPLATE */]: (0, import_path.join)(ctx2.templates, "template.html.j2" /* TEMPLATE */)
92
+ };
93
+ ctx2.options = (0, import_boilerplate_oclif.deepMergeWithArrayOverwrite)(await import_fs_extra.default.readJSON(paths["settings.json" /* SETTINGS */]), {
94
+ pdf_options: {},
95
+ dest: args?.output ?? ctx2.graymatter.data?.dest ?? `${(0, import_path.basename)(args.file, (0, import_path.extname)(args.file))}.pdf`,
96
+ document_title: ctx2.graymatter.data?.document_title ?? flags2.title ?? args.file
97
+ });
98
+ if (import_fs_extra.default.existsSync(paths["main.css" /* CSS */])) {
99
+ this.logger.debug("CSS exists for template.");
100
+ ctx2.options.css = await import_fs_extra.default.readFile(paths["main.css" /* CSS */], "utf-8");
101
+ }
102
+ if (import_fs_extra.default.existsSync(paths["header.html" /* HEADER */])) {
103
+ this.logger.debug("Header exists for template.");
104
+ ctx2.options.pdf_options.headerTemplate = await import_fs_extra.default.readFile(paths["header.html" /* HEADER */], "utf-8");
105
+ }
106
+ if (import_fs_extra.default.existsSync(paths["footer.html" /* FOOTER */])) {
107
+ this.logger.debug("Footer exists for template.");
108
+ ctx2.options.pdf_options.footerTemplate = await import_fs_extra.default.readFile(paths["footer.html" /* FOOTER */], "utf-8");
109
+ }
110
+ if (import_fs_extra.default.existsSync(paths["template.html.j2" /* TEMPLATE */])) {
111
+ this.logger.debug("Design template exists for template.");
112
+ ctx2.template = await import_fs_extra.default.readFile(paths["template.html.j2" /* TEMPLATE */], "utf-8");
113
+ ctx2.content = ctx2.graymatter.content;
114
+ this.logger.debug("Frontmatter: %o", ctx2.graymatter.data);
115
+ }
116
+ }
117
+ },
118
+ {
119
+ task: async (ctx2) => {
120
+ if (flags2.dev) {
121
+ ctx2.options.devtools = true;
122
+ }
123
+ return this.runMd2Pdf(ctx2);
124
+ }
125
+ }
126
+ ]);
127
+ const ctx = await tasks.run();
128
+ if (flags2.watch) {
129
+ this.logger.info("Running in watch mode.");
130
+ (0, import_chokidar.watch)([args.file, (0, import_path.join)(ctx.templates, "**/*")]).on("change", async () => {
131
+ await tasks.run();
132
+ this.logger.info("Waiting for the next change.");
133
+ });
134
+ }
135
+ }
136
+ async runMd2Pdf(ctx) {
137
+ let pdf;
138
+ if (ctx.template) {
139
+ this.logger.debug("Rendering as template.");
140
+ pdf = await (0, import_md_to_pdf.default)({ content: this.nunjucks.renderString(ctx.template, { ...ctx.graymatter?.data ?? {}, content: ctx.content }) }, ctx.options);
141
+ } else {
142
+ this.logger.debug("Rendering as plain file.");
143
+ pdf = await (0, import_md_to_pdf.default)({ content: ctx.content }, ctx.options);
144
+ }
145
+ const output = pdf.filename;
146
+ await import_fs_extra.default.mkdirp((0, import_path.dirname)(output));
147
+ if (!output) {
148
+ throw new Error("Output should either be defined with the variable or front-matter.");
149
+ } else if (!OUTPUT_FILE_ACCEPTED_TYPES.includes((0, import_path.extname)(output))) {
150
+ throw new Error(`Output file should be ending with the extension: ${OUTPUT_FILE_ACCEPTED_TYPES.join(", ")} -> current: ${(0, import_path.extname)(output)}`);
79
151
  }
80
- }
81
- exports.default = MDPrinter;
82
- MDPrinter.description = 'Generates a PDF from the given markdown file with the selected HTML template.';
152
+ this.logger.debug("Output file will be: %s", output);
153
+ if (pdf) {
154
+ this.logger.info("Writing file to output: %s", output);
155
+ await import_fs_extra.default.writeFile(output, pdf.content);
156
+ }
157
+ }
158
+ };
159
+ var MDPrinter = _MDPrinter;
160
+ MDPrinter.description = "Generates a PDF from the given markdown file with the selected HTML template.";
83
161
  MDPrinter.flags = {
84
- template: command_1.flags.string({
85
- char: 't',
86
- default: 'default',
87
- description: 'HTML template for the generated PDF file.'
88
- }),
89
- title: command_1.flags.string({
90
- char: 'T',
91
- description: 'Overwrite document title.'
92
- })
162
+ template: import_command.flags.string({
163
+ char: "t",
164
+ default: "default",
165
+ description: "HTML template for the generated PDF file."
166
+ }),
167
+ title: import_command.flags.string({
168
+ char: "T",
169
+ description: "Overwrite document title."
170
+ }),
171
+ watch: import_command.flags.boolean({
172
+ char: "w",
173
+ description: "Watch the changes on the given file."
174
+ }),
175
+ dev: import_command.flags.boolean({
176
+ char: "d",
177
+ description: "Run with Chrome browser instead of publishing the file."
178
+ })
93
179
  };
94
180
  MDPrinter.args = [
95
- {
96
- name: 'file',
97
- description: 'Markdown file to be processed.',
98
- required: true
99
- },
100
- {
101
- name: 'output',
102
- description: 'Output file that will be generated. Overwrites the one define in front-matter.',
103
- required: false
104
- }
181
+ {
182
+ name: "file",
183
+ description: "Markdown file to be processed.",
184
+ required: true
185
+ },
186
+ {
187
+ name: "output",
188
+ description: "Output file that will be generated. Overwrites the one define in front-matter.",
189
+ required: false
190
+ }
105
191
  ];
192
+ // Annotate the CommonJS export names for ESM import in node:
193
+ 0 && (module.exports = {});
@@ -1,5 +1,32 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OUTPUT_FILE_ACCEPTED_TYPES = exports.INPUT_FILE_ACCEPTED_TYPES = void 0;
4
- exports.INPUT_FILE_ACCEPTED_TYPES = ['.md'];
5
- exports.OUTPUT_FILE_ACCEPTED_TYPES = ['.pdf'];
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/constants/file.constants.ts
20
+ var file_constants_exports = {};
21
+ __export(file_constants_exports, {
22
+ INPUT_FILE_ACCEPTED_TYPES: () => INPUT_FILE_ACCEPTED_TYPES,
23
+ OUTPUT_FILE_ACCEPTED_TYPES: () => OUTPUT_FILE_ACCEPTED_TYPES
24
+ });
25
+ module.exports = __toCommonJS(file_constants_exports);
26
+ var INPUT_FILE_ACCEPTED_TYPES = [".md"];
27
+ var OUTPUT_FILE_ACCEPTED_TYPES = [".pdf"];
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ INPUT_FILE_ACCEPTED_TYPES,
31
+ OUTPUT_FILE_ACCEPTED_TYPES
32
+ });
@@ -1,18 +1,52 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
15
8
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./template.constants"), exports);
18
- __exportStar(require("./file.constants"), exports);
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/constants/index.ts
20
+ var constants_exports = {};
21
+ __export(constants_exports, {
22
+ INPUT_FILE_ACCEPTED_TYPES: () => INPUT_FILE_ACCEPTED_TYPES,
23
+ OUTPUT_FILE_ACCEPTED_TYPES: () => OUTPUT_FILE_ACCEPTED_TYPES,
24
+ RequiredTemplateFiles: () => RequiredTemplateFiles,
25
+ TEMPLATE_DIRECTORY: () => TEMPLATE_DIRECTORY,
26
+ TemplateFiles: () => TemplateFiles
27
+ });
28
+ module.exports = __toCommonJS(constants_exports);
29
+
30
+ // src/constants/template.constants.ts
31
+ var TemplateFiles = /* @__PURE__ */ ((TemplateFiles2) => {
32
+ TemplateFiles2["FOOTER"] = "footer.html";
33
+ TemplateFiles2["HEADER"] = "header.html";
34
+ TemplateFiles2["TEMPLATE"] = "template.html.j2";
35
+ TemplateFiles2["CSS"] = "main.css";
36
+ TemplateFiles2["SETTINGS"] = "settings.json";
37
+ return TemplateFiles2;
38
+ })(TemplateFiles || {});
39
+ var RequiredTemplateFiles = ["settings.json" /* SETTINGS */];
40
+ var TEMPLATE_DIRECTORY = "templates";
41
+
42
+ // src/constants/file.constants.ts
43
+ var INPUT_FILE_ACCEPTED_TYPES = [".md"];
44
+ var OUTPUT_FILE_ACCEPTED_TYPES = [".pdf"];
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 && (module.exports = {
47
+ INPUT_FILE_ACCEPTED_TYPES,
48
+ OUTPUT_FILE_ACCEPTED_TYPES,
49
+ RequiredTemplateFiles,
50
+ TEMPLATE_DIRECTORY,
51
+ TemplateFiles
52
+ });
@@ -1,11 +1,42 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TEMPLATE_DIRECTORY = exports.TemplateFiles = void 0;
4
- var TemplateFiles;
5
- (function (TemplateFiles) {
6
- TemplateFiles["FOOTER"] = "footer.html";
7
- TemplateFiles["HEADER"] = "header.html";
8
- TemplateFiles["CSS"] = "main.css";
9
- TemplateFiles["SETTINGS"] = "settings.json";
10
- })(TemplateFiles = exports.TemplateFiles || (exports.TemplateFiles = {}));
11
- exports.TEMPLATE_DIRECTORY = 'templates';
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/constants/template.constants.ts
20
+ var template_constants_exports = {};
21
+ __export(template_constants_exports, {
22
+ RequiredTemplateFiles: () => RequiredTemplateFiles,
23
+ TEMPLATE_DIRECTORY: () => TEMPLATE_DIRECTORY,
24
+ TemplateFiles: () => TemplateFiles
25
+ });
26
+ module.exports = __toCommonJS(template_constants_exports);
27
+ var TemplateFiles = /* @__PURE__ */ ((TemplateFiles2) => {
28
+ TemplateFiles2["FOOTER"] = "footer.html";
29
+ TemplateFiles2["HEADER"] = "header.html";
30
+ TemplateFiles2["TEMPLATE"] = "template.html.j2";
31
+ TemplateFiles2["CSS"] = "main.css";
32
+ TemplateFiles2["SETTINGS"] = "settings.json";
33
+ return TemplateFiles2;
34
+ })(TemplateFiles || {});
35
+ var RequiredTemplateFiles = ["settings.json" /* SETTINGS */];
36
+ var TEMPLATE_DIRECTORY = "templates";
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ RequiredTemplateFiles,
40
+ TEMPLATE_DIRECTORY,
41
+ TemplateFiles
42
+ });
@@ -1,5 +1,35 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const logo_template_1 = require("../templates/logo.template");
4
- const boilerplate_oclif_1 = require("@cenk1cenk2/boilerplate-oclif");
5
- exports.default = (0, boilerplate_oclif_1.generateInitHook)({ logo: logo_template_1.logo });
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/hooks/init.hook.ts
20
+ var init_hook_exports = {};
21
+ __export(init_hook_exports, {
22
+ default: () => init_hook_default
23
+ });
24
+ module.exports = __toCommonJS(init_hook_exports);
25
+
26
+ // src/templates/logo.template.ts
27
+ function logo(version) {
28
+ return `md-printer v${version}`;
29
+ }
30
+
31
+ // src/hooks/init.hook.ts
32
+ var import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
33
+ var init_hook_default = (0, import_boilerplate_oclif.generateInitHook)({ logo });
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {});
@@ -1,4 +1,28 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const boilerplate_oclif_1 = require("@cenk1cenk2/boilerplate-oclif");
4
- exports.default = boilerplate_oclif_1.notFoundHook;
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/hooks/not-found.hook.ts
20
+ var not_found_hook_exports = {};
21
+ __export(not_found_hook_exports, {
22
+ default: () => not_found_hook_default
23
+ });
24
+ module.exports = __toCommonJS(not_found_hook_exports);
25
+ var import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
26
+ var not_found_hook_default = import_boilerplate_oclif.notFoundHook;
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {});
@@ -1,4 +1,28 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const boilerplate_oclif_1 = require("@cenk1cenk2/boilerplate-oclif");
4
- exports.default = boilerplate_oclif_1.prerunHook;
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/hooks/prerun.hook.ts
20
+ var prerun_hook_exports = {};
21
+ __export(prerun_hook_exports, {
22
+ default: () => prerun_hook_default
23
+ });
24
+ module.exports = __toCommonJS(prerun_hook_exports);
25
+ var import_boilerplate_oclif = require("@cenk1cenk2/boilerplate-oclif");
26
+ var prerun_hook_default = import_boilerplate_oclif.prerunHook;
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {});
@@ -1,2 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
12
+ };
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/interfaces/commands/index.interface.ts
16
+ var index_interface_exports = {};
17
+ module.exports = __toCommonJS(index_interface_exports);
@@ -1,17 +1,17 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __copyProps = (to, from, except, desc) => {
6
+ if (from && typeof from === "object" || typeof from === "function") {
7
+ for (let key of __getOwnPropNames(from))
8
+ if (!__hasOwnProp.call(to, key) && key !== except)
9
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ }
11
+ return to;
15
12
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./index.interface"), exports);
13
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
+
15
+ // src/interfaces/commands/index.ts
16
+ var commands_exports = {};
17
+ module.exports = __toCommonJS(commands_exports);