Skip to content

Commit

Permalink
build(ns-openapi-3-0): use nodenext for TypeScript modules
Browse files Browse the repository at this point in the history
Refs #4385
  • Loading branch information
glowcloud committed Nov 7, 2024
1 parent dba362e commit 9a20ace
Show file tree
Hide file tree
Showing 156 changed files with 817 additions and 770 deletions.
22 changes: 22 additions & 0 deletions packages/apidom-ns-openapi-3-0/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"settings": {
"import/resolver": {
"typescript": {
"project": ["./tsconfig.json"]
}
}
},
"rules": {
"import/extensions": [
"error",
"always",
{
"ts": "always",
"tsx": "always",
"js": "always",
"jsx": "never",
"ignorePackages": true
}
]
}
}
9 changes: 9 additions & 0 deletions packages/apidom-ns-openapi-3-0/check-types-test.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"allowImportingTsExtensions": true
},
"include": [
"test/**/*"
]
}
11 changes: 11 additions & 0 deletions packages/apidom-ns-openapi-3-0/check-types.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
"allowImportingTsExtensions": true
},
"include": [
"src/**/*"
]
}
2 changes: 1 addition & 1 deletion packages/apidom-ns-openapi-3-0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"clean": "rimraf --glob 'src/**/*.mjs' 'src/**/*.cjs' 'test/**/*.mjs' ./dist ./types",
"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",
"typescript:check-types": "tsc -p check-types.tsconfig.json --noEmit && tsc -p check-types-test.tsconfig.json --noEmit",
"typescript:declaration": "tsc -p declaration.tsconfig.json && rollup -c config/rollup/types.dist.js",
"prepack": "copyfiles -u 3 ../../LICENSES/* LICENSES && copyfiles -u 2 ../../NOTICE .",
"postpack": "rimraf NOTICE LICENSES"
Expand Down
4 changes: 2 additions & 2 deletions packages/apidom-ns-openapi-3-0/src/elements/Header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
Element,
} from '@swagger-api/apidom-core';

import SchemaElement from './Schema';
import ReferenceElement from './Reference';
import SchemaElement from './Schema.ts';
import ReferenceElement from './Reference.ts';

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

import ContactElement from './Contact';
import LicenseElement from './License';
import ContactElement from './Contact.ts';
import LicenseElement from './License.ts';

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

import ServerElement from './Server';
import OperationElement from './Operation';
import ServerElement from './Server.ts';
import OperationElement from './Operation.ts';

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

import SchemaElement from './Schema';
import ReferenceElement from './Reference';
import SchemaElement from './Schema.ts';
import ReferenceElement from './Reference.ts';

class MediaType extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-ns-openapi-3-0/src/elements/OAuthFlows.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ObjectElement, Attributes, Meta } from '@swagger-api/apidom-core';

import OAuthFlowElement from './OAuthFlow';
import OAuthFlowElement from './OAuthFlow.ts';

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

import OpenapiElement from './Openapi';
import InfoElement from './Info';
import ComponentsElement from './Components';
import PathsElement from './Paths';
import ExternalDocumentationElement from './ExternalDocumentation';
import OpenapiElement from './Openapi.ts';
import InfoElement from './Info.ts';
import ComponentsElement from './Components.ts';
import PathsElement from './Paths.ts';
import ExternalDocumentationElement from './ExternalDocumentation.ts';

// eslint-disable-next-line @typescript-eslint/naming-convention
class OpenApi3_0 extends ObjectElement {
Expand Down
8 changes: 4 additions & 4 deletions packages/apidom-ns-openapi-3-0/src/elements/Operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
Meta,
} from '@swagger-api/apidom-core';

import ReferenceElement from './Reference';
import ExternalDocumentationElement from './ExternalDocumentation';
import RequestBodyElement from './RequestBody';
import ResponsesElement from './Responses';
import ReferenceElement from './Reference.ts';
import ExternalDocumentationElement from './ExternalDocumentation.ts';
import RequestBodyElement from './RequestBody.ts';
import ResponsesElement from './Responses.ts';

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

import SchemaElement from './Schema';
import ReferenceElement from './Reference';
import SchemaElement from './Schema.ts';
import ReferenceElement from './Reference.ts';

class Parameter extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-ns-openapi-3-0/src/elements/PathItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Meta,
} from '@swagger-api/apidom-core';

import OperationElement from './Operation';
import OperationElement from './Operation.ts';

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

import ResponseElement from './Response';
import ReferenceElement from './Reference';
import ResponseElement from './Response.ts';
import ReferenceElement from './Reference.ts';

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

import ReferenceElement from './Reference';
import DiscriminatorElement from './Discriminator';
import XmlElement from './Xml';
import ExternalDocumentationElement from './ExternalDocumentation';
import ReferenceElement from './Reference.ts';
import DiscriminatorElement from './Discriminator.ts';
import XmlElement from './Xml.ts';
import ExternalDocumentationElement from './ExternalDocumentation.ts';

/* eslint-disable class-methods-use-this */
class Schema extends JSONSchemaElement {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ObjectElement, StringElement, Attributes, Meta } from '@swagger-api/apidom-core';

import OAuthFlowsElement from './OAuthFlows';
import OAuthFlowsElement from './OAuthFlows.ts';

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

import ExternalDocumentationElement from './ExternalDocumentation';
import ExternalDocumentationElement from './ExternalDocumentation.ts';

class Tag extends ObjectElement {
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) {
Expand Down
Loading

0 comments on commit 9a20ace

Please sign in to comment.