@ui-doc/vite 0.1.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/LICENSE.md +9 -0
- package/README.md +52 -0
- package/dist/index.cjs +222 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.mjs +218 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +63 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# UI-Doc vite plugin
|
|
2
|
+
|
|
3
|
+
Integrates UI-Doc into vite by using the `@ui-doc/rollup` plugin and add functionality to vite dev server to display / preview the UI-Doc.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
# npm
|
|
9
|
+
npm install --save-dev @ui-doc/vite @ui-doc/html-renderer @highlightjs/cdn-assets
|
|
10
|
+
|
|
11
|
+
# yarn
|
|
12
|
+
yarn add --dev @ui-doc/vite @ui-doc/html-renderer @highlightjs/cdn-assets
|
|
13
|
+
|
|
14
|
+
# pnpm
|
|
15
|
+
pnpm install --save-dev @ui-doc/vite @ui-doc/html-renderer @highlightjs/cdn-assets
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Setup
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import uidoc from '@ui-doc/vite'
|
|
22
|
+
import { defineConfig } from 'vite'
|
|
23
|
+
|
|
24
|
+
export default defineConfig({
|
|
25
|
+
build: {
|
|
26
|
+
outDir: 'dist/vite',
|
|
27
|
+
rollupOptions: {
|
|
28
|
+
input: {
|
|
29
|
+
app: 'css/index.css',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
plugins: [
|
|
35
|
+
uidoc({
|
|
36
|
+
settings: {
|
|
37
|
+
generate: {
|
|
38
|
+
logo: () => 'Vite',
|
|
39
|
+
},
|
|
40
|
+
texts: {
|
|
41
|
+
title: 'Vite Example',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
source: ['css/**/*.css'],
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
})
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Options
|
|
51
|
+
|
|
52
|
+
Please see the Options from `@ui-doc/rollup` they are the same.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var createRollupPlugin = require('@ui-doc/rollup');
|
|
6
|
+
var require$$0 = require('tty');
|
|
7
|
+
|
|
8
|
+
function getDefaultExportFromCjs (x) {
|
|
9
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function commonjsRequire(path) {
|
|
13
|
+
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var picocolors = {exports: {}};
|
|
17
|
+
|
|
18
|
+
let argv = process.argv || [],
|
|
19
|
+
env = process.env;
|
|
20
|
+
let isColorSupported =
|
|
21
|
+
!("NO_COLOR" in env || argv.includes("--no-color")) &&
|
|
22
|
+
("FORCE_COLOR" in env ||
|
|
23
|
+
argv.includes("--color") ||
|
|
24
|
+
process.platform === "win32" ||
|
|
25
|
+
(commonjsRequire != null && require$$0.isatty(1) && env.TERM !== "dumb") ||
|
|
26
|
+
"CI" in env);
|
|
27
|
+
|
|
28
|
+
let formatter =
|
|
29
|
+
(open, close, replace = open) =>
|
|
30
|
+
input => {
|
|
31
|
+
let string = "" + input;
|
|
32
|
+
let index = string.indexOf(close, open.length);
|
|
33
|
+
return ~index
|
|
34
|
+
? open + replaceClose(string, close, replace, index) + close
|
|
35
|
+
: open + string + close
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
let replaceClose = (string, close, replace, index) => {
|
|
39
|
+
let result = "";
|
|
40
|
+
let cursor = 0;
|
|
41
|
+
do {
|
|
42
|
+
result += string.substring(cursor, index) + replace;
|
|
43
|
+
cursor = index + close.length;
|
|
44
|
+
index = string.indexOf(close, cursor);
|
|
45
|
+
} while (~index)
|
|
46
|
+
return result + string.substring(cursor)
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
let createColors = (enabled = isColorSupported) => {
|
|
50
|
+
let init = enabled ? formatter : () => String;
|
|
51
|
+
return {
|
|
52
|
+
isColorSupported: enabled,
|
|
53
|
+
reset: init("\x1b[0m", "\x1b[0m"),
|
|
54
|
+
bold: init("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
55
|
+
dim: init("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
56
|
+
italic: init("\x1b[3m", "\x1b[23m"),
|
|
57
|
+
underline: init("\x1b[4m", "\x1b[24m"),
|
|
58
|
+
inverse: init("\x1b[7m", "\x1b[27m"),
|
|
59
|
+
hidden: init("\x1b[8m", "\x1b[28m"),
|
|
60
|
+
strikethrough: init("\x1b[9m", "\x1b[29m"),
|
|
61
|
+
black: init("\x1b[30m", "\x1b[39m"),
|
|
62
|
+
red: init("\x1b[31m", "\x1b[39m"),
|
|
63
|
+
green: init("\x1b[32m", "\x1b[39m"),
|
|
64
|
+
yellow: init("\x1b[33m", "\x1b[39m"),
|
|
65
|
+
blue: init("\x1b[34m", "\x1b[39m"),
|
|
66
|
+
magenta: init("\x1b[35m", "\x1b[39m"),
|
|
67
|
+
cyan: init("\x1b[36m", "\x1b[39m"),
|
|
68
|
+
white: init("\x1b[37m", "\x1b[39m"),
|
|
69
|
+
gray: init("\x1b[90m", "\x1b[39m"),
|
|
70
|
+
bgBlack: init("\x1b[40m", "\x1b[49m"),
|
|
71
|
+
bgRed: init("\x1b[41m", "\x1b[49m"),
|
|
72
|
+
bgGreen: init("\x1b[42m", "\x1b[49m"),
|
|
73
|
+
bgYellow: init("\x1b[43m", "\x1b[49m"),
|
|
74
|
+
bgBlue: init("\x1b[44m", "\x1b[49m"),
|
|
75
|
+
bgMagenta: init("\x1b[45m", "\x1b[49m"),
|
|
76
|
+
bgCyan: init("\x1b[46m", "\x1b[49m"),
|
|
77
|
+
bgWhite: init("\x1b[47m", "\x1b[49m"),
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
picocolors.exports = createColors();
|
|
82
|
+
picocolors.exports.createColors = createColors;
|
|
83
|
+
|
|
84
|
+
var picocolorsExports = picocolors.exports;
|
|
85
|
+
var pc = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports);
|
|
86
|
+
|
|
87
|
+
var version = "0.1.0";
|
|
88
|
+
|
|
89
|
+
/* eslint-disable sort-keys */
|
|
90
|
+
const PLUGIN_NAME = 'ui-doc';
|
|
91
|
+
function resolveOptions(options) {
|
|
92
|
+
var _a;
|
|
93
|
+
options.outputDir = (_a = options.outputDir) !== null && _a !== void 0 ? _a : 'ui-doc';
|
|
94
|
+
return options;
|
|
95
|
+
}
|
|
96
|
+
function normalizeRollupInput(input) {
|
|
97
|
+
if (!input) {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
if (typeof input === 'string') {
|
|
101
|
+
return [input];
|
|
102
|
+
}
|
|
103
|
+
if (Array.isArray(input)) {
|
|
104
|
+
return input;
|
|
105
|
+
}
|
|
106
|
+
return Object.values(input);
|
|
107
|
+
}
|
|
108
|
+
function prepareServe(plugin, options, config) {
|
|
109
|
+
var _a, _b, _c, _d;
|
|
110
|
+
if (options.outputDir === undefined) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const pathPrefix = `/${options.outputDir.endsWith('/') ? options.outputDir : `${options.outputDir}/`}`;
|
|
114
|
+
// replace resolveUrl to make sure that all assets are resolved correctly for vite server
|
|
115
|
+
(_a = plugin.api) === null || _a === void 0 ? void 0 : _a.uidoc.replaceGenerate('resolveUrl', (uri, type) => {
|
|
116
|
+
if (type === 'asset' || type === 'asset-example') {
|
|
117
|
+
return `/${uri}`;
|
|
118
|
+
}
|
|
119
|
+
return `${pathPrefix}${uri}`;
|
|
120
|
+
});
|
|
121
|
+
// include vite client in ui-kit assets
|
|
122
|
+
(_b = plugin.api) === null || _b === void 0 ? void 0 : _b.uidoc.addAsset({
|
|
123
|
+
type: 'script',
|
|
124
|
+
src: '@vite/client',
|
|
125
|
+
attrs: { type: 'module' },
|
|
126
|
+
});
|
|
127
|
+
// use user inputs as example assets
|
|
128
|
+
normalizeRollupInput((_d = (_c = config.build) === null || _c === void 0 ? void 0 : _c.rollupOptions) === null || _d === void 0 ? void 0 : _d.input).forEach(input => {
|
|
129
|
+
var _a;
|
|
130
|
+
(_a = plugin.api) === null || _a === void 0 ? void 0 : _a.uidocAsset(input, 'example');
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
async function uidocPlugin(rawOptions) {
|
|
134
|
+
const options = resolveOptions(rawOptions);
|
|
135
|
+
const plugin = (await createRollupPlugin(options));
|
|
136
|
+
plugin.name = PLUGIN_NAME;
|
|
137
|
+
plugin.version = version;
|
|
138
|
+
if (!plugin.api) {
|
|
139
|
+
throw new Error('UI-Doc rollup plugin API is not available');
|
|
140
|
+
}
|
|
141
|
+
plugin.api.version = version;
|
|
142
|
+
plugin.onLog = (_level, log) => {
|
|
143
|
+
// hide rollup output logs
|
|
144
|
+
if (log.plugin === createRollupPlugin.PLUGIN_NAME && log.pluginCode === 'OUTPUT') {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
plugin.config = (config, { command }) => {
|
|
149
|
+
if (command === 'serve') {
|
|
150
|
+
prepareServe(plugin, options, config);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
plugin.configureServer = async (server) => {
|
|
154
|
+
var _a, _b, _c, _d, _e;
|
|
155
|
+
const uidoc = (_a = plugin.api) === null || _a === void 0 ? void 0 : _a.uidoc;
|
|
156
|
+
const pathPrefix = (_b = plugin.api) === null || _b === void 0 ? void 0 : _b.options.pathPrefix;
|
|
157
|
+
const assets = (_d = (_c = plugin.api) === null || _c === void 0 ? void 0 : _c.options.assets) !== null && _d !== void 0 ? _d : [];
|
|
158
|
+
if (!uidoc || !pathPrefix) {
|
|
159
|
+
throw new Error('UI-Doc API is not available');
|
|
160
|
+
}
|
|
161
|
+
const regexPage = new RegExp(`^/${pathPrefix}([a-z0-9_\\-]+).html$`);
|
|
162
|
+
const regexExample = new RegExp(`^/${pathPrefix}examples/([a-z0-9_\\-]+).html$`);
|
|
163
|
+
const regexAsset = new RegExp(`^/${pathPrefix}([a-z0-9\\._\\-]+)$`);
|
|
164
|
+
server.middlewares.use((req, res, next) => {
|
|
165
|
+
if (!req.originalUrl) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (req.originalUrl.match(new RegExp(`^/${pathPrefix}?$`))) {
|
|
169
|
+
res.write(uidoc.page('index'));
|
|
170
|
+
res.end();
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const writeContent = (content) => {
|
|
174
|
+
if (content) {
|
|
175
|
+
res.write(content);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
res.statusCode = 404;
|
|
179
|
+
}
|
|
180
|
+
res.end();
|
|
181
|
+
};
|
|
182
|
+
const pageMatch = req.originalUrl.match(regexPage);
|
|
183
|
+
if (pageMatch) {
|
|
184
|
+
writeContent(uidoc.page(pageMatch[1]));
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const exampleMatch = req.originalUrl.match(regexExample);
|
|
188
|
+
if (exampleMatch) {
|
|
189
|
+
writeContent(uidoc.example(exampleMatch[1]));
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (req.originalUrl.match(regexAsset)) {
|
|
193
|
+
const assetName = req.originalUrl.substring(1);
|
|
194
|
+
const asset = assets.find(entry => entry.name === assetName);
|
|
195
|
+
if (asset) {
|
|
196
|
+
res.write(asset.code);
|
|
197
|
+
res.end();
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
next();
|
|
202
|
+
});
|
|
203
|
+
(_e = server.httpServer) === null || _e === void 0 ? void 0 : _e.once('listening', () => {
|
|
204
|
+
setTimeout(() => {
|
|
205
|
+
var _a;
|
|
206
|
+
server.config.logger.info(`\n ${pc.green(`${pc.bold('UI-Doc')} v${version}`)} under /${pc.gray(pathPrefix)} \n`);
|
|
207
|
+
if (Array.isArray((_a = server.resolvedUrls) === null || _a === void 0 ? void 0 : _a.local)) {
|
|
208
|
+
server.resolvedUrls.local.forEach(url => {
|
|
209
|
+
server.config.logger.info(` ${pc.green('➜')} ${pc.bold('Local')}: ${pc.cyan(`${url}${pathPrefix}`)}`);
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}, 300);
|
|
213
|
+
uidoc.on('context-entry', () => {
|
|
214
|
+
server.ws.send({ type: 'full-reload', path: `/${pathPrefix}*` });
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
return plugin;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
exports.default = uidocPlugin;
|
|
222
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js","../src/index.ts"],"sourcesContent":["let argv = process.argv || [],\n\tenv = process.env\nlet isColorSupported =\n\t!(\"NO_COLOR\" in env || argv.includes(\"--no-color\")) &&\n\t(\"FORCE_COLOR\" in env ||\n\t\targv.includes(\"--color\") ||\n\t\tprocess.platform === \"win32\" ||\n\t\t(require != null && require(\"tty\").isatty(1) && env.TERM !== \"dumb\") ||\n\t\t\"CI\" in env)\n\nlet formatter =\n\t(open, close, replace = open) =>\n\tinput => {\n\t\tlet string = \"\" + input\n\t\tlet index = string.indexOf(close, open.length)\n\t\treturn ~index\n\t\t\t? open + replaceClose(string, close, replace, index) + close\n\t\t\t: open + string + close\n\t}\n\nlet replaceClose = (string, close, replace, index) => {\n\tlet result = \"\"\n\tlet cursor = 0\n\tdo {\n\t\tresult += string.substring(cursor, index) + replace\n\t\tcursor = index + close.length\n\t\tindex = string.indexOf(close, cursor)\n\t} while (~index)\n\treturn result + string.substring(cursor)\n}\n\nlet createColors = (enabled = isColorSupported) => {\n\tlet init = enabled ? formatter : () => String\n\treturn {\n\t\tisColorSupported: enabled,\n\t\treset: init(\"\\x1b[0m\", \"\\x1b[0m\"),\n\t\tbold: init(\"\\x1b[1m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[1m\"),\n\t\tdim: init(\"\\x1b[2m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[2m\"),\n\t\titalic: init(\"\\x1b[3m\", \"\\x1b[23m\"),\n\t\tunderline: init(\"\\x1b[4m\", \"\\x1b[24m\"),\n\t\tinverse: init(\"\\x1b[7m\", \"\\x1b[27m\"),\n\t\thidden: init(\"\\x1b[8m\", \"\\x1b[28m\"),\n\t\tstrikethrough: init(\"\\x1b[9m\", \"\\x1b[29m\"),\n\t\tblack: init(\"\\x1b[30m\", \"\\x1b[39m\"),\n\t\tred: init(\"\\x1b[31m\", \"\\x1b[39m\"),\n\t\tgreen: init(\"\\x1b[32m\", \"\\x1b[39m\"),\n\t\tyellow: init(\"\\x1b[33m\", \"\\x1b[39m\"),\n\t\tblue: init(\"\\x1b[34m\", \"\\x1b[39m\"),\n\t\tmagenta: init(\"\\x1b[35m\", \"\\x1b[39m\"),\n\t\tcyan: init(\"\\x1b[36m\", \"\\x1b[39m\"),\n\t\twhite: init(\"\\x1b[37m\", \"\\x1b[39m\"),\n\t\tgray: init(\"\\x1b[90m\", \"\\x1b[39m\"),\n\t\tbgBlack: init(\"\\x1b[40m\", \"\\x1b[49m\"),\n\t\tbgRed: init(\"\\x1b[41m\", \"\\x1b[49m\"),\n\t\tbgGreen: init(\"\\x1b[42m\", \"\\x1b[49m\"),\n\t\tbgYellow: init(\"\\x1b[43m\", \"\\x1b[49m\"),\n\t\tbgBlue: init(\"\\x1b[44m\", \"\\x1b[49m\"),\n\t\tbgMagenta: init(\"\\x1b[45m\", \"\\x1b[49m\"),\n\t\tbgCyan: init(\"\\x1b[46m\", \"\\x1b[49m\"),\n\t\tbgWhite: init(\"\\x1b[47m\", \"\\x1b[49m\"),\n\t}\n}\n\nmodule.exports = createColors()\nmodule.exports.createColors = createColors\n",null],"names":["require","picocolorsModule","ROLLUP_PLUGIN_NAME"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE;AAC7B,CAAC,GAAG,GAAG,OAAO,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AAA,EAAE,CAAC,CAAA;AAClE,aAAC,CAAC,CAAA;AACJ,SAAC,CAAC,CAAA;AACJ,KAAC,CAAA;AAED,IAAA,OAAO,MAAqB,CAAA;AAC9B;;;;","x_google_ignoreList":[0]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Api as RollupPluginApi, type Options as RollupPluginOptions } from '@ui-doc/rollup';
|
|
2
|
+
import type { Plugin } from 'vite';
|
|
3
|
+
export interface Options extends RollupPluginOptions {
|
|
4
|
+
}
|
|
5
|
+
export interface Api extends RollupPluginApi {
|
|
6
|
+
version: string;
|
|
7
|
+
}
|
|
8
|
+
export default function uidocPlugin(rawOptions: Options): Promise<Plugin<Api>>;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import createRollupPlugin, { PLUGIN_NAME as PLUGIN_NAME$1 } from '@ui-doc/rollup';
|
|
2
|
+
import require$$0 from 'tty';
|
|
3
|
+
|
|
4
|
+
function getDefaultExportFromCjs (x) {
|
|
5
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function commonjsRequire(path) {
|
|
9
|
+
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
var picocolors = {exports: {}};
|
|
13
|
+
|
|
14
|
+
let argv = process.argv || [],
|
|
15
|
+
env = process.env;
|
|
16
|
+
let isColorSupported =
|
|
17
|
+
!("NO_COLOR" in env || argv.includes("--no-color")) &&
|
|
18
|
+
("FORCE_COLOR" in env ||
|
|
19
|
+
argv.includes("--color") ||
|
|
20
|
+
process.platform === "win32" ||
|
|
21
|
+
(commonjsRequire != null && require$$0.isatty(1) && env.TERM !== "dumb") ||
|
|
22
|
+
"CI" in env);
|
|
23
|
+
|
|
24
|
+
let formatter =
|
|
25
|
+
(open, close, replace = open) =>
|
|
26
|
+
input => {
|
|
27
|
+
let string = "" + input;
|
|
28
|
+
let index = string.indexOf(close, open.length);
|
|
29
|
+
return ~index
|
|
30
|
+
? open + replaceClose(string, close, replace, index) + close
|
|
31
|
+
: open + string + close
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
let replaceClose = (string, close, replace, index) => {
|
|
35
|
+
let result = "";
|
|
36
|
+
let cursor = 0;
|
|
37
|
+
do {
|
|
38
|
+
result += string.substring(cursor, index) + replace;
|
|
39
|
+
cursor = index + close.length;
|
|
40
|
+
index = string.indexOf(close, cursor);
|
|
41
|
+
} while (~index)
|
|
42
|
+
return result + string.substring(cursor)
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
let createColors = (enabled = isColorSupported) => {
|
|
46
|
+
let init = enabled ? formatter : () => String;
|
|
47
|
+
return {
|
|
48
|
+
isColorSupported: enabled,
|
|
49
|
+
reset: init("\x1b[0m", "\x1b[0m"),
|
|
50
|
+
bold: init("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
|
|
51
|
+
dim: init("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
|
|
52
|
+
italic: init("\x1b[3m", "\x1b[23m"),
|
|
53
|
+
underline: init("\x1b[4m", "\x1b[24m"),
|
|
54
|
+
inverse: init("\x1b[7m", "\x1b[27m"),
|
|
55
|
+
hidden: init("\x1b[8m", "\x1b[28m"),
|
|
56
|
+
strikethrough: init("\x1b[9m", "\x1b[29m"),
|
|
57
|
+
black: init("\x1b[30m", "\x1b[39m"),
|
|
58
|
+
red: init("\x1b[31m", "\x1b[39m"),
|
|
59
|
+
green: init("\x1b[32m", "\x1b[39m"),
|
|
60
|
+
yellow: init("\x1b[33m", "\x1b[39m"),
|
|
61
|
+
blue: init("\x1b[34m", "\x1b[39m"),
|
|
62
|
+
magenta: init("\x1b[35m", "\x1b[39m"),
|
|
63
|
+
cyan: init("\x1b[36m", "\x1b[39m"),
|
|
64
|
+
white: init("\x1b[37m", "\x1b[39m"),
|
|
65
|
+
gray: init("\x1b[90m", "\x1b[39m"),
|
|
66
|
+
bgBlack: init("\x1b[40m", "\x1b[49m"),
|
|
67
|
+
bgRed: init("\x1b[41m", "\x1b[49m"),
|
|
68
|
+
bgGreen: init("\x1b[42m", "\x1b[49m"),
|
|
69
|
+
bgYellow: init("\x1b[43m", "\x1b[49m"),
|
|
70
|
+
bgBlue: init("\x1b[44m", "\x1b[49m"),
|
|
71
|
+
bgMagenta: init("\x1b[45m", "\x1b[49m"),
|
|
72
|
+
bgCyan: init("\x1b[46m", "\x1b[49m"),
|
|
73
|
+
bgWhite: init("\x1b[47m", "\x1b[49m"),
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
picocolors.exports = createColors();
|
|
78
|
+
picocolors.exports.createColors = createColors;
|
|
79
|
+
|
|
80
|
+
var picocolorsExports = picocolors.exports;
|
|
81
|
+
var pc = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports);
|
|
82
|
+
|
|
83
|
+
var version = "0.1.0";
|
|
84
|
+
|
|
85
|
+
/* eslint-disable sort-keys */
|
|
86
|
+
const PLUGIN_NAME = 'ui-doc';
|
|
87
|
+
function resolveOptions(options) {
|
|
88
|
+
var _a;
|
|
89
|
+
options.outputDir = (_a = options.outputDir) !== null && _a !== void 0 ? _a : 'ui-doc';
|
|
90
|
+
return options;
|
|
91
|
+
}
|
|
92
|
+
function normalizeRollupInput(input) {
|
|
93
|
+
if (!input) {
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
if (typeof input === 'string') {
|
|
97
|
+
return [input];
|
|
98
|
+
}
|
|
99
|
+
if (Array.isArray(input)) {
|
|
100
|
+
return input;
|
|
101
|
+
}
|
|
102
|
+
return Object.values(input);
|
|
103
|
+
}
|
|
104
|
+
function prepareServe(plugin, options, config) {
|
|
105
|
+
var _a, _b, _c, _d;
|
|
106
|
+
if (options.outputDir === undefined) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const pathPrefix = `/${options.outputDir.endsWith('/') ? options.outputDir : `${options.outputDir}/`}`;
|
|
110
|
+
// replace resolveUrl to make sure that all assets are resolved correctly for vite server
|
|
111
|
+
(_a = plugin.api) === null || _a === void 0 ? void 0 : _a.uidoc.replaceGenerate('resolveUrl', (uri, type) => {
|
|
112
|
+
if (type === 'asset' || type === 'asset-example') {
|
|
113
|
+
return `/${uri}`;
|
|
114
|
+
}
|
|
115
|
+
return `${pathPrefix}${uri}`;
|
|
116
|
+
});
|
|
117
|
+
// include vite client in ui-kit assets
|
|
118
|
+
(_b = plugin.api) === null || _b === void 0 ? void 0 : _b.uidoc.addAsset({
|
|
119
|
+
type: 'script',
|
|
120
|
+
src: '@vite/client',
|
|
121
|
+
attrs: { type: 'module' },
|
|
122
|
+
});
|
|
123
|
+
// use user inputs as example assets
|
|
124
|
+
normalizeRollupInput((_d = (_c = config.build) === null || _c === void 0 ? void 0 : _c.rollupOptions) === null || _d === void 0 ? void 0 : _d.input).forEach(input => {
|
|
125
|
+
var _a;
|
|
126
|
+
(_a = plugin.api) === null || _a === void 0 ? void 0 : _a.uidocAsset(input, 'example');
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
async function uidocPlugin(rawOptions) {
|
|
130
|
+
const options = resolveOptions(rawOptions);
|
|
131
|
+
const plugin = (await createRollupPlugin(options));
|
|
132
|
+
plugin.name = PLUGIN_NAME;
|
|
133
|
+
plugin.version = version;
|
|
134
|
+
if (!plugin.api) {
|
|
135
|
+
throw new Error('UI-Doc rollup plugin API is not available');
|
|
136
|
+
}
|
|
137
|
+
plugin.api.version = version;
|
|
138
|
+
plugin.onLog = (_level, log) => {
|
|
139
|
+
// hide rollup output logs
|
|
140
|
+
if (log.plugin === PLUGIN_NAME$1 && log.pluginCode === 'OUTPUT') {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
plugin.config = (config, { command }) => {
|
|
145
|
+
if (command === 'serve') {
|
|
146
|
+
prepareServe(plugin, options, config);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
plugin.configureServer = async (server) => {
|
|
150
|
+
var _a, _b, _c, _d, _e;
|
|
151
|
+
const uidoc = (_a = plugin.api) === null || _a === void 0 ? void 0 : _a.uidoc;
|
|
152
|
+
const pathPrefix = (_b = plugin.api) === null || _b === void 0 ? void 0 : _b.options.pathPrefix;
|
|
153
|
+
const assets = (_d = (_c = plugin.api) === null || _c === void 0 ? void 0 : _c.options.assets) !== null && _d !== void 0 ? _d : [];
|
|
154
|
+
if (!uidoc || !pathPrefix) {
|
|
155
|
+
throw new Error('UI-Doc API is not available');
|
|
156
|
+
}
|
|
157
|
+
const regexPage = new RegExp(`^/${pathPrefix}([a-z0-9_\\-]+).html$`);
|
|
158
|
+
const regexExample = new RegExp(`^/${pathPrefix}examples/([a-z0-9_\\-]+).html$`);
|
|
159
|
+
const regexAsset = new RegExp(`^/${pathPrefix}([a-z0-9\\._\\-]+)$`);
|
|
160
|
+
server.middlewares.use((req, res, next) => {
|
|
161
|
+
if (!req.originalUrl) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
if (req.originalUrl.match(new RegExp(`^/${pathPrefix}?$`))) {
|
|
165
|
+
res.write(uidoc.page('index'));
|
|
166
|
+
res.end();
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const writeContent = (content) => {
|
|
170
|
+
if (content) {
|
|
171
|
+
res.write(content);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
res.statusCode = 404;
|
|
175
|
+
}
|
|
176
|
+
res.end();
|
|
177
|
+
};
|
|
178
|
+
const pageMatch = req.originalUrl.match(regexPage);
|
|
179
|
+
if (pageMatch) {
|
|
180
|
+
writeContent(uidoc.page(pageMatch[1]));
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const exampleMatch = req.originalUrl.match(regexExample);
|
|
184
|
+
if (exampleMatch) {
|
|
185
|
+
writeContent(uidoc.example(exampleMatch[1]));
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (req.originalUrl.match(regexAsset)) {
|
|
189
|
+
const assetName = req.originalUrl.substring(1);
|
|
190
|
+
const asset = assets.find(entry => entry.name === assetName);
|
|
191
|
+
if (asset) {
|
|
192
|
+
res.write(asset.code);
|
|
193
|
+
res.end();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
next();
|
|
198
|
+
});
|
|
199
|
+
(_e = server.httpServer) === null || _e === void 0 ? void 0 : _e.once('listening', () => {
|
|
200
|
+
setTimeout(() => {
|
|
201
|
+
var _a;
|
|
202
|
+
server.config.logger.info(`\n ${pc.green(`${pc.bold('UI-Doc')} v${version}`)} under /${pc.gray(pathPrefix)} \n`);
|
|
203
|
+
if (Array.isArray((_a = server.resolvedUrls) === null || _a === void 0 ? void 0 : _a.local)) {
|
|
204
|
+
server.resolvedUrls.local.forEach(url => {
|
|
205
|
+
server.config.logger.info(` ${pc.green('➜')} ${pc.bold('Local')}: ${pc.cyan(`${url}${pathPrefix}`)}`);
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}, 300);
|
|
209
|
+
uidoc.on('context-entry', () => {
|
|
210
|
+
server.ws.send({ type: 'full-reload', path: `/${pathPrefix}*` });
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
return plugin;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { uidocPlugin as default };
|
|
218
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js","../src/index.ts"],"sourcesContent":["let argv = process.argv || [],\n\tenv = process.env\nlet isColorSupported =\n\t!(\"NO_COLOR\" in env || argv.includes(\"--no-color\")) &&\n\t(\"FORCE_COLOR\" in env ||\n\t\targv.includes(\"--color\") ||\n\t\tprocess.platform === \"win32\" ||\n\t\t(require != null && require(\"tty\").isatty(1) && env.TERM !== \"dumb\") ||\n\t\t\"CI\" in env)\n\nlet formatter =\n\t(open, close, replace = open) =>\n\tinput => {\n\t\tlet string = \"\" + input\n\t\tlet index = string.indexOf(close, open.length)\n\t\treturn ~index\n\t\t\t? open + replaceClose(string, close, replace, index) + close\n\t\t\t: open + string + close\n\t}\n\nlet replaceClose = (string, close, replace, index) => {\n\tlet result = \"\"\n\tlet cursor = 0\n\tdo {\n\t\tresult += string.substring(cursor, index) + replace\n\t\tcursor = index + close.length\n\t\tindex = string.indexOf(close, cursor)\n\t} while (~index)\n\treturn result + string.substring(cursor)\n}\n\nlet createColors = (enabled = isColorSupported) => {\n\tlet init = enabled ? formatter : () => String\n\treturn {\n\t\tisColorSupported: enabled,\n\t\treset: init(\"\\x1b[0m\", \"\\x1b[0m\"),\n\t\tbold: init(\"\\x1b[1m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[1m\"),\n\t\tdim: init(\"\\x1b[2m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[2m\"),\n\t\titalic: init(\"\\x1b[3m\", \"\\x1b[23m\"),\n\t\tunderline: init(\"\\x1b[4m\", \"\\x1b[24m\"),\n\t\tinverse: init(\"\\x1b[7m\", \"\\x1b[27m\"),\n\t\thidden: init(\"\\x1b[8m\", \"\\x1b[28m\"),\n\t\tstrikethrough: init(\"\\x1b[9m\", \"\\x1b[29m\"),\n\t\tblack: init(\"\\x1b[30m\", \"\\x1b[39m\"),\n\t\tred: init(\"\\x1b[31m\", \"\\x1b[39m\"),\n\t\tgreen: init(\"\\x1b[32m\", \"\\x1b[39m\"),\n\t\tyellow: init(\"\\x1b[33m\", \"\\x1b[39m\"),\n\t\tblue: init(\"\\x1b[34m\", \"\\x1b[39m\"),\n\t\tmagenta: init(\"\\x1b[35m\", \"\\x1b[39m\"),\n\t\tcyan: init(\"\\x1b[36m\", \"\\x1b[39m\"),\n\t\twhite: init(\"\\x1b[37m\", \"\\x1b[39m\"),\n\t\tgray: init(\"\\x1b[90m\", \"\\x1b[39m\"),\n\t\tbgBlack: init(\"\\x1b[40m\", \"\\x1b[49m\"),\n\t\tbgRed: init(\"\\x1b[41m\", \"\\x1b[49m\"),\n\t\tbgGreen: init(\"\\x1b[42m\", \"\\x1b[49m\"),\n\t\tbgYellow: init(\"\\x1b[43m\", \"\\x1b[49m\"),\n\t\tbgBlue: init(\"\\x1b[44m\", \"\\x1b[49m\"),\n\t\tbgMagenta: init(\"\\x1b[45m\", \"\\x1b[49m\"),\n\t\tbgCyan: init(\"\\x1b[46m\", \"\\x1b[49m\"),\n\t\tbgWhite: init(\"\\x1b[47m\", \"\\x1b[49m\"),\n\t}\n}\n\nmodule.exports = createColors()\nmodule.exports.createColors = createColors\n",null],"names":["require","picocolorsModule","ROLLUP_PLUGIN_NAME"],"mappings":";;;;;;;;;;;;;AAAA,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE;AAC7B,CAAC,GAAG,GAAG,OAAO,CAAC,IAAG;AAClB,IAAI,gBAAgB;AACpB,CAAC,EAAE,UAAU,IAAI,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AACpD,EAAE,aAAa,IAAI,GAAG;AACtB,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC1B,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO;AAC9B,GAAGA,eAAO,IAAI,IAAI,IAAI,UAAc,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC;AACtE,EAAE,IAAI,IAAI,GAAG,EAAC;AACd;AACA,IAAI,SAAS;AACb,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;AAC7B,CAAC,KAAK,IAAI;AACV,EAAE,IAAI,MAAM,GAAG,EAAE,GAAG,MAAK;AACzB,E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,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAK,CAAC,EAAE;oBAC7C,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,IAAG;AACtC,wBAAA,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CACvB,CAAK,EAAA,EAAA,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAK,EAAA,EAAA,EAAE,CAAC,IAAI,CAAC,CAAG,EAAA,GAAG,GAAG,UAAU,CAAA,CAAE,CAAC,CAAA,CAAE,CAC7E,CAAA;AACH,qBAAC,CAAC,CAAA;iBACH;aACF,EAAE,GAAG,CAAC,CAAA;AAEP,YAAA,KAAK,CAAC,EAAE,CAAC,eAAe,EAAE,MAAK;AAC7B,gBAAA,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAA,CAAA,EAAI,UAAU,CAAG,CAAA,CAAA,EAAE,CAAC,CAAA;AAClE,aAAC,CAAC,CAAA;AACJ,SAAC,CAAC,CAAA;AACJ,KAAC,CAAA;AAED,IAAA,OAAO,MAAqB,CAAA;AAC9B;;;;","x_google_ignoreList":[0]}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ui-doc/vite",
|
|
3
|
+
"description": "Vite plugin for UI-Doc generation and preview.",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"ui-doc",
|
|
8
|
+
"styleguide",
|
|
9
|
+
"ui-kit",
|
|
10
|
+
"documentation",
|
|
11
|
+
"generation",
|
|
12
|
+
"vite",
|
|
13
|
+
"vite-plugin"
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/gherrink/ui-doc",
|
|
18
|
+
"directory": "packages/vite"
|
|
19
|
+
},
|
|
20
|
+
"author": "Maurice Busch",
|
|
21
|
+
"homepage": "https://github.com/gherrink/ui-doc/tree/master/packages/vite#readme",
|
|
22
|
+
"bugs": "https://github.com/gherrink/ui-doc/issues",
|
|
23
|
+
"main": "./dist/index.cjs",
|
|
24
|
+
"module": "./dist/index.mjs",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.mjs",
|
|
30
|
+
"default": "./dist/index.cjs"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=16.0.0"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist",
|
|
38
|
+
"LICENSE.md",
|
|
39
|
+
"README.md"
|
|
40
|
+
],
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"sideEffects": false,
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"vite": "^5.0.0"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@ui-doc/rollup": "^0.1.1"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"picocolors": "^1.0.1",
|
|
53
|
+
"vite": "^5.3.1",
|
|
54
|
+
"@ui-doc/rollup": "0.1.1"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "rollup -c",
|
|
58
|
+
"prebuild": "rm -rf dist dist",
|
|
59
|
+
"prerelease": "pnpm build",
|
|
60
|
+
"release": "pnpm --workspace-root package:release $(pwd)",
|
|
61
|
+
"release:dry": "pnpm --workspace-root package:release-dry $(pwd)"
|
|
62
|
+
}
|
|
63
|
+
}
|