docus 1.0.6 → 3.0.0-beta.1
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 +9 -22
- package/app/router.options.ts +18 -0
- package/assets/css/fonts.css +84 -0
- package/assets/css/main.css +11 -0
- package/assets/css/tailwind.css +282 -0
- package/components/app/Container.vue +23 -0
- package/components/app/Footer.vue +38 -0
- package/components/app/Navbar.vue +26 -0
- package/components/app/NavbarLogo.vue +31 -0
- package/components/app/Page.vue +7 -0
- package/components/app/PoweredByDocus.vue +11 -0
- package/components/content/Alert.vue +124 -0
- package/components/content/BlockHero.vue +54 -0
- package/components/content/ButtonLink.vue +44 -0
- package/components/content/Card.vue +46 -0
- package/components/content/CardGrid.vue +23 -0
- package/components/content/CodeBlock.vue +47 -0
- package/components/content/CodeGroup.vue +134 -0
- package/components/content/CopyButton.vue +48 -0
- package/components/content/List.vue +5 -0
- package/components/content/NeedContribution.vue +23 -0
- package/components/content/ReadMore.vue +24 -0
- package/components/content/Sandbox.vue +100 -0
- package/components/content/TabsHeader.vue +44 -0
- package/components/content/Terminal.vue +70 -0
- package/components/content/VideoPlayer.vue +113 -0
- package/components/docs/DocsAside.vue +19 -0
- package/components/docs/DocsAsideTree.vue +101 -0
- package/components/docs/DocsHero.vue +39 -0
- package/components/docs/DocsPage.vue +22 -0
- package/components/docs/DocsPageContent.vue +29 -0
- package/components/docs/DocsToc.vue +72 -0
- package/components/globals/Icon.vue +24 -0
- package/components/globals/Logo.vue +3 -0
- package/components/globals/NuxtImg.vue +43 -0
- package/components/globals/SocialIcons.vue +43 -0
- package/components/globals/ThemeSelect.vue +35 -0
- package/components/icons/IconAlgolia.vue +8 -0
- package/components/icons/IconArrowLeft.vue +10 -0
- package/components/icons/IconArrowRight.vue +10 -0
- package/components/icons/IconBadgeCheck.vue +14 -0
- package/components/icons/IconCheck.vue +10 -0
- package/components/icons/IconCheckCircle.vue +10 -0
- package/components/icons/IconChevronRight.vue +12 -0
- package/components/icons/IconClipboardCheck.vue +14 -0
- package/components/icons/IconClipboardCopy.vue +14 -0
- package/components/icons/IconCodeSandbox.vue +8 -0
- package/components/icons/IconCopy.vue +17 -0
- package/components/icons/IconDots.vue +10 -0
- package/components/icons/IconEdit.vue +18 -0
- package/components/icons/IconExclamationCircle.vue +12 -0
- package/components/icons/IconExclamationTriangle.vue +10 -0
- package/components/icons/IconExternalLink.vue +12 -0
- package/components/icons/IconGit.vue +7 -0
- package/components/icons/IconGitHub.vue +10 -0
- package/components/icons/IconHeart.vue +9 -0
- package/components/icons/IconInformationCircle.vue +10 -0
- package/components/icons/IconLighthouse.vue +83 -0
- package/components/icons/IconLine.vue +10 -0
- package/components/icons/IconMarkdown.vue +13 -0
- package/components/icons/IconMenu.vue +12 -0
- package/components/icons/IconMenuAlt.vue +10 -0
- package/components/icons/IconMinus.vue +10 -0
- package/components/icons/IconMoon.vue +10 -0
- package/components/icons/IconNuxt.vue +14 -0
- package/components/icons/IconNuxtContent.vue +20 -0
- package/components/icons/IconNuxtLabs.vue +21 -0
- package/components/icons/IconPlus.vue +10 -0
- package/components/icons/IconPuzzle.vue +8 -0
- package/components/icons/IconSSG.vue +7 -0
- package/components/icons/IconSearch.vue +12 -0
- package/components/icons/IconSun.vue +10 -0
- package/components/icons/IconTocBack.vue +21 -0
- package/components/icons/IconTocCurrent.vue +21 -0
- package/components/icons/IconTocNext.vue +8 -0
- package/components/icons/IconTranslate.vue +14 -0
- package/components/icons/IconTwitter.vue +8 -0
- package/components/icons/IconVite.vue +30 -0
- package/components/icons/IconVue.vue +6 -0
- package/components/icons/IconVueTelescope.vue +11 -0
- package/components/icons/IconWindi.vue +17 -0
- package/components/icons/IconX.vue +12 -0
- package/components/icons/IconXCircle.vue +10 -0
- package/components/icons/IconZap.vue +8 -0
- package/components/prose/ProseA.vue +66 -0
- package/components/prose/ProseBlockquote.vue +21 -0
- package/components/prose/ProseCode.vue +68 -0
- package/components/prose/ProseCodeInline.vue +38 -0
- package/components/prose/ProseEm.vue +11 -0
- package/components/prose/ProseH1.vue +22 -0
- package/components/prose/ProseH2.vue +22 -0
- package/components/prose/ProseH3.vue +24 -0
- package/components/prose/ProseH4.vue +24 -0
- package/components/prose/ProseHr.vue +13 -0
- package/components/prose/ProseImg.vue +32 -0
- package/components/prose/ProseLi.vue +31 -0
- package/components/prose/ProseOl.vue +16 -0
- package/components/prose/ProseP.vue +14 -0
- package/components/prose/ProseStrong.vue +14 -0
- package/components/prose/ProseTable.vue +13 -0
- package/components/prose/ProseTbody.vue +5 -0
- package/components/prose/ProseTd.vue +11 -0
- package/components/prose/ProseTh.vue +11 -0
- package/components/prose/ProseThead.vue +11 -0
- package/components/prose/ProseTr.vue +11 -0
- package/components/prose/ProseUl.vue +15 -0
- package/composables/useContent.ts +155 -0
- package/composables/useMenu.ts +20 -0
- package/composables/useScrollToHeading.ts +35 -0
- package/composables/useScrollspy.ts +45 -0
- package/composables/useTheme.ts +10 -0
- package/layouts/default.vue +27 -0
- package/layouts/page.vue +11 -0
- package/nuxt.config.ts +151 -0
- package/package.json +45 -63
- package/pages/[...slug].vue +24 -0
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/site.webmanifest +1 -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
|
-
}
|