@ama-openapi/redocly-plugin 0.0.0-placeholder → 0.0.0-placeholder.10

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ama-openapi/redocly-plugin",
3
- "version": "0.0.0-placeholder",
3
+ "version": "0.0.0-placeholder.10",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -30,14 +30,14 @@
30
30
  "postbuild": "patch-package-json-main"
31
31
  },
32
32
  "dependencies": {
33
- "@ama-openapi/core": "workspace:~",
33
+ "@ama-openapi/core": "~0.0.0-placeholder.10",
34
34
  "dotenv": "~17.2.3",
35
35
  "tslib": "^2.6.2",
36
36
  "yargs": "~18.0.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "@o3r/telemetry": "workspace:~",
40
- "@redocly/openapi-core": "^2.8.0"
39
+ "@o3r/telemetry": "~0.0.0-placeholder.10",
40
+ "@redocly/openapi-core": "^2.11.0"
41
41
  },
42
42
  "peerDependenciesMeta": {
43
43
  "@o3r/telemetry": {
@@ -54,11 +54,11 @@
54
54
  "@nx/eslint-plugin": "~21.6.0",
55
55
  "@nx/jest": "~21.6.0",
56
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",
57
+ "@o3r/build-helpers": "~0.0.0-placeholder.10",
58
+ "@o3r/eslint-plugin": "~0.0.0-placeholder.10",
59
+ "@o3r/telemetry": "~0.0.0-placeholder.10",
60
+ "@o3r/test-helpers": "~0.0.0-placeholder.10",
61
+ "@redocly/openapi-core": "~2.11.0",
62
62
  "@stylistic/eslint-plugin": "~5.5.0",
63
63
  "@types/jest": "~29.5.2",
64
64
  "@types/js-yaml": "^4.0.5",
@@ -67,10 +67,10 @@
67
67
  "@types/semver": "^7.3.13",
68
68
  "@types/yargs": "~17.0.33",
69
69
  "@typescript-eslint/parser": "~8.46.0",
70
- "angular-eslint": "~20.4.0",
70
+ "angular-eslint": "~20.5.0",
71
71
  "babel-jest": "^29.7.0",
72
72
  "cpy-cli": "^6.0.0",
73
- "eslint": "~9.38.0",
73
+ "eslint": "~9.39.0",
74
74
  "eslint-import-resolver-node": "~0.3.9",
75
75
  "eslint-import-resolver-typescript": "~4.4.0",
76
76
  "eslint-plugin-import": "~2.32.0",
@@ -95,4 +95,4 @@
95
95
  "engines": {
96
96
  "node": "^20.19.0 || ^22.17.0 || ^24.0.0"
97
97
  }
98
- }
98
+ }
package/src/plugin.d.mts CHANGED
@@ -1,12 +1,10 @@
1
- import { type InstallDependenciesOptions } from '@ama-openapi/core';
2
1
  import { Plugin } from '@redocly/openapi-core';
2
+ import { type RetrieveDependencyOptions } from './plugins/meta/retrieve-dependency.meta.mjs';
3
3
  /** Options for ama-openapi plugin */
4
- export interface AmaOpenapiPluginOptions extends InstallDependenciesOptions {
5
- /** Skip the download of dependency */
6
- skipDependencyDownload?: boolean;
4
+ export interface AmaOpenapiPluginOptions extends Partial<RetrieveDependencyOptions> {
7
5
  }
8
6
  /**
9
- * Ama OpenAPI Redocly Plugin
7
+ * Ama OpenAPI {@link https://redocly.com/docs/cli/custom-plugins | Redocly Plugin}
10
8
  * @param options
11
9
  */
12
10
  export declare const amaOpenapiPlugin: (options?: AmaOpenapiPluginOptions) => Promise<Plugin>;
@@ -1 +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"}
1
+ {"version":3,"file":"plugin.d.mts","sourceRoot":"","sources":["../../src/plugin.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACP,MAAM,uBAAuB,CAAC;AAU/B,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,6CAA6C,CAAC;AAIrD,qCAAqC;AACrC,MAAM,WAAW,uBAAwB,SAAQ,OAAO,CAAC,yBAAyB,CAAC;CAClF;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAU,UAAU,uBAAuB,KAAG,OAAO,CAAC,MAAM,CAkBxF,CAAC"}
package/src/plugin.mjs CHANGED
@@ -1,17 +1,19 @@
1
1
  import { config, } from 'dotenv';
2
2
  import { ENVIRONMENT_VARIABLE_PREFIX, } from './constants.mjs';
3
3
  import { retrieveDependency, } from './plugins/meta/retrieve-dependency.meta.mjs';
4
+ const DEFAULT_OPTIONS = 'error';
4
5
  /**
5
- * Ama OpenAPI Redocly Plugin
6
+ * Ama OpenAPI {@link https://redocly.com/docs/cli/custom-plugins | Redocly Plugin}
6
7
  * @param options
7
8
  */
8
9
  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);
10
+ config({ override: true, quiet: true });
11
+ const { [`${ENVIRONMENT_VARIABLE_PREFIX}_VERBOSE`]: verbose, [`${ENVIRONMENT_VARIABLE_PREFIX}_QUIET`]: quiet, [`${ENVIRONMENT_VARIABLE_PREFIX}_NO_BAIL`]: noBail } = process.env;
12
+ await retrieveDependency({
13
+ logLevel: verbose === 'true' ? 'debug' : (options?.logLevel ?? DEFAULT_OPTIONS),
14
+ quiet: quiet ? quiet === 'true' : options?.quiet ?? false,
15
+ noBail: noBail ? noBail === 'true' : options?.noBail ?? false
16
+ });
15
17
  return {
16
18
  id: 'ama-openapi'
17
19
  };
@@ -1 +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"}
1
+ {"version":3,"file":"plugin.mjs","sourceRoot":"","sources":["../../src/plugin.mts"],"names":[],"mappings":"AAGA,OAAO,EACL,MAAM,GACP,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EACL,kBAAkB,GAEnB,MAAM,6CAA6C,CAAC;AAErD,MAAM,eAAe,GAAa,OAAO,CAAC;AAM1C;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,OAAiC,EAAmB,EAAE;IAC3F,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAExC,MAAM,EACJ,CAAC,GAAG,2BAA2B,UAAU,CAAC,EAAE,OAAO,EACnD,CAAC,GAAG,2BAA2B,QAAQ,CAAC,EAAE,KAAK,EAC/C,CAAC,GAAG,2BAA2B,UAAU,CAAC,EAAE,MAAM,EACnD,GAAG,OAAO,CAAC,GAAG,CAAC;IAEhB,MAAM,kBAAkB,CAAC;QACvB,QAAQ,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,QAAQ,IAAI,eAAe,CAAC;QAC/E,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,IAAI,KAAK;QACzD,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,KAAK;KAC9D,CAAC,CAAC;IAEH,OAAO;QACL,EAAE,EAAE,aAAa;KAClB,CAAC;AACJ,CAAC,CAAC"}
@@ -5,13 +5,16 @@ export interface RetrieveDependencyOptions extends InstallDependenciesOptions {
5
5
  * Define the logging level
6
6
  * @default 'error'
7
7
  */
8
- logLevel?: LogLevel;
8
+ logLevel: LogLevel;
9
+ /** Suppress all output */
10
+ quiet: boolean;
9
11
  /** Continue on dependency download failure */
10
- noBail?: boolean;
12
+ noBail: boolean;
11
13
  }
12
14
  /**
13
- * Retrieve dependencies according to manifest files
15
+ * Retrieve dependencies according to manifest files.
16
+ * Refer to {@link InstallDependencies} for more information
14
17
  * @param options
15
18
  */
16
- export declare const retrieveDependency: (options?: RetrieveDependencyOptions) => Promise<void>;
19
+ export declare const retrieveDependency: (options: RetrieveDependencyOptions) => Promise<void>;
17
20
  //# sourceMappingURL=retrieve-dependency.meta.d.mts.map
@@ -1 +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"}
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,EAEhC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,yBAA0B,SAAQ,0BAA0B;IAC3E;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC;IAEnB,0BAA0B;IAC1B,KAAK,EAAE,OAAO,CAAC;IAEf,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAU,SAAS,yBAAyB,kBAY1E,CAAC"}
@@ -1,20 +1,14 @@
1
- import { installDependencies, } from '@ama-openapi/core';
2
- import { ENVIRONMENT_VARIABLE_PREFIX, } from '../../constants.mjs';
1
+ import { installDependencies,
2
+ // eslint-disable-next-line import/no-unresolved -- Cannot resolve mjs file in current setup
3
+ } from '@ama-openapi/core';
3
4
  import { getLogger, } from '../../logger.mjs';
4
- const DEFAULT_OPTIONS = {
5
- logLevel: 'error'
6
- };
7
5
  /**
8
- * Retrieve dependencies according to manifest files
6
+ * Retrieve dependencies according to manifest files.
7
+ * Refer to {@link InstallDependencies} for more information
9
8
  * @param options
10
9
  */
11
10
  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);
11
+ const logger = options.quiet ? undefined : getLogger(options.logLevel);
18
12
  try {
19
13
  await installDependencies(process.cwd(), { ...options, logger });
20
14
  }
@@ -1 +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"}
1
+ {"version":3,"file":"retrieve-dependency.meta.mjs","sourceRoot":"","sources":["../../../../src/plugins/meta/retrieve-dependency.meta.mts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB;AAEnB,4FAA4F;EAC7F,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,SAAS,GAEV,MAAM,kBAAkB,CAAC;AAgB1B;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,OAAkC,EAAE,EAAE;IAC7E,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEvE,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"}