Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I set workspace and generate code, the line breaks keep increasing. #1875

Closed
maroKanatani opened this issue Feb 4, 2025 · 0 comments · Fixed by #1876
Closed

When I set workspace and generate code, the line breaks keep increasing. #1875

maroKanatani opened this issue Feb 4, 2025 · 0 comments · Fixed by #1876
Assignees
Labels
enhancement New feature or request

Comments

@maroKanatani
Copy link
Contributor

maroKanatani commented Feb 4, 2025

I always use orval. Thanks.

This phenomenon occurs in the following steps.

  1. setup project
$ node -v
v22.13.1
$ mkdir orval-sample
$ cd orval-sample
$ npm init --yes
$ npm install orval
  1. create orval.config.js
module.exports = {
    petstore: {
        input: 'https://petstore3.swagger.io/api/v3/openapi.json',
        output: {
            workspace: "generated",
            target: "./zod/sample.ts",
            schemas: "./types",
            client: "zod",
            mode: "tags-split",
            clean: true,
        },
    },
}
  1. add orval command
    package.json
{
  "scripts": {
      "test": "echo \"Error: no test specified\" && exit 1",
+     "orval": "orval --config ./orval.config.js"
  },
}
  1. execute orval command
$ npm run orval
  1. The end of the line in generated/index.ts grows longer and longer each time the command is executed.
export * from './zod/pet/pet';
export * from './zod/store/store';
export * from './zod/user/user';
export * from './types';

+
+
maroKanatani added a commit to maroKanatani/orval that referenced this issue Feb 4, 2025
@melloware melloware added the enhancement New feature or request label Feb 4, 2025
maroKanatani added a commit to maroKanatani/orval that referenced this issue Feb 5, 2025
maroKanatani added a commit to maroKanatani/orval that referenced this issue Feb 5, 2025
maroKanatani added a commit to maroKanatani/orval that referenced this issue Feb 9, 2025
soartec-lab pushed a commit that referenced this issue Feb 10, 2025
…nd of a line in an existing index file #1875 (#1876)

* fix(core): Fixed workspace setting does not append a newline to the end of a line in an existing index file (#1875)

* fix(core): add empty string to join method (#1875)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants