Skip to content

Commit

Permalink
separate packages, clean up deps (remove babel/core)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyramation committed May 20, 2024
1 parent 68c127a commit 1c91627
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 1,361 deletions.
2 changes: 1 addition & 1 deletion packages/open-api/__tests__/openapi.generate.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { writeFileSync } from 'fs';
import { getDefaultSchemaTSOptions } from 'schema-typescript';

import schema from '../../../__fixtures__/openapi/swagger.json';
import { getDefaultSchemaTSOptions } from '../src';
import { generateOpenApiClient } from '../src/openapi';

it('swagger', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/open-api/__tests__/openapi.overrides.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { writeFileSync } from 'fs';
import { generateTypeScript } from 'schema-typescript';

import schema from '../../../__fixtures__/openapi/swagger.json';
import { generateTypeScript } from '../src';

const myschema = {
title: 'Kubernetes',
Expand Down
2 changes: 1 addition & 1 deletion packages/open-api/__tests__/openapi.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { writeFileSync } from 'fs';
import { generateTypeScript } from 'schema-typescript';

import schema from '../../../__fixtures__/openapi/swagger.json';
import { generateTypeScript } from '../src';

const myschema = {
title: 'Kubernetes',
Expand Down
2 changes: 1 addition & 1 deletion packages/open-api/__tests__/template.literal.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import generate from '@babel/generator';
import { getDefaultSchemaTSOptions } from 'schema-typescript';

import { createPathTemplateLiteral } from '../src';
import { getDefaultSchemaTSOptions } from '../src';

const options = getDefaultSchemaTSOptions();
export const renderTemplateTag = (str: string) => {
Expand Down
12 changes: 5 additions & 7 deletions packages/open-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.5.0",
"description": "Convert JSON Schema to TypeScript Definitions",
"author": "Dan Lynch <[email protected]>",
"homepage": "https://github.com/pyramation/schema-typescript#readme",
"homepage": "https://github.com/cosmology-tech/schema-typescript#readme",
"license": "SEE LICENSE IN LICENSE",
"main": "index.js",
"module": "esm/index.js",
Expand All @@ -14,10 +14,10 @@
},
"repository": {
"type": "git",
"url": "https://github.com/pyramation/schema-typescript"
"url": "https://github.com/cosmology-tech/schema-typescript"
},
"bugs": {
"url": "https://github.com/pyramation/schema-typescript/issues"
"url": "https://github.com/cosmology-tech/schema-typescript/issues"
},
"scripts": {
"copy": "copyfiles -f ../../LICENSE README.md package.json dist",
Expand All @@ -28,11 +28,9 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@babel/core": "^7.24.4",
"@babel/generator": "^7.24.4",
"@babel/types": "^7.24.0",
"deepmerge": "^4.3.1",
"minimatch": "^9.0.4"
"schema-typescript": "^0.5.0"
},
"keywords": ["jsonschema", "schema", "typescript"]
"keywords": ["jsonschema", "schema", "typescript", "swagger", "openapi"]
}
84 changes: 0 additions & 84 deletions packages/open-api/src/context.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/open-api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './context';
export * from './schema';
export * from './types';
export * from './openapi';
export * from './openapi.types';
export * from './utils';
6 changes: 3 additions & 3 deletions packages/open-api/src/openapi.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import generate from "@babel/generator";
import * as t from '@babel/types';
import { SchemaTSOptions } from "schema-typescript";
import { generateTypeScriptTypes } from "schema-typescript";
import { createPathTemplateLiteral, getTypeNameSafe, shouldInclude, toCamelCase, toPascalCase } from "schema-typescript";

import { SchemaTSOptions } from "./context";
import { OpenAPIPathItem, OpenAPISpec, Operation, Parameter, Response } from "./openapi.types";
import { generateTypeScriptTypes } from "./schema";
import { createPathTemplateLiteral, getTypeNameSafe, shouldInclude, toCamelCase, toPascalCase } from "./utils";

export interface OpenAPIOptions extends SchemaTSOptions {
version?: 'v1' | 'v1beta1' | 'v2beta1' | 'v2beta2';
Expand Down
2 changes: 1 addition & 1 deletion packages/open-api/src/openapi.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JSONSchema } from "./types";
import { JSONSchema } from "schema-typescript";

export interface OpenAPISpec {
swagger: string;
Expand Down
Loading

0 comments on commit 1c91627

Please sign in to comment.