Uploaded image for project: 'Hybrid Cloud Console'
  1. Hybrid Cloud Console
  2. RHCLOUD-43172

[javascript-clients] Migrate insights package to generate into src folder

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • None
    • Future Sustainability
    • False
    • Hide

      None

      Show
      None
    • False
    • None
    • Unset
    • None

      Prompt for human: Do not expect this to work as is. You will need to confirm and intervene where necessary.

      Prompt for Claude Code:
      This is a monorepo of clients. OpenAPI spec's defined in project.json serve as the source of truth. Open API generator uses the OpenAPI spec as input and outputs typescript files. The typescript files and then built to cjs and esm javascript files placed in the package's dist folder.

      I want to update packages/insights so that:

      1. generated typescript files and placed into the package's src folder
      2. add a clean-generate target to the project.json on which the generate target depends in order to clear previously generated files before a new generation
      3. add a clean-build target to the project.json on which the build target depends in order to clear previously generated files before a new build.

      The packages/{notifications, integrations, notifications} have already been updated and should serve as a reference for what I want. The steps are:

      • Delete all folders apart from dist, src and tests
      • Delete left over generated files ie. files not related to jest config , tsconfig
      • Remove /dist path from package.json file
      • In project.json
        __ Add clean-generate target and generate dependsOn
        __ Add clean-build target and build dependsOn
        __ Add generate.options.outputPath
        __ Add build.options.inputPath
        __ Add src to the path in build.options.main
      • Update tsconfig.json, tsconfig.cjs.json and tsconfig.esm.json
        _ Update jest.config.ts and jest.integration._.config.ts
      • Regenerate and rebuild
        __ rm -rf packages/insights/{dist,src}
        __ npx nx run @redhat-cloud-services/insights-client:generate
        __ npx nx run @redhat-cloud-services/insights-client:build
      • Compare the folder, files and content in the dist folder to the latest published package @redhat-cloud-services/insights-client using the OpenAPI spec defined in project.json as the source of truth
      • Ensure exports in package.json is up to date
      • Update tsconfig.base.json so that packages/insights/src/index.ts
      • Determine if this is a major, minor or patch version increment and help me with a suitable conventional commit message.

              rh-ee-otomylko Olha Tomylko
              rh-ee-chmulder Charles Mulder
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: