UNPKG

2.98 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const lodash_1 = require("lodash");
4const types_1 = require("../../graph/nodes/types");
5const types_2 = require("./types");
6exports.STOPLIGHT_CONFIG_PLUGIN_ID = 'STOPLIGHT_CONFIG';
7exports.STOPLIGHT_CONFIG_PATH = '.stoplight.json';
8exports.STOPLIGHT_CONFIG_PATH_REGEXP = new RegExp(`^${lodash_1.escapeRegExp(exports.STOPLIGHT_CONFIG_PATH)}$`);
9exports.RECOMMENDED_IGNORE_LIST = [
10 '**/.git',
11 '**/cache',
12 '**/log',
13 '**/tmp',
14 '**/vendor',
15 '**/_deps',
16 '**/target/classes',
17 '**/*.un~',
18 '**/node_modules',
19 '**/.pnp',
20 '**/.pnp.js',
21 '**/.nyc_output',
22 '**/.cache~',
23 '**/dist/**',
24 'Pods/',
25 '**/composer.phar',
26 '**/__pycache__/',
27 '**/*.py[cod]',
28 '**/*$py.class',
29 '**/.Python',
30 '**/develop-eggs/',
31 '**/downloads/',
32 '**/eggs/',
33 '**/.eggs/',
34 '**/lib64/',
35 '**/sdist/',
36 '**/wheels/',
37 '**/pip-wheel-metadata/',
38 '**/share/python-wheels/',
39 '**/*.egg-info/',
40 '**/*.egg',
41 '**/*.manifest',
42 '**/*.spec',
43 '**/.bundle/',
44 '**/db/*.sqlite3',
45 '**/db/*.sqlite3-journal',
46 '**/db/*.sqlite3-[0-9]*',
47 '**/.sass-cache/',
48 '**/.idea/',
49 '**/.vscode/',
50 '**/.DS_Store',
51 '**/.directory',
52];
53exports.DEFAULT_PATHS = Object.freeze({
54 [types_2.StoplightKnownPath.OAS]: 'reference',
55 [types_2.StoplightKnownPath.Json_Schema]: 'models',
56 [types_2.StoplightKnownPath.Markdown]: 'docs',
57 [types_2.StoplightKnownPath.Image]: 'assets/images',
58});
59exports.DEFAULT_CONFIG = {
60 get exclude() {
61 return [...exports.RECOMMENDED_IGNORE_LIST];
62 },
63 get formats() {
64 return {
65 openapi: {
66 rootDir: exports.DEFAULT_PATHS[types_2.StoplightKnownPath.OAS],
67 include: ['**'],
68 },
69 json_schema: {
70 rootDir: exports.DEFAULT_PATHS[types_2.StoplightKnownPath.Json_Schema],
71 include: ['**'],
72 },
73 markdown: {
74 rootDir: exports.DEFAULT_PATHS[types_2.StoplightKnownPath.Markdown],
75 },
76 image: {
77 rootDir: exports.DEFAULT_PATHS[types_2.StoplightKnownPath.Image],
78 },
79 };
80 },
81 get trees() {
82 return {
83 apis: {
84 formats: [types_2.StoplightKnownPath.OAS, types_2.StoplightKnownPath.Json_Schema],
85 },
86 docs: {
87 formats: [types_2.StoplightKnownPath.Markdown, types_2.StoplightKnownPath.Image],
88 },
89 };
90 },
91};
92exports.FORMATS_SPEC_MAP = {
93 [types_1.Specs.OAS2]: types_2.StoplightKnownPath.OAS,
94 [types_1.Specs.OAS3]: types_2.StoplightKnownPath.OAS,
95 [types_1.Specs.Json_Schema]: types_2.StoplightKnownPath.Json_Schema,
96 [types_1.Specs.Markdown]: types_2.StoplightKnownPath.Markdown,
97 [types_1.Specs.Image]: types_2.StoplightKnownPath.Image,
98};
99//# sourceMappingURL=consts.js.map
\No newline at end of file