docula 0.3.7 → 0.5.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.
Files changed (184) hide show
  1. package/README.md +108 -39
  2. package/bin/docula.mjs +8 -0
  3. package/dist/builder.d.ts +35 -0
  4. package/dist/builder.js +201 -0
  5. package/dist/builder.js.map +1 -0
  6. package/dist/console.d.ts +22 -0
  7. package/dist/console.js +120 -0
  8. package/dist/console.js.map +1 -0
  9. package/dist/docula.d.ts +22 -22
  10. package/dist/docula.js +119 -174
  11. package/dist/docula.js.map +1 -1
  12. package/dist/github.d.ts +22 -0
  13. package/dist/github.js +74 -0
  14. package/dist/github.js.map +1 -0
  15. package/dist/helpers.d.ts +7 -0
  16. package/dist/helpers.js +58 -0
  17. package/dist/helpers.js.map +1 -0
  18. package/dist/options.d.ts +12 -0
  19. package/dist/options.js +47 -0
  20. package/dist/options.js.map +1 -0
  21. package/init/docula.config.cjs +10 -0
  22. package/init/favicon.ico +0 -0
  23. package/init/logo.png +0 -0
  24. package/init/variables.css +30 -0
  25. package/package.json +57 -94
  26. package/{templates/default/assets/css/styles → template/css}/home.css +20 -18
  27. package/{init/_includes/assets/css/styles → template/css}/index.css +7 -0
  28. package/template/includes/footer.hbs +10 -0
  29. package/template/includes/header.hbs +17 -0
  30. package/template/includes/landing/content.hbs +63 -0
  31. package/template/includes/landing/hero.hbs +3 -0
  32. package/template/includes/scripts.hbs +4 -0
  33. package/template/index.hbs +16 -0
  34. package/template/releases.hbs +45 -0
  35. package/bin/docula.js +0 -7
  36. package/dist/config.d.ts +0 -21
  37. package/dist/config.d.ts.map +0 -1
  38. package/dist/config.js +0 -78
  39. package/dist/config.js.map +0 -1
  40. package/dist/docula-plugin.d.ts +0 -9
  41. package/dist/docula-plugin.d.ts.map +0 -1
  42. package/dist/docula-plugin.js +0 -2
  43. package/dist/docula-plugin.js.map +0 -1
  44. package/dist/docula.d.ts.map +0 -1
  45. package/dist/eleventy/filters.d.ts +0 -2
  46. package/dist/eleventy/filters.d.ts.map +0 -1
  47. package/dist/eleventy/filters.js +0 -10
  48. package/dist/eleventy/filters.js.map +0 -1
  49. package/dist/eleventy/global-data.d.ts +0 -3
  50. package/dist/eleventy/global-data.d.ts.map +0 -1
  51. package/dist/eleventy/global-data.js +0 -2
  52. package/dist/eleventy/global-data.js.map +0 -1
  53. package/dist/eleventy/shortcodes.d.ts +0 -4
  54. package/dist/eleventy/shortcodes.d.ts.map +0 -1
  55. package/dist/eleventy/shortcodes.js +0 -18
  56. package/dist/eleventy/shortcodes.js.map +0 -1
  57. package/dist/eleventy.d.ts +0 -24
  58. package/dist/eleventy.d.ts.map +0 -1
  59. package/dist/eleventy.js +0 -82
  60. package/dist/eleventy.js.map +0 -1
  61. package/dist/index.d.ts +0 -9
  62. package/dist/index.d.ts.map +0 -1
  63. package/dist/index.js +0 -67
  64. package/dist/index.js.map +0 -1
  65. package/dist/logger.d.ts +0 -4
  66. package/dist/logger.d.ts.map +0 -1
  67. package/dist/logger.js +0 -20
  68. package/dist/logger.js.map +0 -1
  69. package/dist/plugins/algolia.d.ts +0 -21
  70. package/dist/plugins/algolia.d.ts.map +0 -1
  71. package/dist/plugins/algolia.js +0 -54
  72. package/dist/plugins/algolia.js.map +0 -1
  73. package/dist/plugins/github.d.ts +0 -16
  74. package/dist/plugins/github.d.ts.map +0 -1
  75. package/dist/plugins/github.js +0 -68
  76. package/dist/plugins/github.js.map +0 -1
  77. package/dist/plugins/index.d.ts +0 -18
  78. package/dist/plugins/index.d.ts.map +0 -1
  79. package/dist/plugins/index.js +0 -16
  80. package/dist/plugins/index.js.map +0 -1
  81. package/dist/plugins/npm.d.ts +0 -14
  82. package/dist/plugins/npm.d.ts.map +0 -1
  83. package/dist/plugins/npm.js +0 -36
  84. package/dist/plugins/npm.js.map +0 -1
  85. package/dist/plugins/pagefind.d.ts +0 -10
  86. package/dist/plugins/pagefind.d.ts.map +0 -1
  87. package/dist/plugins/pagefind.js +0 -22
  88. package/dist/plugins/pagefind.js.map +0 -1
  89. package/dist/plugins/robots.d.ts +0 -14
  90. package/dist/plugins/robots.d.ts.map +0 -1
  91. package/dist/plugins/robots.js +0 -34
  92. package/dist/plugins/robots.js.map +0 -1
  93. package/dist/plugins/sitemap.d.ts +0 -11
  94. package/dist/plugins/sitemap.d.ts.map +0 -1
  95. package/dist/plugins/sitemap.js +0 -27
  96. package/dist/plugins/sitemap.js.map +0 -1
  97. package/dist/schemas.d.ts +0 -21
  98. package/dist/schemas.d.ts.map +0 -1
  99. package/dist/schemas.js +0 -25
  100. package/dist/schemas.js.map +0 -1
  101. package/dist/tools/__mocks__/inquirer-prompt.d.ts +0 -20
  102. package/dist/tools/__mocks__/inquirer-prompt.d.ts.map +0 -1
  103. package/dist/tools/__mocks__/inquirer-prompt.js +0 -19
  104. package/dist/tools/__mocks__/inquirer-prompt.js.map +0 -1
  105. package/dist/tools/__mocks__/path.d.ts +0 -5
  106. package/dist/tools/__mocks__/path.d.ts.map +0 -1
  107. package/dist/tools/__mocks__/path.js +0 -7
  108. package/dist/tools/__mocks__/path.js.map +0 -1
  109. package/dist/tools/inquirer-prompt.d.ts +0 -11
  110. package/dist/tools/inquirer-prompt.d.ts.map +0 -1
  111. package/dist/tools/inquirer-prompt.js +0 -139
  112. package/dist/tools/inquirer-prompt.js.map +0 -1
  113. package/dist/tools/path.d.ts +0 -4
  114. package/dist/tools/path.d.ts.map +0 -1
  115. package/dist/tools/path.js +0 -6
  116. package/dist/tools/path.js.map +0 -1
  117. package/dist/tools/tools.d.ts +0 -3
  118. package/dist/tools/tools.d.ts.map +0 -1
  119. package/dist/tools/tools.js +0 -10
  120. package/dist/tools/tools.js.map +0 -1
  121. package/dist/types/config.d.ts +0 -8
  122. package/dist/types/config.d.ts.map +0 -1
  123. package/dist/types/config.js +0 -2
  124. package/dist/types/config.js.map +0 -1
  125. package/init/_data/site.json +0 -5
  126. package/init/_includes/assets/css/styles/home.css +0 -305
  127. package/init/_includes/assets/css/styles/search/algolia.css +0 -125
  128. package/init/_includes/assets/css/styles/search/pagefind.css +0 -60
  129. package/init/_includes/assets/css/styles/variables.css +0 -30
  130. package/init/_includes/assets/images/docula-logo-horizontal.webp +0 -0
  131. package/init/_includes/assets/images/logo.svg +0 -10
  132. package/init/_includes/doc.njk +0 -22
  133. package/init/_includes/landing/landingHero.njk +0 -8
  134. package/init/_includes/landing/singlePage.njk +0 -24
  135. package/init/_includes/multipage/header.njk +0 -23
  136. package/init/_includes/multipage/homeHeader.njk +0 -20
  137. package/init/_includes/multipage/main.njk +0 -47
  138. package/init/_includes/multipage/scripts.njk +0 -47
  139. package/init/_includes/multipage/searchEngine.njk +0 -5
  140. package/init/_includes/multipage/searchModal.njk +0 -19
  141. package/init/_includes/multipage/sidebar.njk +0 -50
  142. package/init/_includes/search/algolia.njk +0 -98
  143. package/init/_includes/search/pagefind.njk +0 -66
  144. package/init/_includes/shared/footer.njk +0 -4
  145. package/init/_includes/shared/head.njk +0 -15
  146. package/init/_includes/shared/highlightScript.njk +0 -6
  147. package/init/_includes/shared/homeData.njk +0 -49
  148. package/init/api/Readme.md +0 -3
  149. package/init/docs/Readme.md +0 -83
  150. package/init/docs/docs.json +0 -13
  151. package/init/index.njk +0 -28
  152. package/init/releases.njk +0 -38
  153. package/init/search-index.md +0 -14
  154. package/init/versions.njk +0 -40
  155. package/templates/default/assets/css/highlight/highlight.min.js +0 -1433
  156. package/templates/default/assets/css/highlight/styles/base16/dracula.min.css +0 -7
  157. package/templates/default/assets/css/styles/index.css +0 -912
  158. package/templates/default/assets/css/styles/search/algolia.css +0 -125
  159. package/templates/default/assets/css/styles/search/pagefind.css +0 -60
  160. package/templates/default/assets/css/styles/variables.css +0 -30
  161. package/templates/default/assets/images/docula-logo-horizontal.webp +0 -0
  162. package/templates/default/assets/images/logo.svg +0 -10
  163. package/templates/default/doc.njk +0 -22
  164. package/templates/default/index.njk +0 -28
  165. package/templates/default/landing/landingHero.njk +0 -8
  166. package/templates/default/landing/singlePage.njk +0 -24
  167. package/templates/default/multipage/header.njk +0 -23
  168. package/templates/default/multipage/homeHeader.njk +0 -20
  169. package/templates/default/multipage/main.njk +0 -47
  170. package/templates/default/multipage/scripts.njk +0 -47
  171. package/templates/default/multipage/searchEngine.njk +0 -5
  172. package/templates/default/multipage/searchModal.njk +0 -19
  173. package/templates/default/multipage/sidebar.njk +0 -50
  174. package/templates/default/releases.njk +0 -38
  175. package/templates/default/search/algolia.njk +0 -98
  176. package/templates/default/search/pagefind.njk +0 -66
  177. package/templates/default/search-index.md +0 -14
  178. package/templates/default/shared/footer.njk +0 -4
  179. package/templates/default/shared/head.njk +0 -15
  180. package/templates/default/shared/highlightScript.njk +0 -6
  181. package/templates/default/shared/homeData.njk +0 -49
  182. package/templates/default/versions.njk +0 -40
  183. /package/{init/_includes/assets → template}/css/highlight/highlight.min.js +0 -0
  184. /package/{init/_includes/assets → template}/css/highlight/styles/base16/dracula.min.css +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"npm.js","sourceRoot":"","sources":["../../src/plugins/npm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAQ1B,MAAM,OAAO,SAAS;IACrB,MAAM,CAAC,MAAM,GAAW;QACvB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,YAAY,CAAC;QACxB,UAAU,EAAE;YACX,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;SAC5B;KACD,CAAC;IAEO,OAAO,GAAY;QAC3B,QAAQ,EAAE,OAAO;QACjB,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,EAAE;KACZ,CAAC;IAEF,OAAO,GAAY,QAAQ,CAAC;IAE5B,YAAY,MAAc;QACzB,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;QAC1C,MAAM,EAAC,UAAU,EAAC,GAAG,MAAM,CAAC,YAAY,CAAC,GAAgB,CAAC;QAC1D,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC9C,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACjE,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAChG,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,mBAAmB;QACxB,MAAM,GAAG,GAAG,oDAAoD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QAC1F,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC,IAAI,CAAC;IACpB,CAAC","sourcesContent":["import axios from 'axios';\nimport fs from 'fs-extra';\nimport type {DoculaPlugin, Options, Schema, Runtime} from '../docula-plugin.js';\nimport type {Config} from '../config.js';\n\nexport type NpmConfig = {\n\tmoduleName: string;\n};\n\nexport class NpmPlugin implements DoculaPlugin {\n\tstatic schema: Schema = {\n\t\ttype: 'object',\n\t\trequired: ['moduleName'],\n\t\tproperties: {\n\t\t\tmoduleName: {type: 'string'},\n\t\t},\n\t};\n\n\treadonly options: Options = {\n\t\tdataPath: '_data',\n\t\tmoduleName: '',\n\t\toutputFile: 'npm.json',\n\t\tsitePath: '',\n\t};\n\n\truntime: Runtime = 'before';\n\n\tconstructor(config: Config) {\n\t\tthis.options.sitePath = config.originPath;\n\t\tconst {moduleName} = config.pluginConfig.npm as NpmConfig;\n\t\tthis.options.moduleName = moduleName;\n\t}\n\n\tasync execute(): Promise<void> {\n\t\tconst data = await this.getMonthlyDownloads();\n\t\tconst path = `${this.options.sitePath}/${this.options.dataPath}`;\n\t\tconst filePath = `${this.options.sitePath}/${this.options.dataPath}/${this.options.outputFile}`;\n\t\tawait fs.ensureDir(path);\n\t\tawait fs.writeFile(filePath, JSON.stringify(data, null, 2));\n\t}\n\n\tasync getMonthlyDownloads(): Promise<any> {\n\t\tconst url = `https://api.npmjs.org/downloads/point/last-month/${this.options.moduleName}`;\n\t\tconst result = await axios.get(url);\n\t\treturn result.data;\n\t}\n}\n"]}
@@ -1,10 +0,0 @@
1
- import type { DoculaPlugin, Options, Schema, Runtime } from '../docula-plugin.js';
2
- import type { Config } from '../config.js';
3
- export declare class PagefindPlugin implements DoculaPlugin {
4
- static schema: Schema;
5
- readonly options: Options;
6
- runtime: Runtime;
7
- constructor(config: Config);
8
- execute(): Promise<void>;
9
- }
10
- //# sourceMappingURL=pagefind.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pagefind.d.ts","sourceRoot":"","sources":["../../src/plugins/pagefind.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,qBAAa,cAAe,YAAW,YAAY;IAClD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;IAE3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAEvB;IAEF,OAAO,EAAE,OAAO,CAAW;gBAEf,MAAM,EAAE,MAAM;IAIpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAW9B"}
@@ -1,22 +0,0 @@
1
- import { exec } from 'node:child_process';
2
- export class PagefindPlugin {
3
- static schema = {};
4
- options = {
5
- outputPath: '',
6
- };
7
- runtime = 'after';
8
- constructor(config) {
9
- this.options.outputPath = config.outputPath;
10
- }
11
- async execute() {
12
- await new Promise((resolve, reject) => {
13
- exec(`npx pagefind --source ${this.options.outputPath}`, (error, stdout) => {
14
- if (error) {
15
- reject(error);
16
- }
17
- resolve(stdout);
18
- });
19
- });
20
- }
21
- }
22
- //# sourceMappingURL=pagefind.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pagefind.js","sourceRoot":"","sources":["../../src/plugins/pagefind.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AAIxC,MAAM,OAAO,cAAc;IAC1B,MAAM,CAAC,MAAM,GAAW,EAAE,CAAC;IAElB,OAAO,GAAY;QAC3B,UAAU,EAAE,EAAE;KACd,CAAC;IAEF,OAAO,GAAY,OAAO,CAAC;IAE3B,YAAY,MAAc;QACzB,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,CAAC,yBAAyB,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,KAAU,EAAE,MAAW,EAAE,EAAE;gBACpF,IAAI,KAAK,EAAE,CAAC;oBACX,MAAM,CAAC,KAAK,CAAC,CAAC;gBACf,CAAC;gBAED,OAAO,CAAC,MAAM,CAAC,CAAC;YACjB,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC","sourcesContent":["import {exec} from 'node:child_process';\nimport type {DoculaPlugin, Options, Schema, Runtime} from '../docula-plugin.js';\nimport type {Config} from '../config.js';\n\nexport class PagefindPlugin implements DoculaPlugin {\n\tstatic schema: Schema = {};\n\n\treadonly options: Options = {\n\t\toutputPath: '',\n\t};\n\n\truntime: Runtime = 'after';\n\n\tconstructor(config: Config) {\n\t\tthis.options.outputPath = config.outputPath;\n\t}\n\n\tasync execute(): Promise<void> {\n\t\tawait new Promise((resolve, reject) => {\n\t\t\texec(`npx pagefind --source ${this.options.outputPath}`, (error: any, stdout: any) => {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t}\n\n\t\t\t\tresolve(stdout);\n\t\t\t});\n\t\t});\n\t}\n}\n"]}
@@ -1,14 +0,0 @@
1
- import type { DoculaPlugin, Options, Runtime, Schema } from '../docula-plugin.js';
2
- import type { Config } from '../config.js';
3
- export type RobotsConfig = {
4
- allowedUrl: string;
5
- disallowedUrl: string;
6
- };
7
- export declare class RobotsPlugin implements DoculaPlugin {
8
- static schema: Schema;
9
- readonly options: Options;
10
- runtime: Runtime;
11
- constructor(config: Config);
12
- execute(): Promise<void>;
13
- }
14
- //# sourceMappingURL=robots.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"robots.d.ts","sourceRoot":"","sources":["../../src/plugins/robots.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,qBAAa,YAAa,YAAW,YAAY;IAChD,MAAM,CAAC,MAAM,EAAE,MAAM,CAMnB;IAEF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAGvB;IAEF,OAAO,EAAE,OAAO,CAAW;gBAEf,MAAM,EAAE,MAAM;IAYpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAS9B"}
@@ -1,34 +0,0 @@
1
- import fs from 'fs-extra';
2
- export class RobotsPlugin {
3
- static schema = {
4
- type: 'object',
5
- properties: {
6
- allowedUrl: { type: 'string' },
7
- disallowedUrl: { type: 'string' },
8
- },
9
- };
10
- options = {
11
- sitemapPath: 'sitemap.xml',
12
- outputFile: 'robots.txt',
13
- };
14
- runtime = 'after';
15
- constructor(config) {
16
- this.options.outputPath = config.outputPath;
17
- const { allowedUrl, disallowedUrl } = config.pluginConfig.robots || {};
18
- if (allowedUrl) {
19
- this.options.allowedUrl = allowedUrl;
20
- }
21
- if (disallowedUrl) {
22
- this.options.disallowedUrl = disallowedUrl;
23
- }
24
- }
25
- async execute() {
26
- const isAllowed = this.options.allowedUrl ? `Allow: ${this.options.allowedUrl}` : '';
27
- const isDisallowed = this.options.disallowedUrl ? `Disallow: ${this.options.disallowedUrl}` : '';
28
- const data = `User-agent: * \n${isAllowed} \n${isDisallowed} \nSitemap: ${this.options.sitemapPath}`;
29
- const filePath = `${this.options.outputPath}/${this.options.outputFile}`;
30
- await fs.ensureDir(this.options.outputPath);
31
- await fs.writeFile(filePath, data);
32
- }
33
- }
34
- //# sourceMappingURL=robots.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"robots.js","sourceRoot":"","sources":["../../src/plugins/robots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAS1B,MAAM,OAAO,YAAY;IACxB,MAAM,CAAC,MAAM,GAAW;QACvB,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACX,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;YAC5B,aAAa,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;SAC/B;KACD,CAAC;IAEO,OAAO,GAAY;QAC3B,WAAW,EAAE,aAAa;QAC1B,UAAU,EAAE,YAAY;KACxB,CAAC;IAEF,OAAO,GAAY,OAAO,CAAC;IAE3B,YAAY,MAAc;QACzB,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAC5C,MAAM,EAAC,UAAU,EAAE,aAAa,EAAC,GAAG,MAAM,CAAC,YAAY,CAAC,MAAiC,IAAI,EAAE,CAAC;QAChG,IAAI,UAAU,EAAE,CAAC;YAChB,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;QACtC,CAAC;QAED,IAAI,aAAa,EAAE,CAAC;YACnB,IAAI,CAAC,OAAO,CAAC,aAAa,GAAG,aAAa,CAAC;QAC5C,CAAC;IACF,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrF,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAEjG,MAAM,IAAI,GAAG,mBAAmB,SAAS,MAAM,YAAY,eAAe,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QACrG,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACzE,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC","sourcesContent":["import fs from 'fs-extra';\nimport type {DoculaPlugin, Options, Runtime, Schema} from '../docula-plugin.js';\nimport type {Config} from '../config.js';\n\nexport type RobotsConfig = {\n\tallowedUrl: string;\n\tdisallowedUrl: string;\n};\n\nexport class RobotsPlugin implements DoculaPlugin {\n\tstatic schema: Schema = {\n\t\ttype: 'object',\n\t\tproperties: {\n\t\t\tallowedUrl: {type: 'string'},\n\t\t\tdisallowedUrl: {type: 'string'},\n\t\t},\n\t};\n\n\treadonly options: Options = {\n\t\tsitemapPath: 'sitemap.xml',\n\t\toutputFile: 'robots.txt',\n\t};\n\n\truntime: Runtime = 'after';\n\n\tconstructor(config: Config) {\n\t\tthis.options.outputPath = config.outputPath;\n\t\tconst {allowedUrl, disallowedUrl} = config.pluginConfig.robots as unknown as RobotsConfig || {};\n\t\tif (allowedUrl) {\n\t\t\tthis.options.allowedUrl = allowedUrl;\n\t\t}\n\n\t\tif (disallowedUrl)\t{\n\t\t\tthis.options.disallowedUrl = disallowedUrl;\n\t\t}\n\t}\n\n\tasync execute(): Promise<void> {\n\t\tconst isAllowed = this.options.allowedUrl ? `Allow: ${this.options.allowedUrl}` : '';\n\t\tconst isDisallowed = this.options.disallowedUrl ? `Disallow: ${this.options.disallowedUrl}` : '';\n\n\t\tconst data = `User-agent: * \\n${isAllowed} \\n${isDisallowed} \\nSitemap: ${this.options.sitemapPath}`;\n\t\tconst filePath = `${this.options.outputPath}/${this.options.outputFile}`;\n\t\tawait fs.ensureDir(this.options.outputPath);\n\t\tawait fs.writeFile(filePath, data);\n\t}\n}\n"]}
@@ -1,11 +0,0 @@
1
- import type { DoculaPlugin, Options, Schema, Runtime } from '../docula-plugin.js';
2
- import type { Config } from '../config.js';
3
- export declare class SitemapPlugin implements DoculaPlugin {
4
- static schema: Schema;
5
- readonly options: Options;
6
- runtime: Runtime;
7
- private readonly eleventy;
8
- constructor(config: Config);
9
- execute(): Promise<void>;
10
- }
11
- //# sourceMappingURL=sitemap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sitemap.d.ts","sourceRoot":"","sources":["../../src/plugins/sitemap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAChF,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAGzC,qBAAa,aAAc,YAAW,YAAY;IACjD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM;IAE3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAIvB;IAEF,OAAO,EAAE,OAAO,CAAW;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;gBAExB,MAAM,EAAE,MAAM;IAQpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAS9B"}
@@ -1,27 +0,0 @@
1
- import fs from 'fs-extra';
2
- import { Eleventy } from '../eleventy.js';
3
- export class SitemapPlugin {
4
- static schema = {};
5
- options = {
6
- siteUrl: '',
7
- outputFile: 'sitemap.xml',
8
- outputPath: '',
9
- };
10
- runtime = 'after';
11
- eleventy;
12
- constructor(config) {
13
- this.eleventy = new Eleventy(config);
14
- this.options.outputPath = config.outputPath;
15
- const { siteUrl } = config;
16
- this.options.siteUrl = siteUrl;
17
- }
18
- async execute() {
19
- const jsonContent = await this.eleventy.toJSON();
20
- const content = `<?xml version="1.0" encoding="utf-8"?>
21
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
22
- ${jsonContent.map(item => (`<url><loc>${this.options.siteUrl}${item.url}</loc></url>`)).join('')}
23
- </urlset>`;
24
- fs.writeFileSync(`${this.options.outputPath}/${this.options.outputFile}`, content);
25
- }
26
- }
27
- //# sourceMappingURL=sitemap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sitemap.js","sourceRoot":"","sources":["../../src/plugins/sitemap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAG1B,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAExC,MAAM,OAAO,aAAa;IACzB,MAAM,CAAC,MAAM,GAAW,EAAE,CAAC;IAElB,OAAO,GAAY;QAC3B,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,aAAa;QACzB,UAAU,EAAE,EAAE;KACd,CAAC;IAEF,OAAO,GAAY,OAAO,CAAC;IACV,QAAQ,CAAW;IAEpC,YAAY,MAAc;QACzB,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAC5C,MAAM,EAAC,OAAO,EAAC,GAAG,MAAM,CAAC;QAEzB,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,OAAO;QACZ,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACjD,MAAM,OAAO,GAAG;;QAEV,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;cACxF,CAAC;QAEb,EAAE,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;IACpF,CAAC","sourcesContent":["import fs from 'fs-extra';\nimport type {DoculaPlugin, Options, Schema, Runtime} from '../docula-plugin.js';\nimport type {Config} from '../config.js';\nimport {Eleventy} from '../eleventy.js';\n\nexport class SitemapPlugin implements DoculaPlugin {\n\tstatic schema: Schema = {};\n\n\treadonly options: Options = {\n\t\tsiteUrl: '',\n\t\toutputFile: 'sitemap.xml',\n\t\toutputPath: '',\n\t};\n\n\truntime: Runtime = 'after';\n\tprivate readonly eleventy: Eleventy;\n\n\tconstructor(config: Config) {\n\t\tthis.eleventy = new Eleventy(config);\n\t\tthis.options.outputPath = config.outputPath;\n\t\tconst {siteUrl} = config;\n\n\t\tthis.options.siteUrl = siteUrl;\n\t}\n\n\tasync execute(): Promise<void> {\n\t\tconst jsonContent = await this.eleventy.toJSON();\n\t\tconst content = `<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\t\t\t\t<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:news=\"http://www.google.com/schemas/sitemap-news/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\">\n\t\t\t\t ${jsonContent.map(item => (`<url><loc>${this.options.siteUrl}${item.url}</loc></url>`)).join('')}\n\t\t\t\t</urlset>`;\n\n\t\tfs.writeFileSync(`${this.options.outputPath}/${this.options.outputFile}`, content);\n\t}\n}\n"]}
package/dist/schemas.d.ts DELETED
@@ -1,21 +0,0 @@
1
- import { type Plugins } from './types/config.js';
2
- type Property = Record<string, string | string[]>;
3
- type PluginsType = {
4
- type: string;
5
- items: {
6
- type: string;
7
- enum: Plugins;
8
- };
9
- };
10
- export type ConfigSchema = {
11
- type: 'object';
12
- additionalProperties: boolean;
13
- properties: {
14
- [key: string]: Property | PluginsType;
15
- plugins: PluginsType;
16
- };
17
- required: string[];
18
- };
19
- export declare const jsonConfigSchema: ConfigSchema;
20
- export {};
21
- //# sourceMappingURL=schemas.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,KAAK,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAE/C,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAElD,KAAK,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,OAAO,CAAC;KACd,CAAC;CACF,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;QACtC,OAAO,EAAE,WAAW,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,YAsB9B,CAAC"}
package/dist/schemas.js DELETED
@@ -1,25 +0,0 @@
1
- import DoculaPlugins from './plugins/index.js';
2
- export const jsonConfigSchema = {
3
- type: 'object',
4
- additionalProperties: false,
5
- properties: {
6
- originPath: { type: 'string' },
7
- outputPath: { type: 'string' },
8
- dataPath: { type: 'string' },
9
- templatePath: { type: 'string' },
10
- searchEngine: { type: 'string', enum: ['algolia', 'pagefind'] },
11
- plugins: {
12
- type: 'array',
13
- items: {
14
- type: 'string',
15
- enum: Object.keys(DoculaPlugins),
16
- },
17
- },
18
- imagesPath: { type: 'string' },
19
- assetsPath: { type: 'string' },
20
- siteUrl: { type: 'string' },
21
- siteType: { type: 'string', enum: ['landing', 'multi page'] },
22
- },
23
- required: [],
24
- };
25
- //# sourceMappingURL=schemas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAuB/C,MAAM,CAAC,MAAM,gBAAgB,GAAiB;IAC7C,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACX,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC5B,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC5B,QAAQ,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC1B,YAAY,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC9B,YAAY,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,EAAC;QAC7D,OAAO,EAAE;YACR,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAY;aAC3C;SACD;QACD,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC5B,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QAC5B,OAAO,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;QACzB,QAAQ,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,EAAC;KAC3D;IACD,QAAQ,EAAE,EAAE;CACZ,CAAC","sourcesContent":["import DoculaPlugins from './plugins/index.js';\nimport {type Plugins} from './types/config.js';\n\ntype Property = Record<string, string | string[]>;\n\ntype PluginsType = {\n\ttype: string;\n\titems: {\n\t\ttype: string;\n\t\tenum: Plugins;\n\t};\n};\n\nexport type ConfigSchema = {\n\ttype: 'object';\n\tadditionalProperties: boolean;\n\tproperties: {\n\t\t[key: string]: Property | PluginsType;\n\t\tplugins: PluginsType;\n\t};\n\trequired: string[];\n};\n\nexport const jsonConfigSchema: ConfigSchema = {\n\ttype: 'object',\n\tadditionalProperties: false,\n\tproperties: {\n\t\toriginPath: {type: 'string'},\n\t\toutputPath: {type: 'string'},\n\t\tdataPath: {type: 'string'},\n\t\ttemplatePath: {type: 'string'},\n\t\tsearchEngine: {type: 'string', enum: ['algolia', 'pagefind']},\n\t\tplugins: {\n\t\t\ttype: 'array',\n\t\t\titems: {\n\t\t\t\ttype: 'string',\n\t\t\t\tenum: Object.keys(DoculaPlugins) as Plugins,\n\t\t\t},\n\t\t},\n\t\timagesPath: {type: 'string'},\n\t\tassetsPath: {type: 'string'},\n\t\tsiteUrl: {type: 'string'},\n\t\tsiteType: {type: 'string', enum: ['landing', 'multi page']},\n\t},\n\trequired: [],\n};\n"]}
@@ -1,20 +0,0 @@
1
- /// <reference types="jest" />
2
- export declare const getGithubInfo: jest.Mock<{
3
- author: string;
4
- repo: string;
5
- }, [], any>;
6
- export declare const validateUrl: jest.Mock<boolean, [], any>;
7
- export declare const getSiteUrl: jest.Mock<string, [], any>;
8
- export declare const getUserPlugins: jest.Mock<{
9
- plugins: string[];
10
- }, [], any>;
11
- export declare const setPlugins: jest.Mock<{
12
- siteUrl: string;
13
- searchEngine: string;
14
- plugins: string[];
15
- github: {
16
- author: string;
17
- repo: string;
18
- };
19
- }, [], any>;
20
- //# sourceMappingURL=inquirer-prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inquirer-prompt.d.ts","sourceRoot":"","sources":["../../../src/tools/__mocks__/inquirer-prompt.ts"],"names":[],"mappings":";AAAA,eAAO,MAAM,aAAa;;;WAGvB,CAAC;AAEJ,eAAO,MAAM,WAAW,6BAAsB,CAAC;AAE/C,eAAO,MAAM,UAAU,4BAA2C,CAAC;AAEnE,eAAO,MAAM,cAAc;;WAExB,CAAC;AAEJ,eAAO,MAAM,UAAU;;;;;;;;WAQpB,CAAC"}
@@ -1,19 +0,0 @@
1
- export const getGithubInfo = jest.fn(() => ({
2
- author: 'jaredwray',
3
- repo: 'docula',
4
- }));
5
- export const validateUrl = jest.fn(() => true);
6
- export const getSiteUrl = jest.fn(() => 'https://www.example.com');
7
- export const getUserPlugins = jest.fn(() => ({
8
- plugins: ['robots.txt', 'npm'],
9
- }));
10
- export const setPlugins = jest.fn(() => ({
11
- siteUrl: 'https://www.example.com',
12
- searchEngine: 'pagefind',
13
- plugins: ['github'],
14
- github: {
15
- author: 'jaredwray',
16
- repo: 'docula',
17
- },
18
- }));
19
- //# sourceMappingURL=inquirer-prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inquirer-prompt.js","sourceRoot":"","sources":["../../../src/tools/__mocks__/inquirer-prompt.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3C,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,QAAQ;CACd,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,yBAAyB,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5C,OAAO,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC;CAC9B,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IACxC,OAAO,EAAE,yBAAyB;IAClC,YAAY,EAAE,UAAU;IACxB,OAAO,EAAE,CAAC,QAAQ,CAAC;IACnB,MAAM,EAAE;QACP,MAAM,EAAE,WAAW;QACnB,IAAI,EAAE,QAAQ;KACd;CACD,CAAC,CAAC,CAAC","sourcesContent":["export const getGithubInfo = jest.fn(() => ({\n\tauthor: 'jaredwray',\n\trepo: 'docula',\n}));\n\nexport const validateUrl = jest.fn(() => true);\n\nexport const getSiteUrl = jest.fn(() => 'https://www.example.com');\n\nexport const getUserPlugins = jest.fn(() => ({\n\tplugins: ['robots.txt', 'npm'],\n}));\n\nexport const setPlugins = jest.fn(() => ({\n\tsiteUrl: 'https://www.example.com',\n\tsearchEngine: 'pagefind',\n\tplugins: ['github'],\n\tgithub: {\n\t\tauthor: 'jaredwray',\n\t\trepo: 'docula',\n\t},\n}));\n"]}
@@ -1,5 +0,0 @@
1
- /// <reference types="jest" />
2
- export declare const getFileName: jest.Mock<string, [], any>;
3
- export declare const getConfigPath: jest.Mock<string, [], any>;
4
- export declare const getSitePath: jest.Mock<string, [], any>;
5
- //# sourceMappingURL=path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/tools/__mocks__/path.ts"],"names":[],"mappings":";AACA,eAAO,MAAM,WAAW,4BAA2B,CAAC;AAEpD,eAAO,MAAM,aAAa,4BAA+D,CAAC;AAE1F,eAAO,MAAM,WAAW,4BAAmD,CAAC"}
@@ -1,7 +0,0 @@
1
- // eslint-disable-next-line unicorn/prefer-module
2
- export const getFileName = jest.fn(() => __dirname);
3
- // eslint-disable-next-line n/prefer-global/process
4
- export const getConfigPath = jest.fn(() => `${process.cwd()}/test/data/site/config.json`);
5
- // eslint-disable-next-line n/prefer-global/process
6
- export const getSitePath = jest.fn(() => `${process.cwd()}/test/data/site`);
7
- //# sourceMappingURL=path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.js","sourceRoot":"","sources":["../../../src/tools/__mocks__/path.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AACpD,mDAAmD;AACnD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,6BAA6B,CAAC,CAAC;AAC1F,mDAAmD;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["// eslint-disable-next-line unicorn/prefer-module\nexport const getFileName = jest.fn(() => __dirname);\n// eslint-disable-next-line n/prefer-global/process\nexport const getConfigPath = jest.fn(() => `${process.cwd()}/test/data/site/config.json`);\n// eslint-disable-next-line n/prefer-global/process\nexport const getSitePath = jest.fn(() => `${process.cwd()}/test/data/site`);\n"]}
@@ -1,11 +0,0 @@
1
- export declare const getGithubInfo: () => Promise<Record<string, string>>;
2
- export declare const validateUrl: (value: string) => boolean | string;
3
- export declare const getSiteUrl: () => Promise<string>;
4
- export declare const getUserPlugins: () => Promise<string[]>;
5
- export declare const getSearchEngine: () => Promise<'algolia' | 'pagefind'>;
6
- export declare const getAlgoliaInfo: () => Promise<Record<string, string>>;
7
- export declare const getSiteType: () => Promise<'landing' | 'multipage'>;
8
- export declare const buildLandingPage: () => Promise<Record<string, unknown>>;
9
- export declare const buildMultipageSite: () => Promise<Record<string, unknown>>;
10
- export declare const setPlugins: () => Promise<Record<string, unknown>>;
11
- //# sourceMappingURL=inquirer-prompt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inquirer-prompt.d.ts","sourceRoot":"","sources":["../../src/tools/inquirer-prompt.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,QAAa,QAAQ,OAAO,MAAM,EAAE,MAAM,CAAC,CAUnE,CAAC;AAEH,eAAO,MAAM,WAAW,UAAW,MAAM,KAAG,OAAO,GAAG,MAOrD,CAAC;AAEF,eAAO,MAAM,UAAU,QAAa,QAAQ,MAAM,CAUjD,CAAC;AAEF,eAAO,MAAM,cAAc,QAAa,QAAQ,MAAM,EAAE,CAqBvD,CAAC;AAEF,eAAO,MAAM,eAAe,QAAa,QAAQ,SAAS,GAAG,UAAU,CActE,CAAC;AAEF,eAAO,MAAM,cAAc,QAAa,QAAQ,OAAO,MAAM,EAAE,MAAM,CAAC,CAgBpE,CAAC;AAEH,eAAO,MAAM,WAAW,QAAa,QAAQ,SAAS,GAAG,WAAW,CAcnE,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAa,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,CAcxE,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAa,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,CAsB1E,CAAC;AAEF,eAAO,MAAM,UAAU,QAAa,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,CAKlE,CAAC"}
@@ -1,139 +0,0 @@
1
- import inquirer from 'inquirer';
2
- import { urlRegex } from './tools.js';
3
- export const getGithubInfo = async () => inquirer.prompt([
4
- {
5
- type: 'input',
6
- name: 'author',
7
- message: 'What is your GitHub username?',
8
- }, {
9
- type: 'input',
10
- name: 'repo',
11
- message: 'What is your GitHub repository\'s name?',
12
- },
13
- ]);
14
- export const validateUrl = (value) => {
15
- const trimmed = value.trim();
16
- if (trimmed.length > 0 && urlRegex.test(trimmed)) {
17
- return true;
18
- }
19
- return 'Please enter a complete URL.';
20
- };
21
- export const getSiteUrl = async () => {
22
- const siteAnswer = await inquirer.prompt([
23
- {
24
- type: 'input',
25
- name: 'url',
26
- message: 'What is the URL of your site?',
27
- validate: validateUrl,
28
- },
29
- ]);
30
- return siteAnswer.url;
31
- };
32
- export const getUserPlugins = async () => {
33
- const userPlugins = await inquirer.prompt([
34
- {
35
- type: 'checkbox',
36
- name: 'plugins',
37
- message: 'Select the plugins you want to use',
38
- choices: [
39
- {
40
- name: 'github',
41
- value: 'github',
42
- }, {
43
- name: 'robots.txt',
44
- value: 'robots',
45
- }, {
46
- name: 'sitemap.xml',
47
- value: 'sitemap',
48
- },
49
- ],
50
- },
51
- ]);
52
- return userPlugins.plugins;
53
- };
54
- export const getSearchEngine = async () => {
55
- const searchEngine = await inquirer.prompt([
56
- {
57
- type: 'list',
58
- name: 'engine',
59
- message: 'Which search engine do you want to use?',
60
- choices: ['Algolia', 'Pagefind'],
61
- default: 'Pagefind',
62
- filter(value) {
63
- return value.toLowerCase();
64
- },
65
- },
66
- ]);
67
- return searchEngine.engine;
68
- };
69
- export const getAlgoliaInfo = async () => inquirer.prompt([
70
- {
71
- type: 'input',
72
- name: 'appId',
73
- message: 'What is your Algolia application ID?',
74
- },
75
- {
76
- type: 'input',
77
- name: 'apiKey',
78
- message: 'What is your Algolia API key?',
79
- },
80
- {
81
- type: 'input',
82
- name: 'indexName',
83
- message: 'What is your Algolia index name?',
84
- },
85
- ]);
86
- export const getSiteType = async () => {
87
- const siteType = await inquirer.prompt([
88
- {
89
- type: 'list',
90
- name: 'type',
91
- message: 'What type of site do you want to build?',
92
- choices: ['Landing', 'Multi page'],
93
- default: 'Multi page',
94
- filter(value) {
95
- return value.toLowerCase();
96
- },
97
- },
98
- ]);
99
- return siteType.type;
100
- };
101
- export const buildLandingPage = async () => {
102
- let githubInfo;
103
- const siteUrl = await getSiteUrl();
104
- const plugins = await getUserPlugins();
105
- if (plugins.includes('github')) {
106
- githubInfo = await getGithubInfo();
107
- }
108
- return {
109
- siteUrl,
110
- plugins,
111
- ...(githubInfo && { github: githubInfo }),
112
- };
113
- };
114
- export const buildMultipageSite = async () => {
115
- let githubInfo;
116
- let algoliaInfo;
117
- const siteUrl = await getSiteUrl();
118
- const searchEngine = await getSearchEngine();
119
- const plugins = await getUserPlugins();
120
- if (searchEngine === 'algolia') {
121
- algoliaInfo = await getAlgoliaInfo();
122
- }
123
- if (plugins.includes('github')) {
124
- githubInfo = await getGithubInfo();
125
- }
126
- return {
127
- siteUrl,
128
- searchEngine,
129
- plugins: [...plugins, searchEngine],
130
- ...(githubInfo && { github: githubInfo }),
131
- ...(algoliaInfo && { algolia: algoliaInfo }),
132
- };
133
- };
134
- export const setPlugins = async () => {
135
- const siteType = await getSiteType();
136
- const config = await (siteType.includes('landing') ? buildLandingPage() : buildMultipageSite());
137
- return { siteType, ...config };
138
- };
139
- //# sourceMappingURL=inquirer-prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inquirer-prompt.js","sourceRoot":"","sources":["../../src/tools/inquirer-prompt.ts"],"names":[],"mappings":"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","sourcesContent":["import inquirer from 'inquirer';\nimport {urlRegex} from './tools.js';\n\nexport const getGithubInfo = async (): Promise<Record<string, string>> => inquirer.prompt([\n\t{\n\t\ttype: 'input',\n\t\tname: 'author',\n\t\tmessage: 'What is your GitHub username?',\n\t}, {\n\t\ttype: 'input',\n\t\tname: 'repo',\n\t\tmessage: 'What is your GitHub repository\\'s name?',\n\t},\n]);\n\nexport const validateUrl = (value: string): boolean | string => {\n\tconst trimmed = value.trim();\n\tif (trimmed.length > 0 && urlRegex.test(trimmed)) {\n\t\treturn true;\n\t}\n\n\treturn 'Please enter a complete URL.';\n};\n\nexport const getSiteUrl = async (): Promise<string> => {\n\tconst siteAnswer = await inquirer.prompt([\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'url',\n\t\t\tmessage: 'What is the URL of your site?',\n\t\t\tvalidate: validateUrl,\n\t\t},\n\t]);\n\treturn siteAnswer.url;\n};\n\nexport const getUserPlugins = async (): Promise<string[]> => {\n\tconst userPlugins = await inquirer.prompt([\n\t\t{\n\t\t\ttype: 'checkbox',\n\t\t\tname: 'plugins',\n\t\t\tmessage: 'Select the plugins you want to use',\n\t\t\tchoices: [\n\t\t\t\t{\n\t\t\t\t\tname: 'github',\n\t\t\t\t\tvalue: 'github',\n\t\t\t\t}, {\n\t\t\t\t\tname: 'robots.txt',\n\t\t\t\t\tvalue: 'robots',\n\t\t\t\t}, {\n\t\t\t\t\tname: 'sitemap.xml',\n\t\t\t\t\tvalue: 'sitemap',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t]);\n\treturn userPlugins.plugins;\n};\n\nexport const getSearchEngine = async (): Promise<'algolia' | 'pagefind'> => {\n\tconst searchEngine = await inquirer.prompt([\n\t\t{\n\t\t\ttype: 'list',\n\t\t\tname: 'engine',\n\t\t\tmessage: 'Which search engine do you want to use?',\n\t\t\tchoices: ['Algolia', 'Pagefind'],\n\t\t\tdefault: 'Pagefind',\n\t\t\tfilter(value: string): string {\n\t\t\t\treturn value.toLowerCase();\n\t\t\t},\n\t\t},\n\t]);\n\treturn searchEngine.engine;\n};\n\nexport const getAlgoliaInfo = async (): Promise<Record<string, string>> => inquirer.prompt([\n\t{\n\t\ttype: 'input',\n\t\tname: 'appId',\n\t\tmessage: 'What is your Algolia application ID?',\n\t},\n\t{\n\t\ttype: 'input',\n\t\tname: 'apiKey',\n\t\tmessage: 'What is your Algolia API key?',\n\t},\n\t{\n\t\ttype: 'input',\n\t\tname: 'indexName',\n\t\tmessage: 'What is your Algolia index name?',\n\t},\n]);\n\nexport const getSiteType = async (): Promise<'landing' | 'multipage'> => {\n\tconst siteType = await inquirer.prompt([\n\t\t{\n\t\t\ttype: 'list',\n\t\t\tname: 'type',\n\t\t\tmessage: 'What type of site do you want to build?',\n\t\t\tchoices: ['Landing', 'Multi page'],\n\t\t\tdefault: 'Multi page',\n\t\t\tfilter(value: string): string {\n\t\t\t\treturn value.toLowerCase();\n\t\t\t},\n\t\t},\n\t]);\n\treturn siteType.type;\n};\n\nexport const buildLandingPage = async (): Promise<Record<string, unknown>> => {\n\tlet githubInfo: Record<string, string> | undefined;\n\tconst siteUrl = await getSiteUrl();\n\tconst plugins = await getUserPlugins();\n\n\tif (plugins.includes('github')) {\n\t\tgithubInfo = await getGithubInfo();\n\t}\n\n\treturn {\n\t\tsiteUrl,\n\t\tplugins,\n\t\t...(githubInfo && {github: githubInfo}),\n\t};\n};\n\nexport const buildMultipageSite = async (): Promise<Record<string, unknown>> => {\n\tlet githubInfo: Record<string, string> | undefined;\n\tlet algoliaInfo: Record<string, string> | undefined;\n\tconst siteUrl = await getSiteUrl();\n\tconst searchEngine = await getSearchEngine();\n\tconst plugins = await getUserPlugins();\n\n\tif (searchEngine === 'algolia') {\n\t\talgoliaInfo = await getAlgoliaInfo();\n\t}\n\n\tif (plugins.includes('github')) {\n\t\tgithubInfo = await getGithubInfo();\n\t}\n\n\treturn {\n\t\tsiteUrl,\n\t\tsearchEngine,\n\t\tplugins: [...plugins, searchEngine],\n\t\t...(githubInfo && {github: githubInfo}),\n\t\t...(algoliaInfo && {algolia: algoliaInfo}),\n\t};\n};\n\nexport const setPlugins = async (): Promise<Record<string, unknown>> => {\n\tconst siteType = await getSiteType();\n\tconst config = await (siteType.includes('landing') ? buildLandingPage() : buildMultipageSite());\n\n\treturn {siteType, ...config};\n};\n"]}
@@ -1,4 +0,0 @@
1
- export declare const getFileName: () => string;
2
- export declare const getSitePath: () => string;
3
- export declare const getConfigPath: () => string;
4
- //# sourceMappingURL=path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/tools/path.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,cAAuC,CAAC;AAEhE,eAAO,MAAM,WAAW,cAAgC,CAAC;AACzD,eAAO,MAAM,aAAa,cAAuC,CAAC"}
@@ -1,6 +0,0 @@
1
- import { fileURLToPath } from 'node:url';
2
- export const getFileName = () => fileURLToPath(import.meta.url);
3
- // eslint-disable-next-line n/prefer-global/process
4
- export const getSitePath = () => `${process.cwd()}/site`;
5
- export const getConfigPath = () => `${getSitePath()}/config.json`;
6
- //# sourceMappingURL=path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/tools/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChE,mDAAmD;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC;AACzD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,GAAG,WAAW,EAAE,cAAc,CAAC","sourcesContent":["import {fileURLToPath} from 'node:url';\n\nexport const getFileName = () => fileURLToPath(import.meta.url);\n// eslint-disable-next-line n/prefer-global/process\nexport const getSitePath = () => `${process.cwd()}/site`;\nexport const getConfigPath = () => `${getSitePath()}/config.json`;\n\n"]}
@@ -1,3 +0,0 @@
1
- export declare const reportError: (error: unknown) => void;
2
- export declare const urlRegex: RegExp;
3
- //# sourceMappingURL=tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/tools/tools.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,UAAW,OAAO,KAAG,IAO5C,CAAC;AAEF,eAAO,MAAM,QAAQ,QAA6E,CAAC"}
@@ -1,10 +0,0 @@
1
- import logger from '../logger.js';
2
- export const reportError = (error) => {
3
- let message = String(error);
4
- if (error instanceof Error) {
5
- message = error.message;
6
- }
7
- logger.error(message);
8
- };
9
- export const urlRegex = /^(http(s)?:\/\/.)[-\w@:%.+~#=]{2,256}\.[a-z]{2,6}\b([-\w@:%+.~#?&/=]*)$/g;
10
- //# sourceMappingURL=tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/tools/tools.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAc,EAAQ,EAAE;IACnD,IAAI,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,0EAA0E,CAAC","sourcesContent":["import logger from '../logger.js';\n\nexport const reportError = (error: unknown): void => {\n\tlet message = String(error);\n\tif (error instanceof Error) {\n\t\tmessage = error.message;\n\t}\n\n\tlogger.error(message);\n};\n\nexport const urlRegex = /^(http(s)?:\\/\\/.)[-\\w@:%.+~#=]{2,256}\\.[a-z]{2,6}\\b([-\\w@:%+.~#?&/=]*)$/g;\n\n"]}
@@ -1,8 +0,0 @@
1
- import type DoculaPlugins from '../plugins/index.js';
2
- import { type PluginConfig, type PluginInstance } from '../plugins/index.js';
3
- export { type PluginConfig, type PluginInstance } from '../plugins/index.js';
4
- export type PluginName = keyof typeof DoculaPlugins;
5
- export type PluginInstances = Record<string, PluginInstance>;
6
- export type Plugins = PluginName[];
7
- export type PluginConfigs = Record<PluginName, PluginConfig>;
8
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,KAAK,YAAY,EAAE,KAAK,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAC,KAAK,YAAY,EAAE,KAAK,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAE3E,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,aAAa,CAAC;AAEpD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE7D,MAAM,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAEnC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"","sourcesContent":["import type DoculaPlugins from '../plugins/index.js';\nimport {type PluginConfig, type PluginInstance} from '../plugins/index.js';\n\nexport {type PluginConfig, type PluginInstance} from '../plugins/index.js';\n\nexport type PluginName = keyof typeof DoculaPlugins;\n\nexport type PluginInstances = Record<string, PluginInstance>;\n\nexport type Plugins = PluginName[];\n\nexport type PluginConfigs = Record<PluginName, PluginConfig>;\n\n"]}
@@ -1,5 +0,0 @@
1
- {
2
- "authorName": "Jared Wray",
3
- "footer": "License MIT and Copyright",
4
- "name": "Docula"
5
- }