@cenk1cenk2/md-printer 1.0.2 → 2.1.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.
@@ -3,13 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const boilerplate_oclif_1 = require("@cenk1cenk2/boilerplate-oclif");
7
6
  const command_1 = require("@oclif/command");
8
- const constants_1 = require("../constants");
9
7
  const fs_extra_1 = __importDefault(require("fs-extra"));
10
8
  const md_to_pdf_1 = __importDefault(require("md-to-pdf"));
11
9
  const path_1 = require("path");
12
10
  const posix_1 = require("path/posix");
11
+ const boilerplate_oclif_1 = require("@cenk1cenk2/boilerplate-oclif");
12
+ const constants_1 = require("../constants");
13
13
  class MDPrinter extends boilerplate_oclif_1.BaseCommand {
14
14
  async run() {
15
15
  const { args, flags } = this.parse(MDPrinter);
@@ -32,7 +32,7 @@ class MDPrinter extends boilerplate_oclif_1.BaseCommand {
32
32
  {
33
33
  task: async (ctx) => {
34
34
  this.logger.debug('Loading template: %s', flags.template);
35
- const templates = (0, path_1.join)(this.config.root, constants_1.TEMPLATE_DIRECTORY, flags.template);
35
+ 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);
36
36
  await Promise.all(Object.values(constants_1.TemplateFiles).map(async (file) => {
37
37
  const current = (0, path_1.join)(templates, file);
38
38
  if (!fs_extra_1.default.existsSync(current)) {
@@ -81,7 +81,6 @@ class MDPrinter extends boilerplate_oclif_1.BaseCommand {
81
81
  exports.default = MDPrinter;
82
82
  MDPrinter.description = 'Generates a PDF from the given markdown file with the selected HTML template.';
83
83
  MDPrinter.flags = {
84
- help: command_1.flags.help({ char: 'h' }),
85
84
  template: command_1.flags.string({
86
85
  char: 't',
87
86
  default: 'default',
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const boilerplate_oclif_1 = require("@cenk1cenk2/boilerplate-oclif");
4
3
  const logo_template_1 = require("../templates/logo.template");
4
+ const boilerplate_oclif_1 = require("@cenk1cenk2/boilerplate-oclif");
5
5
  exports.default = (0, boilerplate_oclif_1.generateInitHook)({ logo: logo_template_1.logo });
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@cenk1cenk2/md-printer",
3
- "version": "1.0.2",
3
+ "version": "2.1.0",
4
4
  "description": "A markdown printer.",
5
5
  "main": "dist/index.js",
6
- "repository": "https://github.com/cenk1cenk2/md-printer",
6
+ "repository": "git@gitlab.kilic.dev:utils/md-printer.git",
7
7
  "author": "Cenk Kilic",
8
8
  "license": "MIT",
9
9
  "bin": {
@@ -58,46 +58,46 @@
58
58
  }
59
59
  },
60
60
  "engines": {
61
- "node": ">=12.0.0"
61
+ "node": ">=16.0.0"
62
62
  },
63
63
  "keywords": [
64
64
  "oclif",
65
65
  "cenk1cenk2"
66
66
  ],
67
67
  "dependencies": {
68
- "@cenk1cenk2/boilerplate-oclif": "^1.10.5",
69
- "@oclif/command": "^1.8.0",
70
- "@oclif/config": "^1.17.0",
68
+ "@cenk1cenk2/boilerplate-oclif": "^1.10.6",
69
+ "@oclif/command": "^1.8.16",
70
+ "@oclif/config": "^1.18.3",
71
71
  "@oclif/errors": "^1.3.5",
72
- "config": "^3.3.6",
72
+ "config": "^3.3.7",
73
73
  "enquirer": "^2.3.6",
74
74
  "execa": "^5.1.1",
75
- "fs-extra": "^10.0.0",
75
+ "fs-extra": "^10.1.0",
76
76
  "globby": "^11.0.4",
77
- "listr2": "^3.13.3",
78
- "md-to-pdf": "^5.0.0",
77
+ "listr2": "^4.0.5",
78
+ "md-to-pdf": "^5.1.0",
79
79
  "tslib": "^2.3.1",
80
- "yaml": "^1.10.2"
80
+ "yaml": "^2.0.1"
81
81
  },
82
82
  "devDependencies": {
83
- "@cenk1cenk2/cz-cc": "^1.4.10",
84
- "@cenk1cenk2/eslint-config": "^1.0.8",
85
- "@oclif/dev-cli": "^1.26.0",
86
- "@types/config": "^0.0.40",
83
+ "@cenk1cenk2/cz-cc": "^1.5.3",
84
+ "@cenk1cenk2/eslint-config": "^2.5.8",
85
+ "@oclif/dev-cli": "^1.26.10",
86
+ "@types/config": "^0.0.41",
87
87
  "@types/fs-extra": "^9.0.13",
88
- "@types/jest": "^27.0.2",
89
- "@types/node": "^16.11.6",
90
- "eslint": "^8.2.0",
88
+ "@types/jest": "^27.4.1",
89
+ "@types/node": "^17.0.25",
90
+ "eslint": "^8.13.0",
91
91
  "lint-staged": "^11",
92
- "prettier": "^2.4.1",
92
+ "prettier": "^2.6.2",
93
93
  "simple-git-hooks": "^2.7.0",
94
- "source-map-support": "^0.5.20",
95
- "ts-jest": "^27.0.7",
96
- "ts-node": "^10.4.0",
97
- "tsc-watch": "^4.5.0",
98
- "tsconfig-paths": "^3.11.0",
94
+ "source-map-support": "^0.5.21",
95
+ "ts-jest": "^27.1.4",
96
+ "ts-node": "^10.7.0",
97
+ "tsc-watch": "^5.0.3",
98
+ "tsconfig-paths": "^3.14.1",
99
99
  "tsconfig-replace-paths": "^0.0.11",
100
- "typescript": "^4.4.4"
100
+ "typescript": "^4.6.3"
101
101
  },
102
102
  "config": {
103
103
  "commitizen": {
package/CHANGELOG.md DELETED
@@ -1,18 +0,0 @@
1
- ## [1.0.2](https://github.com/cenk1cenk2/md-printer/compare/v1.0.1...v1.0.2) (2021-11-14)
2
-
3
- ### Bug Fixes
4
-
5
- - remove extension in default name ([7bb0f49](https://github.com/cenk1cenk2/md-printer/commit/7bb0f4945c1242cdc7804361dd6c5b8afca511e2))
6
-
7
- ## [1.0.1](https://github.com/cenk1cenk2/md-printer/compare/v1.0.0...v1.0.1) (2021-11-14)
8
-
9
- ### Bug Fixes
10
-
11
- - add fallback to file name ([6a5d110](https://github.com/cenk1cenk2/md-printer/commit/6a5d1109d76706c00536cfb83002184e55209f77))
12
-
13
- # 1.0.0 (2021-11-14)
14
-
15
- ### Bug Fixes
16
-
17
- - initial commit ([f2f5d32](https://github.com/cenk1cenk2/md-printer/commit/f2f5d32a411edfb2b69417170deb5446653ac6d8))
18
- - rollback old lint-staged ver ([ff7991c](https://github.com/cenk1cenk2/md-printer/commit/ff7991c1624aa9459be09fabae51277b3ead2efb))