Skip to content

Commit

Permalink
PIXEL-520 Update Custom Report Template (#93)
Browse files Browse the repository at this point in the history
* Add renovate.json

* Configure renovate

* INVT-11343 Do not pin dependencies

This avoids that projects using this as a dependency get "stuck" on
old version of transitive dependencies.

* Pin dependencies

* Update NodeJS to make renovate work

* Update actions/cache action to v3

* Update actions/checkout action to v4

* Update actions/setup-node action to v4

* Update dependency rimraf to v5

* Move to ES2015 & update builder tests

* Update rimraf import in helpers and adapt tests

* Update all non-major dependencies

* Update all non-major dependencies

* Update actions/cache action to v4

* Update dependency commander to v12

* Update commander import and usage in `app.ts`

* Update dependency @types/lodash to v4.17.0

* Update dependency tar to v6

* Update dependency rimraf to v6

* Add Jest moduleNameMapper for `node:url`

This commit adds a moduleNameMapper configuration to Jest in order to resolve 'node:url' imports. This is required due to the upgrade of the 'rimraf' package to version 6.0.0, which uses 'node:url' imports that are not resolved correctly by Jest in the current setup.

* Update `jest` dependencies to `@latest`

* Mock nodejs `url`

* Convert syntax to `ESModule`

Revert "Convert syntax to `ESModule`"

This reverts commit 4d4c5f6.

Run `npm audit fix`

* Migrate to `package-lock.json`& run `npm audit fix`

* TNDO-5442 Uninstall `request` and `promise-native`

* TNDO-5442 Install `axios` dependency

* TNDO-5442 Update `ApiTokenResolver` to use `axios`

* TNDO-5442 Install `form-data` dependency

* TNDO-5442 Use `axios` & `form-data` in `Uploader`

* TNDO-5442 Allow synthetic default imports in ts`

Revert "TNDO-5442 Allow synthetic default imports in ts`"

This reverts commit 340f027.

TNDO-5442 Import FormData differently in uploader

* TNDO-5442 Split `proxy` into `host` and `port`

* TNDO-5442 Optimize `proxy` host & port split funct

* Update dependency axios to v1.7.4 [SECURITY]

* Update all non-major dependencies

* Update `axios` to latest version

* TNDO-5478 Automerge renovate PRs

* Update dependency node to v20

* Update dependency mkdirp to v3

* Update dependency @types/mkdirp to v2

* Update all non-major dependencies

* Pin dependencies

* PIXEL-520 Update Custom Report Template dependencies (#91)

* PIXEL-520 Update Custom Report Template dependencies

---------

Co-authored-by: Paulo Santos <paulo.santos04@sap.com>

* PIXEL-520 Bump package version

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Guido Lorenz <guido.lorenz@leanix.net>
Co-authored-by: Guido Lorenz <82028520+gul-leanix@users.noreply.github.com>
Co-authored-by: ama-leanix <121863340+ama-leanix@users.noreply.github.com>
Co-authored-by: ama-leanix <amine.abdelhedi@leanix.net>
Co-authored-by: Tom Gehder <tom.gehder@leanix.net>
Co-authored-by: Tom Gehder <63093340+tog-leanix@users.noreply.github.com>
Co-authored-by: Paulo Santos <paulo.santos04@sap.com>
  • Loading branch information
9 people authored Oct 24, 2024
1 parent 5af15b1 commit 5fe66ff
Show file tree
Hide file tree
Showing 22 changed files with 8,600 additions and 6,988 deletions.
33 changes: 27 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
name: CI

on: [push]
on:
push:
branches:
- main
- feature/*
- bugfix/*
- hotfix/*
- snyk-upgrade-*
- renovate/*
- revert-*
pull_request:
branches:
- revert-**

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint & Test
lint-test-and-build:
name: Lint & Test & Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'

- name: Install dependencies
run: npm ci

- name: Cache npm modules
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('npm-shrinkwrap.json') }}
Expand All @@ -32,3 +50,6 @@ jobs:

- name: Test
run: npm test

- name: Build
run: npm run build
80 changes: 80 additions & 0 deletions .github/workflows/lib-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Release package

on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-test-build-release:
name: Lint, Test, Build and Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'

steps:
- name: Get credentials
uses: leanix/secrets-action@master
with:
secret-store-credentials: ${{ secrets.INJECTED_SECRET_STORE_CREDENTIALS }}

- uses: actions/checkout@v4
with:
token: ${{ env.GITHUB_TOKEN }}
ref: develop

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'

- name: Install dependencies
run: npm ci

- name: Cache npm modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('npm-shrinkwrap.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Lint
run: npm run lint

- name: Test
run: npm test

- name: Build
run: npm run build

- name: Release library
run: |
# Set npm token for leanix user
npm set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
# Set commit user
git config --global user.name ${{ github.actor }}
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
# Bump version
npm version --no-commit-hooks patch
# Read version
PACKAGE_VERSION=`npx -c 'echo "$npm_package_version"'`
TAG="report-lib@$PACKAGE_VERSION"
# Commit version
git commit -am "Release of @leanix/reporting-cli@$PACKAGE_VERSION"
# Add tag
git tag $TAG
# Rebase on remote version of develop & push
git pull origin develop --rebase
git push origin develop --follow-tags ||
git push origin develop --follow-tags
# Publish package
npm publish --access public
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
20.17.0
1 change: 1 addition & 0 deletions __mocks__/node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('url');
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: '.spec.ts$'
testRegex: '.spec.ts$',
moduleNameMapper: {
'^node:url$': '<rootDir>/__mocks__/node.js'
}
};
Loading

0 comments on commit 5fe66ff

Please sign in to comment.