docus 1.0.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +9 -24
- package/dist/index.cjs +549 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.mjs +523 -0
- package/dist/runtime/app/components/DocusContent.vue +215 -0
- package/dist/runtime/app/components/DocusContent.vue.d.ts +25 -0
- package/dist/runtime/app/components/Error.vue +19 -0
- package/dist/runtime/app/components/Error.vue.d.ts +9 -0
- package/dist/runtime/app/components/Markdown.vue +56 -0
- package/dist/runtime/app/components/Markdown.vue.d.ts +25 -0
- package/dist/runtime/app/components/Page.vue +29 -0
- package/dist/runtime/app/components/Page.vue.d.ts +2 -0
- package/dist/runtime/app/components/Props.vue +130 -0
- package/dist/runtime/app/components/Props.vue.d.ts +80 -0
- package/dist/runtime/app/components/prose/ProseA.vue +41 -0
- package/dist/runtime/app/components/prose/ProseA.vue.d.ts +23 -0
- package/dist/runtime/app/components/prose/ProseBlockquote.vue +5 -0
- package/dist/runtime/app/components/prose/ProseCode.vue +5 -0
- package/dist/runtime/app/components/prose/ProseCodeInline.vue +5 -0
- package/dist/runtime/app/components/prose/ProseEm.vue +5 -0
- package/dist/runtime/app/components/prose/ProseH1.vue +3 -0
- package/dist/runtime/app/components/prose/ProseH2.vue +3 -0
- package/dist/runtime/app/components/prose/ProseH3.vue +3 -0
- package/dist/runtime/app/components/prose/ProseH4.vue +3 -0
- package/dist/runtime/app/components/prose/ProseH5.vue +3 -0
- package/dist/runtime/app/components/prose/ProseH6.vue +3 -0
- package/dist/runtime/app/components/prose/ProseHr.vue +3 -0
- package/dist/runtime/app/components/prose/ProseImg.vue +32 -0
- package/dist/runtime/app/components/prose/ProseImg.vue.d.ts +21 -0
- package/dist/runtime/app/components/prose/ProseLi.vue +3 -0
- package/dist/runtime/app/components/prose/ProseOl.vue +5 -0
- package/dist/runtime/app/components/prose/ProseParagraph.vue +3 -0
- package/dist/runtime/app/components/prose/ProseStrong.vue +5 -0
- package/dist/runtime/app/components/prose/ProseTable.vue +5 -0
- package/dist/runtime/app/components/prose/ProseTbody.vue +5 -0
- package/dist/runtime/app/components/prose/ProseTd.vue +5 -0
- package/dist/runtime/app/components/prose/ProseTh.vue +5 -0
- package/dist/runtime/app/components/prose/ProseThead.vue +5 -0
- package/dist/runtime/app/components/prose/ProseTr.vue +5 -0
- package/dist/runtime/app/components/prose/ProseUl.vue +5 -0
- package/dist/runtime/app/composables/helpers.d.ts +4 -0
- package/dist/runtime/app/composables/helpers.js +66 -0
- package/dist/runtime/app/composables/helpers.mjs +40 -0
- package/dist/runtime/app/composables/index.d.ts +90 -0
- package/dist/runtime/app/composables/index.js +108 -0
- package/dist/runtime/app/composables/index.mjs +63 -0
- package/dist/runtime/app/composables/navigation.d.ts +37 -0
- package/dist/runtime/app/composables/navigation.js +227 -0
- package/dist/runtime/app/composables/navigation.mjs +148 -0
- package/dist/runtime/app/composables/store.d.ts +7 -0
- package/dist/runtime/app/composables/store.js +52 -0
- package/dist/runtime/app/composables/store.mjs +35 -0
- package/dist/runtime/app/composables/style.d.ts +11 -0
- package/dist/runtime/app/composables/style.js +117 -0
- package/dist/runtime/app/composables/style.mjs +71 -0
- package/dist/runtime/app/composables/theme-colors.d.ts +30 -0
- package/dist/runtime/app/composables/theme-colors.js +80 -0
- package/dist/runtime/app/composables/theme-colors.mjs +48 -0
- package/dist/runtime/app/composables/websocket.d.ts +3 -0
- package/dist/runtime/app/composables/websocket.js +79 -0
- package/dist/runtime/app/composables/websocket.mjs +63 -0
- package/dist/runtime/app/layouts/default.vue +5 -0
- package/dist/runtime/app/layouts/error.vue +33 -0
- package/dist/runtime/app/layouts/error.vue.d.ts +21 -0
- package/dist/runtime/app/pages/_.vue +222 -0
- package/dist/runtime/app/pages/_.vue.d.ts +2 -0
- package/dist/runtime/context.d.ts +1 -0
- package/dist/runtime/context.js +17 -0
- package/dist/runtime/context.mjs +5 -0
- package/dist/runtime/database/Query.d.ts +18 -0
- package/dist/runtime/database/Query.js +68 -0
- package/dist/runtime/database/Query.mjs +49 -0
- package/dist/runtime/database/index.d.ts +4 -0
- package/dist/runtime/database/index.js +45 -0
- package/dist/runtime/database/index.mjs +25 -0
- package/dist/runtime/database/providers/local/Query.d.ts +14 -0
- package/dist/runtime/database/providers/local/Query.js +85 -0
- package/dist/runtime/database/providers/local/Query.mjs +60 -0
- package/dist/runtime/database/providers/local/index.d.ts +3 -0
- package/dist/runtime/database/providers/local/index.js +63 -0
- package/dist/runtime/database/providers/local/index.mjs +39 -0
- package/dist/runtime/database/providers/local/operations.d.ts +2 -0
- package/dist/runtime/database/providers/local/operations.js +83 -0
- package/dist/runtime/database/providers/local/operations.mjs +53 -0
- package/dist/runtime/database/providers/local/utils.d.ts +8 -0
- package/dist/runtime/database/providers/local/utils.js +28 -0
- package/dist/runtime/database/providers/local/utils.mjs +17 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.js +44 -0
- package/dist/runtime/index.mjs +3 -0
- package/dist/runtime/navigation.d.ts +4 -0
- package/dist/runtime/navigation.js +176 -0
- package/dist/runtime/navigation.mjs +137 -0
- package/dist/runtime/server/api/get.d.ts +10 -0
- package/dist/runtime/server/api/get.js +24 -0
- package/dist/runtime/server/api/get.mjs +13 -0
- package/dist/runtime/server/api/list.d.ts +9 -0
- package/dist/runtime/server/api/list.js +34 -0
- package/dist/runtime/server/api/list.mjs +18 -0
- package/dist/runtime/server/api/navigation.d.ts +7 -0
- package/dist/runtime/server/api/navigation.js +20 -0
- package/dist/runtime/server/api/navigation.mjs +10 -0
- package/dist/runtime/server/api/preview.d.ts +3 -0
- package/dist/runtime/server/api/preview.js +54 -0
- package/dist/runtime/server/api/preview.mjs +31 -0
- package/dist/runtime/server/api/reload.d.ts +6 -0
- package/dist/runtime/server/api/reload.js +27 -0
- package/dist/runtime/server/api/reload.mjs +11 -0
- package/dist/runtime/server/api/search.d.ts +6 -0
- package/dist/runtime/server/api/search.js +27 -0
- package/dist/runtime/server/api/search.mjs +13 -0
- package/dist/runtime/server/content.d.ts +46 -0
- package/dist/runtime/server/content.js +175 -0
- package/dist/runtime/server/content.mjs +114 -0
- package/dist/runtime/server/socket.d.ts +9 -0
- package/dist/runtime/server/socket.js +33 -0
- package/dist/runtime/server/socket.mjs +20 -0
- package/dist/runtime/server/utils/cache.d.ts +19 -0
- package/dist/runtime/server/utils/cache.js +110 -0
- package/dist/runtime/server/utils/cache.mjs +75 -0
- package/dist/runtime/server/utils/index.d.ts +4 -0
- package/dist/runtime/server/utils/index.js +18 -0
- package/dist/runtime/server/utils/index.mjs +8 -0
- package/dist/runtime/transformers/index.d.ts +1 -0
- package/dist/runtime/transformers/index.js +26 -0
- package/dist/runtime/transformers/index.mjs +11 -0
- package/dist/runtime/transformers/json.d.ts +3 -0
- package/dist/runtime/transformers/json.js +15 -0
- package/dist/runtime/transformers/json.mjs +5 -0
- package/dist/runtime/transformers/markdown/index.d.ts +8 -0
- package/dist/runtime/transformers/markdown/index.js +25 -0
- package/dist/runtime/transformers/markdown/index.mjs +16 -0
- package/dist/runtime/transformers/utils/index.d.ts +1 -0
- package/dist/runtime/transformers/utils/index.js +18 -0
- package/dist/runtime/transformers/utils/index.mjs +1 -0
- package/dist/runtime/transformers/utils/path.d.ts +26 -0
- package/dist/runtime/transformers/utils/path.js +88 -0
- package/dist/runtime/transformers/utils/path.mjs +56 -0
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +18 -0
- package/dist/runtime/utils/index.mjs +1 -0
- package/dist/runtime/utils/log.d.ts +1 -0
- package/dist/runtime/utils/log.js +14 -0
- package/dist/runtime/utils/log.mjs +2 -0
- package/dist/runtime/utils/object.d.ts +9 -0
- package/dist/runtime/utils/object.js +22 -0
- package/dist/runtime/utils/object.mjs +4 -0
- package/dist/templates/content.mjs +50 -0
- package/dist/templates/docus.mjs +13 -0
- package/dist/templates/hot.mjs +16 -0
- package/dist/templates/i18n.mjs +23 -0
- package/dist/templates/options.mjs +46 -0
- package/package.json +78 -58
- package/shims.d.ts +24 -0
- package/types.d.ts +397 -0
- package/dist/create-docus/create-docus.js +0 -7
- package/dist/create-docus/index.js +0 -122
- package/dist/helpers.js +0 -154
- package/dist/index.js +0 -10
package/dist/helpers.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.copy = copy;
|
|
7
|
-
exports.log = log;
|
|
8
|
-
exports.getTemplate = getTemplate;
|
|
9
|
-
exports.overwriteDir = overwriteDir;
|
|
10
|
-
exports.getValidPackageName = getValidPackageName;
|
|
11
|
-
|
|
12
|
-
var _package = require("../package.json");
|
|
13
|
-
|
|
14
|
-
var _fs = _interopRequireDefault(require("fs"));
|
|
15
|
-
|
|
16
|
-
var _path = _interopRequireDefault(require("path"));
|
|
17
|
-
|
|
18
|
-
var _kolorist = require("kolorist");
|
|
19
|
-
|
|
20
|
-
var _prompts = _interopRequireDefault(require("prompts"));
|
|
21
|
-
|
|
22
|
-
var _degit = _interopRequireDefault(require("degit"));
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
|
-
function copyDir(srcDir, destDir) {
|
|
27
|
-
_fs.default.mkdirSync(destDir, {
|
|
28
|
-
recursive: true
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
for (const file of _fs.default.readdirSync(srcDir)) {
|
|
32
|
-
const srcFile = _path.default.resolve(srcDir, file);
|
|
33
|
-
|
|
34
|
-
const destFile = _path.default.resolve(destDir, file);
|
|
35
|
-
|
|
36
|
-
copy(srcFile, destFile);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function emptyDir(dir) {
|
|
41
|
-
if (!_fs.default.existsSync(dir)) return;
|
|
42
|
-
|
|
43
|
-
for (const file of _fs.default.readdirSync(dir)) {
|
|
44
|
-
const abs = _path.default.resolve(dir, file);
|
|
45
|
-
|
|
46
|
-
if (_fs.default.lstatSync(abs).isDirectory()) {
|
|
47
|
-
emptyDir(abs);
|
|
48
|
-
|
|
49
|
-
_fs.default.rmdirSync(abs);
|
|
50
|
-
} else {
|
|
51
|
-
_fs.default.unlinkSync(abs);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function copy(src, dest) {
|
|
57
|
-
const stat = _fs.default.statSync(src);
|
|
58
|
-
|
|
59
|
-
if (stat.isDirectory()) copyDir(src, dest);else _fs.default.copyFileSync(src, dest);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function log() {
|
|
63
|
-
const commands = {
|
|
64
|
-
space: () => console.log(),
|
|
65
|
-
bold: str => (0, _kolorist.bold)(str),
|
|
66
|
-
primary: str => (0, _kolorist.green)(str),
|
|
67
|
-
secondary: str => (0, _kolorist.dim)(str),
|
|
68
|
-
warning: str => (0, _kolorist.yellow)(str),
|
|
69
|
-
broadcast: str => console.log(` ${str}`),
|
|
70
|
-
motd: () => {
|
|
71
|
-
commands.space();
|
|
72
|
-
commands.broadcast(`${(0, _kolorist.bold)("Docus") + commands.secondary(" CLI")} ${commands.primary(`v${_package.version}`)}`);
|
|
73
|
-
commands.space();
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
return commands;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
async function getTemplate() {
|
|
80
|
-
const {
|
|
81
|
-
broadcast,
|
|
82
|
-
primary,
|
|
83
|
-
secondary
|
|
84
|
-
} = log();
|
|
85
|
-
|
|
86
|
-
const templateDir = _path.default.join(__dirname, "./template");
|
|
87
|
-
|
|
88
|
-
broadcast([secondary("Cloning the latest"), primary("Docus"), secondary("template...")].join(" "));
|
|
89
|
-
emptyDir(templateDir);
|
|
90
|
-
const repo = (0, _degit.default)("git@github.com:docusgen/starter.git", {
|
|
91
|
-
force: true,
|
|
92
|
-
verbose: true,
|
|
93
|
-
mode: "git"
|
|
94
|
-
});
|
|
95
|
-
await repo.clone(templateDir);
|
|
96
|
-
return {
|
|
97
|
-
templateDir
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
async function overwriteDir(path2) {
|
|
102
|
-
const {
|
|
103
|
-
broadcast,
|
|
104
|
-
warning,
|
|
105
|
-
space
|
|
106
|
-
} = log();
|
|
107
|
-
|
|
108
|
-
if (!_fs.default.existsSync(path2)) {
|
|
109
|
-
_fs.default.mkdirSync(path2, {
|
|
110
|
-
recursive: true
|
|
111
|
-
});
|
|
112
|
-
} else {
|
|
113
|
-
const existing = _fs.default.readdirSync(path2);
|
|
114
|
-
|
|
115
|
-
const dir = path2.split("/");
|
|
116
|
-
const dirName = dir[dir.length - 1];
|
|
117
|
-
|
|
118
|
-
if (existing.length) {
|
|
119
|
-
space();
|
|
120
|
-
broadcast(warning(`Target directory "${dirName}" is not empty.`));
|
|
121
|
-
space();
|
|
122
|
-
const {
|
|
123
|
-
yes
|
|
124
|
-
} = await (0, _prompts.default)({
|
|
125
|
-
type: "confirm",
|
|
126
|
-
name: "yes",
|
|
127
|
-
initial: "Y",
|
|
128
|
-
message: "Remove existing files and continue?"
|
|
129
|
-
});
|
|
130
|
-
if (yes) emptyDir(path2);else return;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
async function getValidPackageName(projectName) {
|
|
136
|
-
projectName = _path.default.basename(projectName);
|
|
137
|
-
const packageNameRegExp = /^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/;
|
|
138
|
-
|
|
139
|
-
if (packageNameRegExp.test(projectName)) {
|
|
140
|
-
return projectName;
|
|
141
|
-
} else {
|
|
142
|
-
const suggestedPackageName = projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z0-9-~]+/g, "-");
|
|
143
|
-
const {
|
|
144
|
-
inputPackageName
|
|
145
|
-
} = await (0, _prompts.default)({
|
|
146
|
-
type: "text",
|
|
147
|
-
name: "inputPackageName",
|
|
148
|
-
message: "Package name:",
|
|
149
|
-
initial: suggestedPackageName,
|
|
150
|
-
validate: input => packageNameRegExp.test(input) ? true : "Invalid package.json name"
|
|
151
|
-
});
|
|
152
|
-
return inputPackageName;
|
|
153
|
-
}
|
|
154
|
-
}
|