1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const lodash_1 = require("lodash");
|
4 | const types_1 = require("../../graph/nodes/types");
|
5 | const types_2 = require("./types");
|
6 | exports.STOPLIGHT_CONFIG_PLUGIN_ID = 'STOPLIGHT_CONFIG';
|
7 | exports.STOPLIGHT_CONFIG_PATH = '.stoplight.json';
|
8 | exports.STOPLIGHT_CONFIG_PATH_REGEXP = new RegExp(`^${lodash_1.escapeRegExp(exports.STOPLIGHT_CONFIG_PATH)}$`);
|
9 | exports.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 | ];
|
53 | exports.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 | });
|
59 | exports.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 | };
|
92 | exports.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 |
|
\ | No newline at end of file |