zod-codegen 1.0.1 → 1.0.2
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/.github/workflows/ci.yml +5 -5
- package/.github/workflows/release.yml +1 -1
- package/.nvmrc +1 -1
- package/CHANGELOG.md +7 -0
- package/dist/src/assets/manifest.json +2 -2
- package/dist/src/generator.js +3 -3
- package/dist/src/http/fetch-client.js +0 -1
- package/dist/src/services/code-generator.service.js +549 -58
- package/dist/src/services/file-reader.service.js +27 -14
- package/dist/src/services/import-builder.service.js +4 -11
- package/dist/src/services/type-builder.service.js +16 -9
- package/dist/tests/unit/generator.test.js +1 -0
- package/eslint.config.mjs +18 -0
- package/package.json +22 -22
- package/src/assets/manifest.json +2 -2
- package/src/generator.ts +3 -3
- package/src/http/fetch-client.ts +4 -4
- package/src/services/code-generator.service.ts +1212 -88
- package/src/services/file-reader.service.ts +26 -13
- package/src/services/import-builder.service.ts +8 -11
- package/src/services/type-builder.service.ts +19 -12
- package/tsconfig.json +4 -4
- package/scripts/update-manifest.js +0 -31
package/.github/workflows/ci.yml
CHANGED
|
@@ -16,7 +16,7 @@ jobs:
|
|
|
16
16
|
runs-on: ${{ matrix.os }}
|
|
17
17
|
strategy:
|
|
18
18
|
matrix:
|
|
19
|
-
node-version: [
|
|
19
|
+
node-version: ['24.11.1']
|
|
20
20
|
os: [ubuntu-latest]
|
|
21
21
|
|
|
22
22
|
steps:
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
run: npm run test:coverage
|
|
51
51
|
|
|
52
52
|
- name: Upload coverage to Codecov
|
|
53
|
-
if: matrix.node-version ==
|
|
53
|
+
if: matrix.node-version == '24.11.1' && matrix.os == 'ubuntu-latest'
|
|
54
54
|
uses: codecov/codecov-action@v5
|
|
55
55
|
with:
|
|
56
56
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -69,7 +69,7 @@ jobs:
|
|
|
69
69
|
- name: Setup Node.js
|
|
70
70
|
uses: actions/setup-node@v5
|
|
71
71
|
with:
|
|
72
|
-
node-version:
|
|
72
|
+
node-version: '24.11.1'
|
|
73
73
|
cache: 'npm'
|
|
74
74
|
|
|
75
75
|
- name: Install dependencies
|
|
@@ -90,7 +90,7 @@ jobs:
|
|
|
90
90
|
- name: Setup Node.js
|
|
91
91
|
uses: actions/setup-node@v5
|
|
92
92
|
with:
|
|
93
|
-
node-version:
|
|
93
|
+
node-version: '24.11.1'
|
|
94
94
|
cache: 'npm'
|
|
95
95
|
|
|
96
96
|
- name: Install dependencies
|
|
@@ -128,7 +128,7 @@ jobs:
|
|
|
128
128
|
- name: Setup Node.js
|
|
129
129
|
uses: actions/setup-node@v5
|
|
130
130
|
with:
|
|
131
|
-
node-version:
|
|
131
|
+
node-version: '24.11.1'
|
|
132
132
|
cache: 'npm'
|
|
133
133
|
|
|
134
134
|
- name: Install dependencies
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
24.11.1
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## <small>1.0.2 (2025-11-12)</small>
|
|
2
|
+
|
|
3
|
+
- Merge pull request #25 from julienandreu/refactor/modernize-typescript-strict-mode ([9614fbd](https://github.com/julienandreu/zod-codegen/commit/9614fbd)), closes [#25](https://github.com/julienandreu/zod-codegen/issues/25)
|
|
4
|
+
- chore: update package-lock.json and pin Node.js to 24.11.1 in CI ([b165b43](https://github.com/julienandreu/zod-codegen/commit/b165b43))
|
|
5
|
+
- ci: update workflows to use Node.js 24 only ([1b56ad8](https://github.com/julienandreu/zod-codegen/commit/1b56ad8))
|
|
6
|
+
- refactor: modernize TypeScript to strict mode and fix all linting errors ([0dc2911](https://github.com/julienandreu/zod-codegen/commit/0dc2911))
|
|
7
|
+
|
|
1
8
|
## <small>1.0.1 (2025-09-16)</small>
|
|
2
9
|
|
|
3
10
|
- Merge pull request #10 from julienandreu/dependabot/npm_and_yarn/eslint-config-prettier-10.1.8 ([d9b786c](https://github.com/julienandreu/zod-codegen/commit/d9b786c)), closes [#10](https://github.com/julienandreu/zod-codegen/issues/10)
|
package/dist/src/generator.js
CHANGED
|
@@ -23,7 +23,7 @@ export class Generator {
|
|
|
23
23
|
}
|
|
24
24
|
async run() {
|
|
25
25
|
try {
|
|
26
|
-
const rawSource = this.readFile();
|
|
26
|
+
const rawSource = await this.readFile();
|
|
27
27
|
const openApiSpec = this.parseFile(rawSource);
|
|
28
28
|
const generatedCode = this.generateCode(openApiSpec);
|
|
29
29
|
this.writeFile(generatedCode);
|
|
@@ -40,8 +40,8 @@ export class Generator {
|
|
|
40
40
|
return Promise.resolve(1);
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
readFile() {
|
|
44
|
-
return this.fileReader.readFile(this.inputPath);
|
|
43
|
+
async readFile() {
|
|
44
|
+
return await this.fileReader.readFile(this.inputPath);
|
|
45
45
|
}
|
|
46
46
|
parseFile(source) {
|
|
47
47
|
return this.fileParser.parse(source);
|