github cloud-carbon-footprint/cloud-carbon-footprint release-2021-06-08

latest releases: latest, release-2024-02-11, release-2024-01-03...
2 years ago

@cloud-carbon-footprint/api@0.3.0

Minor Changes

  • ababb82: Extracts two new packages app and common to avoid circular dependancies and make it easier to extract cloud provider packages

  • e84a4c7: Extract logic into the new packages: app, common, gcp, aws, azure:

    There are many files that have been updated/extracted.
    In order to update create-app templates, refer to the follow commit.

    The following changes were made to,
    'packages/create-app/templates/default-app/packages/client/tsconfig.json':

        // ...
            "skipLibCheck": true,
            "esModuleInterop": true,
            "allowSyntheticDefaultImports": true,
    -        "strict": true,
            "forceConsistentCasingInFileNames": true,
            "module": "esnext",
            "moduleResolution": "node",
            "resolveJsonModule": true,
    -        "isolatedModules": true,
            "noEmit": true,
            "jsx": "react-jsx",
    -        "noFallthroughCasesInSwitch": true
    +        "noFallthroughCasesInSwitch": true,
    +        "strict": false,
    +        "isolatedModules": true
          },
    -      "include": [
    -        "src",
    -        "node_modules/apexcharts/types/apexcharts.d.ts"
    -      ]
    +      "include": ["src"]
        }
        // ...

    Additionally, the following dependencies have been updated and should also be updated in their respective template package.json file:

    • @cloud-carbon-footprint root package.json:
      • "@types/fs-extra": "^9.0.11"
      • "concurrently": "^6.2.0"
      • "marked": ">=2.0.5"
    • @cloud-carbon-footprint/api and @cloud-carbon-footprint/cli:
      • "dotenv": "^10.0.0"
      • "@cloud-carbon-footprint/app": Can be added with yarn up @cloud-carbon-footprint/app
      • "@cloud-carbon-footprint/common": Can be added with yarn up @cloud-carbon-footprint/common
    • @cloud-carbon-footprint/client:
      • "dotenv": "^10.0.0"
      • "@testing-library/react-hooks": "^7.0.0"
      • "concurrently": "^6.2.0"
      • "@cloud-carbon-footprint/common": Can be added with yarn up @cloud-carbon-footprint/common

Patch Changes

  • c7fa7db: Updates dependencies to the latest

  • 54c6e5f: updates check for error type

    packages/api/src/api.ts:

        // ...
    
          } catch (e) {
            apiLogger.error(`Unable to process footprint request.`, e)
    -       if (e instanceof EstimationRequestValidationError) {
    +       if (
    +          e.constructor.name ===
    +          EstimationRequestValidationError.prototype.constructor.name
    +       ) {
              res.status(400).send(e.message)
    -       } else if (e instanceof EstimationRequestValidationError) {
    +       } else if (
    +          e.constructor.name === PartialDataError.prototype.constructor.name
    +       ) {
              res.status(416).send(e.message)
            } else res.status(500).send('Internal Server Error')
    
        // ...
    • @cloud-carbon-footprint/app@0.0.2

@cloud-carbon-footprint/cli@0.4.0

Minor Changes

  • ababb82: Extracts two new packages app and common to avoid circular dependancies and make it easier to extract cloud provider packages

  • e84a4c7: Extract logic into the new packages: app, common, gcp, aws, azure:

    There are many files that have been updated/extracted.
    In order to update create-app templates, refer to the follow commit.

    The following changes were made to,
    'packages/create-app/templates/default-app/packages/client/tsconfig.json':

        // ...
            "skipLibCheck": true,
            "esModuleInterop": true,
            "allowSyntheticDefaultImports": true,
    -        "strict": true,
            "forceConsistentCasingInFileNames": true,
            "module": "esnext",
            "moduleResolution": "node",
            "resolveJsonModule": true,
    -        "isolatedModules": true,
            "noEmit": true,
            "jsx": "react-jsx",
    -        "noFallthroughCasesInSwitch": true
    +        "noFallthroughCasesInSwitch": true,
    +        "strict": false,
    +        "isolatedModules": true
          },
    -      "include": [
    -        "src",
    -        "node_modules/apexcharts/types/apexcharts.d.ts"
    -      ]
    +      "include": ["src"]
        }
        // ...

    Additionally, the following dependencies have been updated and should also be updated in their respective template package.json file:

    • @cloud-carbon-footprint root package.json:
      • "@types/fs-extra": "^9.0.11"
      • "concurrently": "^6.2.0"
      • "marked": ">=2.0.5"
    • @cloud-carbon-footprint/api and @cloud-carbon-footprint/cli:
      • "dotenv": "^10.0.0"
      • "@cloud-carbon-footprint/app": Can be added with yarn up @cloud-carbon-footprint/app
      • "@cloud-carbon-footprint/common": Can be added with yarn up @cloud-carbon-footprint/common
    • @cloud-carbon-footprint/client:
      • "dotenv": "^10.0.0"
      • "@testing-library/react-hooks": "^7.0.0"
      • "concurrently": "^6.2.0"
      • "@cloud-carbon-footprint/common": Can be added with yarn up @cloud-carbon-footprint/common

Patch Changes

  • c7fa7db: Updates dependencies to the latest
  • Updated dependencies [f9fbcb4]
  • Updated dependencies [c7fa7db]
  • Updated dependencies [ababb82]
  • Updated dependencies [e84a4c7]
    • @cloud-carbon-footprint/core@0.8.0

@cloud-carbon-footprint/client@0.8.0

Minor Changes

  • d24c127: Change Carbon equivalency component to be globally relevant

    packages/client/src/dashboard/CarbonComparisonCard.tsx:

        // ...
    
            }
        })
    
    -    export const toMiles = (co2mt: number): number => co2mt * 2481.3918390475
    -    export const toGas = (co2mt: number): number => co2mt * 112.5247230304
    +    export const toFlights = (co2mt: number): number => co2mt * 1.2345679 // direct one way flight from NYC to London per metric ton per CO2
    +    export const toPhones = (co2mt: number): number => co2mt * 121643 // phones charged per metric ton of CO2
        export const toTrees = (co2mt: number): number => co2mt * 16.5337915448
    
        export const CarbonComparisonCard: FunctionComponent<CarbonComparisonCardProps> =
    
        // ...
    
            const [selection, setSelection] = useState('flights')
            const mtSum: number = sumCO2(data)
    
    -        const milesSum = toMiles(mtSum)
    -        const gasSum = toGas(mtSum)
    +        const totalFlights = toFlights(mtSum)
    +        const totalPhones = toPhones(mtSum)
            const treesSum = toTrees(mtSum)
    
    -        const formatNumber = (number: number, decimalPlaces = 0) =>
    -        number.toLocaleString(undefined, { maximumFractionDigits: decimalPlaces })
    +        const formatNumber = (number: number, decimalPlaces = 0) => {
    +        if (number >= 1000000000) return `${(number / 1000000000).toFixed(1)}+ B`
    +
    +        if (number >= 1000000) return `${(number / 1000000).toFixed(1)}+ M`
    +
    +        return number.toLocaleString(undefined, {
    +            maximumFractionDigits: decimalPlaces,
    +           })
    +        }
    
            const comparisons: Comparison = {
            flights: {
                icon: (
                    <FlightTakeoff className={classes.icon} data-testid="flightsIcon" />
                ),
    -            total: milesSum,
    -            textOne: 'greenhouse gas emissions from',
    -            textTwo: 'miles driven on average',
    +            total: totalFlights,
    +            textOne: 'CO2e emissions from',
    +            textTwo: 'direct one way flights from NYC to London',
            },
            phones: {
                icon: (
                    <PhonelinkRing className={classes.icon} data-testid="phonesIcon" />
                ),
    -            total: gasSum,
    +            total: totalPhones,
    -            textOne: 'CO2 emissions from',
    +            textOne: 'CO2e emissions from',
    -            textTwo: 'gallons of gasoline consumed',
    +            textTwo: 'smartphones charged',
            },
            trees: {
                icon: <Eco className={classes.icon} data-testid="treesIcon" />,
    
        // ...
  • ababb82: Extracts two new packages app and common to avoid circular dependancies and make it easier to extract cloud provider packages

  • e84a4c7: Extract logic into the new packages: app, common, gcp, aws, azure:

    There are many files that have been updated/extracted.
    In order to update create-app templates, refer to the follow commit.

    The following changes were made to,
    'packages/create-app/templates/default-app/packages/client/tsconfig.json':

        // ...
            "skipLibCheck": true,
            "esModuleInterop": true,
            "allowSyntheticDefaultImports": true,
    -        "strict": true,
            "forceConsistentCasingInFileNames": true,
            "module": "esnext",
            "moduleResolution": "node",
            "resolveJsonModule": true,
    -        "isolatedModules": true,
            "noEmit": true,
            "jsx": "react-jsx",
    -        "noFallthroughCasesInSwitch": true
    +        "noFallthroughCasesInSwitch": true,
    +        "strict": false,
    +        "isolatedModules": true
          },
    -      "include": [
    -        "src",
    -        "node_modules/apexcharts/types/apexcharts.d.ts"
    -      ]
    +      "include": ["src"]
        }
        // ...

    Additionally, the following dependencies have been updated and should also be updated in their respective template package.json file:

    • @cloud-carbon-footprint root package.json:
      • "@types/fs-extra": "^9.0.11"
      • "concurrently": "^6.2.0"
      • "marked": ">=2.0.5"
    • @cloud-carbon-footprint/api and @cloud-carbon-footprint/cli:
      • "dotenv": "^10.0.0"
      • "@cloud-carbon-footprint/app": Can be added with yarn up @cloud-carbon-footprint/app
      • "@cloud-carbon-footprint/common": Can be added with yarn up @cloud-carbon-footprint/common
    • @cloud-carbon-footprint/client:
      • "dotenv": "^10.0.0"
      • "@testing-library/react-hooks": "^7.0.0"
      • "concurrently": "^6.2.0"
      • "@cloud-carbon-footprint/common": Can be added with yarn up @cloud-carbon-footprint/common

Patch Changes

  • c7fa7db: Updates dependencies to the latest

  • e1353b8: Refactor CarbonComparisonCard to be more resuable with configuring comparison types

  • c588945: Updates CarbonFormulaDrawer to link to the microsite

    packages/client/src/dashboard/CarbonFormulaDrawer.tsx:

        // ...
    
            available.
            </Typography>
            <Link
    -          href="https://github.com/cloud-carbon-footprint/cloud-carbon-footprint/blob/trunk/microsite/docs/Methodology.md"
    +          href="https://www.cloudcarbonfootprint.org/docs/methodology"
              target="_blank"
              rel="noopener"
              className={classes.methodology}
    
        // ...

@cloud-carbon-footprint/core@0.8.0

Minor Changes

  • f9fbcb4: Updates GCPCredentials class to us the @google-cloud/iam-credentials library instead, to reduce the core package size

  • ababb82: Extracts two new packages app and common to avoid circular dependancies and make it easier to extract cloud provider packages

  • e84a4c7: Extract logic into the new packages: app, common, gcp, aws, azure:

    There are many files that have been updated/extracted.
    In order to update create-app templates, refer to the follow commit.

    The following changes were made to,
    'packages/create-app/templates/default-app/packages/client/tsconfig.json':

        // ...
            "skipLibCheck": true,
            "esModuleInterop": true,
            "allowSyntheticDefaultImports": true,
    -        "strict": true,
            "forceConsistentCasingInFileNames": true,
            "module": "esnext",
            "moduleResolution": "node",
            "resolveJsonModule": true,
    -        "isolatedModules": true,
            "noEmit": true,
            "jsx": "react-jsx",
    -        "noFallthroughCasesInSwitch": true
    +        "noFallthroughCasesInSwitch": true,
    +        "strict": false,
    +        "isolatedModules": true
          },
    -      "include": [
    -        "src",
    -        "node_modules/apexcharts/types/apexcharts.d.ts"
    -      ]
    +      "include": ["src"]
        }
        // ...

    Additionally, the following dependencies have been updated and should also be updated in their respective template package.json file:

    • @cloud-carbon-footprint root package.json:
      • "@types/fs-extra": "^9.0.11"
      • "concurrently": "^6.2.0"
      • "marked": ">=2.0.5"
    • @cloud-carbon-footprint/api and @cloud-carbon-footprint/cli:
      • "dotenv": "^10.0.0"
      • "@cloud-carbon-footprint/app": Can be added with yarn up @cloud-carbon-footprint/app
      • "@cloud-carbon-footprint/common": Can be added with yarn up @cloud-carbon-footprint/common
    • @cloud-carbon-footprint/client:
      • "dotenv": "^10.0.0"
      • "@testing-library/react-hooks": "^7.0.0"
      • "concurrently": "^6.2.0"
      • "@cloud-carbon-footprint/common": Can be added with yarn up @cloud-carbon-footprint/common

Patch Changes

  • c7fa7db: Updates dependencies to the latest

@cloud-carbon-footprint/create-app@0.4.11

Minor Changes

  • e84a4c7: Extract logic into the new packages: app, common, gcp, aws, azure:

    There are many files that have been updated/extracted.
    In order to update create-app templates, refer to the follow commit.

    The following changes were made to,
    'packages/create-app/templates/default-app/packages/client/tsconfig.json':

        // ...
            "skipLibCheck": true,
            "esModuleInterop": true,
            "allowSyntheticDefaultImports": true,
    -        "strict": true,
            "forceConsistentCasingInFileNames": true,
            "module": "esnext",
            "moduleResolution": "node",
            "resolveJsonModule": true,
    -        "isolatedModules": true,
            "noEmit": true,
            "jsx": "react-jsx",
    -        "noFallthroughCasesInSwitch": true
    +        "noFallthroughCasesInSwitch": true,
    +        "strict": false,
    +        "isolatedModules": true
          },
    -      "include": [
    -        "src",
    -        "node_modules/apexcharts/types/apexcharts.d.ts"
    -      ]
    +      "include": ["src"]
        }
        // ...

    Additionally, the following dependencies have been updated and should also be updated in their respective template package.json file:

    • @cloud-carbon-footprint root package.json:
      • "@types/fs-extra": "^9.0.11"
      • "concurrently": "^6.2.0"
      • "marked": ">=2.0.5"
    • @cloud-carbon-footprint/api and @cloud-carbon-footprint/cli:
      • "dotenv": "^10.0.0"
      • "@cloud-carbon-footprint/app": Can be added with yarn up @cloud-carbon-footprint/app
      • "@cloud-carbon-footprint/common": Can be added with yarn up @cloud-carbon-footprint/common
    • @cloud-carbon-footprint/client:
      • "dotenv": "^10.0.0"
      • "@testing-library/react-hooks": "^7.0.0"
      • "concurrently": "^6.2.0"
      • "@cloud-carbon-footprint/common": Can be added with yarn up @cloud-carbon-footprint/common

Patch Changes

  • d24c127: Change Carbon equivalency component to be globally relevant

    packages/client/src/dashboard/CarbonComparisonCard.tsx:

        // ...
    
            }
        })
    
    -    export const toMiles = (co2mt: number): number => co2mt * 2481.3918390475
    -    export const toGas = (co2mt: number): number => co2mt * 112.5247230304
    +    export const toFlights = (co2mt: number): number => co2mt * 1.2345679 // direct one way flight from NYC to London per metric ton per CO2
    +    export const toPhones = (co2mt: number): number => co2mt * 121643 // phones charged per metric ton of CO2
        export const toTrees = (co2mt: number): number => co2mt * 16.5337915448
    
        export const CarbonComparisonCard: FunctionComponent<CarbonComparisonCardProps> =
    
        // ...
    
            const [selection, setSelection] = useState('flights')
            const mtSum: number = sumCO2(data)
    
    -        const milesSum = toMiles(mtSum)
    -        const gasSum = toGas(mtSum)
    +        const totalFlights = toFlights(mtSum)
    +        const totalPhones = toPhones(mtSum)
            const treesSum = toTrees(mtSum)
    
    -        const formatNumber = (number: number, decimalPlaces = 0) =>
    -        number.toLocaleString(undefined, { maximumFractionDigits: decimalPlaces })
    +        const formatNumber = (number: number, decimalPlaces = 0) => {
    +        if (number >= 1000000000) return `${(number / 1000000000).toFixed(1)}+ B`
    +
    +        if (number >= 1000000) return `${(number / 1000000).toFixed(1)}+ M`
    +
    +        return number.toLocaleString(undefined, {
    +            maximumFractionDigits: decimalPlaces,
    +           })
    +        }
    
            const comparisons: Comparison = {
            flights: {
                icon: (
                    <FlightTakeoff className={classes.icon} data-testid="flightsIcon" />
                ),
    -            total: milesSum,
    -            textOne: 'greenhouse gas emissions from',
    -            textTwo: 'miles driven on average',
    +            total: totalFlights,
    +            textOne: 'CO2e emissions from',
    +            textTwo: 'direct one way flights from NYC to London',
            },
            phones: {
                icon: (
                    <PhonelinkRing className={classes.icon} data-testid="phonesIcon" />
                ),
    -            total: gasSum,
    +            total: totalPhones,
    -            textOne: 'CO2 emissions from',
    +            textOne: 'CO2e emissions from',
    -            textTwo: 'gallons of gasoline consumed',
    +            textTwo: 'smartphones charged',
            },
            trees: {
                icon: <Eco className={classes.icon} data-testid="treesIcon" />,
    
        // ...
  • c7fa7db: Updates dependencies to the latest

  • 54c6e5f: updates check for error type

    packages/api/src/api.ts:

        // ...
    
          } catch (e) {
            apiLogger.error(`Unable to process footprint request.`, e)
    -       if (e instanceof EstimationRequestValidationError) {
    +       if (
    +          e.constructor.name ===
    +          EstimationRequestValidationError.prototype.constructor.name
    +       ) {
              res.status(400).send(e.message)
    -       } else if (e instanceof EstimationRequestValidationError) {
    +       } else if (
    +          e.constructor.name === PartialDataError.prototype.constructor.name
    +       ) {
              res.status(416).send(e.message)
            } else res.status(500).send('Internal Server Error')
    
        // ...
  • c588945: Updates CarbonFormulaDrawer to link to the microsite

    packages/client/src/dashboard/CarbonFormulaDrawer.tsx:

        // ...
    
            available.
            </Typography>
            <Link
    -          href="https://github.com/cloud-carbon-footprint/cloud-carbon-footprint/blob/trunk/microsite/docs/Methodology.md"
    +          href="https://www.cloudcarbonfootprint.org/docs/methodology"
              target="_blank"
              rel="noopener"
              className={classes.methodology}
    
        // ...

@cloud-carbon-footprint/app@0.0.2

Patch Changes

  • @cloud-carbon-footprint/aws@0.0.2
  • @cloud-carbon-footprint/azure@0.0.2
  • @cloud-carbon-footprint/gcp@0.0.2

@cloud-carbon-footprint/aws@0.0.2

Patch Changes

  • Updated dependencies [f9fbcb4]
  • Updated dependencies [c7fa7db]
  • Updated dependencies [ababb82]
  • Updated dependencies [e84a4c7]
    • @cloud-carbon-footprint/core@0.8.0

@cloud-carbon-footprint/azure@0.0.2

Patch Changes

  • Updated dependencies [f9fbcb4]
  • Updated dependencies [c7fa7db]
  • Updated dependencies [ababb82]
  • Updated dependencies [e84a4c7]
    • @cloud-carbon-footprint/core@0.8.0

@cloud-carbon-footprint/gcp@0.0.2

Patch Changes

  • Updated dependencies [f9fbcb4]
  • Updated dependencies [c7fa7db]
  • Updated dependencies [ababb82]
  • Updated dependencies [e84a4c7]
    • @cloud-carbon-footprint/core@0.8.0

@cloud-carbon-footprint/integration-tests@1.0.1

Patch Changes

  • c7fa7db: Updates dependencies to the latest

Don't miss a new cloud-carbon-footprint release

NewReleases is sending notifications on new releases.