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

Added deprecated to enums #2342

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div *ngIf="item?.isDeprecated" class="doc-viewer-item-query-deprecated">
<span class="doc-viewer-item-query-deprecated-title">
{{ 'DOCS_DEPRECATED_TEXT' | translate }}
</span>
<span markdown [data]="item?.deprecationReason ?? ''"> </span>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { DocViewerDeprecatedComponent } from './doc-viewer-deprecated.component';

describe('DocViewerDeprecatedComponent', () => {
let component: DocViewerDeprecatedComponent;
let fixture: ComponentFixture<DocViewerDeprecatedComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ DocViewerDeprecatedComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(DocViewerDeprecatedComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component, Input } from '@angular/core';
import { GraphQLEnumValue, GraphQLField } from 'graphql';

@Component({
selector: 'app-doc-viewer-deprecated',
templateUrl: './doc-viewer-deprecated.component.html',
styles: [],
})
export class DocViewerDeprecatedComponent {
@Input() item?: GraphQLField<any, any> | GraphQLEnumValue;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
markdown
[data]="data.description || ''"
></div>
<app-doc-viewer-deprecated
[item]="data"
></app-doc-viewer-deprecated>
<div class="doc-viewer-item-query-inner">
<button
class="doc-viewer-item-query-add-btn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<span class="doc-viewer-item-type">
{{ item.value }}
</span>
<app-doc-viewer-deprecated [item]="item"></app-doc-viewer-deprecated>
</div>
<div
*ngIf="item.description"
Expand Down Expand Up @@ -173,10 +174,7 @@
{{ item.type.inspect() }}
</span>
</div>
<div *ngIf="item.isDeprecated" class="doc-viewer-item-query-deprecated">
{{ 'DOCS_DEPRECATED_TEXT' | translate }}:
<span markdown [data]="item.deprecationReason || ''"> </span>
</div>
<app-doc-viewer-deprecated [item]="item"></app-doc-viewer-deprecated>
<div
class="doc-viewer-item-query-description"
markdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { DocViewerTypeComponent } from './doc-viewer-type/doc-viewer-type.compon
import { DocViewerSearchResultsComponent } from './doc-viewer-search-results/doc-viewer-search-results.component';
import { ComponentModule } from '../components.module';
import { PipesModule } from '../../pipes';
import { DocViewerDeprecatedComponent } from './doc-viewer-deprecated/doc-viewer-deprecated.component';

@NgModule({
imports: [
Expand All @@ -24,6 +25,7 @@ import { PipesModule } from '../../pipes';
DocViewerFieldComponent,
DocViewerTypeComponent,
DocViewerSearchResultsComponent,
DocViewerDeprecatedComponent,
],
exports: [
DocViewerComponent,
Expand Down
10 changes: 9 additions & 1 deletion packages/altair-app/src/scss/components/_doc-viewer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,20 @@ app-doc-viewer {
}

.doc-viewer-item-query-deprecated {
display: inline-block;
display: inline-flex;
align-items: center;
gap: 4px;
font-size: fontsize(12);
padding: 3px;
margin: 3px 0;
background: rgba(var(--rgb-red), 0.05);
border-radius: 4px;
color: var(--red-color);
}
.doc-viewer-item-query-deprecated-title {
font-weight: 600;
font-size: fontsize(10);
}

.doc-viewer-item-query-description {
font-size: fontsize(13);
Expand Down
5 changes: 2 additions & 3 deletions packages/altair-koa-middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
"@types/supertest": "^2.0.11",
"jest": "29.4.1",
"koa": "^2.13.1",
"koa-send": "^5.0.1",
Copy link
Contributor

@jaydenseric jaydenseric Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was it added to dev dependencies, instead of dependencies? It's used in the published code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that was by mistake. Thanks for spotting it.

"nodemon": "^2.0.12",
"supertest": "^6.1.6",
"ts-jest": "29.0.5",
"ts-node": "^10.2.1",
"typescript": "4.9.5"
},
"peerDependencies": {
"@koa/router": "~11.0.2",
"koa-send": "^5.0.1"
Comment on lines -25 to -26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were semver major changes, but they were published in non semver major version changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I'm not sure I follow. You mean I should have published a major version since the change is major?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean I should have published a major version since the change is major?

Yes.

Anytime a package makes its peer dependency requirements tighter (require newer versions), it's a breaking change that should be published in a semver major version increment.

Packages that were previously using @koa/router v11 and altair-koa-middleware will now have npm install errors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I can publish a major version next but I don't think that would fix the issue with those packages, as they would need to update manually.

Copy link
Contributor

@jaydenseric jaydenseric Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit rusty about the correct way to fix an accidentally major change in a minor/patch release, but maybe what you could do is revert the major changes in an other patch release so that way people using altair-koa-middleware v5 are fixed (for projects not using a lock file , which are most open source published packages, CI will just start working for them again, and npm install for them will start working again), and then redo the major changes correctly in a follow-up v6 release.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

"@koa/router": "^12.0.1"
},
"engines": {
"node": ">= 12"
Expand All @@ -32,7 +32,6 @@
"type": "opencollective",
"url": "https://opencollective.com/altair"
},
"gitHead": "e5ce60f5a14997f1471a961ac76efacbb044df46",
"homepage": "https://github.com/altair-graphql/altair#readme",
"keywords": [
"altair",
Expand Down
21 changes: 19 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17928,7 +17928,7 @@ http-errors@2.0.0:
statuses "2.0.1"
toidentifier "1.0.1"

http-errors@^1.6.3, http-errors@~1.8.0:
http-errors@^1.6.3, http-errors@^1.7.3, http-errors@~1.8.0:
version "1.8.1"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c"
integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==
Expand Down Expand Up @@ -20416,6 +20416,15 @@ koa-convert@^2.0.0:
co "^4.6.0"
koa-compose "^4.1.0"

koa-send@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/koa-send/-/koa-send-5.0.1.tgz#39dceebfafb395d0d60beaffba3a70b4f543fe79"
integrity sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==
dependencies:
debug "^4.1.1"
http-errors "^1.7.3"
resolve-path "^1.4.0"

koa@^2.13.1:
version "2.13.4"
resolved "https://registry.yarnpkg.com/koa/-/koa-2.13.4.tgz#ee5b0cb39e0b8069c38d115139c774833d32462e"
Expand Down Expand Up @@ -23785,7 +23794,7 @@ path-exists@^5.0.0:
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7"
integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==

path-is-absolute@^1.0.0:
path-is-absolute@1.0.1, path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
Expand Down Expand Up @@ -25832,6 +25841,14 @@ resolve-from@^4.0.0:
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6"
integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==

resolve-path@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/resolve-path/-/resolve-path-1.4.0.tgz#c4bda9f5efb2fce65247873ab36bb4d834fe16f7"
integrity sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==
dependencies:
http-errors "~1.6.2"
path-is-absolute "1.0.1"

resolve-url-loader@5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/resolve-url-loader/-/resolve-url-loader-5.0.0.tgz#ee3142fb1f1e0d9db9524d539cfa166e9314f795"
Expand Down
Loading