Skip to content

Commit

Permalink
chore(ns-openapi-2): use API Extractor for TypeScript rollup (#4543)
Browse files Browse the repository at this point in the history
Refs #4382
  • Loading branch information
glowcloud authored Nov 22, 2024
1 parent aa9027f commit d9baa6b
Show file tree
Hide file tree
Showing 109 changed files with 582 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../../api-extractor.json"
}
11 changes: 0 additions & 11 deletions packages/apidom-ns-openapi-2/config/rollup/types.dist.js

This file was deleted.

8 changes: 4 additions & 4 deletions packages/apidom-ns-openapi-2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"unpkg": "./dist/apidom-ns-openapi-2.browser.min.js",
"main": "./src/index.cjs",
"exports": {
"types": "./types/dist.d.ts",
"types": "./types/apidom-ns-openapi-2.d.ts",
"import": "./src/index.mjs",
"require": "./src/index.cjs"
},
"types": "./types/dist.d.ts",
"types": "./types/apidom-ns-openapi-2.d.ts",
"scripts": {
"build": "npm run clean && run-p --max-parallel ${CPU_CORES:-2} typescript:declaration build:es build:cjs build:umd:browser",
"build:es": "cross-env BABEL_ENV=es babel src --out-dir src --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward'",
Expand All @@ -30,7 +30,7 @@
"test": "npm run build:es && cross-env BABEL_ENV=es babel test --out-dir test --extensions '.ts' --out-file-extension '.mjs' --root-mode 'upward' && cross-env NODE_ENV=test mocha",
"test:update-snapshots": "cross-env UPDATE_SNAPSHOT=1 mocha",
"typescript:check-types": "tsc --noEmit && tsc -p ./test/tsconfig.json --noEmit",
"typescript:declaration": "tsc -p tsconfig.declaration.json && rollup -c config/rollup/types.dist.js",
"typescript:declaration": "tsc -p tsconfig.declaration.json && api-extractor run -l -c ./config/api-extractor/api-extractor.json 2>&1 | shx grep -v 'Visitor_base'",
"prepack": "copyfiles -u 3 ../../LICENSES/* LICENSES && copyfiles -u 2 ../../NOTICE .",
"postpack": "rimraf NOTICE LICENSES"
},
Expand All @@ -54,7 +54,7 @@
"src/**/*.mjs",
"src/**/*.cjs",
"dist/",
"types/dist.d.ts",
"types/apidom-ns-openapi-2.d.ts",
"LICENSES",
"NOTICE",
"README.md",
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Contact.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { StringElement, ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class Contact extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Definitions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class Definitions extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Example.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class Example extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { StringElement, ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class ExternalDocumentation extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import {
} from '@swagger-api/apidom-ns-json-schema-draft-4';

/* eslint-disable class-methods-use-this */
/**
* @public
*/
class Header extends JSONSchemaElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Headers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class Headers extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { StringElement, ObjectElement, Attributes, Meta } from '@swagger-api/api
import ContactElement from './Contact.ts';
import LicenseElement from './License.ts';

/**
* @public
*/
class Info extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import {
} from '@swagger-api/apidom-ns-json-schema-draft-4';

/* eslint-disable class-methods-use-this */
/**
* @public
*/
class Items extends JSONSchemaElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/License.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { StringElement, ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class License extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import {
import ExternalDocumentationElement from './ExternalDocumentation.ts';
import ResponsesElement from './Responses.ts';

/**
* @public
*/
class Operation extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Parameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import {
import SchemaElement from './Schema.ts';

/* eslint-disable class-methods-use-this */
/**
* @public
*/
class Parameter extends JSONSchemaElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class ParametersDefinitions extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/PathItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import {

import OperationElement from './Operation.ts';

/**
* @public
*/
class PathItem extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Paths.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class Paths extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Reference.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { StringElement, ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class Reference extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import SchemaElement from './Schema.ts';
import HeadersElement from './Headers.ts';
import ExampleElement from './Example.ts';

/**
* @public
*/
class Response extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';
import ResponseElement from './Response.ts';
import ReferenceElement from './Reference.ts';

/**
* @public
*/
class Responses extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class ResponsesDefinitions extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import {
} from '@swagger-api/apidom-ns-json-schema-draft-4';

/* eslint-disable class-methods-use-this */
/**
* @public
*/
class Schema extends JSONSchemaElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Scopes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class Scopes extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class SecurityDefinitions extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class SecurityRequirement extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/SecurityScheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import {
Meta,
} from '@swagger-api/apidom-core';

/**
* @public
*/
class SecurityScheme extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import ResponsesDefinitionsElement from './ResponsesDefinitions.ts';
import SecurityDefinitionsElement from './SecurityDefinitions.ts';
import ExternalDocumentationElement from './ExternalDocumentation.ts';

/**
* @public
*/
class Swagger extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/SwaggerVersion.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { StringElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class SwaggerVersion extends StringElement {
constructor(content?: string, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { ObjectElement, StringElement, Attributes, Meta } from '@swagger-api/api

import ExternalDocumentationElement from './ExternalDocumentation.ts';

/**
* @public
*/
class Tag extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
3 changes: 3 additions & 0 deletions packages/apidom-ns-openapi-2/src/elements/Xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import {
Meta,
} from '@swagger-api/apidom-core';

/**
* @public
*/
class Xml extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
super(content, meta, attributes);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class OperationConsumes extends ArrayElement {
static primaryClass = 'operation-consumes';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class OperationParameters extends ArrayElement {
static primaryClass = 'operation-parameters';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class OperationProduces extends ArrayElement {
static primaryClass = 'operation-produces';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class OperationSchemes extends ArrayElement {
static primaryClass = 'operation-schemes';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class OperationSecurity extends ArrayElement {
static primaryClass = 'operation-security';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class OperationTags extends ArrayElement {
static primaryClass = 'operation-tags';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class PathItemParameters extends ArrayElement {
static primaryClass = 'path-item-parameters';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class SwaggerConsumes extends ArrayElement {
static primaryClass = 'swagger-consumes';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class SwaggerProduces extends ArrayElement {
static primaryClass = 'swagger-produces';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ArrayElement, Attributes, Meta } from '@swagger-api/apidom-core';

/**
* @public
*/
class SwaggerSchemes extends ArrayElement {
static primaryClass = 'swagger-schemes';

Expand Down
Loading

0 comments on commit d9baa6b

Please sign in to comment.