@ama-openapi/redocly-plugin 0.0.0-placeholder
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/package.json +98 -0
- package/src/constants.d.mts +3 -0
- package/src/constants.d.mts.map +1 -0
- package/src/constants.mjs +3 -0
- package/src/constants.mjs.map +1 -0
- package/src/logger.d.mts +26 -0
- package/src/logger.d.mts.map +1 -0
- package/src/logger.mjs +41 -0
- package/src/logger.mjs.map +1 -0
- package/src/plugin.d.mts +13 -0
- package/src/plugin.d.mts.map +1 -0
- package/src/plugin.mjs +19 -0
- package/src/plugin.mjs.map +1 -0
- package/src/plugins/meta/retrieve-dependency.meta.d.mts +17 -0
- package/src/plugins/meta/retrieve-dependency.meta.d.mts.map +1 -0
- package/src/plugins/meta/retrieve-dependency.meta.mjs +30 -0
- package/src/plugins/meta/retrieve-dependency.meta.mjs.map +1 -0
- package/src/public_api.d.mts +3 -0
- package/src/public_api.d.mts.map +1 -0
- package/src/public_api.mjs +3 -0
- package/src/public_api.mjs.map +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ama-openapi/redocly-plugin",
|
|
3
|
+
"version": "0.0.0-placeholder",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"description": "Redocly plugins library to manage OpenAPI models",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"otter",
|
|
11
|
+
"otter-module",
|
|
12
|
+
"openapi",
|
|
13
|
+
"redocly"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": {
|
|
17
|
+
"default": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
".": {
|
|
20
|
+
"module": "./src/public_api.mjs",
|
|
21
|
+
"typings": "./src/public_api.d.mts",
|
|
22
|
+
"default": "./src/public_api.mjs"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"nx": "nx",
|
|
27
|
+
"ng": "yarn nx",
|
|
28
|
+
"build:source": "tsc -b tsconfig.build.json && yarn cpy package.json dist/",
|
|
29
|
+
"build": "yarn nx build ama-openapi-redocly",
|
|
30
|
+
"postbuild": "patch-package-json-main"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@ama-openapi/core": "workspace:~",
|
|
34
|
+
"dotenv": "~17.2.3",
|
|
35
|
+
"tslib": "^2.6.2",
|
|
36
|
+
"yargs": "~18.0.0"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@o3r/telemetry": "workspace:~",
|
|
40
|
+
"@redocly/openapi-core": "^2.8.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependenciesMeta": {
|
|
43
|
+
"@o3r/telemetry": {
|
|
44
|
+
"optional": true
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@babel/core": "~7.28.0",
|
|
49
|
+
"@babel/preset-env": "~7.28.0",
|
|
50
|
+
"@babel/preset-typescript": "~7.28.0",
|
|
51
|
+
"@compodoc/compodoc": "^1.1.19",
|
|
52
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
53
|
+
"@nx/eslint": "~21.6.0",
|
|
54
|
+
"@nx/eslint-plugin": "~21.6.0",
|
|
55
|
+
"@nx/jest": "~21.6.0",
|
|
56
|
+
"@nx/js": "~21.6.0",
|
|
57
|
+
"@o3r/build-helpers": "workspace:~",
|
|
58
|
+
"@o3r/eslint-plugin": "workspace:~",
|
|
59
|
+
"@o3r/telemetry": "workspace:~",
|
|
60
|
+
"@o3r/test-helpers": "workspace:~",
|
|
61
|
+
"@redocly/openapi-core": "~2.8.0",
|
|
62
|
+
"@stylistic/eslint-plugin": "~5.5.0",
|
|
63
|
+
"@types/jest": "~29.5.2",
|
|
64
|
+
"@types/js-yaml": "^4.0.5",
|
|
65
|
+
"@types/minimist": "^1.2.2",
|
|
66
|
+
"@types/node": "~22.18.0",
|
|
67
|
+
"@types/semver": "^7.3.13",
|
|
68
|
+
"@types/yargs": "~17.0.33",
|
|
69
|
+
"@typescript-eslint/parser": "~8.46.0",
|
|
70
|
+
"angular-eslint": "~20.4.0",
|
|
71
|
+
"babel-jest": "^29.7.0",
|
|
72
|
+
"cpy-cli": "^6.0.0",
|
|
73
|
+
"eslint": "~9.38.0",
|
|
74
|
+
"eslint-import-resolver-node": "~0.3.9",
|
|
75
|
+
"eslint-import-resolver-typescript": "~4.4.0",
|
|
76
|
+
"eslint-plugin-import": "~2.32.0",
|
|
77
|
+
"eslint-plugin-import-newlines": "~1.4.0",
|
|
78
|
+
"eslint-plugin-jest": "~29.0.0",
|
|
79
|
+
"eslint-plugin-jsdoc": "~54.7.0",
|
|
80
|
+
"eslint-plugin-prefer-arrow": "~1.2.3",
|
|
81
|
+
"eslint-plugin-unicorn": "~60.0.0",
|
|
82
|
+
"eslint-plugin-unused-imports": "~4.3.0",
|
|
83
|
+
"globals": "^16.0.0",
|
|
84
|
+
"jest": "~29.7.0",
|
|
85
|
+
"jest-junit": "~16.0.0",
|
|
86
|
+
"jest-resolve": "~29.7.0",
|
|
87
|
+
"jest-util": "~29.7.0",
|
|
88
|
+
"jsonc-eslint-parser": "~2.4.0",
|
|
89
|
+
"nx": "~21.6.0",
|
|
90
|
+
"pid-from-port": "^1.1.3",
|
|
91
|
+
"ts-jest": "~29.4.0",
|
|
92
|
+
"typescript": "~5.9.2",
|
|
93
|
+
"typescript-eslint": "~8.46.0"
|
|
94
|
+
},
|
|
95
|
+
"engines": {
|
|
96
|
+
"node": "^20.19.0 || ^22.17.0 || ^24.0.0"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/constants.mts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/constants.mts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAAC"}
|
package/src/logger.d.mts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Logger } from '@ama-openapi/core';
|
|
2
|
+
import type { LocationObject, RuleSeverity } from '@redocly/openapi-core';
|
|
3
|
+
/** Duplicate of Problem not exposed by @redocly/openapi-core */
|
|
4
|
+
type Problem = {
|
|
5
|
+
message: string;
|
|
6
|
+
suggest?: string[];
|
|
7
|
+
location?: Partial<LocationObject> | Partial<LocationObject>[];
|
|
8
|
+
from?: LocationObject;
|
|
9
|
+
forceSeverity?: RuleSeverity;
|
|
10
|
+
ruleId?: string;
|
|
11
|
+
};
|
|
12
|
+
/** Log levels for logger */
|
|
13
|
+
export type LogLevel = 'silent' | 'error' | 'warn' | 'info' | 'debug';
|
|
14
|
+
/**
|
|
15
|
+
* Create a Logger from a report function
|
|
16
|
+
* @param report
|
|
17
|
+
*/
|
|
18
|
+
export declare const getLoggerFromReport: (report: (problem: Problem) => void) => Logger;
|
|
19
|
+
/**
|
|
20
|
+
* Get a logger with the specified log level
|
|
21
|
+
* @param level
|
|
22
|
+
* @param logger
|
|
23
|
+
*/
|
|
24
|
+
export declare const getLogger: (level?: LogLevel, logger?: Logger) => Logger;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=logger.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.mts","sourceRoot":"","sources":["../../src/logger.mts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,MAAM,EACP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACb,MAAM,uBAAuB,CAAC;AAE/B,gEAAgE;AAChE,KAAK,OAAO,GAAG;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;IAC/D,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAIF,4BAA4B;AAC5B,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,KAAG,MAMvE,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,QAAQ,QAAQ,EAAE,SAAQ,MAAgB,WAqBnE,CAAC"}
|
package/src/logger.mjs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EOL, } from 'node:os';
|
|
2
|
+
const noop = () => { };
|
|
3
|
+
/**
|
|
4
|
+
* Create a Logger from a report function
|
|
5
|
+
* @param report
|
|
6
|
+
*/
|
|
7
|
+
export const getLoggerFromReport = (report) => ({
|
|
8
|
+
error: (...messages) => report({ forceSeverity: 'error', message: messages.map((msg) => JSON.stringify(msg)).join(EOL) }),
|
|
9
|
+
warn: (...messages) => report({ forceSeverity: 'warn', message: messages.map((msg) => JSON.stringify(msg)).join(EOL) }),
|
|
10
|
+
info: (...messages) => report({ message: messages.map((msg) => JSON.stringify(msg)).join(EOL) }),
|
|
11
|
+
debug: (...messages) => report({ message: messages.map((msg) => JSON.stringify(msg)).join(EOL) }),
|
|
12
|
+
log: (...messages) => report({ message: messages.map((msg) => JSON.stringify(msg)).join(EOL) })
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Get a logger with the specified log level
|
|
16
|
+
* @param level
|
|
17
|
+
* @param logger
|
|
18
|
+
*/
|
|
19
|
+
export const getLogger = (level, logger = console) => {
|
|
20
|
+
if (level) {
|
|
21
|
+
switch (level) {
|
|
22
|
+
case 'silent': {
|
|
23
|
+
logger = { ...logger, error: noop };
|
|
24
|
+
}
|
|
25
|
+
// eslint-disable-next-line no-fallthrough -- done on purpose to disable multiple levels
|
|
26
|
+
case 'error': {
|
|
27
|
+
logger = { ...logger, warn: noop };
|
|
28
|
+
}
|
|
29
|
+
// eslint-disable-next-line no-fallthrough -- done on purpose to disable multiple levels
|
|
30
|
+
case 'warn': {
|
|
31
|
+
logger = { ...logger, info: noop };
|
|
32
|
+
}
|
|
33
|
+
// eslint-disable-next-line no-fallthrough -- done on purpose to disable multiple levels
|
|
34
|
+
case 'info': {
|
|
35
|
+
logger = { ...logger, debug: noop };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return logger;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=logger.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.mjs","sourceRoot":"","sources":["../../src/logger.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,GACJ,MAAM,SAAS,CAAC;AAmBjB,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAKtB;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAkC,EAAU,EAAE,CAAC,CAAC;IAClF,KAAK,EAAE,CAAC,GAAG,QAAe,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAChI,IAAI,EAAE,CAAC,GAAG,QAAe,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IAC9H,IAAI,EAAE,CAAC,GAAG,QAAe,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACvG,KAAK,EAAE,CAAC,GAAG,QAAe,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACxG,GAAG,EAAE,CAAC,GAAG,QAAe,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;CACvG,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAgB,EAAE,SAAiB,OAAO,EAAE,EAAE;IACtE,IAAI,KAAK,EAAE,CAAC;QACV,QAAQ,KAAK,EAAE,CAAC;YACd,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACd,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YACtC,CAAC;YACD,wFAAwF;YACxF,KAAK,OAAO,CAAC,CAAC,CAAC;gBACb,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YACrC,CAAC;YACD,wFAAwF;YACxF,KAAK,MAAM,CAAC,CAAC,CAAC;gBACZ,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YACrC,CAAC;YACD,wFAAwF;YACxF,KAAK,MAAM,CAAC,CAAC,CAAC;gBACZ,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YACtC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/src/plugin.d.mts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type InstallDependenciesOptions } from '@ama-openapi/core';
|
|
2
|
+
import { Plugin } from '@redocly/openapi-core';
|
|
3
|
+
/** Options for ama-openapi plugin */
|
|
4
|
+
export interface AmaOpenapiPluginOptions extends InstallDependenciesOptions {
|
|
5
|
+
/** Skip the download of dependency */
|
|
6
|
+
skipDependencyDownload?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Ama OpenAPI Redocly Plugin
|
|
10
|
+
* @param options
|
|
11
|
+
*/
|
|
12
|
+
export declare const amaOpenapiPlugin: (options?: AmaOpenapiPluginOptions) => Promise<Plugin>;
|
|
13
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","sourceRoot":"","sources":["../../src/plugin.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,0BAA0B,EAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,MAAM,EACP,MAAM,uBAAuB,CAAC;AAW/B,qCAAqC;AACrC,MAAM,WAAW,uBAAwB,SAAQ,0BAA0B;IACzE,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAU,UAAU,uBAAuB,KAAG,OAAO,CAAC,MAAM,CAaxF,CAAC"}
|
package/src/plugin.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { config, } from 'dotenv';
|
|
2
|
+
import { ENVIRONMENT_VARIABLE_PREFIX, } from './constants.mjs';
|
|
3
|
+
import { retrieveDependency, } from './plugins/meta/retrieve-dependency.meta.mjs';
|
|
4
|
+
/**
|
|
5
|
+
* Ama OpenAPI Redocly Plugin
|
|
6
|
+
* @param options
|
|
7
|
+
*/
|
|
8
|
+
export const amaOpenapiPlugin = async (options) => {
|
|
9
|
+
config({ override: true });
|
|
10
|
+
options = {
|
|
11
|
+
skipDependencyDownload: !!process.env[`${ENVIRONMENT_VARIABLE_PREFIX}_SKIP_DOWNLOAD`],
|
|
12
|
+
...options
|
|
13
|
+
};
|
|
14
|
+
await retrieveDependency(options);
|
|
15
|
+
return {
|
|
16
|
+
id: 'ama-openapi'
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.mjs","sourceRoot":"","sources":["../../src/plugin.mts"],"names":[],"mappings":"AAMA,OAAO,EACL,MAAM,GACP,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AAQrD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,OAAiC,EAAmB,EAAE;IAC3F,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAE3B,OAAO,GAAG;QACR,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,2BAA2B,gBAAgB,CAAC;QACrF,GAAG,OAAO;KACX,CAAC;IAEF,MAAM,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAElC,OAAO;QACL,EAAE,EAAE,aAAa;KAClB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type InstallDependenciesOptions } from '@ama-openapi/core';
|
|
2
|
+
import { type LogLevel } from '../../logger.mjs';
|
|
3
|
+
export interface RetrieveDependencyOptions extends InstallDependenciesOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Define the logging level
|
|
6
|
+
* @default 'error'
|
|
7
|
+
*/
|
|
8
|
+
logLevel?: LogLevel;
|
|
9
|
+
/** Continue on dependency download failure */
|
|
10
|
+
noBail?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Retrieve dependencies according to manifest files
|
|
14
|
+
* @param options
|
|
15
|
+
*/
|
|
16
|
+
export declare const retrieveDependency: (options?: RetrieveDependencyOptions) => Promise<void>;
|
|
17
|
+
//# sourceMappingURL=retrieve-dependency.meta.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieve-dependency.meta.d.mts","sourceRoot":"","sources":["../../../../src/plugins/meta/retrieve-dependency.meta.mts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAEL,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,yBAA0B,SAAQ,0BAA0B;IAC3E;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAMD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAU,UAAU,yBAAyB,kBAiB3E,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { installDependencies, } from '@ama-openapi/core';
|
|
2
|
+
import { ENVIRONMENT_VARIABLE_PREFIX, } from '../../constants.mjs';
|
|
3
|
+
import { getLogger, } from '../../logger.mjs';
|
|
4
|
+
const DEFAULT_OPTIONS = {
|
|
5
|
+
logLevel: 'error'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Retrieve dependencies according to manifest files
|
|
9
|
+
* @param options
|
|
10
|
+
*/
|
|
11
|
+
export const retrieveDependency = async (options) => {
|
|
12
|
+
options = {
|
|
13
|
+
...DEFAULT_OPTIONS,
|
|
14
|
+
noBail: !!process.env[`${ENVIRONMENT_VARIABLE_PREFIX}_NO_BAIL`],
|
|
15
|
+
...options
|
|
16
|
+
};
|
|
17
|
+
const logger = getLogger(options?.logLevel || DEFAULT_OPTIONS.logLevel, options?.logger);
|
|
18
|
+
try {
|
|
19
|
+
await installDependencies(process.cwd(), { ...options, logger });
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
if (options?.noBail) {
|
|
23
|
+
logger?.error(e);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
throw e;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=retrieve-dependency.meta.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retrieve-dependency.meta.mjs","sourceRoot":"","sources":["../../../../src/plugins/meta/retrieve-dependency.meta.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAEpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,SAAS,GAEV,MAAM,kBAAkB,CAAC;AAa1B,MAAM,eAAe,GAA8B;IACjD,QAAQ,EAAE,OAAO;CAClB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,OAAmC,EAAE,EAAE;IAC9E,OAAO,GAAG;QACR,GAAG,eAAe;QAClB,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,2BAA2B,UAAU,CAAC;QAC/D,GAAG,OAAO;KACX,CAAC;IACF,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,QAAQ,IAAI,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAEzF,IAAI,CAAC;QACH,MAAM,mBAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IACnE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public_api.d.mts","sourceRoot":"","sources":["../../src/public_api.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public_api.mjs","sourceRoot":"","sources":["../../src/public_api.mts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,gBAAgB,IAAI,OAAO,EAAE,MAAM,cAAc,CAAC"}
|