Skip to content

Features for diffing openapi-compatible json specs. #2

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

Merged
merged 41 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0b95102
chore: change CODEOWNERS
jaychang99 May 25, 2024
88d5154
feat: add console.log to run function
jaychang99 May 25, 2024
befe255
feat: creating comment in PRs and issues for test purposes
jaychang99 May 25, 2024
edfee4a
feat: testing posting comments on PR feature
jaychang99 May 25, 2024
d4b819b
fix: upgrade peter-evans library from v1 to v4
jaychang99 May 25, 2024
6c75f65
feat: trying adding write permissions in workflow
jaychang99 May 25, 2024
4a651e2
feat: testing using typescript output when commenting on PRs
jaychang99 May 25, 2024
13195ed
feat: echo output from typescript output
jaychang99 May 25, 2024
d75b99c
feat: trying to write directly to process.env.GITHUB_OUTPUT in typesc…
jaychang99 May 25, 2024
a457291
feat: using core.setOutput for transferring outputs between steps
jaychang99 May 25, 2024
be9cfab
fix: define 'result' in outputs in action.yml
jaychang99 May 25, 2024
7d9aa1a
fix: remove deprecated 'set-output' in ci.yml
jaychang99 May 25, 2024
8fc5980
feat: add openapi.json with name and age in CreateCatDto
jaychang99 May 26, 2024
29cc449
feat: testing comparing two different openapi files from base and hea…
jaychang99 May 26, 2024
152ded7
chore: try logging out baseFile and headFile
jaychang99 May 26, 2024
8cb339b
chore: ignore openapi.json file when linting and formatting
jaychang99 May 26, 2024
b7de861
feat(Eslint): copy eslint.yml file in .github to root for language se…
jaychang99 May 26, 2024
94890da
refactor: rename typescript files to conform to file naming convention
jaychang99 May 26, 2024
5f6f1f7
fix: diffing openapi procedure follows default code, not the other wa…
jaychang99 May 26, 2024
f8e1a48
feat(Dist): commiting compiled javascript files
jaychang99 May 26, 2024
6662906
fix: change openapi.json path
jaychang99 May 26, 2024
0249fa1
feat(Env): setup development environment
Frontend-jaewon May 26, 2024
e5edb17
feat(Dev): open server in local dev environment
Frontend-jaewon May 26, 2024
cc6de35
feat(Markdown): format openapi diffs with markdown
Frontend-jaewon May 26, 2024
0a3bf47
fix(Ci): change ci to use markdown version of openapi diff
jaychang99 May 26, 2024
e7a1172
feat: resolve all ref-generated openapi json files
jaychang99 May 26, 2024
0007194
feat(Markdown): display Response Parameters in JSON
jaychang99 May 26, 2024
0b2ea50
feat(Markdown): markdown support for single, 1-depth responses
jaychang99 May 26, 2024
36a3d22
chore: comment out unused console.logs
jaychang99 May 26, 2024
65bbd70
dist: commit distribution files
jaychang99 May 26, 2024
b08efaf
feat(Markdown): mark nullable fields in responses
jaychang99 May 26, 2024
fda3f2b
feat(Markdown): additional markings for changed request parameters
jaychang99 May 26, 2024
8818bf5
fix: fix some added apis being marked as modified
jaychang99 May 26, 2024
3a7eccb
feat: markdown support for nested arrays up to 2 depths
jaychang99 May 26, 2024
baf7b5a
feat(Dist): commit distribution files
jaychang99 May 26, 2024
0dd221f
feat: gracefully handle APIs with no summary and description
jaychang99 May 26, 2024
89b5308
feat: markdown support for request bodies
jaychang99 May 26, 2024
5ec5f9c
feat: gracefully handle cases where no descriptions and examples were…
jaychang99 May 26, 2024
9c3c0aa
fix: request body's content-type to be the actual MIME type, not sche…
jaychang99 May 26, 2024
398d6e7
feat(Dist): commit distribution code
jaychang99 May 26, 2024
228414d
fix(Markdown): if no response data were provided, do not show
jaychang99 May 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ lib/
dist/
node_modules/
coverage/
openapi.json
83 changes: 83 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
env:
node: true
es6: true
jest: true

globals:
Atomics: readonly
SharedArrayBuffer: readonly

ignorePatterns:
- '!.*'
- '**/node_modules/.*'
- '**/dist/.*'
- '**/coverage/.*'
- '*.json'

parser: '@typescript-eslint/parser'

parserOptions:
ecmaVersion: 2023
sourceType: module
project:
- './.github/linters/tsconfig.json'
- './tsconfig.json'

plugins:
- jest
- '@typescript-eslint'

extends:
- eslint:recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:github/recommended
- plugin:jest/recommended

rules:
{
'camelcase': 'off',
'eslint-comments/no-use': 'off',
'eslint-comments/no-unused-disable': 'off',
'i18n-text/no-en': 'off',
'import/no-namespace': 'off',
'no-console': 'off',
'no-unused-vars': 'off',
'prettier/prettier': 'error',
'semi': 'off',
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/explicit-member-accessibility':
['error', { 'accessibility': 'no-public' }],
'@typescript-eslint/explicit-function-return-type':
['error', { 'allowExpressions': true }],
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extraneous-class': 'error',
'@typescript-eslint/no-for-in-array': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-for-of': 'warn',
'@typescript-eslint/prefer-function-type': 'warn',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/semi': ['error', 'never'],
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/unbound-method': 'error'
}
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,35 @@ jobs:
test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write

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

- name: Test Local Action
- name: Test Local Action And Capture Output
id: test-action
uses: ./
with:
milliseconds: 2000

# echo outputs from test-action's stdout
- name: Echo Output
id: echo-output
run: echo "${{ steps.test-action.outputs.result }})"

- name: Post comment on PR
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}

body: |
${{ steps.test-action.outputs.result }}

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,5 @@ __tests__/runner/*
.idea
.vscode
*.code-workspace

.local/*
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
node_modules/
coverage/
openapi.json
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Repository CODEOWNERS

* @actions/actions-oss-maintainers
* @jaychang99
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ inputs:
outputs:
time:
description: 'Your output description here'
result:
description: 'The result of the Typescript test'

runs:
using: node20
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions debug/markdown-stylesheet.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
* {
all: revert;

table {
border-spacing: 0 !important;
border-collapse: collapse !important;
border-color: inherit !important;
display: block !important;
width: max-content !important;
max-width: 100% !important;
overflow: auto !important;
}

tbody,
td,
tfoot,
th,
thead,
tr {
border-color: inherit !important;
border-style: solid !important;
border-width: 1px !important;
/* fix width of column depending on the longest cell */
padding: 0.5em 1em !important;
border-spacing: 0 !important;
border-collapse: collapse !important;
}

th {
font-weight: bold !important;
color: black;
background-color: white;
}
}
Loading
Loading