Skip to content

Commit

Permalink
build(ns-openapi-3-1): 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 655d7af
Show file tree
Hide file tree
Showing 138 changed files with 482 additions and 414 deletions.
22 changes: 22 additions & 0 deletions packages/apidom-ns-openapi-3-1/.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-1/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-1/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-1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"perf": "cross-env BABEL_ENV=es babel ./test/perf/index.ts --out-file ./test/perf/index.mjs --root-mode 'upward' && cross-env NODE_ENV=test node ./test/perf/index.mjs",
"perf:visitor-shortcut": "cross-env BABEL_ENV=es babel ./test/perf/visitor-shortcut.ts --out-file ./test/perf/visitor-shortcut.mjs --root-mode 'upward' && cross-env NODE_ENV=test node ./test/perf/visitor-shortcut.mjs",
"perf:refract": "cross-env BABEL_ENV=es babel ./test/perf/refract.ts --out-file ./test/perf/refract.mjs --root-mode 'upward' && cross-env NODE_ENV=test node ./test/perf/refract.mjs",
"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
2 changes: 1 addition & 1 deletion packages/apidom-ns-openapi-3-1/src/elements/Header.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HeaderElement } from '@swagger-api/apidom-ns-openapi-3-0';

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

class Header extends HeaderElement {
get schema(): SchemaElement | undefined {
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-ns-openapi-3-1/src/elements/Info.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StringElement } from '@swagger-api/apidom-core';
import { InfoElement } from '@swagger-api/apidom-ns-openapi-3-0';

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

class Info extends InfoElement {
get license(): LicenseElement | undefined {
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-ns-openapi-3-1/src/elements/MediaType.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MediaTypeElement } from '@swagger-api/apidom-ns-openapi-3-0';

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

class MediaType extends MediaTypeElement {
get schema(): SchemaElement | undefined {
Expand Down
10 changes: 5 additions & 5 deletions packages/apidom-ns-openapi-3-1/src/elements/OpenApi3-1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import {
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_1 extends ObjectElement {
Expand Down
4 changes: 2 additions & 2 deletions packages/apidom-ns-openapi-3-1/src/elements/Operation.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { OperationElement } from '@swagger-api/apidom-ns-openapi-3-0';

import RequestBodyElement from './RequestBody';
import ReferenceElement from './Reference';
import RequestBodyElement from './RequestBody.ts';
import ReferenceElement from './Reference.ts';

class Operation extends OperationElement {
get requestBody(): RequestBodyElement | ReferenceElement | undefined {
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-ns-openapi-3-1/src/elements/Parameter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ParameterElement } from '@swagger-api/apidom-ns-openapi-3-0';

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

class Parameter extends ParameterElement {
get schema(): SchemaElement | undefined {
Expand Down
2 changes: 1 addition & 1 deletion packages/apidom-ns-openapi-3-1/src/elements/PathItem.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PathItemElement } from '@swagger-api/apidom-ns-openapi-3-0';

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

class PathItem extends PathItemElement {
get GET(): OperationElement {
Expand Down
6 changes: 3 additions & 3 deletions packages/apidom-ns-openapi-3-1/src/elements/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
Meta,
} from '@swagger-api/apidom-core';

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

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

0 comments on commit 655d7af

Please sign in to comment.