@ng-forge/openapi-generator
Advanced tools
+21
| MIT License | ||
| Copyright (c) 2026 ng-forge | ||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
+5
-4
| { | ||
| "name": "@ng-forge/openapi-generator", | ||
| "version": "1.0.0-rc.4", | ||
| "version": "1.0.0", | ||
| "description": "Generate @ng-forge/dynamic-forms configurations from OpenAPI specs", | ||
@@ -33,4 +33,4 @@ "type": "module", | ||
| ".": { | ||
| "import": "./src/index.js", | ||
| "types": "./src/index.d.ts" | ||
| "types": "./src/index.d.ts", | ||
| "import": "./src/index.js" | ||
| } | ||
@@ -41,3 +41,4 @@ }, | ||
| "bin", | ||
| "README.md" | ||
| "README.md", | ||
| "LICENSE" | ||
| ], | ||
@@ -44,0 +45,0 @@ "engines": { |
+6
-2
@@ -48,3 +48,3 @@ # @ng-forge/openapi-generator | ||
| ```bash | ||
| npx ng-forge-generator --spec openapi.yaml --output src/generated | ||
| npx @ng-forge/openapi-generator --spec openapi.yaml --output src/generated | ||
| ``` | ||
@@ -55,2 +55,3 @@ | ||
| ```typescript | ||
| import { DynamicForm } from '@ng-forge/dynamic-forms'; | ||
| import { registerUserFormConfig } from './generated/forms'; | ||
@@ -60,3 +61,4 @@ import type { RegisterUserFormValue } from './generated/types'; | ||
| @Component({ | ||
| template: `<ngf-dynamic-form [config]="formConfig" (formSubmit)="onSubmit($event)" />`, | ||
| imports: [DynamicForm], | ||
| template: `<form [dynamic-form]="formConfig" (submitted)="onSubmit($event)"></form>`, | ||
| }) | ||
@@ -72,2 +74,4 @@ export class RegisterComponent { | ||
| > The form needs a UI adapter registered once in your app providers, for example `provideDynamicForm(...withMaterialFields())`. See any `@ng-forge/dynamic-forms-*` adapter package for setup. | ||
| The generator produces a typed FormConfig and a matching TypeScript interface: | ||
@@ -74,0 +78,0 @@ |
| export declare const fixtureDir: string; | ||
| export declare function fixturePath(name: string): string; | ||
| export declare function createTempDir(): Promise<string>; | ||
| export declare function cleanupDir(dir: string): Promise<void>; | ||
| export declare function readGenerated(outputDir: string, subdirectory: string, fileName: string): Promise<string>; | ||
| export declare function readConfigFile(dir: string): Promise<Record<string, unknown>>; | ||
| export declare function fileExists(filePath: string): Promise<boolean>; | ||
| export type AdapterName = 'material' | 'bootstrap' | 'primeng' | 'ionic'; | ||
| /** | ||
| * Type-check a generator-produced form file the way a real consumer would: with a UI | ||
| * adapter (Material by default) registered via module augmentation. The adapter import | ||
| * is what activates field types like `'input'` — without it the generated config fails | ||
| * against the core-only `RegisteredFieldTypes`. | ||
| */ | ||
| export declare function typecheckGeneratedForm(formFilePath: string, adapter?: AdapterName): string[]; | ||
| /** | ||
| * Write a tsconfig next to a generated form that mirrors the compile options used by | ||
| * `typecheckGeneratedForm`. Editors and ad-hoc `tsc` invocations pick up the same | ||
| * adapter paths and module/resolution settings, so local inspection matches CI. | ||
| */ | ||
| export declare function writeRepoRelativeTsconfig(outputDir: string, adapter?: AdapterName): Promise<void>; | ||
| //# sourceMappingURL=helpers.d.ts.map |
| {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../packages/openapi-generator/src/__tests__/integration/helpers.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,UAAU,QAAqC,CAAC;AAE7D,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAErD;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D;AAED,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9G;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAGlF;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;AAkCD,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzE;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,GAAE,WAAwB,GAAG,MAAM,EAAE,CA6CxG;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,WAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBnH"} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
2
-33.33%431
0.94%163624
-0.58%51
-1.92%3429
-0.61%