@ng-forge/openapi-generator 1.0.0-rc.4 → 1.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ng-forge
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -45,17 +45,19 @@ paths:
|
|
|
45
45
|
**2. Run the generator:**
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
npx ng-forge-generator --spec openapi.yaml --output src/generated
|
|
48
|
+
npx @ng-forge/openapi-generator --spec openapi.yaml --output src/generated
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
**3. Import and use in your Angular component:**
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
|
+
import { DynamicForm } from '@ng-forge/dynamic-forms';
|
|
54
55
|
import { registerUserFormConfig } from './generated/forms';
|
|
55
56
|
import type { RegisterUserFormValue } from './generated/types';
|
|
56
57
|
|
|
57
58
|
@Component({
|
|
58
|
-
|
|
59
|
+
imports: [DynamicForm],
|
|
60
|
+
template: `<form [dynamic-form]="formConfig" (submitted)="onSubmit($event)"></form>`,
|
|
59
61
|
})
|
|
60
62
|
export class RegisterComponent {
|
|
61
63
|
formConfig = registerUserFormConfig;
|
|
@@ -66,6 +68,8 @@ export class RegisterComponent {
|
|
|
66
68
|
}
|
|
67
69
|
```
|
|
68
70
|
|
|
71
|
+
> 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.
|
|
72
|
+
|
|
69
73
|
The generator produces a typed FormConfig and a matching TypeScript interface:
|
|
70
74
|
|
|
71
75
|
<details>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-forge/openapi-generator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0-next.1",
|
|
4
4
|
"description": "Generate @ng-forge/dynamic-forms configurations from OpenAPI specs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,14 +30,15 @@
|
|
|
30
30
|
"types": "./src/index.d.ts",
|
|
31
31
|
"exports": {
|
|
32
32
|
".": {
|
|
33
|
-
"
|
|
34
|
-
"
|
|
33
|
+
"types": "./src/index.d.ts",
|
|
34
|
+
"import": "./src/index.js"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"src",
|
|
39
39
|
"bin",
|
|
40
|
-
"README.md"
|
|
40
|
+
"README.md",
|
|
41
|
+
"LICENSE"
|
|
41
42
|
],
|
|
42
43
|
"engines": {
|
|
43
44
|
"node": ">=24.0.0"
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const fixtureDir: string;
|
|
2
|
-
export declare function fixturePath(name: string): string;
|
|
3
|
-
export declare function createTempDir(): Promise<string>;
|
|
4
|
-
export declare function cleanupDir(dir: string): Promise<void>;
|
|
5
|
-
export declare function readGenerated(outputDir: string, subdirectory: string, fileName: string): Promise<string>;
|
|
6
|
-
export declare function readConfigFile(dir: string): Promise<Record<string, unknown>>;
|
|
7
|
-
export declare function fileExists(filePath: string): Promise<boolean>;
|
|
8
|
-
export type AdapterName = 'material' | 'bootstrap' | 'primeng' | 'ionic';
|
|
9
|
-
/**
|
|
10
|
-
* Type-check a generator-produced form file the way a real consumer would: with a UI
|
|
11
|
-
* adapter (Material by default) registered via module augmentation. The adapter import
|
|
12
|
-
* is what activates field types like `'input'` — without it the generated config fails
|
|
13
|
-
* against the core-only `RegisteredFieldTypes`.
|
|
14
|
-
*/
|
|
15
|
-
export declare function typecheckGeneratedForm(formFilePath: string, adapter?: AdapterName): string[];
|
|
16
|
-
/**
|
|
17
|
-
* Write a tsconfig next to a generated form that mirrors the compile options used by
|
|
18
|
-
* `typecheckGeneratedForm`. Editors and ad-hoc `tsc` invocations pick up the same
|
|
19
|
-
* adapter paths and module/resolution settings, so local inspection matches CI.
|
|
20
|
-
*/
|
|
21
|
-
export declare function writeRepoRelativeTsconfig(outputDir: string, adapter?: AdapterName): Promise<void>;
|
|
22
|
-
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"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"}
|