"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const doc_methods_1 = require("../../utils/doc-methods");
const doc_1 = require("../../constant/doc");
const { npm } = require('../../utils/npm');
function previewDoc() {
    return __awaiter(this, void 0, void 0, function* () {
        // 合并storybook配置
        (0, doc_methods_1.mergeConfig)();
        // 启动storybook
        npm(['run', 'storybook'], {
            cwd: doc_1.DOC_ROOT_PATH,
        });
    });
}
exports.default = previewDoc;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZG9jLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vY29tbWFuZHMvcHJldmlldy9kb2MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFBQSx5REFBcUQ7QUFDckQsNENBQWtEO0FBQ2xELE1BQU0sRUFBRSxHQUFHLEVBQUUsR0FBRyxPQUFPLENBQUMsaUJBQWlCLENBQUMsQ0FBQTtBQUUxQyxTQUFlLFVBQVU7O1FBQ3ZCLGdCQUFnQjtRQUNoQixJQUFBLHlCQUFXLEdBQUUsQ0FBQTtRQUViLGNBQWM7UUFDZCxHQUFHLENBQUMsQ0FBQyxLQUFLLEVBQUUsV0FBVyxDQUFDLEVBQUU7WUFDeEIsR0FBRyxFQUFFLG1CQUFhO1NBQ25CLENBQUMsQ0FBQTtJQUNKLENBQUM7Q0FBQTtBQUVELGtCQUFlLFVBQVUsQ0FBQSJ9