Skip to content

Commit

Permalink
chore: dependency updates (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael M authored Oct 27, 2023
2 parents 4d3d573 + 0424d6d commit 98d5a7e
Show file tree
Hide file tree
Showing 21 changed files with 15,478 additions and 10,266 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"extends": ["plugin:@public-js/eslint-plugin-node/imports", "plugin:@public-js/eslint-plugin-node/unicornEsmOff"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -24,7 +24,7 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
Expand All @@ -36,7 +36,7 @@
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
}
]
Expand Down
82 changes: 82 additions & 0 deletions .github/actions/nodejs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Action for Node.js & cache
description: Node.js setup and cache

inputs:
node-version:
description: Node.js version
required: false
default: 18.x

outputs:
root-package-version:
description: Full version from root package.json
value: ${{ steps.output.outputs.root-package-version }}
root-package-major-version:
description: Major version from root package.json
value: ${{ steps.output.outputs.root-package-major-version }}

runs:
using: composite
steps:
- name: Additional debug logs
shell: bash
run: |
echo "github.workflow: ${{ github.workflow }}"
echo "github.sha: ${{ github.sha }}"
echo "github.ref: ${{ github.ref }}"
echo "github.ref_name: ${{ github.ref_name }}"
echo "github.ref_type: ${{ github.ref_type }}"
echo "github.base_ref: ${{ github.base_ref }}"
echo "github.head_ref: ${{ github.head_ref }}"
echo "github.run_id: ${{ github.run_id }}"
echo "github.run_number: ${{ github.run_number }}"
echo "github.run_attempt: ${{ github.run_attempt }}"
echo "github.event.number: ${{ github.event.number }}"
echo "github.event.pull_request.head.ref: ${{ github.event.pull_request.head.ref }}"
echo "github.event.pull_request.head.repo.full_name: ${{ github.event.pull_request.head.repo.full_name }}"
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Restore node_modules from cache
id: cache-node-modules
uses: actions/cache@v3
with:
path: |
**/node_modules/
!**/node_modules/.cache
key: modules-cache__nodejs-${{ inputs.node-version }}__${{ hashFiles('package-lock.json') }}

- name: Restore from global npm cache
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-cache__nodejs-${{ inputs.node-version }}__${{ hashFiles('package-lock.json') }}
restore-keys: npm-cache-hash__

- shell: bash
run: |
echo "Environment info: Node.js, npm"
node -v
npm -v
- shell: bash
run: |
echo "Providing global variables"
echo "TIMING=true" >> $GITHUB_ENV
echo "NPM_CONFIG_CACHE=~/.npm" >> $GITHUB_ENV
- name: Clean install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
shell: bash

- id: output
shell: bash
run: |
echo "root-package-version=v$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
echo "root-package-major-version=$(node -p "parseInt(require('./package.json').version)")" >> $GITHUB_OUTPUT
52 changes: 0 additions & 52 deletions .github/actions/setup-node/action.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js and cache
uses: ./.github/actions/setup-node
uses: ./.github/actions/nodejs

- name: Build only changed packages
if: ${{ env.IS_MAIN == 'false' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
security-events: write
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ jobs:
steps:
- name: Checkout origin repo
if: ${{ env.IS_FORK == 'false' && env.IS_DBOT == 'false' }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.BM_GITHUB_PAT }}
fetch-depth: 2
- name: Checkout forked repo
if: ${{ env.IS_FORK == 'true' || env.IS_DBOT == 'true' }}
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Setup Node.js and cache
uses: ./.github/actions/setup-node
uses: ./.github/actions/nodejs

#- name: Typecheck
# run: npm run typecheck
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.BM_GITHUB_PAT }}
fetch-depth: 0

- name: Setup Node.js and cache
uses: ./.github/actions/setup-node
uses: ./.github/actions/nodejs

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
name: Any test with nx
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js and cache
uses: ./.github/actions/setup-node
uses: ./.github/actions/nodejs

- name: Test all packages
run: npm run ci:all:test
Expand All @@ -32,14 +32,14 @@ jobs:
coverage-reports: 'coverage/packages/*/lcov.info'

- name: Report to Code Climate
uses: paambaati/codeclimate-action@v3.0.0
uses: paambaati/codeclimate-action@v3.2.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageLocations: 'coverage/packages/*/lcov.info:lcov'

- name: Report to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: 'coverage/packages/*/lcov.info'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ testem.log
Thumbs.db

.angular
.nx/cache
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
/tools/executors/pseudo-test/modified-results
/tools/executors/pseudo-test/original-results
/tools/executors/schema-generator/**/*.js

.angular
.nx/cache
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[![Downloads](https://img.shields.io/npm/dw/@public-js/ng-openapi-gen?style=flat)](https://www.npmjs.com/package/@public-js/ng-openapi-gen)
[![Size](https://packagephobia.com/badge?p=@public-js/ng-openapi-gen)](https://packagephobia.com/result?p=@public-js/ng-openapi-gen)

[![Codacy](https://app.codacy.com/project/badge/Grade/bf3812369c7146d285b05b539fcf913f)](https://www.codacy.com/gh/public-js/ng-openapi-gen/dashboard)
[![LGTM](https://img.shields.io/lgtm/grade/javascript/g/public-js/ng-openapi-gen?logo=lgtm)](https://lgtm.com/projects/g/public-js/ng-openapi-gen/context:javascript)
[![CodeQL](https://github.com/public-js/ng-openapi-gen/actions/workflows/codeql-analyze.yml/badge.svg?branch=main)](https://github.com/public-js/ng-openapi-gen/actions/workflows/codeql-analyze.yml)
[![Codacy](https://app.codacy.com/project/badge/Grade/bf3812369c7146d285b05b539fcf913f)](https://app.codacy.com/gh/public-js/ng-openapi-gen/dashboard)
[![Codecov](https://codecov.io/gh/public-js/ng-openapi-gen/branch/main/graph/badge.svg?token=DXGP8I126q)](https://codecov.io/gh/public-js/ng-openapi-gen)
[![Code Climate](https://api.codeclimate.com/v1/badges/1200908a0ede980d61dc/maintainability)](https://codeclimate.com/github/public-js/ng-openapi-gen/maintainability)

Expand Down Expand Up @@ -66,4 +66,4 @@ Execute it from your root `package.json` file like this:
## License

MIT, [full license text](LICENSE).
Read more about it on [TLDRLegal](https://www.tldrlegal.com/l/mit).
Read more about it on [TLDRLegal](https://www.tldrlegal.com/license/mit-license).
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { getJestProjects } = require('@nrwl/jest');
const { getJestProjects } = require('@nx/jest');

export default {
projects: getJestProjects(),
Expand Down
2 changes: 1 addition & 1 deletion jest.preset.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const nxPreset = require('@nrwl/jest/preset').default;
const nxPreset = require('@nx/jest/preset').default;

module.exports = { ...nxPreset };
47 changes: 32 additions & 15 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,42 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"extends": "nx/presets/core.json",
"npmScope": "public-js",
"affected": {
"defaultBase": "origin/main"
},
"cli": {
"defaultCollection": "@nrwl/workspace"
},
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"],
"accessToken": "YzcxZDRhNzgtNDg3Zi00NjExLWE0ZTAtM2VjMzBmMDU5NDc1fHJlYWQtd3JpdGU="
}
}
},
"pluginsConfig": {
"@nrwl/js": {
"@nx/js": {
"analyzeSourceFiles": true
}
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"sharedGlobals": [],
"production": [
"default",
"!{projectRoot}/.eslintrc.json",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/src/test-setup.[jt]s"
]
},
"targetDefaults": {
"build": {
"inputs": ["production", "^production"],
"cache": true
},
"lint": {
"cache": true,
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
},
"test": {
"cache": true,
"inputs": ["default", "^production"]
},
"e2e": {
"cache": true
}
},
"nxCloudAccessToken": "YzcxZDRhNzgtNDg3Zi00NjExLWE0ZTAtM2VjMzBmMDU5NDc1fHJlYWQtd3JpdGU="
}
Loading

0 comments on commit 98d5a7e

Please sign in to comment.