juisy 2.0.0-beta.8 → 2.0.0-beta.9

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.
package/dist/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * juisy v2.0.0-beta.8
2
+ * juisy v2.0.0-beta.9
3
3
  * Copyright © 2022-Present Hervé Perchec
4
4
  */
5
5
 
@@ -174,7 +174,7 @@ const proxify = (target) => {
174
174
  }
175
175
  return obj[prop];
176
176
  }
177
- return undefined;
177
+ return void 0;
178
178
  }
179
179
  });
180
180
  for (const property in target) {
@@ -412,7 +412,7 @@ class OutputUtils {
412
412
  static formatOutputMessage(msg, options = {}) {
413
413
  let formatted = `${msg}`;
414
414
  if (options.indentChar) {
415
- if (options.indent === undefined) {
415
+ if (options.indent === void 0) {
416
416
  options.indent = 1;
417
417
  }
418
418
  } else {
@@ -467,7 +467,7 @@ class OutputUtils {
467
467
  */
468
468
  static error(msg, err) {
469
469
  OutputUtils.log(OutputUtils.$style.red(`⨉ ERROR: ${msg}`));
470
- if (err !== undefined) {
470
+ if (err !== void 0) {
471
471
  OutputUtils.log();
472
472
  throw err;
473
473
  }
@@ -483,7 +483,7 @@ class OutputUtils {
483
483
  */
484
484
  static step(msg, options = {}) {
485
485
  OutputUtils.stepsCache.index++;
486
- if (options.index === undefined) {
486
+ if (options.index === void 0) {
487
487
  options.index = OutputUtils.stepsCache.index;
488
488
  }
489
489
  OutputUtils.log(`${options.index !== null ? options.index + " - " : ""}${msg}`, { indentChar: "● " });
@@ -1399,7 +1399,7 @@ const release = new Command({
1399
1399
  if (argv["dry-run"]) {
1400
1400
  releaseItCmdArgs.push("--dry-run");
1401
1401
  }
1402
- if (argv.increment !== undefined) {
1402
+ if (argv.increment !== void 0) {
1403
1403
  if (argv.increment === false) {
1404
1404
  releaseItCmdArgs.push("--no-increment");
1405
1405
  } else {
@@ -1613,13 +1613,13 @@ async function extractUsage(factory, recursive = false, args = [""], locale = "e
1613
1613
  const innerYargs = factory([""]);
1614
1614
  innerYargs.locale(locale);
1615
1615
  const doclet = {
1616
- command: undefined,
1617
- args: undefined,
1618
- aliases: undefined,
1616
+ command: void 0,
1617
+ args: void 0,
1618
+ aliases: void 0,
1619
1619
  deprecated: false,
1620
- extractedUsage: undefined,
1621
- rawUsage: undefined,
1622
- children: recursive ? {} : undefined
1620
+ extractedUsage: void 0,
1621
+ rawUsage: void 0,
1622
+ children: recursive ? {} : void 0
1623
1623
  };
1624
1624
  const parseCallback = function(err, argv, output) {
1625
1625
  if (err)
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * juisy v2.0.0-beta.8
2
+ * juisy v2.0.0-beta.9
3
3
  * Copyright © 2022-Present Hervé Perchec
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * juisy v2.0.0-beta.8
2
+ * juisy v2.0.0-beta.9
3
3
  * Copyright © 2022-Present Hervé Perchec
4
4
  */
5
5
 
@@ -28,7 +28,7 @@ class Templater {
28
28
  this.methodsMap.compile = async (template) => {
29
29
  return handlebars.compile(template, options.engineOptions);
30
30
  };
31
- this.methodsMap.render = async (template, data = undefined, opts = undefined) => {
31
+ this.methodsMap.render = async (template, data = void 0, opts = void 0) => {
32
32
  return this.methodsMap.compile(template).template(data);
33
33
  };
34
34
  break;
@@ -37,7 +37,7 @@ class Templater {
37
37
  this.methodsMap.compile = async (template) => {
38
38
  return ejs.compile(template, options.engineOptions);
39
39
  };
40
- this.methodsMap.render = async (template, data = undefined, opts) => {
40
+ this.methodsMap.render = async (template, data = void 0, opts) => {
41
41
  return ejs.render(template, data, {
42
42
  ...options.engineOptions,
43
43
  ...opts || {}
@@ -66,7 +66,7 @@ class Templater {
66
66
  /**
67
67
  * Renders a template with the given context.
68
68
  */
69
- async render(template, data = undefined, options = undefined) {
69
+ async render(template, data = void 0, options = void 0) {
70
70
  const mergedData = { ...this.defaultData, ...data || {} };
71
71
  return await this.methodsMap.render(template, mergedData, options);
72
72
  }
@@ -99,8 +99,8 @@ class MarkdownTemplater extends Templater {
99
99
  use: [
100
100
  ...options.use || []
101
101
  ],
102
- toc: options.toc === true ? defaultRemarkTocOptions : options.toc !== undefined ? options.toc : defaultRemarkTocOptions,
103
- frontmatter: options.frontmatter === true ? defaultRemarkFrontmatterOptions : options.frontmatter !== undefined ? options.frontmatter : defaultRemarkFrontmatterOptions
102
+ toc: options.toc === true ? defaultRemarkTocOptions : options.toc !== void 0 ? options.toc : defaultRemarkTocOptions,
103
+ frontmatter: options.frontmatter === true ? defaultRemarkFrontmatterOptions : options.frontmatter !== void 0 ? options.frontmatter : defaultRemarkFrontmatterOptions
104
104
  };
105
105
  }
106
106
  initProcessor() {
@@ -116,7 +116,7 @@ class MarkdownTemplater extends Templater {
116
116
  /**
117
117
  * Renders a template with the given context.
118
118
  */
119
- async render(template, data = undefined, options = undefined) {
119
+ async render(template, data = void 0, options = void 0) {
120
120
  const content = await super.render(template, data, options);
121
121
  return (await this.processor.process(content)).toString();
122
122
  }
@@ -229,9 +229,9 @@ class ReadmeTemplater {
229
229
  } else {
230
230
  result.ejsOptions = ReadmeTemplater.defaultConfig.ejsOptions;
231
231
  }
232
- result.appendAutoGenMessage = customConfig.appendAutoGenMessage !== undefined ? customConfig.appendAutoGenMessage : ReadmeTemplater.defaultConfig.appendAutoGenMessage;
233
- result.autoToc = customConfig.autoToc !== undefined ? customConfig.autoToc : ReadmeTemplater.defaultConfig.autoToc;
234
- result.slugify = customConfig.slugify !== undefined ? customConfig.slugify : ReadmeTemplater.defaultConfig.slugify;
232
+ result.appendAutoGenMessage = customConfig.appendAutoGenMessage !== void 0 ? customConfig.appendAutoGenMessage : ReadmeTemplater.defaultConfig.appendAutoGenMessage;
233
+ result.autoToc = customConfig.autoToc !== void 0 ? customConfig.autoToc : ReadmeTemplater.defaultConfig.autoToc;
234
+ result.slugify = customConfig.slugify !== void 0 ? customConfig.slugify : ReadmeTemplater.defaultConfig.slugify;
235
235
  return result;
236
236
  }
237
237
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juisy",
3
- "version": "2.0.0-beta.8",
3
+ "version": "2.0.0-beta.9",
4
4
  "description": "Make your JavaScript (and/or TypeScript) project juicy!",
5
5
  "type": "module",
6
6
  "files": [
@@ -88,6 +88,7 @@
88
88
  "@commitlint/cli": "^19.6.1",
89
89
  "@commitlint/config-conventional": "^19.6.0",
90
90
  "@github/markdownlint-github": "^0.7.0",
91
+ "@release-it/bumper": "6.0.1",
91
92
  "@release-it/conventional-changelog": "^9.0.4",
92
93
  "@stylistic/eslint-plugin": "^2",
93
94
  "@typescript-eslint/eslint-plugin": "^8",
@@ -106,6 +107,12 @@
106
107
  "@github/markdownlint-github": {
107
108
  "optional": true
108
109
  },
110
+ "@release-it/bumper": {
111
+ "optional": true
112
+ },
113
+ "@release-it/conventional-changelog": {
114
+ "optional": true
115
+ },
109
116
  "markdownlint-cli2-formatter-pretty": {
110
117
  "optional": true
111
118
  }
@@ -1,42 +0,0 @@
1
- /** @type {import('#juisy/cli').Command} */
2
- export default new CLI.Command({
3
- command: 'lint',
4
- describe: 'Lint markdown with markdownlint',
5
- builder: function (cli) {
6
- cli.option('c', {
7
- alias: 'config',
8
- type: 'string',
9
- describe: 'Path to custom markdownlint config file (relative to root folder)',
10
- requiresArg: true
11
- })
12
- cli.option('f', {
13
- alias: 'fix',
14
- type: 'boolean',
15
- describe: 'Auto fix by passing --fix option to markdownlint-cli2',
16
- default: false
17
- })
18
- return cli
19
- },
20
- async handler (argv) {
21
- const { abort, run } = CLI.InterfaceUtils
22
- const configPath = argv.config || './docs/.markdownlint-cli2.cjs' // default relative to root folder
23
-
24
- /**
25
- * Call markdownlint command
26
- */
27
- try {
28
- await run(
29
- 'npx',
30
- [
31
- 'markdownlint-cli2',
32
- '--config',
33
- configPath,
34
- ...(argv.fix ? [ '--fix' ] : [])
35
- ],
36
- { stdio: 'inherit' }
37
- )
38
- } catch (error) {
39
- abort(error.exitCode)
40
- }
41
- }
42
- })