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

[IF-Env] Generates incorrect package.json when there is also node-modules inside the folder #860

Closed
MariamKhalatova opened this issue Jun 25, 2024 · 0 comments · Fixed by #862
Assignees
Labels
bug Error, flaw or fault

Comments

@MariamKhalatova
Copy link
Contributor

Description of the Error

When running if-env from a folder, where also exists node-modules, the generated package.json file contains all dependencies from node-modules

Expected Behaviour

Package.json should contain only necessary dependencies, and the ones from node-modules should not be included

Actual Behavior

Dependencies from node-modules are included into the package.json file. This happens both when running from inside if and outside if.

Steps to Reproduce

  1. Have node-modules folder with the appropriate dependencies inside it.
  2. Run if-env ( the below command is used in case of running from outside of if.
    npm run --prefix=./if if-env -- -m manifests/testing/testing.yaml --cwd

Manifest File That Generated the Error

Testing.yaml

description: >-
  a pipeline that does arbitrary calculations using our generic arithmetic
  builtins
tags: null
initialize:
  plugins:
    teads-curve:
      path: '@grnsft/if-unofficial-plugins'
      method: TeadsCurve
      global-config:
        interpolation: spline
    sum:
      path: builtin
      method: Sum
      global-config:
        input-parameters:
          - cpu/energy
          - network/energy
        output-parameter: energy-sum
    coefficient:
      path: builtin
      method: Coefficient
      global-config:
        input-parameter: energy
        coefficient: 2
        output-parameter: energy-doubled
    multiply:
      path: builtin
      method: Multiply
      global-config:
        input-parameters:
          - cpu/utilization
          - duration
        output-parameter: cpu-times-duration
  outputs:
    - yaml
execution:
  command: >-
    /Users/mariamkhalatova/.npm/_npx/1bf7c3c15bf47d04/node_modules/.bin/ts-node
    /Users/mariamkhalatova/Projects/UK/if/src/index.ts -m
    manifests/testing/generics.yml -o
    /Users/mariamkhalatova/Projects/UK/if/manifests/testing
  environment:
    if-version: 0.4.0
    os: macOS
    os-version: '13.2'
    node-version: 18.14.2
    date-time: 2024-06-23T17:26:28.567Z (UTC)
    dependencies:
      - '@babel/core@7.22.10'
      - '@babel/preset-typescript@7.23.3'
      - '@commitlint/cli@18.6.0'
      - '@commitlint/config-conventional@18.6.0'
      - '@grnsft/if-core@0.0.7'
      - '@grnsft/if-plugins@v0.3.2 extraneous -> file:../../../../if-models'
      - >-
        @grnsft/if-unofficial-plugins@v0.3.1 extraneous ->
        file:../../../../if-unofficial-models
      - '@jest/globals@29.7.0'
      - '@types/jest@29.5.8'
      - '@types/js-yaml@4.0.9'
      - '@types/luxon@3.4.2'
      - '@types/node@20.9.0'
      - axios-mock-adapter@1.22.0
      - axios@1.7.2
      - cross-env@7.0.3
      - csv-parse@5.5.6
      - csv-stringify@6.4.6
      - fixpack@4.0.0
      - gts@5.2.0
      - husky@8.0.3
      - jest@29.7.0
      - js-yaml@4.1.0
      - lint-staged@15.2.2
      - luxon@3.4.4
      - release-it@16.3.0
      - rimraf@5.0.5
      - ts-command-line-args@2.5.1
      - ts-jest@29.1.1
      - typescript-cubic-spline@1.0.1
      - typescript@5.2.2
      - winston@3.11.0
      - zod@3.22.4
  status: success
tree:
  children:
    child-1:
      pipeline:
        - teads-curve
        - sum
        - coefficient
        - multiply
      config: null
      defaults:
        cpu/thermal-design-power: 100
      inputs:
        - timestamp: '2023-12-12T00:00:00.000Z'
          cloud/instance-type: A1
          cloud/region: uk-west
          duration: 1
          cpu/utilization: 50
          network/energy: 10
          energy: 5
        - timestamp: '2023-12-12T00:00:01.000Z'
          duration: 5
          cpu/utilization: 20
          cloud/instance-type: A1
          cloud/region: uk-west
          network/energy: 10
          energy: 5
        - timestamp: '2023-12-12T00:00:06.000Z'
          duration: 7
          cpu/utilization: 15
          cloud/instance-type: A1
          cloud/region: uk-west
          network/energy: 10
          energy: 5
        - timestamp: '2023-12-12T00:00:13.000Z'
          duration: 30
          cloud/instance-type: A1
          cloud/region: uk-west
          cpu/utilization: 15
          network/energy: 10
          energy: 5
      outputs:
        - timestamp: '2023-12-12T00:00:00.000Z'
          cloud/instance-type: A1
          cloud/region: uk-west
          duration: 1
          cpu/utilization: 50
          network/energy: 10
          energy: 5
          cpu/thermal-design-power: 100
          cpu/energy: 0.000020833333333333333
          energy-sum: 10.000020833333334
          energy-doubled: 10
          cpu-times-duration: 50
        - timestamp: '2023-12-12T00:00:01.000Z'
          duration: 5
          cpu/utilization: 20
          cloud/instance-type: A1
          cloud/region: uk-west
          network/energy: 10
          energy: 5
          cpu/thermal-design-power: 100
          cpu/energy: 0.00006635035569105689
          energy-sum: 10.000066350355691
          energy-doubled: 10
          cpu-times-duration: 100
        - timestamp: '2023-12-12T00:00:06.000Z'
          duration: 7
          cpu/utilization: 15
          cloud/instance-type: A1
          cloud/region: uk-west
          network/energy: 10
          energy: 5
          cpu/thermal-design-power: 100
          cpu/energy: 0.00007870368606029811
          energy-sum: 10.00007870368606
          energy-doubled: 10
          cpu-times-duration: 105
        - timestamp: '2023-12-12T00:00:13.000Z'
          duration: 30
          cloud/instance-type: A1
          cloud/region: uk-west
          cpu/utilization: 15
          network/energy: 10
          energy: 5
          cpu/thermal-design-power: 100
          cpu/energy: 0.0003373015116869919
          energy-sum: 10.000337301511687
          energy-doubled: 10
          cpu-times-duration: 450
@MariamKhalatova MariamKhalatova added the bug Error, flaw or fault label Jun 25, 2024
@MariamKhalatova MariamKhalatova moved this to In Design in IF Jun 25, 2024
@manushak manushak moved this from In Design to In Progress in IF Jun 26, 2024
@manushak manushak moved this from In Progress to Pending Review in IF Jun 26, 2024
@manushak manushak linked a pull request Jun 26, 2024 that will close this issue
9 tasks
@github-project-automation github-project-automation bot moved this from Pending Review to Done in IF Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Error, flaw or fault
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants