docula 0.0.8 → 0.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.
- package/README.md +2 -1
- package/dist/docula.d.ts +2 -1
- package/dist/docula.d.ts.map +1 -1
- package/dist/docula.js +39 -10
- package/dist/docula.js.map +1 -1
- package/dist/eleventy/global-data.d.ts +3 -0
- package/dist/eleventy/global-data.d.ts.map +1 -0
- package/dist/eleventy/global-data.js +2 -0
- package/dist/eleventy/global-data.js.map +1 -0
- package/dist/eleventy/shortcodes.d.ts +1 -1
- package/dist/eleventy/shortcodes.d.ts.map +1 -1
- package/dist/eleventy/shortcodes.js +1 -1
- package/dist/eleventy/shortcodes.js.map +1 -1
- package/dist/eleventy.d.ts +1 -0
- package/dist/eleventy.d.ts.map +1 -1
- package/dist/eleventy.js +12 -1
- package/dist/eleventy.js.map +1 -1
- package/dist/plugins/algolia.d.ts +21 -0
- package/dist/plugins/algolia.d.ts.map +1 -0
- package/dist/plugins/algolia.js +53 -0
- package/dist/plugins/algolia.js.map +1 -0
- package/dist/plugins/index.d.ts +4 -2
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/index.js.map +1 -1
- package/dist/schemas.js +1 -1
- package/dist/schemas.js.map +1 -1
- package/dist/tools/__mocks__/inquirer-prompt.d.ts +4 -2
- package/dist/tools/__mocks__/inquirer-prompt.d.ts.map +1 -1
- package/dist/tools/__mocks__/inquirer-prompt.js +3 -1
- package/dist/tools/__mocks__/inquirer-prompt.js.map +1 -1
- package/dist/tools/inquirer-prompt.d.ts +5 -4
- package/dist/tools/inquirer-prompt.d.ts.map +1 -1
- package/dist/tools/inquirer-prompt.js +72 -28
- package/dist/tools/inquirer-prompt.js.map +1 -1
- package/init/_includes/assets/css/styles/algolia.css +125 -0
- package/init/_includes/doc.njk +1 -1
- package/init/_includes/search/algolia.njk +98 -0
- package/init/_includes/shared/head.njk +5 -1
- package/init/_includes/shared/main.njk +2 -2
- package/init/_includes/shared/scripts.njk +3 -1
- package/init/_includes/shared/searchEngine.njk +5 -0
- package/init/_includes/shared/searchModal.njk +13 -4
- package/init/index.njk +1 -1
- package/init/search-index.md +14 -0
- package/init/versions.njk +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://github.com/jaredwray/docula/actions/workflows/tests.yaml)
|
|
6
6
|
[](https://codecov.io/github/jaredwray/docula)
|
|
7
|
+
[](https://www.npmjs.com/package/docula)
|
|
8
|
+
[](https://www.npmjs.com/package/docula)
|
|
7
9
|
|
|
8
10
|
## :warning: - this is currently under development. Please do not use.
|
|
9
11
|
|
|
@@ -25,7 +27,6 @@
|
|
|
25
27
|
|
|
26
28
|
- `site/docs` - contains the documentation files
|
|
27
29
|
- `site/template` - contains the templates files
|
|
28
|
-
- `site/blog` - contains the blog files and images
|
|
29
30
|
|
|
30
31
|
This will all be generated in the `dist` folder by default. To change that you can use the `--output=<folder_name>` flag.
|
|
31
32
|
|
package/dist/docula.d.ts
CHANGED
|
@@ -11,7 +11,8 @@ export declare class Docula {
|
|
|
11
11
|
build(): Promise<void>;
|
|
12
12
|
serve(): Promise<void>;
|
|
13
13
|
copyFolder(source: string, target: string): void;
|
|
14
|
-
|
|
14
|
+
copySearchEngineFiles(): void;
|
|
15
|
+
private writeConfigFile;
|
|
15
16
|
private loadPlugins;
|
|
16
17
|
private readonly executePlugins;
|
|
17
18
|
}
|
package/dist/docula.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docula.d.ts","sourceRoot":"","sources":["../src/docula.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"docula.d.ts","sourceRoot":"","sources":["../src/docula.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAMnC,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAEjD,qBAAa,MAAM;IAClB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IACpC,OAAO,CAAC,eAAe,CAAuB;IAE9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAwB;IACtD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAwB;gBAEzC,OAAO,CAAC,EAAE,gBAAgB;IASzB,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAatC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAc5B,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAkCvD,qBAAqB,IAAI,IAAI;YA0Bf,eAAe;IAe7B,OAAO,CAAC,WAAW;IAkBnB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAE7B;CACF"}
|
package/dist/docula.js
CHANGED
|
@@ -4,7 +4,7 @@ import fs from 'fs-extra';
|
|
|
4
4
|
import express from 'express';
|
|
5
5
|
import { Eleventy } from './eleventy.js';
|
|
6
6
|
import { Config } from './config.js';
|
|
7
|
-
import {
|
|
7
|
+
import { setPlugins } from './tools/inquirer-prompt.js';
|
|
8
8
|
import DoculaPlugins from './plugins/index.js';
|
|
9
9
|
import { getConfigPath, getFileName } from './tools/path.js';
|
|
10
10
|
import logger from './logger.js';
|
|
@@ -24,7 +24,7 @@ export class Docula {
|
|
|
24
24
|
this.loadPlugins();
|
|
25
25
|
}
|
|
26
26
|
async init(sitePath) {
|
|
27
|
-
await this.
|
|
27
|
+
await this.writeConfigFile();
|
|
28
28
|
const { originPath } = this.config;
|
|
29
29
|
const rootSitePath = path.join(process.cwd(), sitePath ?? originPath);
|
|
30
30
|
// Create the <site> folder
|
|
@@ -32,6 +32,7 @@ export class Docula {
|
|
|
32
32
|
fs.mkdirSync(rootSitePath);
|
|
33
33
|
}
|
|
34
34
|
this.copyFolder('init', rootSitePath);
|
|
35
|
+
this.copySearchEngineFiles();
|
|
35
36
|
}
|
|
36
37
|
async build() {
|
|
37
38
|
const { originPath } = this.config;
|
|
@@ -64,6 +65,10 @@ export class Docula {
|
|
|
64
65
|
const sourceStats = fs.statSync(sourcePath);
|
|
65
66
|
const isDirectory = sourceExists && sourceStats.isDirectory();
|
|
66
67
|
if (isDirectory) {
|
|
68
|
+
// Exclude the search folder
|
|
69
|
+
if (source.includes('search')) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
67
72
|
if (!targetExists) {
|
|
68
73
|
fs.mkdirSync(target);
|
|
69
74
|
}
|
|
@@ -74,18 +79,42 @@ export class Docula {
|
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
else if (!fs.existsSync(target)) {
|
|
82
|
+
// Exclude the search-index file
|
|
83
|
+
if (source.includes('search-index.md')) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
77
86
|
fs.copyFileSync(sourcePath, target);
|
|
78
87
|
}
|
|
79
88
|
}
|
|
80
|
-
|
|
89
|
+
copySearchEngineFiles() {
|
|
90
|
+
const { searchEngine, originPath } = this.config;
|
|
91
|
+
const __filename = getFileName();
|
|
92
|
+
const doculaPath = path.dirname(path.dirname(path.dirname(__filename)));
|
|
93
|
+
const sourcePath = path.join(doculaPath, `init/_includes/search/${searchEngine}.njk`);
|
|
94
|
+
const searchPath = path.join(process.cwd(), `${originPath}/_includes/search`);
|
|
95
|
+
const targetPath = path.join(process.cwd(), `${originPath}/_includes/search/${searchEngine}.njk`);
|
|
96
|
+
if (!fs.existsSync(searchPath)) {
|
|
97
|
+
fs.mkdirSync(searchPath);
|
|
98
|
+
}
|
|
99
|
+
if (!fs.existsSync(targetPath)) {
|
|
100
|
+
fs.copyFileSync(sourcePath, targetPath);
|
|
101
|
+
}
|
|
102
|
+
if (searchEngine === 'algolia') {
|
|
103
|
+
const indexSource = path.join(doculaPath, 'init/search-index.md');
|
|
104
|
+
const indexTarget = path.join(process.cwd(), `${originPath}/search-index.md`);
|
|
105
|
+
if (!fs.existsSync(indexTarget)) {
|
|
106
|
+
fs.copyFileSync(indexSource, indexTarget);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async writeConfigFile() {
|
|
81
111
|
const userConfig = {};
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
userConfig[plugin] = parsedPlugins[plugin];
|
|
112
|
+
const plugins = await setPlugins();
|
|
113
|
+
for (const plugin in plugins) {
|
|
114
|
+
if (Object.prototype.hasOwnProperty.call(plugins, plugin)) {
|
|
115
|
+
userConfig[plugin] = plugins[plugin];
|
|
116
|
+
// @ts-expect-error fix later
|
|
117
|
+
this.config[plugin] = plugins[plugin];
|
|
89
118
|
}
|
|
90
119
|
}
|
|
91
120
|
const configPath = getConfigPath();
|
package/dist/docula.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docula.js","sourceRoot":"","sources":["../src/docula.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AACvC,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"docula.js","sourceRoot":"","sources":["../src/docula.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,O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I,OAAO,KAAK,OAAO,EAAE;gBAC/B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aACvC;SACD;IACF,CAAC;CAKD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-data.d.ts","sourceRoot":"","sources":["../../src/eleventy/global-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,MAAM,EAAC,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,SAAS,WAAY,MAAM,KAAG,MAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-data.js","sourceRoot":"","sources":["../../src/eleventy/global-data.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAU,EAAE,CAAC,MAAM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const getYear: () => string;
|
|
2
|
-
export declare const formatDate: (format: string, date?:
|
|
2
|
+
export declare const formatDate: (format: string, date?: string) => string;
|
|
3
3
|
export declare const parseRelease: (content: string) => string;
|
|
4
4
|
//# sourceMappingURL=shortcodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortcodes.d.ts","sourceRoot":"","sources":["../../src/eleventy/shortcodes.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,QAAO,MAAmD,CAAC;AAE/E,eAAO,MAAM,UAAU,WAAY,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"shortcodes.d.ts","sourceRoot":"","sources":["../../src/eleventy/shortcodes.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,QAAO,MAAmD,CAAC;AAE/E,eAAO,MAAM,UAAU,WAAY,MAAM,SAAS,MAAM,KAAG,MAM1D,CAAC;AAEF,eAAO,MAAM,YAAY,YAAa,MAAM,WAO3C,CAAC"}
|
|
@@ -3,7 +3,7 @@ import MarkdownIt from 'markdown-it';
|
|
|
3
3
|
export const getYear = () => DateTime.local().toUTC().toFormat('yyyy');
|
|
4
4
|
export const formatDate = (format, date) => {
|
|
5
5
|
if (date) {
|
|
6
|
-
return DateTime.
|
|
6
|
+
return DateTime.fromISO(date).toUTC().toFormat(format);
|
|
7
7
|
}
|
|
8
8
|
return DateTime.now().toUTC().toFormat(format);
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortcodes.js","sourceRoot":"","sources":["../../src/eleventy/shortcodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,OAAO,GAAG,GAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"shortcodes.js","sourceRoot":"","sources":["../../src/eleventy/shortcodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,OAAO,GAAG,GAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,IAAa,EAAU,EAAE;IACnE,IAAI,IAAI,EAAE;QACT,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KACvD;IAED,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE;IAC/C,MAAM,EAAE,GAAG,IAAI,UAAU,CAAC;QACzB,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,IAAI;KACjB,CAAC,CAAC;IACH,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC,CAAC"}
|
package/dist/eleventy.d.ts
CHANGED
package/dist/eleventy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eleventy.d.ts","sourceRoot":"","sources":["../src/eleventy.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"eleventy.d.ts","sourceRoot":"","sources":["../src/eleventy.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AA+BxC,KAAK,cAAc,GAAG;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,qBAAa,QAAQ;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA2J;IAC1L,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,IAAI,MAAM,IAAI,MAAM,CAEnB;gBAEW,MAAM,EAAE,MAAM;IA4Bb,KAAK;IASL,MAAM;IAKnB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,aAAa;CAIrB"}
|
package/dist/eleventy.js
CHANGED
|
@@ -8,6 +8,7 @@ import markdownIt from 'markdown-it';
|
|
|
8
8
|
import markdownItAnchor from 'markdown-it-anchor';
|
|
9
9
|
import { squashCallback } from './eleventy/filters.js';
|
|
10
10
|
import { getYear, formatDate, parseRelease } from './eleventy/shortcodes.js';
|
|
11
|
+
import { getConfig } from './eleventy/global-data.js';
|
|
11
12
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12
13
|
const Elev = pkg.default;
|
|
13
14
|
export class Eleventy {
|
|
@@ -25,6 +26,7 @@ export class Eleventy {
|
|
|
25
26
|
this.addPlugin(eleventyConfig);
|
|
26
27
|
this.addShortcode(eleventyConfig);
|
|
27
28
|
this.addFilter(eleventyConfig);
|
|
29
|
+
this.addGlobalData(eleventyConfig);
|
|
28
30
|
eleventyConfig.setTemplateFormats(['njk', 'md', 'html']);
|
|
29
31
|
return {
|
|
30
32
|
markdownTemplateEngine: 'njk',
|
|
@@ -37,7 +39,12 @@ export class Eleventy {
|
|
|
37
39
|
this.eleventy = new Elev(this.config.originPath, this.config.outputPath, this.eleventyConfig);
|
|
38
40
|
}
|
|
39
41
|
async build() {
|
|
40
|
-
|
|
42
|
+
try {
|
|
43
|
+
await this.eleventy.write();
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
throw new Error(`Eleventy build failed: ${error.message}`);
|
|
47
|
+
}
|
|
41
48
|
}
|
|
42
49
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
43
50
|
async toJSON() {
|
|
@@ -65,5 +72,9 @@ export class Eleventy {
|
|
|
65
72
|
addFilter(eleventyConfig) {
|
|
66
73
|
eleventyConfig.addFilter('squash', squashCallback);
|
|
67
74
|
}
|
|
75
|
+
addGlobalData(eleventyConfig) {
|
|
76
|
+
// EleventyConfig.addGlobalData('algoliaKeys', () => algoliaKeys(this.config));
|
|
77
|
+
eleventyConfig.addGlobalData('config', () => getConfig(this.config));
|
|
78
|
+
}
|
|
68
79
|
}
|
|
69
80
|
//# sourceMappingURL=eleventy.js.map
|
package/dist/eleventy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eleventy.js","sourceRoot":"","sources":["../src/eleventy.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,6CAA6C;AAC7C,OAAO,wBAAwB,MAAM,2BAA2B,CAAC;AACjE,6CAA6C;AAC7C,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"eleventy.js","sourceRoot":"","sources":["../src/eleventy.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,6CAA6C;AAC7C,OAAO,wBAAwB,MAAM,2BAA2B,CAAC;AACjE,6CAA6C;AAC7C,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAC,SAAS,EAAC,MAAM,2BAA2B,CAAC;AAEpD,gEAAgE;AAChE,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC;AAgCzB,MAAM,OAAO,QAAQ;IAIpB,IAAI,MAAM;QACT,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,YAAY,MAAc;QACzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,cAAc,GAAG;YACrB,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AuB,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9D,CAAC;IAEO,kBAAkB,CAAC,cAA0B;QACpD,MAAM,UAAU,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,mBAAmB,CAAC;QAChE,cAAc,CAAC,kBAAkB,CAAC,EAAC,CAAC,UAAU,CAAC,EAAE,UAAU,EAAC,CAAC,CAAC;IAC/D,CAAC;IAEO,UAAU,CAAC,cAA0B;QAC5C,cAAc,CAAC,UAAU,CACxB,IAAI,EACJ,UAAU,EAAE,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAClC,CAAC;IACH,CAAC;IAEO,SAAS,CAAC,cAA0B;QAC3C,cAAc,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;QACnD,cAAc,CAAC,SAAS,CAAC,SAAS,EAAE;YACnC,IAAI,EAAE,CAAC,IAAI,CAAC;SACZ,CAAC,CAAC;IACJ,CAAC;IAEO,YAAY,CAAC,cAA0B;QAC9C,cAAc,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7C,cAAc,CAAC,YAAY,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACtD,cAAc,CAAC,YAAY,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAC3D,CAAC;IAEO,SAAS,CAAC,cAA0B;QAC3C,cAAc,CAAC,SAAS,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACpD,CAAC;IAEO,aAAa,CAAC,cAA0B;QAC/C,+EAA+E;QAC/E,cAAc,CAAC,aAAa,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IACtE,CAAC;CACD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type SearchClient, type SearchIndex } from 'algoliasearch';
|
|
2
|
+
import type { Config } from '../config.js';
|
|
3
|
+
import type { DoculaPlugin, Options, Schema, Runtime } from '../docula-plugin.js';
|
|
4
|
+
export type AlgoliaConfig = {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
appId: string;
|
|
7
|
+
indexName: string;
|
|
8
|
+
};
|
|
9
|
+
type SearchOptions = {
|
|
10
|
+
index?: SearchIndex;
|
|
11
|
+
} & Options;
|
|
12
|
+
export declare class AlgoliaPlugin implements DoculaPlugin {
|
|
13
|
+
static schema: Schema;
|
|
14
|
+
readonly options: SearchOptions;
|
|
15
|
+
runtime: Runtime;
|
|
16
|
+
readonly client: SearchClient;
|
|
17
|
+
constructor(config: Config);
|
|
18
|
+
execute(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=algolia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"algolia.d.ts","sourceRoot":"","sources":["../../src/plugins/algolia.ts"],"names":[],"mappings":"AACA,OAAsB,EAAC,KAAK,YAAY,EAAE,KAAK,WAAW,EAAC,MAAM,eAAe,CAAC;AAEjF,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAEhF,MAAM,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,aAAa,GAAG;IACpB,KAAK,CAAC,EAAE,WAAW,CAAC;CACpB,GAAG,OAAO,CAAC;AAEZ,qBAAa,aAAc,YAAW,YAAY;IACjD,MAAM,CAAC,MAAM,EAAE,MAAM,CAQnB;IAEF,QAAQ,CAAC,OAAO,EAAE,aAAa,CAK7B;IAEF,OAAO,EAAE,OAAO,CAAW;IAC3B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;gBAElB,MAAM,EAAE,MAAM;IAWpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAqB9B"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import algoliasearch from 'algoliasearch';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
export class AlgoliaPlugin {
|
|
5
|
+
constructor(config) {
|
|
6
|
+
this.options = {
|
|
7
|
+
apiKey: '',
|
|
8
|
+
appId: '',
|
|
9
|
+
indexName: '',
|
|
10
|
+
outputPath: '',
|
|
11
|
+
};
|
|
12
|
+
this.runtime = 'after';
|
|
13
|
+
const { appId, apiKey, indexName } = config.pluginConfig.algolia;
|
|
14
|
+
this.options.outputPath = config.outputPath;
|
|
15
|
+
this.options.appId = appId;
|
|
16
|
+
this.options.apiKey = apiKey;
|
|
17
|
+
this.options.indexName = indexName;
|
|
18
|
+
// @ts-expect-error - algoliasearch is not callable
|
|
19
|
+
this.client = algoliasearch(this.options.appId, this.options.apiKey);
|
|
20
|
+
this.options.index = this.client.initIndex(this.options.indexName);
|
|
21
|
+
}
|
|
22
|
+
async execute() {
|
|
23
|
+
let jsonContent = [];
|
|
24
|
+
const jsonPath = `${process.cwd()}/${this.options.outputPath}/algolia.json`;
|
|
25
|
+
if (fs.existsSync(jsonPath)) {
|
|
26
|
+
const data = fs.readFileSync(jsonPath, 'utf8');
|
|
27
|
+
const content = JSON.parse(data);
|
|
28
|
+
jsonContent = content.filter(item => item.description.length);
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
// @ts-expect-error - clearObjects
|
|
32
|
+
await this.options.index.clearObjects();
|
|
33
|
+
// @ts-expect-error - saveObjects
|
|
34
|
+
await this.options.index.saveObjects(jsonContent, {
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
36
|
+
autoGenerateObjectIDIfNotExist: true,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
throw new Error(`Error while indexing to Algolia: ${error.message}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
AlgoliaPlugin.schema = {
|
|
45
|
+
type: 'object',
|
|
46
|
+
required: ['apiKey', 'appId', 'indexName'],
|
|
47
|
+
properties: {
|
|
48
|
+
apiKey: { type: 'string' },
|
|
49
|
+
appId: { type: 'string' },
|
|
50
|
+
indexName: { type: 'string' },
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=algolia.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"algolia.js","sourceRoot":"","sources":["../../src/plugins/algolia.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,aAAoD,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,MAAM,UAAU,CAAC;AAc1B,MAAM,OAAO,aAAa;IAqBzB,YAAY,MAAc;QAVjB,YAAO,GAAkB;YACjC,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,EAAE;YACb,UAAU,EAAE,EAAE;SACd,CAAC;QAEF,YAAO,GAAY,OAAO,CAAC;QAI1B,MAAM,EAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAC,GAAG,MAAM,CAAC,YAAY,CAAC,OAAwB,CAAC;QAChF,IAAI,CAAC,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAC5C,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;QAC7B,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;QACnC,mDAAmD;QACnD,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACrE,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC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14 +3,16 @@ import { type NpmConfig, NpmPlugin } from './npm.js';
|
|
|
3
3
|
import { type RobotsConfig, RobotsPlugin } from './robots.js';
|
|
4
4
|
import { SitemapPlugin } from './sitemap.js';
|
|
5
5
|
import { PagefindPlugin } from './pagefind.js';
|
|
6
|
+
import { type AlgoliaConfig, AlgoliaPlugin } from './algolia.js';
|
|
6
7
|
declare const plugins: {
|
|
7
8
|
github: typeof GithubPlugin;
|
|
8
9
|
npm: typeof NpmPlugin;
|
|
9
10
|
robots: typeof RobotsPlugin;
|
|
10
11
|
sitemap: typeof SitemapPlugin;
|
|
11
12
|
pagefind: typeof PagefindPlugin;
|
|
13
|
+
algolia: typeof AlgoliaPlugin;
|
|
12
14
|
};
|
|
13
|
-
export type PluginConfig = GithubConfig | NpmConfig | RobotsConfig;
|
|
14
|
-
export type PluginInstance = GithubPlugin | NpmPlugin | RobotsPlugin | SitemapPlugin | PagefindPlugin;
|
|
15
|
+
export type PluginConfig = GithubConfig | NpmConfig | RobotsConfig | AlgoliaConfig;
|
|
16
|
+
export type PluginInstance = GithubPlugin | NpmPlugin | RobotsPlugin | SitemapPlugin | PagefindPlugin | AlgoliaPlugin;
|
|
15
17
|
export default plugins;
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,YAAY,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAC,KAAK,SAAS,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AACnD,OAAO,EAAC,KAAK,YAAY,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,YAAY,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAC,KAAK,SAAS,EAAE,SAAS,EAAC,MAAM,UAAU,CAAC;AACnD,OAAO,EAAC,KAAK,YAAY,EAAE,YAAY,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAC,KAAK,aAAa,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AAE/D,QAAA,MAAM,OAAO;;;;;;;CAOZ,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa,CAAC;AAEnF,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa,GAAG,cAAc,GAAG,aAAa,CAAC;AAEtH,eAAe,OAAO,CAAC"}
|
package/dist/plugins/index.js
CHANGED
|
@@ -3,12 +3,14 @@ import { NpmPlugin } from './npm.js';
|
|
|
3
3
|
import { RobotsPlugin } from './robots.js';
|
|
4
4
|
import { SitemapPlugin } from './sitemap.js';
|
|
5
5
|
import { PagefindPlugin } from './pagefind.js';
|
|
6
|
+
import { AlgoliaPlugin } from './algolia.js';
|
|
6
7
|
const plugins = {
|
|
7
8
|
github: GithubPlugin,
|
|
8
9
|
npm: NpmPlugin,
|
|
9
10
|
robots: RobotsPlugin,
|
|
10
11
|
sitemap: SitemapPlugin,
|
|
11
12
|
pagefind: PagefindPlugin,
|
|
13
|
+
algolia: AlgoliaPlugin,
|
|
12
14
|
};
|
|
13
15
|
export default plugins;
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAiB,SAAS,EAAC,MAAM,UAAU,CAAC;AACnD,OAAO,EAAoB,YAAY,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAiB,SAAS,EAAC,MAAM,UAAU,CAAC;AACnD,OAAO,EAAoB,YAAY,EAAC,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAqB,aAAa,EAAC,MAAM,cAAc,CAAC;AAE/D,MAAM,OAAO,GAAG;IACf,MAAM,EAAE,YAAY;IACpB,GAAG,EAAE,SAAS;IACd,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,aAAa;IACtB,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,aAAa;CACtB,CAAC;AAMF,eAAe,OAAO,CAAC"}
|
package/dist/schemas.js
CHANGED
|
@@ -7,7 +7,7 @@ export const jsonConfigSchema = {
|
|
|
7
7
|
outputPath: { type: 'string' },
|
|
8
8
|
dataPath: { type: 'string' },
|
|
9
9
|
templatePath: { type: 'string' },
|
|
10
|
-
searchEngine: { type: 'string', enum: ['algolia'] },
|
|
10
|
+
searchEngine: { type: 'string', enum: ['algolia', 'pagefind'] },
|
|
11
11
|
plugins: {
|
|
12
12
|
type: 'array',
|
|
13
13
|
items: {
|
package/dist/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"m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EAAE,EAAC,IAAI,EAAE,QAAQ,EAAC;KACzB;IACD,QAAQ,EAAE,EAAE;CACZ,CAAC"}
|
|
@@ -8,11 +8,13 @@ export declare const getSiteUrl: jest.Mock<string, [], any>;
|
|
|
8
8
|
export declare const getUserPlugins: jest.Mock<{
|
|
9
9
|
plugins: string[];
|
|
10
10
|
}, [], any>;
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const setPlugins: jest.Mock<{
|
|
12
|
+
siteUrl: string;
|
|
13
|
+
searchEngine: string;
|
|
12
14
|
plugins: string[];
|
|
13
15
|
github: {
|
|
14
16
|
author: string;
|
|
15
17
|
repo: string;
|
|
16
18
|
};
|
|
17
|
-
}, [
|
|
19
|
+
}, [], any>;
|
|
18
20
|
//# sourceMappingURL=inquirer-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -7,7 +7,9 @@ export const getSiteUrl = jest.fn(() => 'https://www.example.com');
|
|
|
7
7
|
export const getUserPlugins = jest.fn(() => ({
|
|
8
8
|
plugins: ['robots.txt', 'npm'],
|
|
9
9
|
}));
|
|
10
|
-
export const
|
|
10
|
+
export const setPlugins = jest.fn(() => ({
|
|
11
|
+
siteUrl: 'https://www.example.com',
|
|
12
|
+
searchEngine: 'pagefind',
|
|
11
13
|
plugins: ['github'],
|
|
12
14
|
github: {
|
|
13
15
|
author: 'jaredwray',
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare const getGithubInfo: () => Promise<Record<string, string>>;
|
|
2
2
|
export declare const validateUrl: (value: string) => boolean | string;
|
|
3
|
-
export declare const getSiteUrl: () => Promise<
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
3
|
+
export declare const getSiteUrl: () => Promise<string>;
|
|
4
|
+
export declare const getUserPlugins: (searchEngine: 'algolia' | 'pagefind') => Promise<string[]>;
|
|
5
|
+
export declare const getSearchEngine: () => Promise<'algolia' | 'pagefind'>;
|
|
6
|
+
export declare const getAlgoliaInfo: () => Promise<Record<string, string>>;
|
|
7
|
+
export declare const setPlugins: () => Promise<Record<string, unknown>>;
|
|
7
8
|
//# sourceMappingURL=inquirer-prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,iBAAwB,SAAS,GAAG,UAAU,KAAG,QAAQ,MAAM,EAAE,CAqB3F,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,UAAU,QAAa,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,CAsBlE,CAAC"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import inquirer from 'inquirer';
|
|
2
2
|
import { urlRegex } from './tools.js';
|
|
3
|
-
export const getGithubInfo = async () =>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
]);
|
|
15
|
-
return data;
|
|
16
|
-
};
|
|
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
|
+
]);
|
|
17
14
|
export const validateUrl = (value) => {
|
|
18
|
-
|
|
15
|
+
const trimmed = value.trim();
|
|
16
|
+
if (trimmed.length > 0 && urlRegex.test(trimmed)) {
|
|
19
17
|
return true;
|
|
20
18
|
}
|
|
21
19
|
return 'Please enter a complete URL.';
|
|
@@ -31,32 +29,78 @@ export const getSiteUrl = async () => {
|
|
|
31
29
|
]);
|
|
32
30
|
return siteAnswer.url;
|
|
33
31
|
};
|
|
34
|
-
export const
|
|
35
|
-
if (plugin.endsWith('.txt') || plugin.endsWith('.xml')) {
|
|
36
|
-
return plugin.split('.')[0];
|
|
37
|
-
}
|
|
38
|
-
return plugin;
|
|
39
|
-
});
|
|
40
|
-
export const getUserPlugins = async () => {
|
|
32
|
+
export const getUserPlugins = async (searchEngine) => {
|
|
41
33
|
const userPlugins = await inquirer.prompt([
|
|
42
34
|
{
|
|
43
35
|
type: 'checkbox',
|
|
44
36
|
name: 'plugins',
|
|
45
37
|
message: 'Select the plugins you want to use',
|
|
46
|
-
choices: [
|
|
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, searchEngine];
|
|
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
|
+
},
|
|
47
65
|
},
|
|
48
66
|
]);
|
|
49
|
-
return
|
|
67
|
+
return searchEngine.engine;
|
|
50
68
|
};
|
|
51
|
-
export const
|
|
52
|
-
|
|
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 setPlugins = async () => {
|
|
53
87
|
let githubInfo;
|
|
54
|
-
|
|
88
|
+
let algoliaInfo;
|
|
89
|
+
const siteUrl = await getSiteUrl();
|
|
90
|
+
const searchEngine = await getSearchEngine();
|
|
91
|
+
const plugins = await getUserPlugins(searchEngine);
|
|
92
|
+
if (searchEngine === 'algolia') {
|
|
93
|
+
algoliaInfo = await getAlgoliaInfo();
|
|
94
|
+
}
|
|
95
|
+
if (plugins.includes('github')) {
|
|
55
96
|
githubInfo = await getGithubInfo();
|
|
56
97
|
}
|
|
57
98
|
return {
|
|
58
|
-
|
|
99
|
+
siteUrl,
|
|
100
|
+
searchEngine,
|
|
101
|
+
plugins,
|
|
59
102
|
...(githubInfo && { github: githubInfo }),
|
|
103
|
+
...(algoliaInfo && { algolia: algoliaInfo }),
|
|
60
104
|
};
|
|
61
105
|
};
|
|
62
106
|
//# sourceMappingURL=inquirer-prompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inquirer-prompt.js","sourceRoot":"","sources":["../../src/tools/inquirer-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,IAAqC,EAAE
|
|
1
|
+
{"version":3,"file":"inquirer-prompt.js","sourceRoot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,EAAE,CAAC;IAC7C,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,YAAY,CAAC,CAAC;IAEnD,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,WAAW,GAAG,MAAM,cAAc,EAAE,CAAC;KACrC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAC/B,UAAU,GAAG,MAAM,aAAa,EAAE,CAAC;KACnC;IAED,OAAO;QACN,OAAO;QACP,YAAY;QACZ,OAAO;QACP,GAAG,CAAC,UAAU,IAAI,EAAC,MAAM,EAAE,UAAU,EAAC,CAAC;QACvC,GAAG,CAAC,WAAW,IAAI,EAAC,OAAO,EAAE,WAAW,EAAC,CAAC;KAC1C,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#hits {
|
|
2
|
+
height: calc(100vh - 72px);
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 72px;
|
|
5
|
+
overflow-y: auto;
|
|
6
|
+
background-color: var(--search-input-background);
|
|
7
|
+
width: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
#hits > div {
|
|
11
|
+
padding: 0 24px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.search-box {
|
|
15
|
+
display: flex;
|
|
16
|
+
width: 100%;
|
|
17
|
+
border-color: var(--search-input-background);
|
|
18
|
+
background-color: var(--search-input-background);
|
|
19
|
+
border: none;
|
|
20
|
+
border-bottom: 1px solid var(--border);
|
|
21
|
+
height: 72px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.search-box input {
|
|
25
|
+
border-color: var(--search-input-background);
|
|
26
|
+
border: none !important;
|
|
27
|
+
border-bottom: 1px solid var(--border);
|
|
28
|
+
font-size: 18px;
|
|
29
|
+
height: 71px !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ais-SearchBox {
|
|
33
|
+
position: relative;
|
|
34
|
+
flex: 0.8;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.close-modal--btn {
|
|
38
|
+
flex: 0.2;
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
align-items: center;
|
|
42
|
+
font-size: 13px;
|
|
43
|
+
border-left: 1px solid var(--border);
|
|
44
|
+
margin: 10px 0;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
opacity: 0.6;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.ais-SearchBox-submit, .ais-SearchBox-reset {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 24px;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
opacity: 0.6;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ais-SearchBox-submit svg {
|
|
57
|
+
fill: currentColor;
|
|
58
|
+
width: 16px;
|
|
59
|
+
height: 16px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ais-SearchBox-reset svg {
|
|
63
|
+
fill: currentColor;
|
|
64
|
+
width: 10px;
|
|
65
|
+
height: 10px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ais-SearchBox-submit {
|
|
69
|
+
left: 16px
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ais-SearchBox-reset {
|
|
73
|
+
right: 16px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.search-result {
|
|
77
|
+
padding: 0;
|
|
78
|
+
margin-top: 24px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.search-result hr {
|
|
82
|
+
margin: 46px 0;
|
|
83
|
+
opacity: 0.3
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media screen and (min-width: 640px) {
|
|
87
|
+
.ais-SearchBox {
|
|
88
|
+
flex: 0.9;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.close-modal--btn {
|
|
92
|
+
flex: 0.1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media screen and (min-width: 992px) {
|
|
97
|
+
#hits {
|
|
98
|
+
height: calc(780px - 72px);
|
|
99
|
+
position: fixed;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
#hits > div {
|
|
103
|
+
padding: 0 48px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.search-container {
|
|
107
|
+
height: 780px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.search-box {
|
|
111
|
+
justify-content: center;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ais-SearchBox-submit, .ais-SearchBox-reset {
|
|
115
|
+
top: 16px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ais-SearchBox {
|
|
119
|
+
flex: 0.8;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.close-modal--btn {
|
|
123
|
+
justify-content: flex-end;
|
|
124
|
+
}
|
|
125
|
+
}
|
package/init/_includes/doc.njk
CHANGED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<script src="https://cdn.jsdelivr.net/npm/algoliasearch@4.14.3/dist/algoliasearch-lite.umd.js" integrity="sha256-dyJcbGuYfdzNfifkHxYVd/rzeR6SLLcDFYEidcybldM=" crossorigin="anonymous"></script>
|
|
2
|
+
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@4.50.3/dist/instantsearch.production.min.js" integrity="sha256-VIZm35iFB4ETVstmsxpzZrlLm99QKqIzPuQb1T0ooOc=" crossorigin="anonymous"></script>
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
{% set algoliaKey = config.pluginConfig.algolia.apiKey %}
|
|
7
|
+
{% set algoliaAppId = config.pluginConfig.algolia.appId %}
|
|
8
|
+
{% set algoliaIndexName = config.pluginConfig.algolia.indexName %}
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
const searchClient = algoliasearch('{{algoliaAppId}}', '{{algoliaKey}}');
|
|
12
|
+
const search = instantsearch({
|
|
13
|
+
indexName: '{{algoliaIndexName}}',
|
|
14
|
+
searchClient,
|
|
15
|
+
searchFunction(helper) {
|
|
16
|
+
const results = document.querySelector('#hits');
|
|
17
|
+
results.style.display = helper.state.query === '' ? 'none' : '';
|
|
18
|
+
helper.search();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
search.addWidgets([
|
|
22
|
+
instantsearch.widgets.searchBox({
|
|
23
|
+
container: '#searchbox',
|
|
24
|
+
placeholder: 'Search for concepts',
|
|
25
|
+
autofocus: true,
|
|
26
|
+
}),
|
|
27
|
+
instantsearch.widgets.hits({
|
|
28
|
+
container: '#hits',
|
|
29
|
+
templates: {
|
|
30
|
+
empty(results, { html }) {
|
|
31
|
+
return html`No results for <q>${results.query}</q>`;
|
|
32
|
+
},
|
|
33
|
+
item(hit, { html, components }) {
|
|
34
|
+
return html`
|
|
35
|
+
<article class="search-result">
|
|
36
|
+
<a href="${hit.url}">
|
|
37
|
+
<h2>${components.Highlight({ hit, attribute: 'title', highlightedTagName: 'span' })}</h2>
|
|
38
|
+
<p>${components.Highlight({ hit, attribute: 'description', highlightedTagName: 'span' })}</p>
|
|
39
|
+
</a>
|
|
40
|
+
<hr />
|
|
41
|
+
</article>
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}),
|
|
46
|
+
]);
|
|
47
|
+
search.start();
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
const searchBtn = document.querySelector('#search-btn');
|
|
52
|
+
const closeModalBtn = document.querySelector('#close-modal-btn');
|
|
53
|
+
const searchModal = document.querySelector('#search-modal');
|
|
54
|
+
|
|
55
|
+
const closeEmptyModal = (e) => {
|
|
56
|
+
const algoliaInput = document.querySelector('.ais-SearchBox-input');
|
|
57
|
+
if(algoliaInput) {
|
|
58
|
+
if(!algoliaInput.value ) {
|
|
59
|
+
if (algoliaInput === e.target || algoliaInput.contains(e.target)) return;
|
|
60
|
+
searchModal.classList.remove('show-modal');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const closeDesktopModal = (e) => {
|
|
66
|
+
const algoliaInput = document.querySelector('.ais-SearchBox-input');
|
|
67
|
+
if(isDesktop && algoliaInput) {
|
|
68
|
+
if(algoliaInput.value ) {
|
|
69
|
+
if (searchModalContainer === e.target || searchModalContainer.contains(e.target)) return;
|
|
70
|
+
searchModal.classList.remove('show-modal');
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
searchModal.addEventListener('click', (e) => {
|
|
76
|
+
closeEmptyModal(e);
|
|
77
|
+
closeDesktopModal(e)
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const autofocusInput = () => {
|
|
81
|
+
const algoliaInput = document.querySelector('.ais-SearchBox-input');
|
|
82
|
+
if (algoliaInput) {
|
|
83
|
+
algoliaInput.focus();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const handleSearchModal = () => {
|
|
88
|
+
searchModal.classList.add('show-modal');
|
|
89
|
+
autofocusInput()
|
|
90
|
+
};
|
|
91
|
+
searchBtn.addEventListener('click', handleSearchModal);
|
|
92
|
+
|
|
93
|
+
if(closeModalBtn) {
|
|
94
|
+
closeModalBtn.addEventListener('click', () => {
|
|
95
|
+
searchModal.classList.remove('show-modal');
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
</script>
|
|
@@ -9,5 +9,9 @@
|
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap" rel="stylesheet">
|
|
11
11
|
<link rel="stylesheet" href="/assets/css/highlight/styles/base16/dracula.min.css">
|
|
12
|
-
|
|
12
|
+
{% if config.searchEngine == 'algolia' %}
|
|
13
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/instantsearch.css@8.0.0/themes/reset-min.css" integrity="sha256-2AeJLzExpZvqLUxMfcs+4DWcMwNfpnjUeAAvEtPr0wU=" crossorigin="anonymous">
|
|
14
|
+
<link rel="stylesheet" href="/assets/css/styles/algolia.css">
|
|
15
|
+
{% endif %}
|
|
16
|
+
|
|
13
17
|
</head>
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
|
|
38
38
|
</article>
|
|
39
39
|
|
|
40
|
-
<div class="on-page-container on-page--desktop
|
|
41
|
-
<div class="on-page
|
|
40
|
+
<div class="on-page-container on-page--desktop">
|
|
41
|
+
<div class="hidden" id="on-page">
|
|
42
42
|
<h5>On this page</h5>
|
|
43
43
|
{{ content | toc | safe }}
|
|
44
44
|
</div>
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
const handleScroll = () => {
|
|
9
9
|
const onPage = document.querySelector('#on-page');
|
|
10
10
|
if(!isHome) {
|
|
11
|
-
if (window.scrollY >
|
|
11
|
+
if (window.scrollY > 250 && window.innerWidth >= 1458) {
|
|
12
12
|
onPage.classList.remove('hidden');
|
|
13
|
+
onPage.classList.add('on-page-fixed');
|
|
13
14
|
} else {
|
|
14
15
|
onPage.classList.add('hidden');
|
|
16
|
+
onPage.classList.remove('on-page-fixed');
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
};
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
<div class="search-modal" id="search-modal">
|
|
2
2
|
<div class="search-container" id="search-container">
|
|
3
|
+
{% if config.searchEngine == 'algolia' %}
|
|
4
|
+
<div id="searchbox" class="search-box">
|
|
5
|
+
<span class="close-modal--btn" id="close-modal-btn">Cancel</span>
|
|
6
|
+
</div>
|
|
7
|
+
<div id="hits"></div>
|
|
8
|
+
|
|
9
|
+
{% elif config.searchEngine == 'pagefind' %}
|
|
3
10
|
<div id="search" class="search-box">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
<span class="close-modal-btn hide-d" id="close-modal-btn">
|
|
12
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"/>
|
|
13
|
+
</svg>
|
|
14
|
+
</span>
|
|
8
15
|
</div>
|
|
16
|
+
|
|
17
|
+
{% endif %}
|
|
9
18
|
</div>
|
|
10
19
|
</div>
|
package/init/index.njk
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
permalink: algolia.json
|
|
3
|
+
templateEngineOverride: njk
|
|
4
|
+
---
|
|
5
|
+
[
|
|
6
|
+
{%- for item in collections.docs -%}
|
|
7
|
+
{
|
|
8
|
+
"url" : "{{ item.url }}",
|
|
9
|
+
"title" : "{{ item.data.title }}",
|
|
10
|
+
"description" : "{{ item.templateContent | striptags }}",
|
|
11
|
+
"objectID": "{{ item.url }}"
|
|
12
|
+
}{% if not loop.last %},{% else %}{%- endif -%}
|
|
13
|
+
{%- endfor -%}
|
|
14
|
+
]
|
package/init/versions.njk
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docula",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Open Source Static Site Generator",
|
|
5
5
|
"exports": "./dist/docula.js",
|
|
6
6
|
"types": "./dist/docula.d.ts",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/jaredwray/docula#readme",
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@types/express": "^4.17.
|
|
43
|
+
"@types/express": "^4.17.17",
|
|
44
44
|
"@types/fs-extra": "^11.0.1",
|
|
45
45
|
"@types/inquirer": "^9.0.3",
|
|
46
46
|
"@types/jest": "^29.4.0",
|
|
47
47
|
"@types/luxon": "^3.2.0",
|
|
48
|
-
"jest": "^29.4.
|
|
48
|
+
"jest": "^29.4.3",
|
|
49
49
|
"jest-ts-webcompat-resolver": "^1.0.0",
|
|
50
50
|
"ts-jest": "^29.0.5",
|
|
51
51
|
"ts-jest-resolver": "^2.0.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@types/markdown-it": "^12.2.3",
|
|
59
59
|
"ajv": "^6.12.6",
|
|
60
60
|
"algoliasearch": "^4.14.3",
|
|
61
|
-
"axios": "^1.3.
|
|
61
|
+
"axios": "^1.3.4",
|
|
62
62
|
"commander": "^10.0.0",
|
|
63
63
|
"dayjs": "^1.11.7",
|
|
64
64
|
"dotenv": "^16.0.3",
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
"express": "^4.18.2",
|
|
68
68
|
"fs-extra": "^11.1.0",
|
|
69
69
|
"inquirer": "^9.1.4",
|
|
70
|
-
"instantsearch.js": "^4.
|
|
70
|
+
"instantsearch.js": "^4.51.1",
|
|
71
71
|
"luxon": "^3.2.1",
|
|
72
72
|
"markdown-it": "^13.0.1",
|
|
73
|
-
"markdown-it-anchor": "^8.6.
|
|
73
|
+
"markdown-it-anchor": "^8.6.7",
|
|
74
74
|
"node-fetch": "3.3.0",
|
|
75
75
|
"winston": "^3.8.2"
|
|
76
76
|
},
|